diff options
author | unknown <ramil@mysql.com> | 2005-02-28 19:59:38 +0400 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2005-02-28 19:59:38 +0400 |
commit | f9dd79c77d3690cee26aeb0949b74ac76fccdcae (patch) | |
tree | 6f12cb96c51f12a54cc4aaabfbed0b10a5a08834 | |
parent | 3bffc522317ad18102f8a2e5079e3242b6866dcf (diff) | |
parent | c8b3d65ca26ff2be783115da2fb7c790dd4338e4 (diff) | |
download | mariadb-git-f9dd79c77d3690cee26aeb0949b74ac76fccdcae.tar.gz |
merging
mysql-test/r/ps.result:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_select.cc:
Auto merged
1377 files changed, 128701 insertions, 31730 deletions
diff --git a/.bzrignore b/.bzrignore index 27fb593c662..d19b005a03e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -45,6 +45,19 @@ COPYING COPYING.LIB Docs/#manual.texi# Docs/INSTALL-BINARY +Docs/Images/myaccess-odbc.txt +Docs/Images/myaccess.txt +Docs/Images/myarchitecture.txt +Docs/Images/mydll-properties.txt +Docs/Images/mydsn-example.txt +Docs/Images/mydsn-icon.txt +Docs/Images/mydsn-options.txt +Docs/Images/mydsn-setup.txt +Docs/Images/mydsn-test-fail.txt +Docs/Images/mydsn-test-success.txt +Docs/Images/mydsn-trace.txt +Docs/Images/mydsn.txt +Docs/Images/myflowchart.txt Docs/include.texi Docs/internals.html Docs/internals.info @@ -88,7 +101,9 @@ Makefile.in Makefile.in' PENDING/* TAGS +ac_available_languages_fragment aclocal.m4 +analyse.test autom4te-2.53.cache/output.0 autom4te-2.53.cache/requests autom4te-2.53.cache/traces.0 @@ -241,6 +256,7 @@ client/mf_iocache.c client/mf_iocache.cc client/mysql client/mysqladmin +client/mysqladmin.c client/mysqlbinlog client/mysqlcheck client/mysqldump @@ -287,6 +303,7 @@ gmon.out hardcopy.0 heap/hp_test1 heap/hp_test2 +help help.c help.h include/my_config.h @@ -355,7 +372,9 @@ libmysqld/field_conv.cc libmysqld/filesort.cc libmysqld/get_password.c libmysqld/gstream.cc +libmysqld/ha_archive.cc libmysqld/ha_berkeley.cc +libmysqld/ha_example.cc libmysqld/ha_heap.cc libmysqld/ha_innobase.cc libmysqld/ha_innodb.cc @@ -363,6 +382,7 @@ libmysqld/ha_isam.cc libmysqld/ha_isammrg.cc libmysqld/ha_myisam.cc libmysqld/ha_myisammrg.cc +libmysqld/ha_tina.cc libmysqld/handler.cc libmysqld/hash_filo.cc libmysqld/hostname.cc @@ -492,15 +512,71 @@ myisam/test2.MYD myisam/test2.MYI mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz mysql-4.0.2-alpha.tar.gz +mysql-4.1.8-win-src.zip mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz mysql-test/gmon.out mysql-test/install_test_db mysql-test/mysql-test-run +mysql-test/mysql-test-run.log +mysql-test/mysql_test_run_new mysql-test/ndb/ndbcluster mysql-test/r/*.reject +mysql-test/r/alter_table.err +mysql-test/r/archive.err +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_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/exampledb.err +mysql-test/r/func_encrypt.err +mysql-test/r/isam.err +mysql-test/r/lowercase_table2.err +mysql-test/r/multi_update.err +mysql-test/r/mysql_protocols.err +mysql-test/r/mysqlbinlog.err +mysql-test/r/mysqlbinlog2.err +mysql-test/r/mysqldump.err +mysql-test/r/mysqltest.err +mysql-test/r/ndb_alter_table.err +mysql-test/r/ndb_autodiscover.err +mysql-test/r/ndb_autodiscover2.err +mysql-test/r/ndb_basic.err +mysql-test/r/ndb_blob.err +mysql-test/r/ndb_cache.err +mysql-test/r/ndb_charset.err +mysql-test/r/ndb_index.err +mysql-test/r/ndb_index_ordered.err +mysql-test/r/ndb_index_unique.err +mysql-test/r/ndb_insert.err +mysql-test/r/ndb_limit.err +mysql-test/r/ndb_lock.err +mysql-test/r/ndb_minmax.err +mysql-test/r/ndb_replace.err +mysql-test/r/ndb_subquery.err +mysql-test/r/ndb_transaction.err +mysql-test/r/ndb_truncate.err +mysql-test/r/ndb_types.err +mysql-test/r/ndb_update.err +mysql-test/r/openssl_1.err +mysql-test/r/ps_1general.err +mysql-test/r/ps_6bdb.err +mysql-test/r/ps_7ndb.err +mysql-test/r/query_cache.err +mysql-test/r/query_cache_merge.err +mysql-test/r/raid.err +mysql-test/r/repair.err +mysql-test/r/replace.err +mysql-test/r/rpl000001.err mysql-test/r/rpl000001.eval mysql-test/r/rpl000002.eval mysql-test/r/rpl000014.eval +mysql-test/r/rpl000015.err mysql-test/r/rpl000015.eval mysql-test/r/rpl000016.eval mysql-test/r/rpl_log.eval @@ -641,6 +717,8 @@ ndb/examples/ndbapi_example2/ndbapi_example2 ndb/examples/ndbapi_example3/ndbapi_example3 ndb/examples/ndbapi_example5/ndbapi_example5 ndb/examples/select_all/select_all +ndb/include/ndb_global.h +ndb/include/ndb_version.h ndb/lib/libMGM_API.so ndb/lib/libNDB_API.so ndb/lib/libNDB_ODBC.so @@ -711,10 +789,25 @@ ndb/tools/ndb_delete_all ndb/tools/ndb_desc ndb/tools/ndb_drop_index ndb/tools/ndb_drop_table +ndb/tools/ndb_restore ndb/tools/ndb_select_all ndb/tools/ndb_select_count ndb/tools/ndb_show_tables +ndb/tools/ndb_test_platform ndb/tools/ndb_waiter +ndbcluster-1186 +ndbcluster-1186/SCCS +ndbcluster-1186/config.ini +ndbcluster-1186/ndb_1.pid +ndbcluster-1186/ndb_1_out.log +ndbcluster-1186/ndb_1_signal.log +ndbcluster-1186/ndb_2.pid +ndbcluster-1186/ndb_2_out.log +ndbcluster-1186/ndb_2_signal.log +ndbcluster-1186/ndb_3.pid +ndbcluster-1186/ndb_3_cluster.log +ndbcluster-1186/ndb_3_out.log +ndbcluster-1186/ndbcluster.pid pull.log regex/re repl-tests/test-repl-ts/repl-timestamp.master.reject @@ -909,16 +1002,54 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl -Docs/Images/myaccess-odbc.txt -Docs/Images/myaccess.txt -Docs/Images/myarchitecture.txt -Docs/Images/mydll-properties.txt -Docs/Images/mydsn-example.txt -Docs/Images/mydsn-icon.txt -Docs/Images/mydsn-options.txt -Docs/Images/mydsn-setup.txt -Docs/Images/mydsn-test-fail.txt -Docs/Images/mydsn-test-success.txt -Docs/Images/mydsn-trace.txt -Docs/Images/mydsn.txt -Docs/Images/myflowchart.txt +tests/mysql_client_test +tests/mysql_client_test +libmysqld/examples/mysql_client_test.c +libmysqld/examples/mysql_client_test_embedded +libmysqld/examples/mysqltest_embedded +ndb/src/common/debugger/signaldata/libsignaldataprint.dsp +ndb/src/common/debugger/libtrace.dsp +ndb/src/common/logger/liblogger.dsp +ndb/src/common/mgmcommon/libmgmsrvcommon.dsp +ndb/src/common/portlib/libportlib.dsp +ndb/src/common/transporter/libtransporter.dsp +ndb/src/common/util/libgeneral.dsp +ndb/src/kernel/blocks/backup/libbackup.dsp +ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp +ndb/src/kernel/blocks/dbacc/libdbacc.dsp +ndb/src/kernel/blocks/dbdict/libdbdict.dsp +ndb/src/kernel/blocks/dbdih/libdbdih.dsp +ndb/src/kernel/blocks/dblqh/libdblqh.dsp +ndb/src/kernel/blocks/dbtc/libdbtc.dsp +ndb/src/kernel/blocks/dbtup/libdbtup.dsp +ndb/src/kernel/blocks/dbtux/libdbtux.dsp +ndb/src/kernel/blocks/dbutil/libdbutil.dsp +ndb/src/kernel/blocks/grep/libgrep.dsp +ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp +ndb/src/kernel/blocks/ndbfs/libndbfs.dsp +ndb/src/kernel/blocks/qmgr/libqmgr.dsp +ndb/src/kernel/blocks/suma/libsuma.dsp +ndb/src/kernel/blocks/trix/libtrix.dsp +ndb/src/kernel/error/liberror.dsp +ndb/src/kernel/vm/libkernel.dsp +ndb/src/kernel/ndbd.dsp +ndb/src/mgmapi/libmgmapi.dsp +ndb/src/mgmclient/ndb_mgm.dsp +ndb/src/mgmclient/libndbmgmclient.dsp +ndb/src/mgmsrv/ndb_mgmd.dsp +ndb/src/ndbapi/libndbapi.dsp +ndb/src/libndbclient.dsp +ndb/test/ndbapi/flexBench.dsp +ndb/test/ndbapi/testBasic.dsp +ndb/test/ndbapi/testBlobs.dsp +ndb/test/ndbapi/testScan.dsp +ndb/test/src/libNDBT.dsp +ndb/tools/ndb_waiter.dsp +ndb/tools/ndb_drop_table.dsp +ndb/tools/ndb_delete_all.dsp +ndb/tools/ndb_desc.dsp +ndb/tools/ndb_drop_index.dsp +ndb/tools/ndb_show_tables.dsp +ndb/tools/ndb_select_all.dsp +ndb/tools/ndb_select_count.dsp +support-files/ndb-config-2-node.ini diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index f8baf317e72..e048ad723ab 100644..100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -1,15 +1,20 @@ +#!/bin/sh + if ! test -f sql/mysqld.cc then echo "You must run this script from the MySQL top-level directory" exit 1 fi +prefix_configs="--prefix=/usr/local/mysql" just_print= just_configure= full_debug= while test $# -gt 0 do case "$1" in + --prefix=* ) prefix_configs="$1"; shift ;; + --with-debug=full ) full_debug="=full"; shift ;; -c | --just-configure ) just_configure=1; shift ;; -n | --just-print | --print ) just_print=1; shift ;; -h | --help ) cat <<EOF; exit 0 ;; @@ -17,13 +22,15 @@ Usage: $0 [-h|-n] [configure-options] -h, --help Show this help message. -n, --just-print Don't actually run any commands; just print them. -c, --just-configure Stop after running configure. - -Any other options will be passed directly to configure. + --with-debug=full Build with full debug. + --prefix=path Build with prefix 'path'. Note: this script is intended for internal use by MySQL developers. EOF - --with-debug=full ) full_debug="=full"; shift ;; - * ) break ;; + * ) + echo "Unknown option '$1'" + exit 1 + break ;; esac done @@ -41,8 +48,16 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch 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-bdb --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio" +max_leave_isam_configs="--with-innodb --with-bdb --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio --with-embedded-server" +max_no_es_configs="$max_leave_isam_configs --without-isam" +max_configs="$max_no_es_configs --with-embedded-server" + alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet +amd64_cflags="-DBIG_TABLES" pentium_cflags="-mcpu=pentiumpro" +pentium64_cflags="-mcpu=nocona -m64" +ppc_cflags="-mpowerpc -mcpu=powerpc" sparc_cflags="" # be as fast as we can be without losing our ability to backtrace @@ -52,11 +67,14 @@ fast_cflags="-O3 -fno-omit-frame-pointer" reckless_cflags="-O3 -fomit-frame-pointer " debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX" +debug_extra_cflags="-O1 -Wuninitialized" base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti" +amd64_cxxflags="-DBIG_TABLES" -base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline" +base_configs="$prefix_configs --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline" static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static" +amd64_configs="" alpha_configs="" # Not used yet pentium_configs="" sparc_configs="" @@ -68,7 +86,7 @@ local_infile_configs="--enable-local-infile" debug_configs="--with-debug$full_debug" if [ -z "$full_debug" ] then - debug_cflags="$debug_cflags -O1 -Wuninitialized" + debug_cflags="$debug_cflags $debug_extra_cflags" fi if gmake --version > /dev/null 2>&1 diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max new file mode 100755 index 00000000000..530bdba009b --- /dev/null +++ b/BUILD/compile-amd64-debug-max @@ -0,0 +1,9 @@ +#! /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_configs="$amd64_configs $debug_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max new file mode 100755 index 00000000000..228448f6392 --- /dev/null +++ b/BUILD/compile-amd64-max @@ -0,0 +1,8 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" +extra_flags="$amd64_cflags $fast_cflags $max_cflags -g" +extra_configs="$amd64_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-dist b/BUILD/compile-dist new file mode 100755 index 00000000000..7c177f54258 --- /dev/null +++ b/BUILD/compile-dist @@ -0,0 +1,48 @@ +#!/bin/sh +# +# This script's purpose is to update the automake/autoconf helper scripts and +# to run a plain "configure" without any special compile flags. Only features +# that affect the content of the source distribution are enabled. The resulting +# tree can then be picked up by "make dist" to create the "pristine source +# package" that is used as the basis for all other binary builds. +# +make distclean +aclocal +autoheader +libtoolize --automake --force --copy +automake --force --add-missing --copy +autoconf +(cd bdb/dist && sh s_all) +(cd innobase && aclocal && autoheader && aclocal && automake && autoconf) + +# Default to gcc for CC and CXX +if test -z "$CXX" ; then + export CXX=gcc +fi + +if test -z "$CC" ; then + export CC=gcc +fi + +# Use ccache, if available +if ccache -V > /dev/null 2>&1 +then + if ! (echo "$CC" | grep "ccache" > /dev/null) + then + export CC="ccache $CC" + fi + if ! (echo "$CXX" | grep "ccache" > /dev/null) + then + export CXX="ccache $CXX" + fi +fi + +# Make sure to enable all features that affect "make dist" +./configure \ + --with-embedded-server \ + --with-berkeley-db \ + --with-innodb \ + --enable-thread-safe-client \ + --with-extra-charsets=complex \ + --with-ndbcluster +make diff --git a/BUILD/compile-ia64-debug-max b/BUILD/compile-ia64-debug-max index 9cd54de428d..56c36059ea9 100755 --- a/BUILD/compile-ia64-debug-max +++ b/BUILD/compile-ia64-debug-max @@ -9,5 +9,5 @@ then (cd gemini && aclocal && autoheader && aclocal && automake && autoconf) fi -CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server +CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server --with-archive-storage-engine gmake diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max index 8894782050c..420657e0b73 100755 --- a/BUILD/compile-pentium-debug-max +++ b/BUILD/compile-pentium-debug-max @@ -3,11 +3,9 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $debug_cflags" +extra_flags="$pentium_cflags $debug_cflags $max_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-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster" +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 4554e38fdc1..803a6a9d6d3 100755 --- a/BUILD/compile-pentium-debug-max-no-embedded +++ b/BUILD/compile-pentium-debug-max-no-embedded @@ -3,11 +3,9 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $debug_cflags" +extra_flags="$pentium_cflags $debug_cflags $max_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-berkeley-db --with-innodb --without-isam --with-openssl --with-raid" +extra_configs="$pentium_configs $debug_configs $max_no_es_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max index caf657a2049..595581f604e 100755 --- a/BUILD/compile-pentium-max +++ b/BUILD/compile-pentium-max @@ -3,12 +3,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $fast_cflags -g" -extra_configs="$pentium_configs" -#strip=yes - -extra_configs="$extra_configs --with-innodb --with-berkeley-db \ - --with-embedded-server --enable-thread-safe-client \ - --with-openssl --with-vio --with-raid --with-ndbcluster" +extra_flags="$pentium_cflags $fast_cflags $max_cflags -g" +extra_configs="$pentium_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index fd9543163d6..f0dc92c2ffd 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -3,13 +3,13 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max" +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 --with-berkeley-db --with-innodb --with-isam --with-embedded-server --with-openssl --with-vio --with-raid --with-ndbcluster" +extra_configs="$extra_configs $max_leave_isam_configs --with-isam" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug new file mode 100755 index 00000000000..0299669f79a --- /dev/null +++ b/BUILD/compile-pentium64-debug @@ -0,0 +1,13 @@ +#! /bin/sh + +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 " + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc b/BUILD/compile-ppc new file mode 100755 index 00000000000..d248ecf2677 --- /dev/null +++ b/BUILD/compile-ppc @@ -0,0 +1,10 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $fast_cflags" +extra_configs="$static_link" +strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug new file mode 100755 index 00000000000..2be11eaaf22 --- /dev/null +++ b/BUILD/compile-ppc-debug @@ -0,0 +1,13 @@ +#! /bin/sh + +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" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max new file mode 100755 index 00000000000..49d1442fd45 --- /dev/null +++ b/BUILD/compile-ppc-debug-max @@ -0,0 +1,11 @@ +#! /bin/sh + +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_configs="$debug_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max new file mode 100755 index 00000000000..1d89be81c9c --- /dev/null +++ b/BUILD/compile-ppc-max @@ -0,0 +1,9 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $fast_cflags $max_cflags -g" +extra_configs="$extra_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify index 71a60e45cb0..5f5ba81396f 100755 --- a/BUILD/compile-solaris-sparc-purify +++ b/BUILD/compile-solaris-sparc-purify @@ -1,15 +1,35 @@ #! /bin/sh +mode="" +cxxfilt="" + +# For g++ 3.X, the PurifyPlus tools needs a program named "cxxfilt", +# "c++file" or similar. It is part of libtool. If not found, you can +# specify the path to it. + while test $# -gt 0 do case "$1" in - --debug) EXTRA_CONFIG_FLAGS=--with-debug; shift ;; - -h | --help ) cat <<EOF; exit 0 ;; -Usage: $0 [-h|-n] [configure-options] - --debug Compile with DBUG enabled + --debug) EXTRA_CONFIG_FLAGS=--with-debug ;; + --purify) mode=purify ;; + --purecov*) mode=purecov ;; + --quantify) mode=quantify ;; + --cxxfilt) shift ; cxxfilt=$1 ;; + -h | --help ) cat <<EOF; exit 0 ;; +Usage: $0 [ options ] + +Where the 'options' are + + --debug Compile with DBUG enabled + --purify Only prepare for Purify + --purecov Only prepare for PureCover + --quantify Only prepare for Quantify + --cxxfilt <cxxfilt> Path to cxxfilt/c++filt program + This program is needed for gcc 3.X EOF - *) echo "No such option '$1'" ; exit ;; + *) echo "No such option '$1'" ; exit 1 ;; esac + shift done gmake -k clean || true @@ -22,9 +42,70 @@ CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-sub gmake -j 4 -cd sql ; mv mysqld mysqld-org ; -make CXXLD="purify -best-effort g++" mysqld ; mv mysqld mysqld-purify -make CXXLD="quantify -best-effort g++" mysqld ; mv mysqld mysqld-quantify -make CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov -mv mysqld-org mysqld +# ---------------------------------------------------------------------- + +#set -x + +purifying_binaries () +{ + while test $1 + do + dir=$1 + shift + target=$1 + shift + binary=$1 + shift + + opts="" + if [ -n "$cxxfilt" ] ; then + opts="$opts -demangle-program=$cxxfilt" + fi + opts="$opts -best-effort" + + back=`pwd` + cd $dir + + # Because of libtool magic, the target and binary + # created might not be the same. To trigger rebuild, + # we need to move them both. + + mv $binary $binary-old + if [ -f $target ] ; then + mv $target $target-old + fi + + if [ -n "$mode" -a $mode = purify ] ; then + gmake CCLD="purify $opts gcc" CXXLD="purify $opts g++" $target + mv $binary $binary-purify + fi + + if [ -n "$mode" -a $mode = quantify ] ; then + gmake CCLD="quantify $opts gcc" CXXLD="quantify $opts g++" $target + mv $binary $binary-quantify + fi + + if [ -n "$mode" -a $mode = purecov ] ; then + gmake CCLD="purecov $opts gcc" CXXLD="purecov $opts g++" $target + mv $binary $binary-purecov + fi + + mv $binary-old $binary + if [ -f $target-old ] ; then + mv $target-old $target + fi + + cd $back + done +} + + +purifying_binaries \ + sql mysqld mysqld \ + client mysqltest .libs/mysqltest \ + tests mysql_client_test mysql_client_test \ + libmysqld/examples mysqltest_embedded mysqltest_embedded \ + libmysqld/examples mysql_client_test_embedded mysql_client_test_embedded + +# ---------------------------------------------------------------------- diff --git a/BitKeeper/etc/gone b/BitKeeper/etc/gone index ad2ffda4d6e..63a759cf131 100644 --- a/BitKeeper/etc/gone +++ b/BitKeeper/etc/gone @@ -841,6 +841,241 @@ serg@serg.mysql.com|mysql-test/t/sel000027.test|20001211130731|23677|ab44bb57a58 serg@serg.mysql.com|mysql-test/t/sel000028.test|20001211130731|28317|db9bfc0a808fb629 serg@serg.mysql.com|mysql-test/t/sel000029.test|20001211130731|32917|6aae34dbb3ee86d9 serg@serg.mysql.com|mysql-test/t/sel000030.test|20001211130732|03110|a29683eac3e7b706 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_sjis.result|20050107081527|04225|2ec1fd4929b5638e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_ucs2.result|20050107081527|11825|f3ac4ae77651d4f4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_ujis.result|20050107081528|17309|2c37b350cc1614b7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_utf8.result|20050107081528|57925|2916262ef0a8467c +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_sjis.result|20050107081528|32479|2d7cc0bab6a08fb7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_ucs2.result|20050107081529|38657|a904397e286b018d +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_ujis.result|20050107081529|63265|a3e5fab4dda3f63 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_utf8.result|20050107081529|19050|8f33e213f34b75c4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_sjis.result|20050107081530|05840|92bcb5996a61c9bc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_ucs2.result|20050107081530|27322|9f3eb425f5a8a94e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_ujis.result|20050107081530|48971|ccce22a3ed33edb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_utf8.result|20050107081530|04766|6be23c27e03aaef +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_sjis.result|20050107081530|26438|e16736c277401654 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_ucs2.result|20050107081531|13914|845b174a4e12fdf5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_ujis.result|20050107081531|35726|ea4382cfe092a050 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_utf8.result|20050107081531|58104|b90186d893390496 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_sjis.result|20050107081531|14644|d35a81ed738ce5ba +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_ucs2.result|20050107081532|01516|94fe34e7cf948cf4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_ujis.result|20050107081532|23036|4d5552d56ab27619 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_utf8.result|20050107081532|44748|374e13cc2ae5b0fa +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_sjis.result|20050107081532|00620|eee512b72025128e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_ucs2.result|20050107081532|22012|c0187e924a3b5cdc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_ujis.result|20050107081533|09019|e8763bd889fa5d1 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_utf8.result|20050107081533|30411|b9afcd7fdbca71bf +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_sjis.result|20050107081533|52491|68150e74f7d83182 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_ucs2.result|20050107081533|08926|50375a296eea1a4c +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_ujis.result|20050107081533|30516|26c8e1122bdac1f1 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_utf8.result|20050107081534|17587|577e655491905344 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_sjis.result|20050107081534|39290|67147bffbcee5282 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_ucs2.result|20050107081534|61019|2a3faa20c3360cfb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_ujis.result|20050107081534|17136|5e7b2c0407b9eae +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_utf8.result|20050107081535|04220|62fa831c2b8a02e9 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_sjis.result|20050107081535|25969|abfcff6cbdae1925 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_ucs2.result|20050107081535|47754|be297a9ec05c0e0a +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_ujis.result|20050107081535|03623|f42e09a2a6736f23 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_utf8.result|20050107081535|24952|8fc889df4669cd6 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_sjis.result|20050107081536|12369|396a43a5ac83bda3 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_ucs2.result|20050107081536|34440|f112f6b3a020dcb5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_ujis.result|20050107081536|56149|dab3a2b2f5e31eb5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_utf8.result|20050107081536|12246|6661d21d7c485970 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_sjis.result|20050107081536|33732|c4d6b2814e85710f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_ucs2.result|20050107081537|20829|ebc1bcd92b01ba3 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_ujis.result|20050107081537|42728|c88e3ddf34290212 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_utf8.result|20050107081537|64357|702b2e408597f5ef +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_sjis.result|20050107081537|20201|ab84fe078f8c50e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_ucs2.result|20050107081538|07211|f79c430972fe4242 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_ujis.result|20050107081538|28829|92e66a0d987080ab +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_utf8.result|20050107081538|50725|f3e1ec3c827572ef +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_sjis.result|20050107081538|07207|497ea317a9779e08 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_ucs2.result|20050107081538|29018|dff13e955936a635 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_ujis.result|20050107081539|16190|5aaf14c5cc0eb3d7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_utf8.result|20050107081539|38032|e62cf43214334eaf +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_sjis.result|20050107081539|59851|f5cd5bb0720f1388 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_ucs2.result|20050107081539|16013|397f3c3ecc929da +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_ujis.result|20050107081540|05016|a0746377dc240841 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_utf8.result|20050107081540|26599|65816e1c9ea27fbc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_sjis.result|20050107081540|48453|be23445a258c2efb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_ucs2.result|20050107081540|04446|10797352d768da53 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_ujis.result|20050107081540|26224|75165c42c9da07e8 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_utf8.result|20050107081541|13606|36ad2d19941abede +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_sjis.result|20050107081541|35572|2b3b542ec89a8440 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_ucs2.result|20050107081541|57615|cab66782e2d918b7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_ujis.result|20050107081541|13734|5e405409e03dca3 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_utf8.result|20050107081542|00849|5f64c2575080fb2e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ps_sjis.result|20050107081542|22464|194a85125571489c +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ps_ujis.result|20050107081542|44552|1d31f04dc3869387 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_sjis.result|20050107081542|00673|76b3f6fab7cce305 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_ucs2.result|20050107081542|22178|40a5c69f7fb9ad70 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_ujis.result|20050107081543|09299|ab8af1803ff6de87 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_utf8.result|20050107081543|31103|34a42201cf18603f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_sjis.result|20050107081543|53242|2fd638c1bbea9de +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_ucs2.result|20050107081543|09440|bcae1663ff14df06 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_ujis.result|20050107081543|31543|69792ccfb7d3b59b +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_utf8.result|20050107081544|19023|30e4181e77154299 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_sjis.result|20050107081544|40814|84b8e7d33c6cc088 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_ucs2.result|20050107081544|62694|20e50c73803406e0 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_ujis.result|20050107081544|18674|2bd13ccf7478f32b +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_utf8.result|20050107081545|06019|b26626fbc0c8fa25 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_sjis.result|20050107081545|47717|a6cb9a00a34d9280 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_ucs2.result|20050107081545|03933|6f310a21c6a3ad7f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_ujis.result|20050107081545|25719|419271caa26c24cd +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_utf8.result|20050107081546|12990|e1cd2ebd6c0208ea +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_sjis.result|20050107081546|34719|d23e6090f98e8fbc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_ucs2.result|20050107081546|56850|f2fe2a72c482aa49 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_ujis.result|20050107081546|13304|1e865c1ccf400e23 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_utf8.result|20050107081547|00440|8b2e0fffb1bc5cd4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_sjis.result|20050107081547|22111|60535594c5605694 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_ucs2.result|20050107081547|44100|71c3558952cbc6ad +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_ujis.result|20050107081547|00264|f0e2860f90982398 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_utf8.result|20050107081547|21895|eeef381fbf2d9c95 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_sjis.result|20050107081548|09502|b652bee325136852 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_ucs2.result|20050107081548|31516|8a8aa66dad072fed +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_ujis.result|20050107081548|53490|8add4d2433058e8e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_utf8.result|20050107081548|09693|cdeb3a8f901a6efb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_sjis.result|20050107081549|05596|fee80f00e654153 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_ucs2.result|20050107081549|28016|238f41941bf1cde2 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_ujis.result|20050107081549|50377|1d6072226dc693ac +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_utf8.result|20050107081549|06796|2dba8103bf4ad46d +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_sjis.result|20050107081549|28652|8a103fbcece5bf25 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_ucs2.result|20050107081550|15970|ac4cba762dc14e28 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_ujis.result|20050107081550|37865|4df912345aac10f1 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_utf8.result|20050107081550|60045|79cba16887bf3b1f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_union_ujis.result|20050107081550|16675|f0d464252c220c15 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_sjis.result|20050107081551|03970|13dc7639ad1ec6e5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_ucs2.result|20050107081551|25688|8fc9b1f31d32a21f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_ujis.result|20050107081551|47775|93f6c8b3f5622aff +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_utf8.result|20050107081551|04259|24a758ee1768afcc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_sjis.result|20050107081551|26138|cb97323da2f50869 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_ucs2.result|20050107081552|13450|b3dad356facc16be +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_ujis.result|20050107081552|35250|4e3045c764bfa364 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_utf8.result|20050107081552|57088|143422da49ad0cdb +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_sjis.dat|20050107081552|13191|3b811e51d64f83c7 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_ucs2.dat|20050107083211|03894|85975a083dfb7a54 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_ujis.dat|20050107081605|05898|699c7c58964df90 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_utf8.dat|20050107081606|12116|74d43073bf069bc7 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis.dat|20050107081606|52743|9e8273f37d55fc4 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis2.dat|20050107083212|14086|38a382ad2316ccf0 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis3.dat|20050107081608|13836|8661d7801d6d35c +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_ucs2.dat|20050107081608|54705|269e953196baf762 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_ujis.dat|20050107081608|29492|e5d30a2aadd8062a +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_utf8.dat|20050107081609|35613|db4e6eadc27ec29e +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_ucs2.dat|20050107081609|10803|4fbb36024a7d47d0 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_ujis.dat|20050107081610|17128|bedeb2aa4cf2103d +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_utf8.dat|20050107081610|58355|6f46c105f00e6da7 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_sjis.test|20050107081610|33134|f7c41740399a114a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_ucs2.test|20050107081611|40070|8aded01010aa4027 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_ujis.test|20050107081611|04428|ddd8a1d2c2b10744 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_utf8.test|20050107081611|26011|749a0e3b6ba599d2 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_sjis.test|20050107081612|13318|38dc8c4a77af62a4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_ucs2.test|20050107081612|35063|fe5674c6b12d2b1 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_ujis.test|20050107081612|57379|e901fbd29981385b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_utf8.test|20050107081612|13800|36ef1b7b55dc4a1b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_sjis.test|20050107081613|01245|daf9bbe53b34f1a8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_ucs2.test|20050107081613|22978|ea01c4415d5ef4a4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_ujis.test|20050107081613|45096|ca893d3a1c4a5fab +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_utf8.test|20050107081613|01406|9d3ffec1489a799b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_sjis.test|20050107081613|23086|a7fbf85ce0fc9591 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_ucs2.test|20050107081614|10458|84828e6663159064 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_ujis.test|20050107081614|32393|a64465e0725243 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_utf8.test|20050107081614|54260|8f344fb86504b604 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_sjis.test|20050107081614|10489|40a1631cffd46fe +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_ucs2.test|20050107081614|32422|8f034f1fb0ae644b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_ujis.test|20050107081615|20478|bbdb04d1a483939b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_utf8.test|20050107081615|42908|1f4418fddb751c58 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_sjis.test|20050107081615|64880|448ff3eaff962456 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_ucs2.test|20050107081615|21081|b2bafda9e7a3f226 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_ujis.test|20050107081616|08589|1477760d458bb313 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_utf8.test|20050107081616|30689|a1d12ccab39f74f3 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_sjis.test|20050107081616|53230|9b863b7e4728f82a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_ucs2.test|20050107081617|23149|f05f1cbbe3740670 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_ujis.test|20050107081618|10643|ac136bedb31cf9a8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_utf8.test|20050107081618|46561|43460e3947ac3d24 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_sjis.test|20050107081618|02948|b32f23f3f588ea9a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_ucs2.test|20050107081618|24774|783e8b896271e49e +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_ujis.test|20050107081619|12298|3f9c8c41cd92faa3 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_utf8.test|20050107081619|37128|e4ab71ff1f780509 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_sjis.test|20050107081619|59453|25fc516136ca9159 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_ucs2.test|20050107081619|15956|673e221671a2770d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_ujis.test|20050107081620|03773|75c1239ff59d928a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_utf8.test|20050107081620|26260|ed912ad48a1893a8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_sjis.test|20050107081620|49077|59a36a82ee570052 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_ucs2.test|20050107081620|05668|7d8665f03f26863d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_ujis.test|20050107081620|27737|ecdf5e86cbda74cb +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_utf8.test|20050107081621|15489|b98f58e8a4a65e7b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_sjis.test|20050107081621|41478|91fcd07aaac68648 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_ucs2.test|20050107081621|63674|65929b80d0271c86 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_ujis.test|20050107081621|20110|2a5ce575491289f4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_utf8.test|20050107081622|07679|932150eea8460d1 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_sjis.test|20050107081622|30138|22fc722d29faeb92 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_ucs2.test|20050107081622|52718|81dcde6618d6a22d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_ujis.test|20050107081622|09451|d5be7e1b3b4fb88b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_utf8.test|20050107081622|31964|cfd3ea368b652b5b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_sjis.test|20050107081623|19721|1db71ef08ca802d0 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_ucs2.test|20050107081623|42415|55eee7f0b2b984cd +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_ujis.test|20050107081623|64766|4136ccd8cd83eee5 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_utf8.test|20050107081623|21529|556e575385ee58f +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_sjis.test|20050107081624|09362|ac12c88e8477d736 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_ucs2.test|20050107081624|31699|e6e0cc4752262b9f +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_ujis.test|20050107081624|54042|afa7eadd28fa536e +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_utf8.test|20050107081624|10934|307d85c4cd318e62 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_sjis.test|20050107081624|33252|29972178e7d58d93 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_ucs2.test|20050107081625|21025|b722d1ed662e03c8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_ujis.test|20050107081625|44023|c1feeadebdfc0ff9 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_utf8.test|20050107081625|01097|2f3347de2a42b9d6 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_sjis.test|20050107081625|23224|fb954f6d4b2a20ac +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_ucs2.test|20050107081626|11079|998157355fe96143 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_ujis.test|20050107081626|33500|aab63ba3302196a2 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_utf8.test|20050107081626|55883|8193f90a6ed58d36 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ps_sjis.test|20050107081626|12674|2f1450a52f147fec +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ps_ujis.test|20050107081627|00495|7b0eb3ca59abb12 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_sjis.test|20050107081627|23008|a74ce2aca0e5ac66 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_ucs2.test|20050107081627|45674|71b7010127493fb +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_ujis.test|20050107081627|02501|cfe2af6b3db381c0 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_utf8.test|20050107081627|24683|57e905b35703072 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_sjis.test|20050107081628|12962|f40219e9e488fc23 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_ucs2.test|20050107081628|35555|2c0e7ad52ec9ca65 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_ujis.test|20050107081628|57942|c353d85f4e92f5df +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_utf8.test|20050107081628|14597|e2588c2a3dcf63a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_sjis.test|20050107081629|02304|14af84f068332d50 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_ucs2.test|20050107081629|24565|729a8377aa8100e4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_ujis.test|20050107081629|47409|a839209fac19b930 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_utf8.test|20050107081629|04400|ada246cab13f1811 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_sjis.test|20050107081629|26583|9ae895ba98c4d31 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_ucs2.test|20050107081630|14467|cc7b3b62ee6dae28 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_ujis.test|20050107081630|37003|9c869c17899db4c7 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_utf8.test|20050107081630|59835|a8ed7c9ff559c38d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_sjis.test|20050107081630|16798|82a8f174f2ac5988 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_ucs2.test|20050107081631|04558|1f90bdf68ed4d6d0 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_ujis.test|20050107081631|26878|1804ccc6518b5d9 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_utf8.test|20050107081631|49568|74375ee1105781bd +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_sjis.test|20050107081631|06299|b1151637493de45 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_ucs2.test|20050107081632|27924|3364d51b3168f562 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_ujis.test|20050107081632|50639|721b5841964bf8e6 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_utf8.test|20050107081632|07426|37222d28b4cfe7c8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_sjis.test|20050107081632|29631|c92ff81669eb652 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_ucs2.test|20050107084021|10337|4b920d28fc9dc5aa +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_ujis.test|20050107083216|33062|3f51b47de1fb0c17 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_utf8.test|20050107081637|15503|fe599c9515084385 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_sjis.test|20050107081638|08555|305285c02185f498 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_ucs2.test|20050107081638|36441|ddc58f642ca61418 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_ujis.test|20050107081638|64337|2cc53c02a5cc4879 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_utf8.test|20050107081638|26081|55bb4e11bc747e5d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_sjis.test|20050107081639|19046|ec18bf7845064d09 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_ucs2.test|20050107081639|46660|583edc63a51fd799 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_ujis.test|20050107081639|06910|87aad3c53be879fd +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_utf8.test|20050107081639|29347|b35fcc89b5fa47c3 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_union_ujis.test|20050107081640|17665|1eb842f74190b3c1 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_sjis.test|20050107081640|40239|d21d19721f975c74 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_ucs2.test|20050107081640|62869|3dad27b824548037 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_ujis.test|20050107081640|19575|5c3da888e148065b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_utf8.test|20050107081641|07967|bc3adabdd5ac865 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_sjis.test|20050107081641|30584|e2886fcc8b23152f +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_ucs2.test|20050107081641|53233|b3c07768684ddfdb +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_ujis.test|20050107081641|10027|9e123ef3c645b66a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_utf8.test|20050107081641|32217|59fb529f60d9d8bc tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.eps|20020228162345|64529|31ade79a89683616 tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.gif|20020228162348|36945|364ca7338682f71 tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.txt|20020228162350|33044|e155c53c10374ff diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 62b00f97f06..a37994b7791 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -2,6 +2,7 @@ Administrador@light. Administrator@co3064164-a. Administrator@co3064164-a.rochd1.qld.optushome.com.au Administrator@fred. +Administrator@w2k. Greg@greg-laptop. Miguel@light.local Sinisa@sinisa.nasamreza.org @@ -25,6 +26,7 @@ bar@deer.(none) bar@gw.udmsearch.izhnet.ru bar@mysql.com bar@noter.intranet.mysql.r18.ru +bell@51.0.168.192.in-addr.arpa bell@laptop.sanja.is.com.ua bell@sanja.is.com.ua bk@admin.bk @@ -32,8 +34,10 @@ bk@mysql.r18.ru brian@avenger.(none) brian@brian-akers-computer.local brian@private-client-ip-101.oz.net +brian@zim.(none) carsten@tsort.bitbybit.dk davida@isil.mysql.com +dean@mysql.com dellis@goetia.(none) dlenev@brandersnatch.localdomain dlenev@build.mysql.com @@ -87,20 +91,27 @@ jcole@mugatu.jcole.us jcole@mugatu.spaceapes.com jcole@sarvik.tfr.cafe.ee jcole@tetra.spaceapes.com +jimw@mysql.com joerg@mysql.com joreland@mysql.com jorge@linux.jorge.mysql.com jplindst@t41.(none) +kaa@polly.local kaj@work.mysql.com kent@mysql.com konstantin@mysql.com kostja@oak.local +lars@mysql.com lenz@kallisto.mysql.com lenz@mysql.com magnus@neptunus.(none) magnus@shellback.(none) marko@hundin.mysql.fi +marty@linux.site +mats@mysql.com +matt@booty.(none) matt@mysql.com +matthias@three.local.lan miguel@hegel.(none) miguel@hegel.br miguel@hegel.local @@ -110,6 +121,7 @@ miguel@light. miguel@light.local miguel@sartre.local mikael@mc04.(none) +mikael@orca.ndb.mysql.com mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se mikron@mikael-ronstr-ms-dator.local mleich@mysql.com @@ -137,6 +149,7 @@ msvensson@build.mysql.com mwagner@cash.mwagner.org mwagner@evoq.mwagner.org mwagner@here.mwagner.org +mwagner@mysql.com mwagner@work.mysql.com mydev@mysql.com mysql@home.(none) @@ -152,23 +165,28 @@ nick@nick.leippe.com papa@gbichot.local patg@krsna.patg.net paul@central.snake.net +paul@frost.snake.net paul@ice.local paul@ice.snake.net paul@kite-hub.kitebird.com +paul@snake-hub.snake.net paul@teton.kitebird.com pekka@mysql.com pem@mysql.com peter@linux.local peter@mysql.com peterg@mysql.com +petr@mysql.com pgulutzan@linux.local ram@deer.(none) ram@gw.mysql.r18.ru ram@gw.udmsearch.izhnet.ru ram@mysql.r18.ru ram@ram.(none) +ramil@mysql.com ranger@regul.home.lan rburnett@build.mysql.com +reggie@bob.(none) root@home.(none) root@mc04.(none) root@x3.internalnet @@ -186,6 +204,8 @@ serg@sergbook.mylan serg@sergbook.mysql.com sergefp@mysql.com sinisa@rhols221.adsl.netsonic.fi +stewart@mysql.com +svoj@mysql.com tfr@beta.frontier86.ee tfr@indrek.tfr.cafe.ee tfr@sarvik.tfr.cafe.ee @@ -193,9 +213,11 @@ tim@bitch.mysql.fi tim@black.box tim@hundin.mysql.fi tim@sand.box +tim@siva.hindu.god tim@threads.polyesthetic.msg tim@white.box tim@work.mysql.com +timour@mysql.com tom@basil-firewall.home.com tomas@mc05.(none) tomas@poseidon.(none) @@ -208,6 +230,7 @@ tonu@x153.internalnet tonu@x3.internalnet tsmith@build.mysql.com tulin@build.mysql.com +tulin@mysql.com ulli@morbus.(none) venu@hundin.mysql.fi venu@myvenu.com diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index 3f347e4c596..93151f3e2b6 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -19,15 +19,28 @@ BK_STATUS=$BK_STATUS$BK_COMMIT if [ "$BK_STATUS" = OK ] then +HAS_ACTUAL_CHANGES=`bk cset -r+ -d | grep -v "^#"` +if [ "$HAS_ACTUAL_CHANGES" = "" ] +then + echo ChangeSet had no real changes, not sending emails + exit +fi + CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet` -BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/ BUG#\1/p'` +BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'` WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'` if [ "$BUG" = "" ] then TO=dev-public@mysql.com + BS="" + BH="" else TO=dev-bugs@mysql.com + BS=" BUG#$BUG" +# need newline here + BH="X-Bug: $BUG +" fi #++ # dev-public@ / dev-bugs@ @@ -38,8 +51,8 @@ fi List-ID: <bk.mysql-$VERSION> From: $FROM To: $TO -Subject: bk commit - $VERSION tree ($CHANGESET)${BUG}${WL} - +Subject: bk commit - $VERSION tree ($CHANGESET)${BS}${WL} +$BH EOF bk changes -v -r+ bk cset -r+ -d @@ -54,14 +67,14 @@ EOF List-ID: <bk.mysql-$VERSION> From: $FROM To: $INTERNALS -Subject: bk commit into $VERSION tree ($CHANGESET) - +Subject: bk commit into $VERSION tree ($CHANGESET)$BS +$BH Below is the list of changes that have just been committed into a local $VERSION repository of $USER. When $USER does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository -see http://www.mysql.com/doc/I/n/Installing_source_tree.html +see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html EOF bk changes -v -r+ @@ -81,7 +94,7 @@ EOF List-ID: <bk.mysql-$VERSION> From: $FROM To: $DOCS -Subject: bk commit - $VERSION tree (Manual) ($CHANGESET) +Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS EOF bk changes -v -r+ diff --git a/BitKeeper/triggers/pre-delta b/BitKeeper/triggers/pre-delta index e22ae9ce940..cd861703bb5 100755 --- a/BitKeeper/triggers/pre-delta +++ b/BitKeeper/triggers/pre-delta @@ -1,5 +1,16 @@ #!/bin/sh +if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ] +then + echo "Error: you cannot checkin as 'Administrator' or 'mysqldev' user." + echo "as a workaround set BK_USER to your nickname" + echo "e.g.: export BK_USER='bar'" + echo "" + echo "Checkin FAILED!" + echo "Set BK_USER and retry." + exit 1 +fi + if [ `tail -c1 $BK_FILE` ] then echo "File $BK_FILE does not end with a new-line character!" diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 8cad093bc5f..64f865362ca 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -26,7 +26,7 @@ else } # Some predefined settings -$build_command= "BUILD/compile-pentium-max"; +$build_command= "BUILD/compile-dist"; $PWD= cwd(); $opt_docdir= $PWD . "/mysqldoc"; $opt_archive_log= undef; @@ -38,7 +38,7 @@ $opt_dry_run= undef; $opt_export_only= undef; $opt_help= $opt_verbose= 0; $opt_log= undef; -$opt_mail= ""; +$opt_mail= "build\@mysql.com"; $opt_pull= undef; $opt_revision= undef; $opt_suffix= ""; @@ -70,7 +70,7 @@ GetOptions( "test|t", "verbose|v", "win-dist|w", - "quiet|q", + "quiet|q", ) || print_help(""); # @@ -122,18 +122,8 @@ if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run)) # if ($opt_pull) { - &logger("Updating BK tree $REPO to latest ChangeSet first"); - chdir ($REPO) or &abort("Could not chdir to $REPO!"); - &run_command("bk pull", "Could not update $REPO!"); - chdir ($PWD) or &abort("Could not chdir to $PWD!"); - - unless ($opt_skip_manual) - { - &logger("Updating manual tree in $opt_docdir"); - chdir ($opt_docdir) or &abort("Could not chdir to $opt_docdir!"); - &run_command("bk pull", "Could not update $opt_docdir!"); - chdir ($PWD) or &abort("Could not chdir to $PWD!"); - } + &bk_pull("$REPO"); + &bk_pull("$opt_docdir") unless ($opt_skip_manual); } # @@ -220,10 +210,16 @@ if (-d $target_dir) } else { - &logger("Renaming $target_dir to $target_dir.old." . $$); + # Get the time stamp of "configure.in" + @stat= stat("$target_dir/configure.in"); + my $mtime= $stat[9]; + my ($sec,$min,$hour,$mday,$mon,$year) = localtime($mtime); + my $mtime= sprintf("%04d-%02d-%02d-%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min); + + &logger("Renaming $target_dir to $target_dir-$mtime"); $command= "mv "; $command.= "-v " if ($opt_verbose || defined $opt_log); - $command.= "$target_dir $target_dir.old." . $$; + $command.= "$target_dir $target_dir-$mtime"; &run_command($command, "Could not rename $target_dir!"); } } @@ -262,7 +258,7 @@ if (defined $opt_changelog) $msg= "Adding $target_dir/ChangeLog"; $msg.= " (down to revision $opt_changelog)" if $opt_changelog ne ""; &logger($msg); - $command= "bk changes -mv"; + $command= "bk changes -v"; $command.= " -r" if ($opt_changelog ne "" || $opt_revision); $command.= $opt_changelog if $opt_changelog ne ""; $command.= ".." if ($opt_changelog ne "" && !$opt_revision); @@ -270,7 +266,7 @@ if (defined $opt_changelog) $command.= " " . $REPO . " > $target_dir/ChangeLog"; &logger($command); # We cannot use run_command here because of output redirection - if (!$opt_dry_run) + unless ($opt_dry_run) { system($command) == 0 or &abort("Could not create $target_dir/ChangeLog!"); } @@ -281,13 +277,17 @@ if (defined $opt_changelog) # unless ($opt_skip_manual) { - $msg= "Updating manual files"; - &logger($msg); - foreach $file qw/internals manual reservedwords/ + &logger("Updating manual files"); + foreach $file qw/internals manual reservedwords errmsg-table cl-errmsg-table/ { system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0 or &abort("Could not update $file.texi in $target_dir/Docs/!"); } + + &run_command("rm -f $target_dir/Docs/Images/Makefile*", + "Could not remove Makefiles in $target_dir/Docs/Images/!"); + &run_command("cp $opt_docdir/Docs/Images/*.* $target_dir/Docs/Images", + "Could not copy image files in $target_dir/Docs/Images/!"); } # @@ -374,6 +374,18 @@ if ($opt_archive_log) exit 0; # +# Run a BK pull on the given BK tree +# +sub bk_pull +{ + my $bk_tree= $_[0]; + &logger("Updating BK tree $bk_tree to latest ChangeSet first"); + chdir ($bk_tree) or &abort("Could not chdir to $bk_tree!"); + &run_command("bk pull", "Could not update $bk_tree!"); + chdir ($PWD) or &abort("Could not chdir to $PWD!"); +} + +# # Print the help text message (with an optional message on top) # sub print_help @@ -425,6 +437,7 @@ Options: include a log file snippet, if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com + Default: build\@mysql.com -q, --quiet Be quiet -p, --pull Update the source BK trees before building -r, --revision=<rev> Export the tree as of revision <rev> diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index f3c20c81a9f..e7ab3357de9 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -7,16 +7,17 @@ use Sys::Hostname; @config_options= (); @make_options= (); -$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; +$opt_comment=$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; -$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; -$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; +$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; +$opt_skip_embedded_test=$opt_skip_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( "bdb", "build-thread=i", "bundled-zlib", + "comment=s", "config-env=s" => \@config_env, "config-extra-env=s" => \@config_extra_env, "config-options=s" => \@config_options, @@ -37,10 +38,13 @@ GetOptions( "no-test", "no-mysqltest", "no-benchmark", + "one-error", "perl-files=s", "perl-options=s", "raid", "readline", + "skip-embedded-test", + "skip-ps-test", "stage=i", "static-client", "static-perl", @@ -52,7 +56,10 @@ GetOptions( "use-old-distribution", "user=s", "version-suffix=s", + "with-archive", "with-cluster", + "with-csv", + "with-example", "with-debug", "with-low-memory", "with-other-libc=s", @@ -104,6 +111,7 @@ $log="$pwd/Logs/$host-$major.$minor$opt_version_suffix.log"; $opt_distribution =~ /(mysql[^\/]*)\.tar/; $ver=$1; $gcc_version=which("gcc"); +$opt_comment= "Official MySQL$opt_version_suffix binary" unless $opt_comment; if (defined($gcc_version) && ! $opt_config_env) { $tmp=`$gcc_version -v 2>&1`; @@ -149,7 +157,7 @@ $ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread*2; $ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build"; $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl"; $slave_port=$mysql_tcp_port+16; -$ndbcluster_port= 9350 + $opt_build_thread*2; +$ndbcluster_port= 9350 + $opt_build_thread*4; $manager_port=$mysql_tcp_port+1; $mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20"; @@ -258,7 +266,8 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-berkeley-db" if ($opt_bdb); $opt_config_options.= " --with-zlib-dir=bundled" if ($opt_bundled_zlib); $opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client); - $opt_config_options.= " --with-debug" if ($opt_with_debug); + $opt_config_options.= " --with-debug" if ($opt_with_debug); + $opt_config_options.= " --without-ndb-debug" if ($opt_with_debug && $opt_with_cluster); $opt_config_options.= " --with-libwrap" if ($opt_libwrap); $opt_config_options.= " --with-low-memory" if ($opt_with_low_memory); $opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server); @@ -272,7 +281,11 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-libedit"; } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); + $opt_skip_embedded_test= 1 if ($opt_without_embedded); + $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); + $opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv); + $opt_config_options.= " --with-example-storage-engine" if ($opt_with_example); # Only enable InnoDB when requested (required to be able to # build the "Classic" packages that do not include InnoDB) @@ -292,7 +305,7 @@ if ($opt_stage <= 1) } $prefix="/usr/local/mysql"; - check_system("$opt_config_env ./configure --prefix=$prefix --localstatedir=$prefix/data --libexecdir=$prefix/bin --with-comment=\"Official MySQL$opt_version_suffix binary\" --with-extra-charsets=complex --with-server-suffix=\"$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL"); + check_system("$opt_config_env ./configure --prefix=$prefix --localstatedir=$prefix/data --libexecdir=$prefix/bin --with-comment=\"$opt_comment\" --with-extra-charsets=complex --with-server-suffix=\"$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL"); if (-d "$pwd/$host/include-mysql") { safe_system("cp -r $pwd/$host/include-mysql/* $pwd/$host/$ver/include"); @@ -310,6 +323,7 @@ if ($opt_stage <= 2) $command=$make; $command.= " $opt_make_options" if (defined($opt_make_options) && $opt_make_options ne ""); safe_system($command); + print LOG "Do-compile: Build successful\n"; } # @@ -373,10 +387,29 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) { my $flags= ""; $flags.= " --with-ndbcluster" if ($opt_with_cluster); + $flags.= " --force" if (!$opt_one_error); log_timestamp(); + info("Running test suite"); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + + unless ($opt_skip_ps_test) + { + log_timestamp(); + info("Running test suite using prepared statements"); + check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } + + unless ($opt_skip_embedded_test) + { + log_timestamp(); + info("Running embedded server test suite"); + # Embedded server and NDB don't jive + $flags=~ s/ --with-ndbcluster//; + check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } + # 'mysql-test-run' writes its own final message for log evaluation. } # @@ -499,6 +532,10 @@ When running several Do-compile runs in parallel, each build should have its own thread ID, so running the test suites does not cause conflicts with duplicate TCP port numbers. +--comment=<comment> +Replace the default compilation comment that is embedded into +the mysqld binary. + --config-env=<environment for configure> To set up the environment, like 'CC=cc CXX=gcc CXXFLAGS=-O3' @@ -555,7 +592,10 @@ Do not run any tests. Do not run the benchmark test (written in perl) --no-mysqltest -Do not run the the mysql-test-run test (Same as 'make test') +Do not run the mysql-test-run test (Same as 'make test') + +--one-error +Terminate the mysql-test-run test after the first difference (default: use '--force') --no-perl Do not compile or install Perl modules, use the system installed ones @@ -572,6 +612,12 @@ Compile with RAID support --readline Compile against readline library instead of libedit +--skip-embedded-test +Skip running the test suite against the embedded server + +--skip-ps-test +Skip running the additional test run that uses the prepared statement protocol + --stage=[1-6] Start script from some specific point. @@ -601,9 +647,18 @@ If user is empty then no mail is sent. --version-suffix=suffix Set name suffix (e.g. 'com' or '-max') for a distribution +--with archive +Enable the Archive storage engine + --with cluster Compile and test with NDB Cluster enabled +--with-csv +Enable the CSV storage engine + +--with-example +Enable the Example storage engine + --with-debug Build binaries with debug information (implies "--no-strip") @@ -635,16 +690,20 @@ sub abort if ($opt_user) { - $mail_header_file="$opt_tmp/do-command.$$"; - open(TMP,">$mail_header_file"); + # Take the last 40 lines of the build log + open(LOG, "$log") or die $!; + my @log= <LOG>; + close LOG; + splice @log => 0, -40; + my $mail_file="$opt_tmp/do-command.$$"; + open(TMP,">$mail_file") or die $!; print TMP "From: mysqldev\@$full_host_name\n"; print TMP "To: $email\n"; print TMP "Subject: $host($uname): $ver$opt_version_suffix compilation failed\n\n"; + print TMP @log; close TMP; - system("tail -n 40 $log > $log.mail"); - system("cat $mail_header_file $log.mail | $sendmail -t -f $email"); - unlink($mail_header_file); - unlink("$log.mail"); + system("$sendmail -t -f $email < $mail_file"); + unlink($mail_file); } exit 1; } @@ -747,7 +806,7 @@ sub find sub rm_all { my(@rm_files)=@_; - my($dir,$current_dir,@files,@dirs); + my($dir,$current_dir,@files,@dirs,$removed); $current_dir = `pwd`; chomp($current_dir); foreach $dir (@rm_files) @@ -771,7 +830,9 @@ sub rm_all } if ($#files >= 0) { - system("rm -f " . join(" ",@files)) && abort("Can't remove files from $dir"); + $removed= unlink @files; + print "rm_all : removed $removed files in $current_dir/$dir\n" if ($opt_debug); + abort("Can't remove all $#files+1 from $current_dir/$dir, just $removed") if $removed != $#files+1; } foreach $dir (@dirs) { diff --git a/Build-tools/Do-hpux-depot b/Build-tools/Do-hpux-depot new file mode 100755 index 00000000000..f7e8e2c020d --- /dev/null +++ b/Build-tools/Do-hpux-depot @@ -0,0 +1,85 @@ +#!/usr/bin/perl + +# +# By Matt Wagner <matt@mysql.com> 2005 +# +# This script generates HP Depot packages for MySQL Server. +# It basically repackages a binary tarball as a depot. +# +# Usage: ./Do-hpux-depot <untarred-binary-tarball> +# + +$fullname = shift @ARGV; +$fullname or die "No package name was specified"; +-d $fullname or die "That directory is not present!"; + +$fullname =~ s,/+$,,; # Remove ending slash if any + +chomp($pwd= `pwd`); + +%title= ( + "mysql-standard" => "MySQL Community Edition - Standard (GPL)", + "mysql-debug" => "MySQL Community Edition - Debug (GPL)", + "mysql-max" => "MySQL Community Edition - Experimental (GPL)", + "mysql-pro" => "MySQL Pro (Commercial)", + "mysql-classic" => "MySQL Classic (Commercial)", + "mysql-cluster" => "MySQL Cluster (Commercial)", +); + +%architecture= ( + "hpux11.23" => "HP-UX_B.11.23", + "hpux11.11" => "HP-UX_B.11.11", + "hpux11.00" => "HP-UX_B.11.00", +); + +%os_release= ( + "hpux11.23" => "?.11.2?", + "hpux11.11" => "?.11.1?", + "hpux11.00" => "?.11.0?", +); + +%machine_type= ( + "ia64" => "ia64*", + "hppa2.0w" => "9000/*", +); + +$fullname =~ m/^(mysql-\w+)-([\d\.]+)-hp-(hpux11\.\d\d)-(hppa2\.0w|(ia64))-?(64bit)?$/; + +# print "title: $1\n"; +# print "version: $2\n"; +# print "os: $3\n"; +# print "cpu: $4\n"; +# print "64: $6\n"; + +$cpu64= ($6 ne "") ? "_64" : ""; + +open (PSF,">${fullname}.psf") or die "Unable to write PSF file ($!)\n"; + +print PSF <<EOF; +product + tag $1 + vendor_tag "MySQL_AB" + title "$title{$1}" + description "MySQL Database Server and Clients" + revision $2 + + architecture $architecture{$3}$cpu64 + machine_type $machine_type{$4} + os_name HP-UX + os_release $os_release{$3} + directory /usr/local + + fileset + tag all + revision $2 + directory $fullname=/usr/local/$fullname + file_permissions -u 222 -g bin -o bin + file * + end +end +EOF + +close(PSF); + +system("/usr/sbin/swpackage -v -d \"|gzip -c > $fullname.depot.gz\" -x target_type=tape -s ${pwd}/${fullname}.psf"); + diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index b9df444a4ba..9e3fde76f4f 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -31,6 +31,7 @@ $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_skip_dmg= undef; +$opt_skip_prefpane= undef; $opt_skip_si= undef; $opt_suffix= undef; $opt_verbose= undef; @@ -41,6 +42,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", + "skip-prefpane|p", "skip-dmg|skip-disk-image|s", "skip-si|skip-startup-item", "suffix=s", @@ -82,9 +84,10 @@ $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; $BUILDDIR= "$PWD/$HOST"; +$PREFPANE= "$PWD/mysql-administrator/source/mac/PreferencePane/build/MySQL.prefPane"; $SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>; $SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; -$TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; +$TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc*.tar.gz>; $TAR =~ /.*\/$NAME(.*)\.tar\.gz$/; $ARCH= $1; $NAME= $NAME . $ARCH; @@ -219,6 +222,19 @@ unless ($opt_skip_si) &run_command($command, "Error while building package $SI_NAME.pkg!"); } +# +# Include the MySQL Preference Pane +# +unless ($opt_skip_prefpane) +{ + &abort("Could not find PrefPane helper application. Did you compile and install it?") + unless (-f "$PREFPANE/Contents/Resources/mahelper"); + &logger("Including $PREFPANE in $PKGDEST"); + &run_command("mkdir $PKGDEST/MySQL.prefPane", "Could not create $PKGDEST/MySQL.prefPane!"); + &run_command("ditto $PREFPANE $PKGDEST/MySQL.prefPane", "Could not copy $PREFPANE into $PKGDEST!"); + &run_command("chown -R root:wheel $PKGDEST/MySQL.prefPane", "Cannot chown $PKGDEST/MySQL.prefPane!"); +} + if ($opt_skip_dmg) { &logger("SUCCESS: Package $PKGDEST/$NAME.pkg created"); @@ -254,6 +270,7 @@ chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f3 -d" "`) if (!$opt_d &logger("Copying $PKGDEST/$NAME.pkg to Disk image /Volumes/$NAME"); &run_command("ditto $PKGDEST /Volumes/$NAME", "Could not copy $PKGDEST to /Volumes/$NAME!"); &run_command("ditto $SUPFILEDIR/ReadMe.txt /Volumes/$NAME", "Could not copy $SPFILEDIR/ReadMe.txt to /Volumes/$NAME!"); +&run_command("chown root:wheel /Volumes/$NAME/ReadMe.txt", "Could not fix ownerships of /Volumes/$NAME/ReadMe.txt!"); chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f1 -d" "`) if (!$opt_dry_run); &abort("/Volumes/$NAME not attached!") if (!$mountpoint && !$opt_dry_run); &logger("Unmounting $mountpoint"); @@ -302,6 +319,7 @@ Options: if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com +-p, --skip-prefpane Skip including the PreferencePane -s, --skip-disk-image, --skip-dmg Just build the PKGs, don't put it into a disk image afterwards --skip-startup-item, --skip-si Skip the creation of the StartupItem PKG diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm index da06e1f58e4..23602debfb1 100755 --- a/Build-tools/Do-rpm +++ b/Build-tools/Do-rpm @@ -22,7 +22,6 @@ use Getopt::Long; Getopt::Long::Configure ("bundling"); use Sys::Hostname; -$opt_nobuild = undef; $opt_cc= undef; $opt_cflags= undef; $opt_clean= undef; @@ -33,6 +32,9 @@ $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_verbose= undef; +$opt_susebuild= undef; +$opt_susebuildroot= undef; +$opt_suserpms= undef; # Set a dummy version until we know the correct one $VERSION= "x.y.z"; @@ -49,7 +51,9 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", - "nobuild", + "susebuild|s", + "susebuildroot|r=s", + "suserpms=s", "verbose|v", ) || &print_help; @@ -57,6 +61,20 @@ GetOptions( defined($SPECFILE=$ARGV[0]) || print_help("Please provide the spec file name!"); +&print_help("Please define the location of the RPM repository!") if $opt_susebuild && !($opt_suserpms || $ENV{BUILD_RPMS}); + +unless ($opt_susebuildroot) +{ + if ($ENV{BUILD_ROOT}) + { + $opt_susebuildroot= $ENV{BUILD_ROOT}; + } + else + { + $opt_susebuildroot="/var/tmp/build-root"; + } +} + # Include helper functions $PWD= cwd(); $LOGGER= "$PWD/logger.pm"; @@ -72,7 +90,7 @@ else $subject= "RPM build for $SPECFILE failed" if $opt_mail; # Open the spec file and extract the version number -open(SPEC, $SPECFILE) or &abort("Unable to open \"$ARGV[0]\": $!"); +open(SPEC, $SPECFILE) or die "Unable to open \"$ARGV[0]\": $!"; @spec= <SPEC>; close SPEC; @@ -94,7 +112,7 @@ $HOST= hostname(); $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/Do-rpm-$HOST-$MAJOR.$MINOR.log"; -&logger("Using spec file for version: $VERSION"); +&logger("Logging to $LOGFILE"); # # Override predefined Log file name @@ -114,103 +132,149 @@ if (defined $opt_log) } } -# -# Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs -# -if (-x "/usr/bin/rpmbuild") +&logger("Using spec file for version: $VERSION"); + +if ($opt_susebuild) { - $RPM= "/usr/bin/rpmbuild"; - $RMSOURCE= "--rmsource --rmspec"; + &susebuild; } else -{ - $RPM= "/bin/rpm"; - $RMSOURCE= "--rmspec"; +{ + &rpmbuild; } -if ($RPM) -{ - &logger("Found rpm binary: $RPM"); -} -else +&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run); +exit 0; + +# +# Build using SUSE's "build" script +# +sub susebuild { - &abort("Unable to find RPM binary!"); + $BUILD= "/usr/bin/build"; + ( -x $BUILD) ? &logger("$BUILD found, proceeding.") : &abort("$BUILD could not be found!"); + $command= "sudo $BUILD --clean"; + $command.= " --root=$opt_susebuildroot"; + $command.= " --rpms=$opt_suserpms" if $opt_suserpms; + $command.= " $SPECFILE"; + &logger("Building RPMs using SUSE build."); + &run_command($command, "Error while running the SUSE RPM build!"); + + # + # Move the resulting RPMs into the pwd - we can use broad globs here + # as the build root has been cleaned up before so there should not be + # any residuals from previous build runs + # + $command= "cp"; + $command.= " -v " if ($opt_verbose); + $command.= " $opt_susebuildroot/usr/src/packages/SRPMS/MySQL*.src.rpm $PWD"; + &logger("Copying source RPM to current dir."); + &run_command($command, "Error moving source RPM!"); + + $command= "cp"; + $command.= " -v " if ($opt_verbose); + $command.= " $opt_susebuildroot/usr/src/packages/RPMS/*/MySQL*.rpm $PWD"; + &logger("Copying binary RPMs to current dir."); + &run_command($command, "Error moving binary RPMs!"); } # -# determine some RPM settings for this host +# Build using "plain" RPM # -chomp($RPMARCH= `$RPM --eval "%{_arch}" 2> /dev/null`); -chomp($RPMDIR= `$RPM --eval "%{_rpmdir}" 2> /dev/null`); -chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`); -chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`); -chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); - -$SOURCEFILE= glob "mysql*-$VERSION.tar.gz"; +sub rpmbuild +{ -unless($opt_nobuild) { + # + # Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs + # + if (-x "/usr/bin/rpmbuild") + { + $RPM= "/usr/bin/rpmbuild"; + $RMSOURCE= "--rmsource --rmspec"; + } + else + { + $RPM= "/bin/rpm"; + $RMSOURCE= "--rmspec"; + } - &logger("Starting RPM build of MySQL-$VERSION on $HOST"); + if ($RPM) + { + &logger("Found rpm binary: $RPM"); + } + else + { + &abort("Unable to find RPM binary!"); + } - foreach $file ($SOURCEFILE, $SPECFILE) - { - &abort("Unable to find $file!") unless (-f "$file"); - } + # + # determine some RPM settings for this host + # + chomp($RPMARCH= `$RPM --eval "%{_arch}" 2> /dev/null`); + chomp($RPMDIR= `$RPM --eval "%{_rpmdir}" 2> /dev/null`); + chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`); + chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`); + chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); -# -# Install source and spec file -# - &logger("Copying SOURCE and SPEC file to build directories."); - unless ($opt_dry_run) - { - copy($SOURCEFILE, $SOURCEDIR) - or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); - copy($SPECFILE, $SPECDIR) - or &abort("Unable to copy $SPECFILE to $SPECDIR!"); - } + $SOURCEFILE= glob "mysql*-$VERSION.tar.gz"; -# -# Set environment variables - these are being used in the -# official MySQL RPM spec file -# - &logger("Setting special build environment variables") - if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx); - $ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc); - $ENV{MYSQL_BUILD_CFLAGS}=$opt_cflags if ($opt_cflags); - $ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags); - $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx); + &logger("Starting RPM build of MySQL-$VERSION on $HOST"); -# -# Build the RPMs -# - $command= "$RPM"; - $command.= " -v" if ($opt_verbose); - $command.= " -ba"; - $command.= " --clean $RMSOURCE" if $opt_clean; - $command.= " $SPECDIR/"; - $command.= basename($SPECFILE); - &logger("Building RPM."); - &run_command($command, "Error while building the RPMs!"); -} + foreach $file ($SOURCEFILE, $SPECFILE) + { + &abort("Unable to find $file!") unless (-f "$file"); + } -# -# Move the resulting RPMs into the pwd -# -$command= "mv"; -$command.= " -v " if ($opt_verbose); -$command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD"; -&logger("Moving source RPM to current dir."); -&run_command($command, "Error moving source RPM!"); - -$command= "mv"; -$command.= " -v " if ($opt_verbose); -# $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; -$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD"; -&logger("Moving binary RPMs to current dir."); -&run_command($command, "Error moving binary RPMs!"); + # + # Install source and spec file + # + &logger("Copying SOURCE and SPEC file to build directories."); + unless ($opt_dry_run) + { + copy($SOURCEFILE, $SOURCEDIR) + or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); + copy($SPECFILE, $SPECDIR) + or &abort("Unable to copy $SPECFILE to $SPECDIR!"); + } -&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run); -exit 0; + # + # Set environment variables - these are being used in the + # official MySQL RPM spec file + # + &logger("Setting special build environment variables") + if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx); + $ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc); + $ENV{MYSQL_BUILD_CFLAGS}=$opt_cflags if ($opt_cflags); + $ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags); + $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx); + + # + # Build the RPMs + # + $command= "$RPM"; + $command.= " -v" if ($opt_verbose); + $command.= " -ba"; + $command.= " --clean $RMSOURCE" if $opt_clean; + $command.= " $SPECDIR/"; + $command.= basename($SPECFILE); + &logger("Building RPM."); + &run_command($command, "Error while building the RPMs!"); + + # + # Move the resulting RPMs into the pwd + # + $command= "mv"; + $command.= " -v " if ($opt_verbose); + $command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD"; + &logger("Moving source RPM to current dir."); + &run_command($command, "Error moving source RPM!"); + + $command= "mv"; + $command.= " -v " if ($opt_verbose); + $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD"; + &logger("Moving binary RPMs to current dir."); + &run_command($command, "Error moving binary RPMs!"); +} sub print_help { @@ -218,7 +282,7 @@ sub print_help if ($message ne "") { print "\n"; - print "ERROR: $message\n\n}"; + print "ERROR: $message\n\n"; } print <<EOF; @@ -241,12 +305,22 @@ Options: -t, --dry-run Dry run without executing -h, --help Print this help -l, --log[=<filename>] Write a log file [to <filename>] - (default is "$LOGFILE") -m, --mail=<address> Mail a failure report to the given address (and include a log file snippet, if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com +-s, --susebuild Use the SUSE "build" script instead of RPM + directly (requires sudo privileges to run the + /usr/bin/build command) +-r, --susebuildroot=<root> Use <root> as the build root directory for the + SUSE "build" (default is /var/tmp/build-root + or defined by the BUILD_ROOT environment + variable) +--suserpms=<path> Path to the SUSE RPM repository to build up + the build root (mandatory option when using + --susebuild and the BUILD_RPMS environment + variable is not set.) -v, --verbose Verbose execution Example: diff --git a/Build-tools/Do-solaris-pkg b/Build-tools/Do-solaris-pkg new file mode 100644 index 00000000000..685a1f0923b --- /dev/null +++ b/Build-tools/Do-solaris-pkg @@ -0,0 +1,183 @@ +#!/usr/bin/perl +# +# Script to create Solaris packages +# +$INTERACTIVE= 0; +chomp ($hostname= `hostname`); +$find = "/usr/bin/find"; +$pkgproto = "/usr/bin/pkgproto"; +$pkgmk = "/usr/bin/pkgmk -o"; +$pkgtrans = "/usr/bin/pkgtrans"; +$temp = "/tmp/prototype$$"; +$prototype = "prototype"; +$pkginfo = "pkginfo"; +($gid ,$pkg ,$uid ,$userInfo ,$email ,$quota ,$group ,$passwd +,$category ,$userHome ,$vendor ,$loginShell ,$pstamp ,$basedir)=(); + +$fullname = shift @ARGV; +$fullname or die "No package name was specified"; +-d $fullname or die "That directory is not present!"; + +$fullname =~ s,/+$,,; # Remove ending slash if any + +$pkgdir= `cd ../$hostname; pwd`; +$pwd = `pwd`; +if ($pwd =~ '\/usr\/local') { + $pwd = $`; +} +die "Wrong location, please cd to <PKGBASE>/usr/local/ and run again.\n" + if ($pwd eq ""); + +system ("$find . -print | $pkgproto > $temp"); +open (PREPROTO,"<$temp") or die "Unable to read prototype information ($!)\n"; +open (PROTO,">$prototype") or die "Unable to write file prototype ($!)\n"; +print PROTO "i pkginfo=./$pkginfo\n"; +while (<PREPROTO>) { + # Read the prototype information from /tmp/prototype$$ + chomp; + $thisline = $_; + if ($thisline =~ " prototype " + or $thisline =~ " pkginfo ") { + # We don't need that line + } elsif ($thisline =~ "^[fd] ") { + # Change the ownership for files and directories + ($dir, $none, $file, $mode, $user, $group) = split / /,$thisline; + print PROTO "$dir $none $file $mode bin bin\n"; + } else { + # Symlinks and other stuff should be printed as well ofcourse + print PROTO "$thisline\n"; + } +} +close PROTO; +close PREPROTO; + +# Clean up +unlink $temp or warn "Unable to remove tempfile ($!)\n"; + +# Now we can start building the package +# +# First get some info + +$fullname =~ /^((mysql)-.+)-([\d\.]+)-.+$/ + or die "This name is not what I expected - \"$fullname\""; + +$default{"name"}= $2; +$default{"version"}= $3; +$default{"pkg"}= $1; +$default{"arch"} = `uname -m`; +chomp $default{"arch"}; +$default{"category"}= "application"; +$default{"vendor"}= "MySQL AB"; +$default{"email"}= "build\@mysql.com"; +$default{"pstamp"}= "MySQL AB Build Engineers"; +$os = `uname -r`; +$os =~ '\.'; +$os = "sol$'"; +chomp $os; +$default{"basedir"}= "/usr/local"; +$default{"packagename"}= "${fullname}.pkg"; + +# Check for correctness of guessed values by userinput + +%questions = ( + pkg => "Please give the name for this package", + name => "Now enter the real name for this package", + arch => "What architecture did you build the package on?", + version => "Enter the version number of the package", + category => "What category does this package belong to?", + vendor => "Who is the vendor of this package?", + email => "Enter the email adress for contact", + pstamp => "Enter your own name", + basedir => "What is the basedir this package will install into?", + packagename => "How should I call the packagefile?", +); + +@vars = qw(pkg name arch version category vendor email pstamp basedir + packagename); +foreach $varname (@vars) { + getvar_noq($varname); +} + +if ($INTERACTIVE) { + while (!&chkvar()) { + print "\n"; + foreach $varname (@vars) { + getvar($varname); + } + @vars = qw(pkg name arch version category vendor email pstamp basedir + packagename); + } +} +$classes = "none"; + +# Create the pkginfo file + +print "\nNow creating $pkginfo file\n"; +open (PKGINFO,">$pkginfo") || die "Unable to open $pkginfo for writing ($!)\n"; +print PKGINFO "PKG=\"$pkg\"\n"; +print PKGINFO "NAME=\"$name\"\n"; +print PKGINFO "ARCH=\"$arch\"\n"; +print PKGINFO "VERSION=\"$version\"\n"; +print PKGINFO "CATEGORY=\"$category\"\n"; +print PKGINFO "VENDOR=\"$vendor\"\n"; +print PKGINFO "EMAIL=\"$email\"\n"; +print PKGINFO "PSTAMP=\"$pstamp\"\n"; +print PKGINFO "BASEDIR=\"$basedir\"\n"; +print PKGINFO "CLASSES=\"$classes\"\n"; +close PKGINFO; +print "Done.\n"; + +# Build and zip the package + +print "Building package\n"; +system ("$pkgmk -r `pwd`"); +system ("(cd /var/spool/pkg; $pkgtrans -s -o `pwd` /tmp/$packagename $pkg)"); +system ("gzip /tmp/$packagename"); + +# Clean-up the spool area +system ("(cd /var/spool/pkg; rm -rf $pkg)"); +# Clean-up the ~/packaging/ area +system ("(rm -rf mysql*)"); +unlink $pkginfo; +unlink $prototype; +system ("mv /tmp/${packagename}.gz $pkgdir"); +print "Done. (~/$hostname/$packagename.gz)\n"; +# The subroutines +sub chkvar { + print "\n"; + + print "PKG=$pkg\n"; + print "NAME=$name\n"; + print "ARCH=$arch\n"; + print "VERSION=$version\n"; + print "CATEGORY=$category\n"; + print "VENDOR=$vendor\n"; + print "EMAIL=$email\n"; + print "PSTAMP=$pstamp\n"; + print "BASEDIR=$basedir\n"; + print "PACKAGENAME=$packagename\n"; + + + print "\nIs this information correct? [Y/n]: "; + my $answer= <STDIN>; + chomp $answer; + $answer= 'Y' if ($answer eq ""); + $answer= uc $answer; + my $res= ($answer eq 'Y')? 1 : 0; + return($res); +} + +sub getvar_noq { + my $questionname = "@_"; + $$questionname = $default{$questionname}; +} + +sub getvar { + my $questionname = "@_"; + my $ucquestionname= uc $questionname; + print "$ucquestionname: $questions{$questionname} [$default{\"$questionname\"}]: "; + my $answer = <STDIN>; + chomp $answer; + $$questionname = $answer; + $$questionname = $default{$questionname} if ($$questionname eq ""); +} diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index 2ea2e8ef441..972d5483d54 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -109,6 +109,12 @@ sub add_copyright $line_copyright= "! "; $end_copyright= ""; } + elsif ($ARGV =~ /\.sql$/) + { + $start_copyright="-- "; + $line_copyright= "-- "; + $end_copyright= ""; + } elsif ($ARGV =~ /\.asm$/) { $start_copyright="; "; diff --git a/Docs/Images/Makefile.am b/Docs/Images/Makefile.am new file mode 100644 index 00000000000..b57d701d8a0 --- /dev/null +++ b/Docs/Images/Makefile.am @@ -0,0 +1,35 @@ +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + +## Process this file with automake to create Makefile.in + +# This is a dummy file to satisfy the hierarchy of Makefiles. +# When a release is built, the true Makefile will be copied +# together with the "real" files in this directory. + +EXTRA_DIST = + +# Nothing to create in this dummy directory. +all: + : + +# Nothing to cleanup in this dummy directory. +clean: + : + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/Docs/Makefile.am b/Docs/Makefile.am index 034cec3b133..681046543bd 100644 --- a/Docs/Makefile.am +++ b/Docs/Makefile.am @@ -9,7 +9,7 @@ # If you know how to fix any of this more elegantly please mail # docs@mysql.com -TEXI2HTML_FLAGS = -iso -number +TEXI2HTML_FLAGS = -iso -number -acc DVIPS = dvips MAKEINFO = @MAKEINFO@ TEXINFO_TEX = Support/texinfo.tex @@ -24,6 +24,8 @@ BUILT_SOURCES = $(targets) manual_toc.html include.texi EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt \ INSTALL-BINARY reservedwords.texi internals.texi +SUBDIRS = Images + all: $(targets) txt_files txt_files: ../INSTALL-SOURCE ../COPYING ../INSTALL-WIN-SOURCE ../EXCEPTIONS-CLIENT \ diff --git a/Docs/Support/texi2html b/Docs/Support/texi2html index 8067d8f72ce..f13c006c7dc 100755 --- a/Docs/Support/texi2html +++ b/Docs/Support/texi2html @@ -1,4 +1,4 @@ -#!PATH_TO_PERL -*- perl -*- +#!/usr/bin/perl # Add path to perl on the previous line and make this executable # if you want to use this as a normal script. 'di '; @@ -12,7 +12,7 @@ #-############################################################################## # @(#)texi2html 1.52 971230 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch -# Enhanced by David Axmark, david@detron.se +# Enhanced by David Axmark # The man page for this program is included at the end of this file and can be # viewed using the command 'nroff -man texi2html'. @@ -40,8 +40,7 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names $XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE) $ERROR = "***"; # prefix for errors and warnings -$THISPROG = "texi2html 1.52 (hacked by david\@detron.se)"; # program name and version -$HOMEPAGE = "http://www.mathematik.uni-kl.de/~obachman/Texi2html/"; # program home page +$THISPROG = "texi2html 1.52 (with additions by MySQL AB)"; # program name and version $TODAY = &pretty_date; # like "20 September 1993" $SPLITTAG = "<!-- SPLIT HERE -->\n"; # tag to know where to split $PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections @@ -114,10 +113,12 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E # %accent_map = ( '"', 'uml', + '\'', 'acute', + ',{', 'cedil', '~', 'tilde', '^', 'circ', '`', 'grave', - '\'', 'acute', + 'ringaccent{', 'ring', ); # @@ -125,7 +126,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E # %simple_map = ( # cf. makeinfo.c - "*", "<BR>", # HTML+ + "*", "<br />", # HTML+ " ", " ", "\n", "\n", "|", "", @@ -134,6 +135,8 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E "!", "!", "?", "?", ".", ".", + # @- means "allow word break", not — + "-", "", ); # @@ -141,9 +144,10 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E # %things_map = ( 'TeX', 'TeX', - 'br', '<P>', # paragraph break + 'br', '<p>', # paragraph break 'bullet', '*', 'copyright', '(C)', + 'registeredsymbol', '(R)', 'dots', '...', 'equiv', '==', 'error', 'error-->', @@ -161,27 +165,28 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E %style_map = ( 'asis', '', 'b', 'B', - 'cite', 'CITE', - 'code', 'CODE', + 'cite', 'cite', + 'code', 'code', + 'command', 'code', 'ctrl', '&do_ctrl', # special case - 'dfn', 'STRONG', # DFN tag is illegal in the standard + 'dfn', 'strong', # DFN tag is illegal in the standard 'dmn', '', # useless 'email', '&fix_email', # special - 'emph', 'EM', - 'file', '"TT', # will put quotes, cf. &apply_style - 'i', 'I', - 'kbd', 'KBD', - 'key', 'KBD', + 'emph', 'em', + 'file', '"tt', # will put quotes, cf. &apply_style + 'i', 'i', + 'kbd', 'kbd', + 'key', 'kbd', 'r', '', # unsupported - 'samp', '"SAMP', # will put quotes, cf. &apply_style + 'samp', '"samp', # will put quotes, cf. &apply_style 'sc', '&do_sc', # special case - 'strong', 'STRONG', - 't', 'TT', + 'strong', 'strong', + 't', 'tt', 'titlefont', '', # useless 'image', '&fix_image', # Image 'url', '&fix_url', # URL 'uref', '&fix_uref', # URL Reference - 'var', 'VAR', + 'var', 'var', 'w', '', # unsupported ); @@ -317,6 +322,7 @@ $usage = <<EOT; This is $THISPROG To convert a Texinfo file to HMTL: $0 [options] file where options can be: +-acc : convert @"-like accents to &entities; -expandinfo : use \@ifinfo sections, not \@iftex -glossary : handle a glossary -invisible name: use 'name' as an invisible anchor @@ -445,11 +451,15 @@ $html_num = 0; if ($use_iso) { $things_map{'bullet'} = "•"; $things_map{'copyright'} = "©"; + $things_map{'registeredsymbol'} = "®"; $things_map{'dots'} = "…"; $things_map{'equiv'} = "≡"; $things_map{'expansion'} = "→"; $things_map{'point'} = "∗"; $things_map{'result'} = "⇒"; + $things_map{'ss'} = "ß"; + $things_map{'o'} = "ø"; + $things_map{'O'} = "Ø"; } # @@ -505,23 +515,27 @@ $html_element = ''; # current HTML element # watch out for regexps, / and escaped characters! $subst_code = ''; foreach (keys(%simple_map)) { - ($re = $_) =~ s/(\W)/\\$1/g; # protect regexp chars - $subst_code .= "s/\\\@$re/$simple_map{$_}/g;\n"; + $re = quotemeta $_; # protect regexp chars + $sub = quotemeta $simple_map{$_}; + $subst_code .= "s/\\\@$re/$sub/g;\n"; } foreach (keys(%things_map)) { - $subst_code .= "s/\\\@$_\\{\\}/$things_map{$_}/g;\n"; + $re = quotemeta $_; # protect regexp chars + $sub = quotemeta $things_map{$_}; + $subst_code .= "s/\\\@$re\\{\\}/$sub/g;\n"; } if ($use_acc) { # accentuated characters foreach (keys(%accent_map)) { + my $brace = /{$/ ? '}' : ''; if ($_ eq "`") { $subst_code .= "s/$;3"; } elsif ($_ eq "'") { $subst_code .= "s/$;4"; } else { - $subst_code .= "s/\\\@\\$_"; + $subst_code .= "s/\\\@\\Q$_\\E"; } - $subst_code .= "([aeiou])/&\${1}$accent_map{$_};/gi;\n"; + $subst_code .= "(\\w)$brace/&\${1}$accent_map{$_};/gi;\n"; } } eval("sub simple_substitutions { $subst_code }"); @@ -703,7 +717,7 @@ READ_LINE: while ($_ = &next_line) s/{[^{}]+}//g); print "# Multitable with $multitable_cols columns\n" if $debug and $DEBUG_USER; - push(@lines, &debug("<TABLE BORDER WIDTH=\"100%\">\n", __LINE__)); + push(@lines, &debug("<TABLE BORDER>\n", __LINE__)); } else { warn "$ERROR Bad table line: $_"; } @@ -873,7 +887,7 @@ READ_LINE: while ($_ = &next_line) &simple_substitutions; s/\@value{($VARRE)}/$value{$1}/eg; s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4 - s|\s+\@tab\s*| </TD><TD> |g if ($in_multitable); + s/(^|\s+)\@tab\s*/ <\/TD><TD> /g if ($in_multitable); # # analyze the tag again @@ -885,7 +899,7 @@ READ_LINE: while ($_ = &next_line) $name =~ s/\s+$//; $level = $sec2level{$tag}; $name = &update_sec_num($tag, $level) . " $name" - if $number_sections && $tag !~ /^unnumbered/; + if $number_sections && $tag !~ /^unnumbered/ && $tag ne 'subsubheading'; if ($tag =~ /heading$/) { push(@lines, &html_debug("\n", __LINE__)); if ($html_element ne 'body') { @@ -1079,7 +1093,7 @@ EOC push(@lines, &debug("</TD></TR>\n", __LINE__)) unless $html_element eq 'TABLE'; &html_pop_if('TR'); - $what =~ s|\s+\@tab\s*| </TD><TD> |g; + $what =~ s/(^|\s+)\@tab\s*/ <\/TD><TD> /g; push(@lines, &debug("<TR><TD>$what\n", __LINE__)); &html_push('TR'); if ($deferred_ref) @@ -1463,11 +1477,7 @@ print "# end of pass 4\n" if $verbose; # # #---############################################################################ -$header = <<EOT; -<!-- This HTML file has been created by $THISPROG - from $docu on $TODAY --> -EOT - + $header = ''; $full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document"; $title = $value{'_settitle'} || $full_title; $_ = &substitute_style($full_title); @@ -1815,8 +1825,10 @@ sub fix_image die "error in image: '$text'" unless defined($1); $arg1 = $1; $arg1 =~ s/@@/@/g; - $ext = "jpg" if -f "$arg1.jpg"; - $ext = "gif" if -f "$arg1.gif"; + foreach (@include_dirs) { + $ext = "jpg" if -f "$_/$arg1.jpg"; + $ext = "gif" if -f "$_/$arg1.gif"; + } if (defined($ext)) { "<IMG SRC=\"$arg1.$ext\">"; @@ -2010,7 +2022,7 @@ sub print_toplevel_header { local($_); - &print_header; # pass given arg... + &print_header unless $opt_empty_headers; # pass given arg... print FILE $full_title; if ($value{'_subtitle'}) { $value{'_subtitle'} =~ s/\n+$//; @@ -2042,13 +2054,7 @@ EOT sub print_toplevel_footer { - &print_ruler; - print FILE <<EOT; -This document was generated on $TODAY using the -<A HREF=\"$HOMEPAGE\">texi2html</A> -translator version 1.52 (extended by davida\@detron.se).</P> -EOT - &print_footer; + &print_footer unless $opt_empty_headers; } sub protect_texi @@ -2065,8 +2071,10 @@ sub protect_html { local($what) = @_; # protect & < > - # Avoid loop in & replacement. This instead bugs out for &# in text.. - $what =~ s/\&([^#]|$)/\&\#38;$1/g; + # hack for the two entity-like variable reference in existing examples + $what =~ s/\&(length|ts);/\&\#38;$1;/g; + # this leaves alone entities, but encodes standalone ampersands + $what =~ s/\&(?!([a-z0-9]+|#\d+);)/\&\#38;/ig; $what =~ s/\</\&\#60;/g; $what =~ s/\>/\&\#62;/g; # but recognize some HTML things diff --git a/Makefile.am b/Makefile.am index 0dbb5032e15..93f34986a1b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,15 +22,15 @@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT SUBDIRS = . include @docs_dirs@ @zlib_dir@ \ @readline_topdir@ sql-common \ - @thread_dirs@ pstack @sql_client_dirs@ \ - @sql_server_dirs@ scripts man tests \ + @thread_dirs@ pstack \ + @sql_union_dirs@ scripts man tests \ netware @libmysqld_dirs@ \ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ DIST_SUBDIRS = . include @docs_dirs@ zlib \ @readline_topdir@ sql-common \ - @thread_dirs@ pstack @sql_client_dirs@ \ - @sql_server_dirs@ scripts @man_dirs@ tests SSL\ + @thread_dirs@ pstack \ + @sql_union_dirs@ scripts @man_dirs@ tests SSL\ BUILD netware os2 @libmysqld_dirs@ \ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ @@ -100,5 +100,4 @@ tags: # Test installation test: - cd mysql-test ; ./mysql-test-run - + cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp index a7e4404e253..7a0b3bec1a7 100644 --- a/VC++Files/client/mysqladmin.dsp +++ b/VC++Files/client/mysqladmin.dsp @@ -115,7 +115,7 @@ LINK32=xilink6.exe # Name "mysqladmin - Win32 classic" # Begin Source File -SOURCE=.\mysqladmin.c +SOURCE=.\mysqladmin.cpp # End Source File # End Target # End Project diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index a1ebdfe11a6..3c955639596 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -51,8 +51,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 Debug" @@ -76,8 +76,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 classic" @@ -103,8 +103,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe -# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp new file mode 100644 index 00000000000..d04dc5bfce8 --- /dev/null +++ b/VC++Files/client/mysqltest.dsp @@ -0,0 +1,125 @@ +# Microsoft Developer Studio Project File - Name="mysqltest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=mysqltest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mysqltest.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mysqltest.mak" CFG="mysqltest - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mysqltest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqltest - Win32 classic" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqltest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "mysqltest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\debug"
+# PROP BASE Intermediate_Dir ".\debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\debug"
+# PROP Intermediate_Dir ".\debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
+# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
+# ADD BASE RSC /l 1033 /d "_DEBUG"
+# ADD RSC /l 1033 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +
+!ELSEIF "$(CFG)" == "mysqltest - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\classic"
+# PROP BASE Intermediate_Dir ".\classic"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\classic"
+# PROP Intermediate_Dir ".\classic"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
+# ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
+# ADD BASE RSC /l 1033 /d "NDEBUG"
+# ADD RSC /l 1033 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +
+!ELSEIF "$(CFG)" == "mysqltest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\release"
+# PROP BASE Intermediate_Dir ".\release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\release"
+# PROP Intermediate_Dir ".\release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32
+# ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32
+# ADD BASE RSC /l 1033 /d "NDEBUG"
+# ADD RSC /l 1033 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +
+!ENDIF
+
+# Begin Target
+
+# Name "mysqltest - Win32 Debug"
+# Name "mysqltest - Win32 classic"
+# Name "mysqltest - Win32 Release"
+# Begin Source File
+
+SOURCE=..\libmysql\manager.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mysqltest.c
+# End Source File
+# End Target
+# End Project
+
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 820ca30509c..8205461c26f 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -73,7 +73,7 @@ LINK32=xilink6.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "SAFEMALLOC" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # SUBTRACT CPP /X /Fr # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp new file mode 100644 index 00000000000..61392b00b94 --- /dev/null +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -0,0 +1,106 @@ +# Microsoft Developer Studio Project File - Name="mysql_test_run_new" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103 +
+CFG=mysql_test_run_new - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mysql_test_run_new.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mysql_test_run_new.mak" CFG="mysql_test_run_new - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "mysql_test_run_new - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\Debug" +# PROP BASE Intermediate_Dir ".\Debug" +# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\Debug" +# PROP Intermediate_Dir ".\Debug" +# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32 +# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32 +# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console +
+!ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\Release" +# PROP BASE Intermediate_Dir ".\Release" +# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\Release" +# PROP Intermediate_Dir ".\Release" +# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32 +# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32 +# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console +
+!ENDIF
+
+# Begin Target
+
+# Name "mysql_test_run_new - Win32 Debug"
+# Name "mysql_test_run_new - Win32 Release"
+# Begin Source File
+
+SOURCE=.\my_create_tables.c +# End Source File
+# Begin Source File
+
+SOURCE=.\my_manage.c +# End Source File
+# Begin Source File
+
+SOURCE=.\my_manage.h +# End Source File
+# Begin Source File
+
+SOURCE=.\mysql_test_run_new.c +# End Source File
+# End Target
+# End Project
+
diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 61a466174b6..d36cbc7a031 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -816,6 +816,61 @@ Package=<4> ############################################################################### +Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4>
+
+Package=<5>
+{{{ +
}}} +
+
+Package=<4>
+{{{
Begin Project Dependency + Project_Dep_Name libmysql + End Project Dependency + Begin Project Dependency + Project_Dep_Name mysys + End Project Dependency + Begin Project Dependency + Project_Dep_Name regex + End Project Dependency +}}} + +###############################################################################
+
+Project: "mysql_client_test"=.\tests\mysql_client_test.dsp - Package Owner=<4> +
+
Package=<5>
+{{{
+
}}} +
+
Package=<4> +
{{{ +
}}} + +
############################################################################### + +
+Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
Begin Project Dependency + Project_Dep_Name mysqltest + End Project Dependency + Begin Project Dependency + Project_Dep_Name mysqladmin + End Project Dependency + Begin Project Dependency + Project_Dep_Name mysql_client_test + End Project Dependency +}}} + + +############################################################################### + Global: Package=<5> diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 31c52009d9f..3508e6b31d0 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -58,7 +58,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld.exe" # SUBTRACT LINK32 /debug !ELSEIF "$(CFG)" == "mysqld - Win32 Debug" @@ -84,7 +84,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "mysqld - Win32 nt" @@ -924,76 +924,139 @@ SOURCE=.\message.mc !IF "$(CFG)" == "mysqld - Win32 Release" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 Debug" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 nt" -# Begin Custom Build - Compiling messages -InputDir=. +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ELSEIF "$(CFG)" == "mysqld - Win32 Max nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 Max" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 classic" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 pro" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ENDIF # End Source File diff --git a/VC++Files/tests/mysql_client_test.dsp b/VC++Files/tests/mysql_client_test.dsp new file mode 100644 index 00000000000..3d1e6728181 --- /dev/null +++ b/VC++Files/tests/mysql_client_test.dsp @@ -0,0 +1,94 @@ +# Microsoft Developer Studio Project File - Name="mysql_client_test" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=mysql_client_test - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mysql_client_test.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mysql_client_test.mak" CFG="mysql_client_test - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mysql_client_test - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysql_client_test - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "mysql_client_test - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\Debug"
+# PROP BASE Intermediate_Dir ".\Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\Debug"
+# PROP Intermediate_Dir ".\Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
+# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
+# ADD BASE MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32
+# ADD MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32
+# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
+
+!ELSEIF "$(CFG)" == "mysql_client_test - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\Release"
+# PROP BASE Intermediate_Dir ".\Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\Release"
+# PROP Intermediate_Dir ".\Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD BASE MTL /nologo /tlb".\Release\mysql_client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Release\mysql_client_test.tlb" /win32 +# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console +
+!ENDIF
+
+# Begin Target
+
+# Name "mysql_client_test - Win32 Debug"
+# Name "mysql_client_test - Win32 Release"
+# Begin Source File
+
+SOURCE=tests\mysql_client_test.c
+# End Source File
+# End Target
+# End Project
+
diff --git a/acinclude.m4 b/acinclude.m4 index 7f25b447f10..5ddd8952c42 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -194,6 +194,8 @@ dnl Define zlib paths to point at bundled zlib AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [ ZLIB_INCLUDES="-I\$(top_srcdir)/zlib" ZLIB_LIBS="\$(top_builddir)/zlib/libz.la" +dnl Omit -L$pkglibdir as it's always in the list of mysql_config deps. +ZLIB_DEPS="-lz" zlib_dir="zlib" AC_SUBST([zlib_dir]) mysql_cv_compress="yes" @@ -208,7 +210,7 @@ INCLUDES="$INCLUDES $ZLIB_INCLUDES" LIBS="$LIBS $ZLIB_LIBS" AC_CACHE_VAL([mysql_cv_compress], [AC_TRY_LINK([#include <zlib.h>], - [int link_test() { return compress(0, (unsigned long*) 0, "", 0); }], + [return compress(0, (unsigned long*) 0, "", 0);], [mysql_cv_compress="yes" AC_MSG_RESULT([ok])], [mysql_cv_compress="no"]) @@ -235,8 +237,13 @@ dnl $prefix/lib. If zlib headers or binaries weren't found at $prefix, the dnl macro bails out with error. dnl dnl If the library was found, this function #defines HAVE_COMPRESS -dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include) and -dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz). +dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include), +dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz) and ZLIB_DEPS which is +dnl used in mysql_config and is always the same as ZLIB_LIBS except to +dnl when we use the bundled zlib. In the latter case ZLIB_LIBS points to the +dnl build dir ($top_builddir/zlib), while mysql_config must point to the +dnl installation dir ($pkglibdir), so ZLIB_DEPS is set to point to +dnl $pkglibdir. AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [ AC_MSG_CHECKING([for zlib compression library]) @@ -285,7 +292,11 @@ case $SYSTEM_TYPE in ;; esac if test "$mysql_cv_compress" = "yes"; then + if test "x$ZLIB_DEPS" = "x"; then + ZLIB_DEPS="$ZLIB_LIBS" + fi AC_SUBST([ZLIB_LIBS]) + AC_SUBST([ZLIB_DEPS]) AC_SUBST([ZLIB_INCLUDES]) AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support]) fi @@ -1039,7 +1050,6 @@ AC_MSG_CHECKING(for OpenSSL) echo "You can't use the --all-static link option when using openssl." exit 1 fi - NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs" else AC_MSG_RESULT(no) if test ! -z "$openssl_includes" @@ -1599,11 +1609,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac - AC_ARG_WITH([ndb-shm], - [ - --with-ndb-shm Include the NDB Cluster shared memory transporter], - [ndb_shm="$withval"], - [ndb_shm=no]) AC_ARG_WITH([ndb-test], [ --with-ndb-test Include the NDB Cluster ndbapi test programs], @@ -1614,28 +1619,30 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation], [ndb_docs="$withval"], [ndb_docs=no]) + AC_ARG_WITH([ndb-port], + [ + --with-ndb-port Port for NDB Cluster management server], + [ndb_port="$withval"], + [ndb_port="default"]) AC_ARG_WITH([ndb-port-base], [ - --with-ndb-port-base Base port for NDB Cluster], + --with-ndb-port-base Base port for NDB Cluster transporters], [ndb_port_base="$withval"], [ndb_port_base="default"]) - + AC_ARG_WITH([ndb-debug], + [ + --without-ndb-debug Disable special ndb debug features], + [ndb_debug="$withval"], + [ndb_debug="default"]) + AC_ARG_WITH([ndb-ccflags], + [ + --with-ndb-ccflags Extra CC options for ndb compile], + [ndb_cxxflags_fix="$ndb_cxxflags_fix $withval"], + [ndb_cxxflags_fix=$ndb_cxxflags_fix]) + AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) - have_ndb_shm=no - case "$ndb_shm" in - yes ) - AC_MSG_RESULT([-- including shared memory transporter]) - AC_DEFINE([NDB_SHM_TRANSPORTER], [1], - [Including Ndb Cluster DB shared memory transporter]) - have_ndb_shm="yes" - ;; - * ) - AC_MSG_RESULT([-- not including shared memory transporter]) - ;; - esac - have_ndb_test=no case "$ndb_test" in yes ) @@ -1658,6 +1665,24 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac + case "$ndb_debug" in + yes ) + AC_MSG_RESULT([-- including ndb extra debug options]) + have_ndb_debug="yes" + ;; + full ) + AC_MSG_RESULT([-- including ndb extra extra debug options]) + have_ndb_debug="full" + ;; + no ) + AC_MSG_RESULT([-- not including ndb extra debug options]) + have_ndb_debug="no" + ;; + * ) + have_ndb_debug="default" + ;; + esac + AC_MSG_RESULT([done.]) ]) @@ -1673,6 +1698,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ have_ndbcluster=no ndbcluster_includes= ndbcluster_libs= + ndb_mgmclient_libs= case "$ndbcluster" in yes ) AC_MSG_RESULT([Using NDB Cluster]) @@ -1681,6 +1707,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi" ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a" ndbcluster_system_libs="" + ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la" MYSQL_CHECK_NDB_OPTIONS ;; * ) @@ -1692,6 +1719,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ AC_SUBST(ndbcluster_includes) AC_SUBST(ndbcluster_libs) AC_SUBST(ndbcluster_system_libs) + AC_SUBST(ndb_mgmclient_libs) ]) dnl --------------------------------------------------------------------------- diff --git a/client/Makefile.am b/client/Makefile.am index a9da284a753..da13c3e9763 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -20,28 +20,20 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @CLIENT_LIBS@ -DEPLIB= ../libmysql/libmysqlclient.la -LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB) +LDADD= @CLIENT_EXTRA_LDFLAGS@ \ + $(top_builddir)/libmysql/libmysqlclient.la bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ client_priv.h mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc +mysqladmin_SOURCES = mysqladmin.cc mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) -mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqladmin_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqlcheck_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c -mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a +mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c +mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c -mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqlmanagerc_SOURCES = mysqlmanagerc.c -mysqlmanagerc_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) sql_src=log_event.h log_event.cc # Fix for mit-threads diff --git a/client/client_priv.h b/client/client_priv.h index f16ec0e802b..95f4d105156 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -45,5 +45,9 @@ enum options_client OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH, OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME, - OPT_SIGINT_IGNORE, OPT_HEXBLOB + OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY +#ifdef HAVE_NDBCLUSTER_DB + ,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING +#endif + ,OPT_IGNORE_TABLE }; diff --git a/client/completion_hash.cc b/client/completion_hash.cc index 536e7f9373a..7a3b363c93c 100644 --- a/client/completion_hash.cc +++ b/client/completion_hash.cc @@ -79,7 +79,8 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, if (!memcmp(p->arKey, arKey, nKeyLength)) { entry *n; - n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)); + if (!(n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)))) + return FAILURE; n->pNext = p->pData; n->str = str; p->pData = n; diff --git a/client/mysql.cc b/client/mysql.cc index 358b13e652b..2c98b7b5eb6 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -172,7 +172,7 @@ static char *shared_memory_base_name=0; #endif static uint opt_protocol=0; static CHARSET_INFO *charset_info= &my_charset_latin1; - + #include "sslopt-vars.h" const char *default_dbug_option="d:t:o,/tmp/mysql.trace"; @@ -330,6 +330,16 @@ static sig_handler mysql_end(int sig); int main(int argc,char *argv[]) { char buff[80]; + char *defaults, *extra_defaults; + char *emb_argv[3]; + int emb_argc= 1; + + emb_argv[0]= argv[0]; + get_defaults_files(argc, argv, &defaults, &extra_defaults); + if (defaults) + emb_argv[emb_argc++]= defaults; + if (extra_defaults) + emb_argv[emb_argc++]= extra_defaults; MY_INIT(argv[0]); DBUG_ENTER("main"); @@ -375,7 +385,7 @@ int main(int argc,char *argv[]) my_end(0); exit(1); } - if (mysql_server_init(0, NULL, (char**) server_default_groups)) + if (mysql_server_init(emb_argc, emb_argv, (char**) server_default_groups)) { free_defaults(defaults_argv); my_end(0); @@ -1420,12 +1430,6 @@ static void build_completion_hash(bool rehash, bool write_info) if (status.batch || quick || !current_db) DBUG_VOID_RETURN; // We don't need completion in batches - if (tables) - { - mysql_free_result(tables); - tables=0; - } - /* hash SQL commands */ while (cmd->name) { add_word(&ht,(char*) cmd->name); @@ -1502,12 +1506,15 @@ You can turn off this feature to get a quicker startup with -A\n\n"); if (!(field_names[i] = (char **) alloc_root(&hash_mem_root, sizeof(char *) * (num_fields*2+1)))) - break; + { + mysql_free_result(fields); + break; + } field_names[i][num_fields*2]= '\0'; j=0; while ((sql_field=mysql_fetch_field(fields))) { - sprintf(buf,"%s.%s",table_row[0],sql_field->name); + sprintf(buf,"%.64s.%.64s",table_row[0],sql_field->name); field_names[i][j] = strdup_root(&hash_mem_root,buf); add_word(&ht,field_names[i][j]); field_names[i][num_fields+j] = strdup_root(&hash_mem_root, @@ -1574,6 +1581,22 @@ static int reconnect(void) return 0; } +static void get_current_db() +{ + MYSQL_RES *res; + + my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); + current_db= NULL; + /* In case of error below current_db will be NULL */ + if (!mysql_query(&mysql, "SELECT DATABASE()") && + (res= mysql_use_result(&mysql))) + { + MYSQL_ROW row= mysql_fetch_row(res); + if (row[0]) + current_db= my_strdup(row[0], MYF(MY_WME)); + mysql_free_result(res); + } +} /*************************************************************************** The different commands @@ -1584,7 +1607,7 @@ int mysql_real_query_for_lazy(const char *buf, int length) for (uint retry=0;; retry++) { if (!mysql_real_query(&mysql,buf,length)) - return 0; + return 0; int error= put_error(&mysql); if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 || !opt_reconnect) @@ -1609,7 +1632,7 @@ static void print_help_item(MYSQL_ROW *cur, int num_name, int num_cat, char *las char ccat= (*cur)[num_cat][0]; if (*last_char != ccat) { - put_info(ccat == 'Y' ? "categories :" : "topics :", INFO_INFO); + put_info(ccat == 'Y' ? "categories:" : "topics:", INFO_INFO); *last_char= ccat; } tee_fprintf(PAGER, " %s\n", (*cur)[num_name]); @@ -1668,29 +1691,28 @@ static int com_server_help(String *buffer __attribute__((unused)), else if (num_fields >= 2 && num_rows) { init_pager(); - char last_char; - + char last_char= 0; + int num_name= 0, num_cat= 0; LINT_INIT(num_name); LINT_INIT(num_cat); if (num_fields == 2) { - put_info("Many help items for your request exist", INFO_INFO); - put_info("To make a more specific request, please type 'help <item>',\nwhere item is one of next", INFO_INFO); + put_info("Many help items for your request exist.", INFO_INFO); + put_info("To make a more specific request, please type 'help <item>',\nwhere <item> is one of the following", INFO_INFO); num_name= 0; num_cat= 1; - last_char= '_'; } else if ((cur= mysql_fetch_row(result))) { tee_fprintf(PAGER, "You asked for help about help category: \"%s\"\n", cur[0]); - put_info("For more information, type 'help <item>', where item is one of the following", INFO_INFO); + put_info("For more information, type 'help <item>', where <item> is one of the following", INFO_INFO); num_name= 1; num_cat= 2; print_help_item(&cur,1,2,&last_char); } - + while ((cur= mysql_fetch_row(result))) print_help_item(&cur,num_name,num_cat,&last_char); tee_fprintf(PAGER, "\n"); @@ -1899,6 +1921,10 @@ com_go(String *buffer,char *line __attribute__((unused))) if (err >= 1) error= put_error(&mysql); + if (!error && !status.batch && + (mysql.server_status & SERVER_STATUS_DB_DROPPED)) + get_current_db(); + return error; /* New command follows */ } @@ -2077,10 +2103,10 @@ print_table_data_html(MYSQL_RES *result) } while ((cur = mysql_fetch_row(result))) { + ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TR>", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { - ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TD>", PAGER); safe_put_field(cur[i],lengths[i]); (void) tee_fputs("</TD>", PAGER); @@ -2106,10 +2132,10 @@ print_table_data_xml(MYSQL_RES *result) fields = mysql_fetch_fields(result); while ((cur = mysql_fetch_row(result))) { + ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("\n <row>\n", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { - ulong *lengths=mysql_fetch_lengths(result); tee_fprintf(PAGER, "\t<%s>", (fields[i].name ? (fields[i].name[0] ? fields[i].name : " ") : "NULL")); @@ -2513,7 +2539,7 @@ com_connect(String *buffer, char *line) { sprintf(buff,"Connection id: %lu",mysql_thread_id(&mysql)); put_info(buff,INFO_INFO); - sprintf(buff,"Current database: %s\n", + sprintf(buff,"Current database: %.128s\n", current_db ? current_db : "*** NONE ***"); put_info(buff,INFO_INFO); } @@ -2615,24 +2641,7 @@ com_use(String *buffer __attribute__((unused)), char *line) under our feet, for example if DROP DATABASE or RENAME DATABASE (latter one not yet available by the time the comment was written) */ - /* Let's reset current_db, assume it's gone */ - my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); - current_db= 0; - /* - We don't care about in case of an error below because current_db - was just set to 0. - */ - if (!mysql_query(&mysql, "SELECT DATABASE()") && - (res= mysql_use_result(&mysql))) - { - row= mysql_fetch_row(res); - if (row[0]) - { - current_db= my_strdup(row[0], MYF(MY_WME)); - } - (void) mysql_fetch_row(res); // Read eof - mysql_free_result(res); - } + get_current_db(); if (!current_db || cmp_database(charset_info, current_db,tmp)) { @@ -2908,9 +2917,9 @@ com_status(String *buffer __attribute__((unused)), MYSQL_ROW cur=mysql_fetch_row(result); if (cur) { - tee_fprintf(stdout, "Server characterset:\t%s\n", cur[0] ? cur[0] : ""); + tee_fprintf(stdout, "Server characterset:\t%s\n", cur[2] ? cur[2] : ""); tee_fprintf(stdout, "Db characterset:\t%s\n", cur[3] ? cur[3] : ""); - tee_fprintf(stdout, "Client characterset:\t%s\n", cur[2] ? cur[2] : ""); + tee_fprintf(stdout, "Client characterset:\t%s\n", cur[0] ? cur[0] : ""); tee_fprintf(stdout, "Conn. characterset:\t%s\n", cur[1] ? cur[1] : ""); } mysql_free_result(result); @@ -3219,13 +3228,20 @@ static const char* construct_prompt() break; } case 'p': + { #ifndef EMBEDDED_LIBRARY if (!connected) { processed_prompt.append("not_connected"); break; } - if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || + + const char *host_info = mysql_get_host_info(&mysql); + if (strstr(host_info, "memory")) + { + processed_prompt.append( mysql.host ); + } + else if (strstr(host_info,"TCP/IP") || !mysql.unix_socket) add_int_to_prompt(mysql.port); else @@ -3234,6 +3250,7 @@ static const char* construct_prompt() processed_prompt.append(pos ? pos+1 : mysql.unix_socket); } #endif + } break; case 'U': if (!full_username) diff --git a/client/mysqladmin.c b/client/mysqladmin.cc index bccbf29ef83..0da7d5b3acf 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.cc @@ -16,7 +16,6 @@ /* maintaince of mysql databases */ - #include "client_priv.h" #include <signal.h> #ifdef THREAD @@ -25,12 +24,17 @@ #include <sys/stat.h> #include <mysql.h> +#ifdef LATER_HAVE_NDBCLUSTER_DB +#include "../ndb/src/mgmclient/ndb_mgmclient.h" +#endif + #define ADMIN_VERSION "8.41" #define MAX_MYSQL_VAR 256 #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 -char *host= NULL, *user= 0, *opt_password= 0; +char *host= NULL, *user= 0, *opt_password= 0, + *default_charset= NULL; char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN]; ulonglong last_values[MAX_MYSQL_VAR]; @@ -42,6 +46,10 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations, opt_count_iterations= 0; static ulong opt_connect_timeout, opt_shutdown_timeout; static my_string unix_port=0; +#ifdef LATER_HAVE_NDBCLUSTER_DB +static my_bool opt_ndbcluster=0; +static char *opt_ndb_connectstring=0; +#endif #ifdef HAVE_SMEM static char *shared_memory_base_name=0; @@ -94,6 +102,9 @@ enum commands { ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS, ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE, ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD +#ifdef LATER_HAVE_NDBCLUSTER_DB + ,ADMIN_NDB_MGM +#endif }; static const char *command_names[]= { "create", "drop", "shutdown", @@ -104,14 +115,21 @@ static const char *command_names[]= { "ping", "extended-status", "flush-status", "flush-privileges", "start-slave", "stop-slave", "flush-threads","old-password", +#ifdef LATER_HAVE_NDBCLUSTER_DB + "ndb-mgm", +#endif NullS }; static TYPELIB command_typelib= -{ array_elements(command_names)-1,"commands", command_names}; +{ array_elements(command_names)-1,"commands", command_names, NULL}; static struct my_option my_long_options[] = { +#ifdef __NETWARE__ + {"autoclose", 'a', " Auto close the screen on exit for NetWare", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"count", 'c', "Number of iterations to make. This works with -i (--sleep) only.", (gptr*) &nr_iterations, (gptr*) &nr_iterations, 0, GET_UINT, @@ -128,6 +146,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default-character-set", OPT_DEFAULT_CHARSET, + "Set the default character set.", (gptr*) &default_charset, + (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, @@ -184,6 +205,14 @@ static struct my_option my_long_options[] = {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (gptr*) &opt_shutdown_timeout, (gptr*) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG, SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0}, +#ifdef LATER_HAVE_NDBCLUSTER_DB + {"ndbcluster", OPT_NDBCLUSTER, "" + "", (gptr*) &opt_ndbcluster, + (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "" + "", (gptr*) &opt_ndb_connectstring, + (gptr*) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -197,6 +226,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int error = 0; switch(optid) { +#ifdef __NETWARE__ + case 'a': + setscreenmode(SCR_AUTOCLOSE_ON_EXIT); // auto close the screen / + break; +#endif case 'c': opt_count_iterations= 1; break; @@ -313,6 +347,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + if (default_charset) + mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (sql_connect(&mysql, option_wait)) { unsigned int err= mysql_errno(&mysql); @@ -587,7 +623,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { char *pos,buff[40]; ulong sec; - pos=strchr(status,' '); + pos= (char*) strchr(status,' '); *pos++=0; printf("%s\t\t\t",status); /* print label */ if ((status=str2int(pos,10,0,LONG_MAX,(long*) &sec))) @@ -795,10 +831,52 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } if (argv[1][0]) { - if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) - make_scrambled_password_323(crypted_pw, argv[1]); + char *pw= argv[1]; + bool old= (find_type(argv[0], &command_typelib, 2) == + ADMIN_OLD_PASSWORD); +#ifdef __WIN__ + uint pw_len= strlen(pw); + if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') + printf("Warning: single quotes were not trimmed from the password by" + " your command\nline client, as you might have expected.\n"); +#endif + /* + If we don't already know to use an old-style password, see what + the server is using + */ + if (!old) + { + if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) + { + my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'", + MYF(ME_BELL),mysql_error(mysql)); + return -1; + } + else + { + MYSQL_RES *res= mysql_store_result(mysql); + if (!res) + { + my_printf_error(0, + "Could not get old_passwords setting from " + "server; error: '%s'", + MYF(ME_BELL),mysql_error(mysql)); + return -1; + } + if (!mysql_num_rows(res)) + old= 1; + else + { + MYSQL_ROW row= mysql_fetch_row(res); + old= !strncmp(row[1], "ON", 2); + } + mysql_free_result(res); + } + } + if (old) + make_scrambled_password_323(crypted_pw, pw); else - make_scrambled_password(crypted_pw, argv[1]); + make_scrambled_password(crypted_pw, pw); } else crypted_pw[0]=0; /* No password */ @@ -882,6 +960,24 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } mysql->reconnect=1; /* Automatic reconnect is default */ break; +#ifdef LATER_HAVE_NDBCLUSTER_DB + case ADMIN_NDB_MGM: + { + if (argc < 2) + { + my_printf_error(0,"Too few arguments to ndb-mgm",MYF(ME_BELL)); + return 1; + } + { + Ndb_mgmclient_handle cmd= + ndb_mgmclient_handle_create(opt_ndb_connectstring); + ndb_mgmclient_execute(cmd, --argc, ++argv); + ndb_mgmclient_handle_destroy(cmd); + } + argc= 0; + } + break; +#endif default: my_printf_error(0,"Unknown command: '%-.60s'",MYF(ME_BELL),argv[0]); return 1; @@ -912,6 +1008,7 @@ static void usage(void) print_defaults("my",load_default_groups); puts("\nWhere command is a one or more of: (Commands may be shortened)\n\ create databasename Create a new database\n\ + debug Instruct server to write debug information to log\n\ drop databasename Delete a database and all its tables\n\ extended-status Gives an extended status message from the server\n\ flush-hosts Flush all cached hosts\n\ @@ -1248,3 +1345,6 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified, } DBUG_RETURN(error); } +#ifdef __GNUC__ +FIX_GCC_LINKING_PROBLEM +#endif diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 5f9a499bd31..0b15ad893e2 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -44,7 +44,7 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; void sql_print_error(const char *format, ...); -static bool one_database=0, to_last_remote_log= 0; +static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0; static const char* database= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static ulonglong offset = 0; @@ -204,7 +204,7 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname, for (;;) { - uint packet_len = my_net_read(net); + ulong packet_len = my_net_read(net); if (packet_len == 0) { if (my_net_write(net, "", 0) || net_flush(net)) @@ -226,7 +226,13 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname, return -1; } - if (my_write(file, (byte*) net->read_pos, packet_len,MYF(MY_WME|MY_NABP))) + if (packet_len > UINT_MAX) + { + sql_print_error("Illegal length of packet read from net"); + return -1; + } + if (my_write(file, (byte*) net->read_pos, + (uint) packet_len, MYF(MY_WME|MY_NABP))) return -1; } @@ -432,6 +438,13 @@ static struct my_option my_long_options[] = {"database", 'd', "List entries for just this database (local log only).", (gptr*) &database, (gptr*) &database, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"disable-log-bin", 'D', "Disable binary log. This is useful, if you " + "enabled --to-last-log and are sending the output to the same MySQL server. " + "This way you could avoid an endless loop. You would also like to use it " + "when restoring after a crash to avoid duplication of the statements you " + "already have. NOTE: you will need a SUPER privilege to use this option.", + (gptr*) &disable_log_bin, (gptr*) &disable_log_bin, 0, GET_BOOL, + NO_ARG, 0, 0, 0, 0, 0, 0}, {"force-read", 'f', "Force reading unknown binlog events.", (gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -674,7 +687,7 @@ static int parse_args(int *argc, char*** argv) static MYSQL* safe_connect() { - MYSQL *local_mysql = mysql_init(NULL); + MYSQL *local_mysql= mysql_init(NULL); if (!local_mysql) die("Failed on mysql_init"); @@ -682,8 +695,12 @@ static MYSQL* safe_connect() if (opt_protocol) mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) - die("failed on connect: %s", mysql_error(local_mysql)); - + { + char errmsg[256]; + strmake(errmsg, mysql_error(local_mysql), sizeof(errmsg)-1); + mysql_close(local_mysql); + die("failed on connect: %s", errmsg); + } return local_mysql; } @@ -705,9 +722,10 @@ static int check_master_version(MYSQL* mysql) if (mysql_query(mysql, "SELECT VERSION()") || !(res = mysql_store_result(mysql))) { + char errmsg[256]; + strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1); mysql_close(mysql); - die("Error checking master version: %s", - mysql_error(mysql)); + die("Error checking master version: %s", errmsg); } if (!(row = mysql_fetch_row(res))) { @@ -747,7 +765,8 @@ static int dump_remote_log_entries(const char* logname) { char buf[128]; char last_db[FN_REFLEN+1] = ""; - uint len, logname_len; + ulong len; + uint logname_len; NET* net; int old_format; int error= 0; @@ -770,7 +789,15 @@ static int dump_remote_log_entries(const char* logname) */ int4store(buf, (uint32)start_position); int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags); - logname_len = (uint) strlen(logname); + + size_s tlen = strlen(logname); + if (tlen > UINT_MAX) + { + fprintf(stderr,"Log name too long\n"); + error= 1; + goto err; + } + logname_len = (uint) tlen; int4store(buf + 6, 0); memcpy(buf + 10, logname, logname_len); if (simple_command(mysql, COM_BINLOG_DUMP, buf, logname_len + 10, 1)) @@ -1053,6 +1080,11 @@ int main(int argc, char** argv) fprintf(result_file, "/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n"); + + if (disable_log_bin) + fprintf(result_file, + "/*!32316 SET @OLD_SQL_LOG_BIN=@@SQL_LOG_BIN, SQL_LOG_BIN=0*/;\n"); + for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ; (--argc >= 0) && !stop_passed ; ) { @@ -1067,6 +1099,9 @@ int main(int argc, char** argv) start_position= BIN_LOG_HEADER_SIZE; } + if (disable_log_bin) + fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); + if (tmpdir.list) free_tmpdir(&tmpdir); if (result_file != stdout) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 8182b95fb83..babf4de0c3d 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -81,8 +81,13 @@ static struct my_option my_long_options[] = "To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.", (gptr*) &opt_databases, (gptr*) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef DBUG_OFF + {"debug", '#', "This is a non-debug version. Catch this and exit.", + 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#else {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", (gptr*) &default_charset, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -190,7 +195,7 @@ static void usage(void) puts("and you are welcome to modify and redistribute it under the GPL license.\n"); puts("This program can be used to CHECK (-c,-m,-C), REPAIR (-r), ANALYZE (-a)"); puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be"); - puts("used at the same time. It works on MyISAM and in some cases on BDB tables."); + puts("used at the same time. Not all options are supported by all storage engines."); puts("Please consult the MySQL manual for latest information about the"); puts("above. The options -c,-r,-a and -o are exclusive to each other, which"); puts("means that the last option will be used, if several was specified.\n"); diff --git a/client/mysqldump.c b/client/mysqldump.c index 1686278096b..2c0bdf9a7a9 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -37,12 +37,13 @@ ** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov */ -#define DUMP_VERSION "10.8" +#define DUMP_VERSION "10.9" #include <my_global.h> #include <my_sys.h> #include <m_string.h> #include <m_ctype.h> +#include <hash.h> #include "client_priv.h" #include "mysql.h" @@ -75,25 +76,27 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length, static char *field_escape(char *to,const char *from,uint length); static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1, - lock_tables=1,ignore_errors=0,flush_logs=0,replace=0, - ignore=0,opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, + lock_tables=1,ignore_errors=0,flush_logs=0, + opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0, - opt_alldbs=0,opt_create_db=0,opt_first_slave=0,opt_set_charset, - opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0, + opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,opt_set_charset, + opt_autocommit=0,opt_disable_keys=1,opt_xml=0, opt_delete_master_logs=0, tty_password=0, opt_single_transaction=0, opt_comments= 0, opt_compact= 0, - opt_hex_blob=0; + opt_hex_blob=0, opt_order_by_primary=0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *current_host=0,*path=0,*fields_terminated=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, - *where=0, + *where=0, *order_by=0, *opt_compatible_mode_str= 0, *err_ptr= 0; static char compatible_mode_normal_str[255]; static ulong opt_compatible_mode= 0; -static uint opt_mysql_port= 0, err_len= 0; +#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1 +#define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2 +static uint opt_mysql_port= 0, err_len= 0, opt_master_data; static my_string opt_mysql_unix_port=0; static int first_error=0; static DYNAMIC_STRING extended_row; @@ -103,7 +106,14 @@ FILE *md_result_file; static char *shared_memory_base_name=0; #endif static uint opt_protocol= 0; -static char *default_charset= (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET; +/* + Constant for detection of default value of default_charset. + If default_charset is equal to mysql_universal_client_charset, then + it is the default value which assigned at the very beginning of main(). +*/ +static const char *mysql_universal_client_charset= + MYSQL_UNIVERSAL_CLIENT_CHARSET; +static char *default_charset; static CHARSET_INFO *charset_info= &my_charset_latin1; const char *default_dbug_option="d:t:o,/tmp/mysqldump.trace"; @@ -124,8 +134,17 @@ const char *compatible_mode_names[]= (1<<10) /* ANSI */\ ) TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1, - "", compatible_mode_names}; + "", compatible_mode_names, NULL}; + +#define TABLE_RULE_HASH_SIZE 16 + +typedef struct st_table_rule_ent +{ + char* key; /* dbname.tablename */ + uint key_len; +} TABLE_RULE_ENT; +HASH ignore_table; static struct my_option my_long_options[] = { @@ -148,12 +167,15 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"comments", 'i', "Write additional information.", + (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, + 1, 0, 0, 0, 0, 0}, {"compatible", OPT_COMPATIBLE, "Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.", (gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compact", OPT_COMPACT, - "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-lock-tables", + "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks", (gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag, @@ -183,8 +205,9 @@ static struct my_option my_long_options[] = (gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"delete-master-logs", OPT_DELETE_MASTER_LOGS, - "Delete logs on master after backup. This automatically enables --first-slave.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Delete logs on master after backup. This automatically enables --master-data.", + (gptr*) &opt_delete_master_logs, (gptr*) &opt_delete_master_logs, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"disable-keys", 'K', "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (gptr*) &opt_disable_keys, (gptr*) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, @@ -203,13 +226,18 @@ static struct my_option my_long_options[] = (gptr*) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0}, {"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...", (gptr*) &escaped, (gptr*) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"first-slave", 'x', "Locks all tables across all databases.", - (gptr*) &opt_first_slave, (gptr*) &opt_first_slave, 0, GET_BOOL, NO_ARG, + {"first-slave", 'x', "Deprecated, renamed to --lock-all-tables.", + (gptr*) &opt_lock_all_tables, (gptr*) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"flush-logs", 'F', "Flush logs file in server before starting dump. " - "Note that if you dump many databases at once (using the option " - "--databases= or --all-databases), the logs will be flushed for " - "each database dumped.", + "Note that if you dump many databases at once (using the option " + "--databases= or --all-databases), the logs will be flushed for " + "each database dumped. The exception is when using --lock-all-tables " + "or --master-data: " + "in this case the logs will be flushed only once, corresponding " + "to the moment all tables are locked. So if you want your dump and " + "the log flush to happen at the same exact moment you should use " + "--lock-all-tables or --master-data with --flush-logs", (gptr*) &flush_logs, (gptr*) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Continue even if we get an sql-error.", @@ -217,24 +245,50 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, " + "VARBINARY, BLOB) in hexadecimal format.", + (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) ¤t_host, (gptr*) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"ignore-table", OPT_IGNORE_TABLE, + "Do not dump the specified table. To specify more than one table to ignore, " + "use the directive multiple times, once for each table. Each table must " + "be specified with both database and table names, e.g. --ignore-table=database.table", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"lock-all-tables", 'x', "Locks all tables across all databases. This " + "is achieved by taking a global read lock for the duration of the whole " + "dump. Automatically turns --single-transaction and --lock-tables off.", + (gptr*) &opt_lock_all_tables, (gptr*) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables, (gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"master-data", OPT_MASTER_DATA, - "This causes the master position and filename to be appended to your output. This automatically enables --first-slave.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "This causes the binary log position and filename to be appended to the " + "output. If equal to 1, will print it as a CHANGE MASTER command; if equal" + " to 2, that command will be prefixed with a comment symbol. " + "This option will turn --lock-all-tables on, unless " + "--single-transaction is specified too (in which case a " + "global read lock is only taken a short time at the beginning of the dump " + "- don't forget to read about --single-transaction below). In all cases " + "any action on logs will happen at the exact moment of the dump." + "Option automatically turns --lock-tables off.", + (gptr*) &opt_master_data, (gptr*) &opt_master_data, 0, + GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, + {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "", + (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, + GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, + (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, + {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "", + (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, + GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, + MALLOC_OVERHEAD-1024, 1024, 0}, {"no-autocommit", OPT_AUTOCOMMIT, "Wrap tables with autocommit/commit statements.", (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"single-transaction", OPT_TRANSACTION, - "Dump all tables in single transaction to get consistent snapshot. Mutually exclusive with --lock-tables.", - (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, - GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-create-db", 'n', "'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}.", (gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0, @@ -246,16 +300,12 @@ static struct my_option my_long_options[] = {"no-set-names", 'N', "Deprecated. Use --skip-set-charset instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"set-charset", OPT_SET_CHARSET, - "Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.", - (gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, - 0, 0, 0, 0, 0}, - {"set-variable", 'O', - "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"opt", OPT_OPTIMIZE, "Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"order-by-primary", OPT_ORDER_BY_PRIMARY, + "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.", + (gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's solicited on the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -276,11 +326,31 @@ static struct my_option my_long_options[] = {"result-file", 'r', "Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"set-charset", OPT_SET_CHARSET, + "Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.", + (gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, + 0, 0, 0, 0, 0}, + {"set-variable", 'O', + "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, "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 + /* + Note that the combination --single-transaction --master-data + will give bullet-proof binlog position only if server >=4.1.3. That's the + old "FLUSH TABLES WITH READ LOCK does not block commit" fixed bug. + */ + {"single-transaction", OPT_TRANSACTION, + "Creates a consistent snapshot by dumping all tables in a single " + "transaction. Works ONLY for tables stored in storage engines which " + "support multiversioning (currently only InnoDB does); the dump is NOT " + "guaranteed to be consistent for other storage engines. Option " + "automatically turns off --lock-tables.", + (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-opt", OPT_SKIP_OPTIMIZATION, "Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -306,20 +376,7 @@ static struct my_option my_long_options[] = (gptr*) &where, (gptr*) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "", - (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, - GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, - (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, - {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "", - (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, - GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, - MALLOC_OVERHEAD-1024, 1024, 0}, - {"comments", 'i', "Write additional information.", - (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, - 1, 0, 0, 0, 0, 0}, - {"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX. this mode does not work with extended-insert", - (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 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} + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static const char *load_default_groups[]= { "mysqldump","client",0 }; @@ -336,6 +393,7 @@ static int dump_databases(char **); static int dump_all_databases(); static char *quote_name(const char *name, char *buff, my_bool force); static const char *check_if_ignore_table(const char *table_name); +static char *primary_key_fields(const char *table_name); #include <help_start.h> @@ -431,7 +489,8 @@ static void write_header(FILE *sql_file, char *db_name) "); } fprintf(sql_file, - "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s%s%s\" */;\n", + "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n" + "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); check_io(sql_file); @@ -460,26 +519,42 @@ static void write_footer(FILE *sql_file) "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); + fprintf(sql_file, + "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n"); fputs("\n", sql_file); check_io(sql_file); } } /* write_footer */ +static void free_table_ent(TABLE_RULE_ENT* e) +{ + my_free((gptr) e, MYF(0)); +} + + +static byte* get_table_key(TABLE_RULE_ENT* e, uint* len, + my_bool not_used __attribute__((unused))) +{ + *len= e->key_len; + return (byte*)e->key; +} + + +void init_table_rule_hash(HASH* h) +{ + if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0, + (hash_get_key) get_table_key, + (hash_free_key) free_table_ent, 0)) + exit(EX_EOM); +} + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { switch (optid) { - case OPT_MASTER_DATA: - opt_master_data=1; - opt_first_slave=1; - break; - case OPT_DELETE_MASTER_LOGS: - opt_delete_master_logs=1; - opt_first_slave=1; - break; case 'p': if (argument) { @@ -524,10 +599,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case '?': usage(); exit(0); + case (int) OPT_MASTER_DATA: + if (!argument) /* work like in old versions */ + opt_master_data= MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL; + break; case (int) OPT_OPTIMIZE: extended_insert= opt_drop= opt_lock= quick= create_options= opt_disable_keys= lock_tables= opt_set_charset= 1; - if (opt_single_transaction) lock_tables=0; break; case (int) OPT_SKIP_OPTIMIZATION: extended_insert= opt_drop= opt_lock= quick= create_options= @@ -542,8 +620,32 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_TABLES: opt_databases=0; break; + case (int) OPT_IGNORE_TABLE: + { + uint len= (uint)strlen(argument); + TABLE_RULE_ENT* e; + if (!strchr(argument, '.')) + { + fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n"); + exit(1); + } + /* len is always > 0 because we know the there exists a '.' */ + e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME)); + if (!e) + exit(EX_EOM); + e->key= (char*)e + sizeof(TABLE_RULE_ENT); + e->key_len= len; + memcpy(e->key, argument, len); + + if (!hash_inited(&ignore_table)) + init_table_rule_hash(&ignore_table); + + if(my_hash_insert(&ignore_table, (byte*)e)) + exit(EX_EOM); + break; + } case (int) OPT_COMPATIBLE: - { + { char buff[255]; char *end= compatible_mode_normal_str; int i; @@ -582,6 +684,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } if (end!=compatible_mode_normal_str) end[-1]= 0; + /* + Set charset to the default compiled value if it hasn't + been reset yet by --default-character-set=xxx. + */ + if (default_charset == mysql_universal_client_charset) + default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } case (int) OPT_MYSQL_PROTOCOL: @@ -623,18 +731,25 @@ static int get_options(int *argc, char ***argv) "%s: You must use option --tab with --fields-...\n", my_progname); return(1); } - if (opt_single_transaction) + + /* Ensure consistency of the set of binlog & locking options */ + if (opt_delete_master_logs && !opt_master_data) + opt_master_data= MYSQL_OPT_MASTER_DATA_COMMENTED_SQL; + if (opt_single_transaction && opt_lock_all_tables) + { + fprintf(stderr, "%s: You can't use --single-transaction and " + "--lock-all-tables at the same time.\n", my_progname); + return(1); + } + if (opt_master_data) + opt_lock_all_tables= !opt_single_transaction; + if (opt_single_transaction || opt_lock_all_tables) lock_tables= 0; if (enclosed && opt_enclosed) { fprintf(stderr, "%s: You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n", my_progname); return(1); } - if (replace && ignore) - { - fprintf(stderr, "%s: You can't use --ignore (-i) and --replace (-r) at the same time.\n",my_progname); - return(1); - } if ((opt_databases || opt_alldbs) && path) { fprintf(stderr, @@ -670,6 +785,36 @@ static void DBerror(MYSQL *mysql, const char *when) } /* DBerror */ +/* + Sends a query to server, optionally reads result, prints error message if + some. + + SYNOPSIS + mysql_query_with_error_report() + mysql_con connection to use + res if non zero, result will be put there with mysql_store_result + query query to send to server + + RETURN VALUES + 0 query sending and (if res!=0) result reading went ok + 1 error +*/ + +static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res, + const char *query) +{ + if (mysql_query(mysql_con, query) || + (res && !((*res)= mysql_store_result(mysql_con)))) + { + my_printf_error(0, "%s: Couldn't execute '%s': %s (%d)", + MYF(0), my_progname, query, + mysql_error(mysql_con), mysql_errno(mysql_con)); + return 1; + } + return 0; +} + + static void safe_exit(int error) { if (!first_error) @@ -685,7 +830,6 @@ static void safe_exit(int error) /* ** dbConnect -- connects to the host and selects DB. -** Also checks whether the tablename is a valid table name. */ static int dbConnect(char *host, char *user,char *passwd) { @@ -717,12 +861,20 @@ static int dbConnect(char *host, char *user,char *passwd) DBerror(&mysql_connection, "when trying to connect"); return 1; } - sprintf(buff, "/*!40100 SET @@SQL_MODE=\"%s\" */", + /* + Don't dump SET NAMES with a pre-4.1 server (bug#7997). + */ + if (mysql_get_server_version(&mysql_connection) < 40100) + opt_set_charset= 0; + /* + As we're going to set SQL_MODE, it would be lost on reconnect, so we + cannot reconnect. + */ + sock->reconnect= 0; + sprintf(buff, "/*!40100 SET @@SQL_MODE='%s' */", compatible_mode_normal_str); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, 0, buff)) { - fprintf(stderr, "%s: Can't set the compatible mode %s (error %s)\n", - my_progname, compatible_mode_normal_str, mysql_error(sock)); mysql_close(sock); safe_exit(EX_MYSQLERR); return 1; @@ -820,7 +972,7 @@ static char *quote_for_like(const char *name, char *buff) len - its length DESCRIPTION - Quote '<' '>' '&' '\"' singns and print a string to the xml_file. + Quote '<' '>' '&' '\"' chars and print a string to the xml_file. */ static void print_quoted_xml(FILE *xml_file, const char *str, ulong len) @@ -961,7 +1113,11 @@ static uint getTableStructure(char *table, char* db) result_table= quote_name(table, table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); - if (!opt_xml && !mysql_query(sock,insert_pat)) + + if (opt_order_by_primary) + order_by = primary_key_fields(opt_quoted_table); + + if (!opt_xml && !mysql_query_with_error_report(sock, 0, insert_pat)) { /* using SHOW CREATE statement */ if (!tFlag) @@ -970,10 +1126,8 @@ static uint getTableStructure(char *table, char* db) char buff[20+FN_REFLEN]; sprintf(buff,"show create table %s", result_table); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, 0, buff)) { - fprintf(stderr, "%s: Can't get CREATE TABLE for table %s (%s)\n", - my_progname, result_table, mysql_error(sock)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -1010,10 +1164,8 @@ static uint getTableStructure(char *table, char* db) mysql_free_result(tableRes); } sprintf(insert_pat,"show fields from %s", result_table); - if (mysql_query(sock,insert_pat) || !(tableRes=mysql_store_result(sock))) + if (mysql_query_with_error_report(sock, &tableRes, insert_pat)) { - fprintf(stderr, "%s: Can't get info about table: %s\nerror: %s\n", - my_progname, result_table, mysql_error(sock)); if (path) my_fclose(sql_file, MYF(MY_WME)); safe_exit(EX_MYSQLERR); @@ -1053,10 +1205,8 @@ static uint getTableStructure(char *table, char* db) my_progname, mysql_error(sock)); sprintf(insert_pat,"show fields from %s", result_table); - if (mysql_query(sock,insert_pat) || !(tableRes=mysql_store_result(sock))) + if (mysql_query_with_error_report(sock, &tableRes, insert_pat)) { - fprintf(stderr, "%s: Can't get info about table: %s\nerror: %s\n", - my_progname, result_table, mysql_error(sock)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -1150,17 +1300,14 @@ static uint getTableStructure(char *table, char* db) char buff[20+FN_REFLEN]; uint keynr,primary_key; sprintf(buff,"show keys from %s", result_table); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, &tableRes, buff)) { - fprintf(stderr, "%s: Can't get keys for table %s (%s)\n", - my_progname, result_table, mysql_error(sock)); if (path) my_fclose(sql_file, MYF(MY_WME)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } - tableRes=mysql_store_result(sock); /* Find first which key is primary key */ keynr=0; primary_key=INT_MAX; @@ -1224,7 +1371,7 @@ static uint getTableStructure(char *table, char* db) char show_name_buff[FN_REFLEN]; sprintf(buff,"show table status like %s", quote_for_like(table, show_name_buff)); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, &tableRes, buff)) { if (mysql_errno(sock) != ER_PARSE_ERROR) { /* If old MySQL version */ @@ -1234,8 +1381,7 @@ static uint getTableStructure(char *table, char* db) result_table,mysql_error(sock)); } } - else if (!(tableRes=mysql_store_result(sock)) || - !(row=mysql_fetch_row(tableRes))) + else if (!(row=mysql_fetch_row(tableRes))) { fprintf(stderr, "Error: Couldn't read status information for table %s (%s)\n", @@ -1387,10 +1533,6 @@ static void dumpTable(uint numFields, char *table) sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '%s'", filename); end= strend(query); - if (replace) - end= strmov(end, " REPLACE"); - if (ignore) - end= strmov(end, " IGNORE"); if (fields_terminated || enclosed || opt_enclosed || escaped) end= strmov(end, " FIELDS"); @@ -1403,10 +1545,17 @@ static void dumpTable(uint numFields, char *table) sprintf(buff," FROM %s", result_table); end= strmov(end,buff); - if (where) + if (where || order_by) { - query= alloc_query_str((ulong) (strlen(where) + (end - query) + 10)); - end= strxmov(query, query_buf, " WHERE ", where, NullS); + query = alloc_query_str((ulong) ((end - query) + 1 + + (where ? strlen(where) + 7 : 0) + + (order_by ? strlen(order_by) + 10 : 0))); + end = strmov(query, query_buf); + + if (where) + end = strxmov(end, " WHERE ", where, NullS); + if (order_by) + end = strxmov(end, " ORDER BY ", order_by, NullS); } if (mysql_real_query(sock, query, (uint) (end - query))) { @@ -1424,37 +1573,45 @@ static void dumpTable(uint numFields, char *table) } sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s", result_table); - if (where) + if (where || order_by) { - if (!opt_xml && opt_comments) + query = alloc_query_str((ulong) (strlen(query) + 1 + + (where ? strlen(where) + 7 : 0) + + (order_by ? strlen(order_by) + 10 : 0))); + end = strmov(query, query_buf); + + if (where) { - fprintf(md_result_file,"-- WHERE: %s\n",where); - check_io(md_result_file); + if (!opt_xml && opt_comments) + { + fprintf(md_result_file, "-- WHERE: %s\n", where); + check_io(md_result_file); + } + end = strxmov(end, " WHERE ", where, NullS); + } + if (order_by) + { + if (!opt_xml && opt_comments) + { + fprintf(md_result_file, "-- ORDER BY: %s\n", order_by); + check_io(md_result_file); + } + end = strxmov(end, " ORDER BY ", order_by, NullS); } - query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10)); - strxmov(query, query_buf, " WHERE ", where, NullS); } if (!opt_xml && !opt_compact) { fputs("\n", md_result_file); check_io(md_result_file); } - if (mysql_query(sock, query)) - { + if (mysql_query_with_error_report(sock, 0, query)) DBerror(sock, "when retrieving data from server"); - error= EX_CONSCHECK; - goto err; - } if (quick) res=mysql_use_result(sock); else res=mysql_store_result(sock); if (!res) - { DBerror(sock, "when retrieving data from server"); - error= EX_CONSCHECK; - goto err; - } if (verbose) fprintf(stderr, "-- Retrieving rows...\n"); if (mysql_num_fields(res) != numFields) @@ -1523,10 +1680,12 @@ static void dumpTable(uint numFields, char *table) /* 63 is my_charset_bin. If charsetnr is not 63, we have not a BLOB but a TEXT column. - we'll dump it in hex only BLOB columns. + we'll dump in hex only BLOB columns. */ is_blob= (opt_hex_blob && field->charsetnr == 63 && - (field->type == FIELD_TYPE_BLOB || + (field->type == FIELD_TYPE_STRING || + field->type == FIELD_TYPE_VAR_STRING || + field->type == FIELD_TYPE_BLOB || field->type == FIELD_TYPE_LONG_BLOB || field->type == FIELD_TYPE_MEDIUM_BLOB || field->type == FIELD_TYPE_TINY_BLOB)) ? 1 : 0; @@ -1544,6 +1703,13 @@ static void dumpTable(uint numFields, char *table) { if (!IS_NUM_FIELD(field)) { + /* + "length * 2 + 2" is OK for both HEX and non-HEX modes: + - In HEX mode we need exactly 2 bytes per character + plus 2 bytes for '0x' prefix. + - In non-HEX mode we need up to 2 bytes per character, + plus 2 bytes for leading and trailing '\'' characters. + */ if (dynstr_realloc(&extended_row,length * 2+2)) { fputs("Aborting dump (out of memory)",stderr); @@ -1552,15 +1718,11 @@ static void dumpTable(uint numFields, char *table) } if (opt_hex_blob && is_blob) { - ulong counter; - unsigned char *ptr= row[i]; dynstr_append(&extended_row, "0x"); - for (counter = 0; counter < lengths[i]; counter++) - { - char xx[3]; - sprintf(xx, "%02X", ptr[counter]); - dynstr_append(&extended_row, xx); - } + extended_row.length+= mysql_hex_string(extended_row.str + + extended_row.length, + row[i], length); + extended_row.str[extended_row.length]= '\0'; } else { @@ -1623,16 +1785,12 @@ static void dumpTable(uint numFields, char *table) fputs("</field>\n", md_result_file); } else if (opt_hex_blob && is_blob) - { /* sakaik got this idea. */ - ulong counter; - char xx[4]; - unsigned char *ptr= row[i]; + { + /* sakaik got the idea to to provide blob's in hex notation. */ + char *ptr= row[i], *end= ptr+ lengths[i]; fputs("0x", md_result_file); - for (counter = 0; counter < lengths[i]; counter++) - { - sprintf(xx, "%02X", ptr[counter]); - fputs(xx, md_result_file); - } + for (; ptr < end ; ptr++) + fprintf(md_result_file, "%02X", *ptr); } else unescape(md_result_file, row[i], lengths[i]); @@ -1784,13 +1942,8 @@ static int dump_all_databases() MYSQL_RES *tableres; int result=0; - if (mysql_query(sock, "SHOW DATABASES") || - !(tableres = mysql_store_result(sock))) - { - my_printf_error(0, "Error: Couldn't execute 'SHOW DATABASES': %s", - MYF(0), mysql_error(sock)); + if (mysql_query_with_error_report(sock, &tableres, "SHOW DATABASES")) return 1; - } while ((row = mysql_fetch_row(tableres))) { if (dump_all_tables_in_db(row[0])) @@ -1840,7 +1993,7 @@ static int init_dumping(char *database) MYSQL_ROW row; MYSQL_RES *dbinfo; - sprintf(qbuf,"SHOW CREATE DATABASE WITH IF NOT EXISTS %s", + sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s", qdatabase); if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock))) @@ -1869,6 +2022,14 @@ static int init_dumping(char *database) } /* init_dumping */ +my_bool include_table(byte* hash_key, uint len) +{ + if (hash_search(&ignore_table, (byte*) hash_key, len)) + return FALSE; + + return TRUE; +} + static int dump_all_tables_in_db(char *database) { @@ -1876,6 +2037,12 @@ static int dump_all_tables_in_db(char *database) uint numrows; char table_buff[NAME_LEN*2+3]; + char hash_key[2*NAME_LEN+2]; /* "db.tablename" */ + char *afterdot; + + afterdot= strmov(hash_key, database); + *afterdot++= '.'; + if (init_dumping(database)) return 1; if (opt_xml) @@ -1884,7 +2051,7 @@ static int dump_all_tables_in_db(char *database) { DYNAMIC_STRING query; init_dynamic_string(&query, "LOCK TABLES ", 256, 1024); - for (numrows=0 ; (table = getTableName(1)) ; numrows++) + for (numrows= 0 ; (table= getTableName(1)) ; numrows++) { dynstr_append(&query, quote_name(table, table_buff, 1)); dynstr_append(&query, " READ /*!32311 LOCAL */,"); @@ -1900,11 +2067,17 @@ static int dump_all_tables_in_db(char *database) DBerror(sock, "when doing refresh"); /* We shall continue here, if --force was given */ } - while ((table = getTableName(0))) + while ((table= getTableName(0))) { - numrows = getTableStructure(table, database); - if (!dFlag && numrows > 0) - dumpTable(numrows,table); + char *end= strmov(afterdot, table); + if (include_table(hash_key, end - hash_key)) + { + numrows = getTableStructure(table, database); + if (!dFlag && numrows > 0) + dumpTable(numrows,table); + my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + order_by= 0; + } } if (opt_xml) { @@ -1912,11 +2085,42 @@ static int dump_all_tables_in_db(char *database) check_io(md_result_file); } if (lock_tables) - mysql_query(sock,"UNLOCK TABLES"); + mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"); return 0; } /* dump_all_tables_in_db */ +/* + get_actual_table_name -- executes a SHOW TABLES LIKE '%s' to get the actual + table name from the server for the table name given on the command line. + we do this because the table name given on the command line may be a + different case (e.g. T1 vs t1) + + RETURN + void +*/ + +static void get_actual_table_name(const char *old_table_name, + char *new_table_name, + int buf_size) +{ + MYSQL_RES *tableRes; + MYSQL_ROW row; + char query[ NAME_LEN + 50 ]; + DBUG_ENTER("get_actual_table_name"); + + sprintf( query, "SHOW TABLES LIKE '%s'", old_table_name); + if (mysql_query_with_error_report(sock, 0, query)) + { + safe_exit(EX_MYSQLERR); + } + + tableRes= mysql_store_result( sock ); + row= mysql_fetch_row( tableRes ); + strmake(new_table_name, row[0], buf_size-1); + mysql_free_result(tableRes); +} + static int dump_selected_tables(char *db, char **table_names, int tables) { @@ -1951,9 +2155,16 @@ static int dump_selected_tables(char *db, char **table_names, int tables) print_xml_tag1(md_result_file, "", "database name=", db, "\n"); for (; tables > 0 ; tables-- , table_names++) { - numrows = getTableStructure(*table_names, db); + char new_table_name[NAME_LEN]; + + /* the table name passed on commandline may be wrong case */ + get_actual_table_name( *table_names, new_table_name, sizeof(new_table_name) ); + + numrows = getTableStructure(new_table_name, db); if (!dFlag && numrows > 0) - dumpTable(numrows, *table_names); + dumpTable(numrows, new_table_name); + my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + order_by= 0; } if (opt_xml) { @@ -1961,11 +2172,93 @@ static int dump_selected_tables(char *db, char **table_names, int tables) check_io(md_result_file); } if (lock_tables) - mysql_query(sock,"UNLOCK TABLES"); + mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"); return 0; } /* dump_selected_tables */ +static int do_show_master_status(MYSQL *mysql_con) +{ + MYSQL_ROW row; + MYSQL_RES *master; + const char *comment_prefix= + (opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL) ? "-- " : ""; + if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS")) + { + my_printf_error(0, "Error: Couldn't execute 'SHOW MASTER STATUS': %s", + MYF(0), mysql_error(mysql_con)); + return 1; + } + else + { + row = mysql_fetch_row(master); + if (row && row[0] && row[1]) + { + if (opt_comments) + fprintf(md_result_file, + "\n--\n-- Position to start replication or point-in-time " + "recovery from\n--\n\n"); + fprintf(md_result_file, + "%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n", + comment_prefix, row[0], row[1]); + check_io(md_result_file); + } + mysql_free_result(master); + } + return 0; +} + + +static int do_flush_tables_read_lock(MYSQL *mysql_con) +{ + /* + We do first a FLUSH TABLES. If a long update is running, the FLUSH TABLES + will wait but will not stall the whole mysqld, and when the long update is + done the FLUSH TABLES WITH READ LOCK will start and succeed quickly. So, + FLUSH TABLES is to lower the probability of a stage where both mysqldump + and most client connections are stalled. Of course, if a second long + update starts between the two FLUSHes, we have that bad stall. + */ + return + ( mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES") || + mysql_query_with_error_report(mysql_con, 0, + "FLUSH TABLES WITH READ LOCK") ); +} + + +static int do_unlock_tables(MYSQL *mysql_con) +{ + return mysql_query_with_error_report(mysql_con, 0, "UNLOCK TABLES"); +} + + +static int do_reset_master(MYSQL *mysql_con) +{ + return mysql_query_with_error_report(mysql_con, 0, "RESET MASTER"); +} + + +static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now) +{ + /* + We use BEGIN for old servers. --single-transaction --master-data will fail + on old servers, but that's ok as it was already silently broken (it didn't + do a consistent read, so better tell people frankly, with the error). + + We want the first consistent read to be used for all tables to dump so we + need the REPEATABLE READ level (not anything lower, for example READ + COMMITTED would give one new consistent read per dumped table). + */ + return (mysql_query_with_error_report(mysql_con, 0, + "SET SESSION TRANSACTION ISOLATION " + "LEVEL REPEATABLE READ") || + mysql_query_with_error_report(mysql_con, 0, + consistent_read_now ? + "START TRANSACTION " + "WITH CONSISTENT SNAPSHOT" : + "BEGIN")); +} + static ulong find_set(TYPELIB *lib, const char *x, uint length, char **err_pos, uint *err_len) @@ -2063,7 +2356,7 @@ static const char *check_if_ignore_table(const char *table_name) sprintf(buff,"show table status like %s", quote_for_like(table_name, show_name_buff)); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, &res, buff)) { if (mysql_errno(sock) != ER_PARSE_ERROR) { /* If old MySQL version */ @@ -2074,29 +2367,100 @@ static const char *check_if_ignore_table(const char *table_name) return 0; /* assume table is ok */ } } - if (!(res= mysql_store_result(sock)) || - !(row= mysql_fetch_row(res))) + if (!(row= mysql_fetch_row(res))) { fprintf(stderr, "Error: Couldn't read status information for table %s (%s)\n", table_name, mysql_error(sock)); - if (res) - mysql_free_result(res); + mysql_free_result(res); return 0; /* assume table is ok */ } if (strcmp(row[1], (result= "MRG_MyISAM")) && strcmp(row[1], (result= "MRG_ISAM"))) result= 0; - mysql_free_result(res); + mysql_free_result(res); + return result; +} + +/* + Get string of comma-separated primary key field names + + SYNOPSIS + char *primary_key_fields(const char *table_name) + RETURNS pointer to allocated buffer (must be freed by caller) + table_name quoted table name + + DESCRIPTION + Use SHOW KEYS FROM table_name, allocate a buffer to hold the + field names, and then build that string and return the pointer + to that buffer. + + Returns NULL if there is no PRIMARY or UNIQUE key on the table, + or if there is some failure. It is better to continue to dump + the table unsorted, rather than exit without dumping the data. +*/ +static char *primary_key_fields(const char *table_name) +{ + MYSQL_RES *res = NULL; + MYSQL_ROW row; + /* SHOW KEYS FROM + table name * 2 (escaped) + 2 quotes + \0 */ + char show_keys_buff[15 + 64 * 2 + 3]; + uint result_length = 0; + char *result = 0; + + sprintf(show_keys_buff, "SHOW KEYS FROM %s", table_name); + if (mysql_query(sock, show_keys_buff) || + !(res = mysql_store_result(sock))) + { + fprintf(stderr, "Warning: Couldn't read keys from table %s;" + " records are NOT sorted (%s)\n", + table_name, mysql_error(sock)); + /* Don't exit, because it's better to print out unsorted records */ + goto cleanup; + } + + /* + * Figure out the length of the ORDER BY clause result. + * Note that SHOW KEYS is ordered: a PRIMARY key is always the first + * row, and UNIQUE keys come before others. So we only need to check + * the first key, not all keys. + */ + if ((row = mysql_fetch_row(res)) && atoi(row[1]) == 0) + { + /* Key is unique */ + do + result_length += strlen(row[4]) + 1; /* + 1 for ',' or \0 */ + while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1); + } + + /* Build the ORDER BY clause result */ + if (result_length) { + char *end; + /* result (terminating \0 is already in result_length) */ + result = my_malloc(result_length + 10, MYF(MY_WME)); + if (!result) { + fprintf(stderr, "Error: Not enough memory to store ORDER BY clause\n"); + goto cleanup; + } + mysql_data_seek(res, 0); + row = mysql_fetch_row(res); + end = strmov(result, row[4]); + while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1) + end = strxmov(end, ",", row[4], NullS); + } + +cleanup: + if (res) + mysql_free_result(res); + return result; } int main(int argc, char **argv) { - MYSQL_ROW row; - MYSQL_RES *master; compatible_mode_normal_str[0]= 0; + default_charset= (char *)mysql_universal_client_charset; MY_INIT(argv[0]); if (get_options(&argc, &argv)) @@ -2109,28 +2473,24 @@ int main(int argc, char **argv) if (!path) write_header(md_result_file, *argv); - if (opt_first_slave) - { - lock_tables=0; /* No other locks needed */ - if (mysql_query(sock, "FLUSH TABLES WITH READ LOCK")) - { - my_printf_error(0, "Error: Couldn't execute 'FLUSH TABLES WITH READ LOCK': %s", - MYF(0), mysql_error(sock)); - my_end(0); - return(first_error); - } - } - else if (opt_single_transaction) + if ((opt_lock_all_tables || opt_master_data) && + do_flush_tables_read_lock(sock)) + goto err; + if (opt_single_transaction && start_transaction(sock, test(opt_master_data))) + goto err; + if (opt_delete_master_logs && do_reset_master(sock)) + goto err; + if (opt_lock_all_tables || opt_master_data) { - /* There is no sense to start transaction if all tables are locked */ - if (mysql_query(sock, "BEGIN")) - { - my_printf_error(0, "Error: Couldn't execute 'BEGIN': %s", - MYF(0), mysql_error(sock)); - my_end(0); - return(first_error); - } + if (flush_logs && mysql_refresh(sock, REFRESH_LOG)) + goto err; + flush_logs= 0; /* not anymore; that would not be sensible */ } + if (opt_master_data && do_show_master_status(sock)) + goto err; + if (opt_single_transaction && do_unlock_tables(sock)) /* unlock but no commit! */ + goto err; + if (opt_alldbs) dump_all_databases(); else if (argc > 1 && !opt_databases) @@ -2143,57 +2503,16 @@ int main(int argc, char **argv) /* One or more databases, all tables */ dump_databases(argv); } - - if (opt_first_slave) - { - if (opt_delete_master_logs && mysql_query(sock, "FLUSH MASTER")) - { - my_printf_error(0, "Error: Couldn't execute 'FLUSH MASTER': %s", - MYF(0), mysql_error(sock)); - } - if (opt_master_data) - { - if (mysql_query(sock, "SHOW MASTER STATUS") || - !(master = mysql_store_result(sock))) - my_printf_error(0, "Error: Couldn't execute 'SHOW MASTER STATUS': %s", - MYF(0), mysql_error(sock)); - else - { - row = mysql_fetch_row(master); - if (row && row[0] && row[1]) - { - if (opt_comments) - fprintf(md_result_file, - "\n--\n-- Position to start replication from\n--\n\n"); - fprintf(md_result_file, - "CHANGE MASTER TO MASTER_LOG_FILE='%s', \ -MASTER_LOG_POS=%s ;\n",row[0],row[1]); - check_io(md_result_file); - } - mysql_free_result(master); - } - } - if (mysql_query(sock, "UNLOCK TABLES")) - my_printf_error(0, "Error: Couldn't execute 'UNLOCK TABLES': %s", - MYF(0), mysql_error(sock)); - } - else if (opt_single_transaction) /* Just to make it beautiful enough */ #ifdef HAVE_SMEM my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); #endif - { - /* - In case we were locking all tables, we did not start transaction - so there is no need to commit it. - */ - - /* This should just free locks as we did not change anything */ - if (mysql_query(sock, "COMMIT")) - { - my_printf_error(0, "Error: Couldn't execute 'COMMIT': %s", - MYF(0), mysql_error(sock)); - } - } + /* + No reason to explicitely COMMIT the transaction, neither to explicitely + UNLOCK TABLES: these will be automatically be done by the server when we + disconnect now. Saves some code here, some network trips, adds nothing to + server. + */ +err: dbDisconnect(current_host); if (!path) write_footer(md_result_file); diff --git a/client/mysqltest.c b/client/mysqltest.c index 4c87561ab84..042f84dfb9e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -42,7 +42,7 @@ **********************************************************************/ -#define MTEST_VERSION "2.3" +#define MTEST_VERSION "2.4" #include <my_global.h> #include <mysql_embed.h> @@ -227,7 +227,7 @@ typedef struct int alloced; } VAR; -#ifdef __NETWARE__ +#if defined(__NETWARE__) || defined(__WIN__) /* Netware doesn't proved environment variable substitution that is done by the shell in unix environments. We do this in the following function: @@ -243,6 +243,7 @@ VAR var_reg[10]; HASH var_hash; my_bool disable_query_log=0, disable_result_log=0, disable_warnings=0; my_bool disable_info= 1; /* By default off */ +my_bool abort_on_error= 1; struct connection cons[MAX_CONS]; struct connection* cur_con, *next_con, *cons_end; @@ -274,6 +275,7 @@ Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS, Q_ENABLE_INFO, Q_DISABLE_INFO, Q_ENABLE_METADATA, Q_DISABLE_METADATA, Q_EXEC, Q_DELIMITER, +Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR, Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_START_TIMER, Q_END_TIMER, @@ -352,6 +354,8 @@ const char *command_names[]= "disable_metadata", "exec", "delimiter", + "disable_abort_on_error", + "enable_abort_on_error", "vertical_results", "horizontal_results", "query_vertical", @@ -365,7 +369,7 @@ const char *command_names[]= }; TYPELIB command_typelib= {array_elements(command_names),"", - command_names}; + command_names, 0}; DYNAMIC_STRING ds_res; static void die(const char *fmt, ...); @@ -534,7 +538,6 @@ static void free_used_memory() mysql_server_end(); if (ps_protocol) ps_free_reg(); - my_end(MY_CHECK_ERROR); DBUG_VOID_RETURN; } @@ -552,6 +555,7 @@ static void die(const char* fmt, ...) } va_end(args); free_used_memory(); + my_end(MY_CHECK_ERROR); exit(1); } @@ -564,6 +568,7 @@ static void abort_not_supported_test() if (!silent) printf("skipped\n"); free_used_memory(); + my_end(MY_CHECK_ERROR); exit(2); } @@ -710,9 +715,10 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw, die("Empty variable"); } length= (uint) (var_name - save_var_name); + if (length >= MAX_VAR_NAME) + die("Too long variable name: %s", save_var_name); - if (!(v = (VAR*) hash_search(&var_hash, save_var_name, length)) && - length < MAX_VAR_NAME) + if (!(v = (VAR*) hash_search(&var_hash, save_var_name, length))) { char buff[MAX_VAR_NAME+1]; strmake(buff, save_var_name, length); @@ -739,7 +745,7 @@ err: DBUG_RETURN(0); } -static VAR* var_obtain(char* name, int len) +static VAR *var_obtain(const char* name, int len) { VAR* v; if ((v = (VAR*)hash_search(&var_hash, name, len))) @@ -749,28 +755,33 @@ static VAR* var_obtain(char* name, int len) return v; } -int var_set(char* var_name, char* var_name_end, char* var_val, - char* var_val_end) +int var_set(const char *var_name, const char *var_name_end, + const char *var_val, const char *var_val_end) { int digit; VAR* v; + DBUG_ENTER("var_set"); + DBUG_PRINT("enter", ("var_name: '%.*s' = '%.*s' (length: %d)", + (int) (var_name_end - var_name), var_name, + (int) (var_val_end - var_val), var_val, + (int) (var_val_end - var_val))); + if (*var_name++ != '$') - { - --var_name; - *var_name_end = 0; - die("Variable name in %s does not start with '$'", var_name); - } + { + var_name--; + die("Variable name in %s does not start with '$'", var_name); + } digit = *var_name - '0'; if (!(digit < 10 && digit >= 0)) - { - v = var_obtain(var_name, var_name_end - var_name); - } + { + v = var_obtain(var_name, (uint) (var_name_end - var_name)); + } else - v = var_reg + digit; - + v = var_reg + digit; return eval_expr(v, var_val, (const char**)&var_val_end); } + int open_file(const char* name) { char buff[FN_REFLEN]; @@ -940,7 +951,6 @@ static void do_exec(struct st_query* q) while (fgets(buf, sizeof(buf), res_file)) replace_dynstr_append_mem(ds, buf, strlen(buf)); } - error= pclose(res_file); if (error != 0) @@ -1239,6 +1249,22 @@ int do_let(struct st_query* q) return var_set(var_name, var_name_end, var_val_start, q->end); } + +/* + Store an integer (typically the returncode of the last SQL) + statement in the mysqltest builtin variable $mysql_errno, by + simulating of a user statement "let $mysql_errno= <integer>" +*/ + +int var_set_errno(int sql_errno) +{ + const char *var_name= "$mysql_errno"; + char var_val[21]; + uint length= my_sprintf(var_val, (var_val, "%d", sql_errno)); + return var_set(var_name, var_name + 12, var_val, var_val + length); +} + + int do_rpl_probe(struct st_query* q __attribute__((unused))) { DBUG_ENTER("do_rpl_probe"); @@ -1247,12 +1273,14 @@ int do_rpl_probe(struct st_query* q __attribute__((unused))) DBUG_RETURN(0); } + int do_enable_rpl_parse(struct st_query* q __attribute__((unused))) { mysql_enable_rpl_parse(&cur_con->mysql); return 0; } + int do_disable_rpl_parse(struct st_query* q __attribute__((unused))) { mysql_disable_rpl_parse(&cur_con->mysql); @@ -1996,7 +2024,7 @@ int read_query(struct st_query** q_ptr) memcpy((gptr) q->expected_errno, (gptr) global_expected_errno, sizeof(global_expected_errno)); q->expected_errors= global_expected_errors; - q->abort_on_error= global_expected_errors == 0; + q->abort_on_error= (global_expected_errors == 0 && abort_on_error); bzero((gptr) global_expected_errno, sizeof(global_expected_errno)); global_expected_errors=0; if (p[0] == '-' && p[1] == '-') @@ -2141,6 +2169,9 @@ static struct my_option my_long_options[] = { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; + +#include <help_start.h> + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,MTEST_VERSION, @@ -2159,6 +2190,8 @@ void usage() my_print_variables(my_long_options); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), @@ -2405,7 +2438,7 @@ static int run_query(MYSQL *mysql, struct st_query *q, int flags) if (ps_protocol_enabled && disable_info && (flags & QUERY_SEND) && (flags & QUERY_REAP) && ps_match_re(q->query)) - return run_query_stmt (mysql, q, flags); + return run_query_stmt(mysql, q, flags); return run_query_normal(mysql, q, flags); } @@ -2642,6 +2675,13 @@ end: dynstr_free(&ds_tmp); if (q->type == Q_EVAL) dynstr_free(&eval_query); + + /* + We save the return code (mysql_errno(mysql)) from the last call sent + to the server into the mysqltest builtin variable $mysql_errno. This + variable then can be used from the test case itself. + */ + var_set_errno(mysql_errno(mysql)); DBUG_RETURN(error); } @@ -2991,6 +3031,7 @@ end: dynstr_free(&ds_tmp); if (q->type == Q_EVAL) dynstr_free(&eval_query); + var_set_errno(mysql_stmt_errno(stmt)); mysql_stmt_close(stmt); DBUG_RETURN(error); } @@ -3298,7 +3339,7 @@ static VAR* var_from_env(const char *name, const char *def_val) if (!(tmp = getenv(name))) tmp = def_val; - v = var_init(0, name, 0, tmp, 0); + v = var_init(0, name, strlen(name), tmp, strlen(tmp)); my_hash_insert(&var_hash, (byte*)v); return v; } @@ -3317,7 +3358,8 @@ static void init_var_hash(MYSQL *mysql) my_hash_insert(&var_hash, (byte*) v); v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0); my_hash_insert(&var_hash, (byte*) v); - + v= var_init(0,"DB", 2, db, 0); + my_hash_insert(&var_hash, (byte*) v); DBUG_VOID_RETURN; } @@ -3395,6 +3437,13 @@ int main(int argc, char **argv) init_var_hash(&cur_con->mysql); + /* + Initialize $mysql_errno with -1, so we can + - distinguish it from valid values ( >= 0 ) and + - detect if there was never a command sent to the server + */ + var_set_errno(-1); + while (!read_query(&q)) { int current_line_inc = 1, processed = 0; @@ -3414,6 +3463,8 @@ int main(int argc, char **argv) case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(q); break; case Q_ENABLE_QUERY_LOG: disable_query_log=0; break; case Q_DISABLE_QUERY_LOG: disable_query_log=1; break; + case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break; + case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break; case Q_ENABLE_RESULT_LOG: disable_result_log=0; break; case Q_DISABLE_RESULT_LOG: disable_result_log=1; break; case Q_ENABLE_WARNINGS: disable_warnings=0; break; @@ -3611,6 +3662,7 @@ int main(int argc, char **argv) if (!got_end_timer) timer_output(); /* No end_timer cmd, end it */ free_used_memory(); + my_end(MY_CHECK_ERROR); exit(error ? 1 : 0); return error ? 1 : 0; /* Keep compiler happy */ } @@ -4472,8 +4524,7 @@ static void get_replace_column(struct st_query *q) my_free(start, MYF(0)); } -#ifdef __NETWARE__ - +#if defined(__NETWARE__) || defined(__WIN__) /* Substitute environment variables with text. @@ -4557,6 +4608,9 @@ static char *subst_env_var(const char *str) */ #undef popen /* Remove wrapper */ +#ifdef __WIN__ +#define popen _popen /* redefine for windows */ +#endif FILE *my_popen(const char *cmd, const char *mode __attribute__((unused))) { @@ -4569,4 +4623,4 @@ FILE *my_popen(const char *cmd, const char *mode __attribute__((unused))) return res_file; } -#endif /* __NETWARE__ */ +#endif /* __NETWARE__ or __WIN__*/ diff --git a/cmd-line-utils/libedit/makelist.sh b/cmd-line-utils/libedit/makelist.sh index fbce06fcc50..b2502d16ed1 100644 --- a/cmd-line-utils/libedit/makelist.sh +++ b/cmd-line-utils/libedit/makelist.sh @@ -145,7 +145,7 @@ case $FLAG in # -fh) cat $FILES | $AWK '/el_action_t/ { print $3 }' | \ - sort | tr '[a-z]' '[A-Z]' | $AWK ' + sort | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | $AWK ' BEGIN { printf("/* Automatically generated file, do not edit */\n"); printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n"); diff --git a/cmd-line-utils/libedit/parse.c b/cmd-line-utils/libedit/parse.c index b113353d464..d09b890c1ab 100644 --- a/cmd-line-utils/libedit/parse.c +++ b/cmd-line-utils/libedit/parse.c @@ -87,7 +87,8 @@ parse_line(EditLine *el, const char *line) int argc; Tokenizer *tok; - tok = tok_init(NULL); + if (!(tok = tok_init(NULL))) + return -1; tok_line(tok, line, &argc, &argv); argc = el_parse(el, argc, argv); tok_end(tok); diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index 7e8ca04e0d6..fd01049f09f 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -311,7 +311,7 @@ rl_generic_bind (type, keyseq, data, map) mapped to something, `abc' to be mapped to something else, and the function bound to `a' to be executed when the user types `abx', leaving `bx' in the input queue. */ - if (k.function /* && k.type == ISFUNC */) + if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR)) { map[ANYOTHERKEY] = k; k.function = 0; diff --git a/configure.in b/configure.in index 979782fe511..d6acef071a6 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,8 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 4.1.8) +# remember to also change ndb version below and update version.c in ndb +AM_INIT_AUTOMAKE(mysql, 4.1.11) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -13,16 +14,16 @@ DOT_FRM_VERSION=6 SHARED_LIB_VERSION=14:0:0 # ndb version -NDB_VERSION_MAJOR=3 -NDB_VERSION_MINOR=5 -NDB_VERSION_BUILD=3 +NDB_VERSION_MAJOR=4 +NDB_VERSION_MINOR=1 +NDB_VERSION_BUILD=11 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"` -MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` +MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` # The port should be constant for a LONG time MYSQL_TCP_PORT_DEFAULT=3306 @@ -31,7 +32,7 @@ MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock" # Remember to add a directory sql/share/LANGUAGE AVAILABLE_LANGUAGES="\ czech danish dutch english estonian french german greek hungarian \ -italian japanese korean norwegian norwegian-ny polish portuguese \ +italian japanese japanese-sjis korean norwegian norwegian-ny polish portuguese \ romanian russian serbian slovak spanish swedish ukrainian" # Generate make rules for all error messages @@ -479,7 +480,7 @@ if $PS p $$ 2> /dev/null | grep $0 > /dev/null then FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null" # Solaris -elif $PS -p $$ 2> /dev/null | grep $0 > /dev/null +elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null then FIND_PROC="$PS -p \$\$PID | grep mysqld > /dev/null" # BSD style @@ -770,7 +771,7 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ - sys/ioctl.h malloc.h sys/malloc.h linux/config.h) + sys/ioctl.h malloc.h sys/malloc.h linux/config.h sys/resource.h sys/param.h) #-------------------------------------------------------------------- # Check for system libraries. Adds the library to $LIBS @@ -923,9 +924,11 @@ if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no" then AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty)) fi -# We make a special variable for client library's to avoid including -# thread libs in the client. -NON_THREADED_CLIENT_LIBS="$LIBS $ZLIB_LIBS" + +# We make a special variable for non-threaded version of LIBS to avoid +# including thread libs into non-threaded version of MySQL client library. +# Later in this script LIBS will be augmented with a threads library. +NON_THREADED_LIBS="$LIBS" AC_MSG_CHECKING([for int8]) case $SYSTEM_TYPE in @@ -973,8 +976,11 @@ case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in CFLAGS="$CFLAGS -DBIG_TABLES" CXXFLAGS="$CXXFLAGS -DBIG_TABLES" ;; + *) ;; +esac +case $SYSTEM_TYPE-$ac_cv_prog_gcc in # workaround for Sun Forte compile problem for ndb - *solaris2.10*-sparc-no) + *solaris*-no) ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static" ;; *) ;; @@ -1035,8 +1041,8 @@ case $SYSTEM_TYPE in ;; *hpux11.*) echo "Enabling workarounds for hpux 11" - CFLAGS="$CFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" - CXXFLAGS="$CXXFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" + CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" + CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" if test "$with_named_thread" = "no" then echo "Using --with-named-thread=-lpthread" @@ -1142,9 +1148,10 @@ dnl Is this the right match for DEC OSF on alpha? fi echo "Adding defines for OSF1" # gethostbyname_r is deprecated and doesn't work ok on OSF1 - CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" - CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" - ndb_cxxflags_fix="$ndb_cxxflags_fix -I/usr/include.dtk" + CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC" + CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC" + # fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler + CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk" ;; *netware*) # No need for curses library so set it to null @@ -1497,7 +1504,7 @@ then if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4" then LIBS="-lxnet $LIBS" - NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS -lxnet" + NON_THREADED_LIBS="-lxnet $NON_THREADED_LIBS" with_named_thread="-Kthread $LDFLAGS -lxnet" LD_FLAGS="" CFLAGS="-Kthread $CFLAGS" @@ -1531,14 +1538,11 @@ then fi fi -TOOLS_LIBS="$NON_THREADED_CLIENT_LIBS" - # Should we use named pthread library ? AC_MSG_CHECKING("named thread libs:") if test "$with_named_thread" != "no" then LIBS="$with_named_thread $LIBS $with_named_thread" - TOOLS_LIBS="$with_named_thread $TOOLS_LIBS $with_named_thread" with_posix_threads="yes" with_mit_threads="no" AC_MSG_RESULT("$with_named_thread") @@ -1557,9 +1561,7 @@ else then AC_MSG_CHECKING("for pthread_create in -lpthread"); ac_save_LIBS="$LIBS" - ac_save_TOOLS_LIBS="$TOOLS_LIBS" LIBS="$LIBS -lpthread" - TOOLS_LIBS="$TOOLS_LIBS -lpthread" AC_TRY_LINK( [#include <pthread.h>], [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], @@ -1568,7 +1570,6 @@ else if test "$with_posix_threads" = "no" then LIBS=" $ac_save_LIBS -lpthreads" - TOOLS_LIBS=" $ac_save_TOOLS_LIBS -lpthreads" AC_MSG_CHECKING("for pthread_create in -lpthreads"); AC_TRY_LINK( [#include <pthread.h>], @@ -1579,7 +1580,6 @@ else then # This is for FreeBSD LIBS="$ac_save_LIBS -pthread" - TOOLS_LIBS="$ac_save_TOOLS_LIBS -pthread" AC_MSG_CHECKING("for pthread_create in -pthread"); AC_TRY_LINK( [#include <pthread.h>], @@ -1590,7 +1590,6 @@ else then with_mit_threads="yes" LIBS="$ac_save_LIBS" - TOOLS_LIBS="$ac_save_TOOLS_LIBS" fi fi fi @@ -1676,12 +1675,12 @@ if test "$with_debug" = "yes" then # Medium debug. CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DDBUG_ON -DSAFE_MUTEX $CXXFLAGS" elif test "$with_debug" = "full" then # Full debug. Very slow in some cases - CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" + CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CXXFLAGS" else # Optimized version. No debug CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" @@ -1913,15 +1912,31 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \ localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \ - mkstemp mlockall perror poll pread pthread_attr_create clock_gettime \ + mkstemp mlockall perror poll pread pthread_attr_create \ pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ - realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \ + realpath rename rint rwlock_init setupterm \ + shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ + sighold sigset sigthreadmask \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) +# +# +# +case "$target" in + *-*-aix4* | *-*-sco*) + # (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS) + # and using AC_TRY_RUN is hard when cross-compiling + # We also disable for SCO for the time being, the headers for the + # thread library we use conflicts with other headers. + ;; + *) AC_CHECK_FUNCS(clock_gettime) + ;; +esac + # isinf() could be a function or a macro (HPUX) AC_MSG_CHECKING(for isinf with <math.h>) AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)], @@ -2695,7 +2710,7 @@ case $default_charset in ;; latin1) default_charset_default_collation="latin1_swedish_ci" - default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci" + default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci" ;; latin2) default_charset_default_collation="latin2_general_ci" @@ -2796,6 +2811,24 @@ AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"], AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"], [Define the default charset name]) + +# Shall we build the UCA-based Unicode collations +AC_ARG_WITH(uca, + [ --without-uca Skip building of the national Unicode collations.], + [with_uca=$withval], + [with_uca=yes] +) + +AC_MSG_CHECKING([whether to compile national Unicode collations]) + +if test "$with_uca" = "yes" +then + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_UCA_COLLATIONS], [1], [national Unicode collations]) +else + AC_MSG_RESULT(no) +fi + MYSQL_CHECK_ISAM MYSQL_CHECK_BDB MYSQL_CHECK_INNODB @@ -2813,7 +2846,7 @@ dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. sql_client_dirs="libmysql strings regex client" linked_client_targets="linked_libmysql_sources" -CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS + if test "$THREAD_SAFE_CLIENT" != "no" then sql_client_dirs="libmysql_r $sql_client_dirs" @@ -2821,9 +2854,11 @@ then AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe]) fi -CLIENT_LIBS="$CLIENT_LIBS $STATIC_NSS_FLAGS" +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS" AC_SUBST(CLIENT_LIBS) +AC_SUBST(NON_THREADED_LIBS) +AC_SUBST(STATIC_NSS_FLAGS) AC_SUBST(sql_client_dirs) AC_SUBST(linked_client_targets) @@ -2941,6 +2976,15 @@ EOF AC_CONFIG_SUBDIRS(innobase) fi +case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in + *solaris*-i?86-no-yes) + # ndb fail for whatever strange reason to link Sun Forte/x86 + # unless using incremental linker + CXXFLAGS="$CXXFLAGS -xildon" + ;; + *) ;; +esac + if test X"$have_ndbcluster" = Xyes then if test X"$mysql_cv_compress" != Xyes @@ -2993,6 +3037,20 @@ AC_SUBST(sql_server_dirs) AC_SUBST(thread_dirs) AC_SUBST(server_scripts) +# Now that sql_client_dirs and sql_server_dirs are stable, determine the union. +# Start with the (longer) server list, add each client item not yet present. +sql_union_dirs=" $sql_server_dirs " +for DIR in $sql_client_dirs +do + if echo " $sql_union_dirs " | grep " $DIR " >/dev/null + then + : # already present, skip + else + sql_union_dirs="$sql_union_dirs $DIR " + fi +done +AC_SUBST(sql_union_dirs) + #if test "$with_posix_threads" = "no" -o "$with_mit_threads" = "yes" #then # MIT pthreads does now support connecting with unix sockets @@ -3002,8 +3060,6 @@ AC_SUBST(server_scripts) # Some usefull subst AC_SUBST(CC) AC_SUBST(GXX) -#Remove TOOLS_LIBS, because this is included in LIBRARIES -#AC_SUBST(TOOLS_LIBS) # Set configuration options for make_binary_distribution case $SYSTEM_TYPE in @@ -3020,32 +3076,62 @@ then MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster" CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)" - if test "$with_debug" = "yes" + if test "$have_ndb_debug" = "default" + then + have_ndb_debug=$with_debug + fi + + if test "$have_ndb_debug" = "yes" then # Medium debug. NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" - elif test "$with_debug" = "full" + elif test "$have_ndb_debug" = "full" then NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" else - NDB_DEFS="-DNDEBUG" + # no extra ndb debug but still do asserts if debug version + if test "$with_debug" = "yes" -o "$with_debug" = "full" + then + NDB_DEFS="" + else + NDB_DEFS="-DNDEBUG" + fi fi AC_SUBST([NDB_DEFS]) AC_SUBST([ndb_cxxflags_fix]) +if test X"$ndb_port" = Xdefault +then + ndb_port="1186" +fi +AC_SUBST([ndb_port]) + if test X"$ndb_port_base" = Xdefault then - ndb_port_base="2200" + ndb_port_base="2202" fi AC_SUBST([ndb_port_base]) ndb_transporter_opt_objs="" -if test X"$have_ndb_shm" = Xyes -then - ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" +if test "$ac_cv_func_shmget" = "yes" && + test "$ac_cv_func_shmat" = "yes" && + test "$ac_cv_func_shmdt" = "yes" && + test "$ac_cv_func_shmctl" = "yes" && + test "$ac_cv_func_sigaction" = "yes" && + test "$ac_cv_func_sigemptyset" = "yes" && + test "$ac_cv_func_sigaddset" = "yes" && + test "$ac_cv_func_pthread_sigmask" = "yes" +then + AC_DEFINE([NDB_SHM_TRANSPORTER], [1], + [Including Ndb Cluster DB shared memory transporter]) + AC_MSG_RESULT([Including ndb shared memory transporter]) + ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" +else + AC_MSG_RESULT([Not including ndb shared memory transporter]) fi + if test X"$have_ndb_sci" = Xyes then ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo" @@ -3076,7 +3162,6 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/src/common/logger/Makefile dnl ndb/src/common/transporter/Makefile dnl ndb/src/common/mgmcommon/Makefile dnl - ndb/src/common/editline/Makefile dnl ndb/src/kernel/Makefile dnl ndb/src/kernel/error/Makefile dnl ndb/src/kernel/blocks/Makefile dnl @@ -3092,7 +3177,6 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/src/kernel/blocks/qmgr/Makefile dnl ndb/src/kernel/blocks/trix/Makefile dnl ndb/src/kernel/blocks/backup/Makefile dnl - ndb/src/kernel/blocks/backup/restore/Makefile dnl ndb/src/kernel/blocks/dbutil/Makefile dnl ndb/src/kernel/blocks/suma/Makefile dnl ndb/src/kernel/blocks/grep/Makefile dnl @@ -3110,6 +3194,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/test/ndbapi/bank/Makefile dnl ndb/test/tools/Makefile dnl ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl + ndb/include/ndb_version.h ndb/include/ndb_global.h dnl ) fi @@ -3127,7 +3212,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl sql-common/Makefile SSL/Makefile dnl dbug/Makefile scripts/Makefile dnl include/Makefile sql-bench/Makefile tools/Makefile dnl - tests/Makefile Docs/Makefile support-files/Makefile dnl + tests/Makefile Docs/Makefile Docs/Images/Makefile support-files/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl netware/Makefile dnl include/mysql_version.h dnl diff --git a/dbug/dbug.c b/dbug/dbug.c index 1796d883c5e..02175f8b091 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -227,14 +227,15 @@ static my_bool init_done = FALSE; /* Set to TRUE when initialization done */ static struct state *stack=0; typedef struct st_code_state { - int lineno; /* Current debugger output line number */ - int level; /* Current function nesting level */ const char *func; /* Name of current user function */ const char *file; /* Name of current user file */ char **framep; /* Pointer to current frame */ - int jmplevel; /* Remember nesting level at setjmp () */ const char *jmpfunc; /* Remember current function for setjmp */ const char *jmpfile; /* Remember current file for setjmp */ + int lineno; /* Current debugger output line number */ + int level; /* Current function nesting level */ + int disable_output; /* Set to it if output is disabled */ + int jmplevel; /* Remember nesting level at setjmp () */ /* * The following variables are used to hold the state information @@ -247,8 +248,8 @@ typedef struct st_code_state { */ uint u_line; /* User source code line number */ - const char *u_keyword; /* Keyword for current macro */ int locked; /* If locked with _db_lock_file */ + const char *u_keyword; /* Keyword for current macro */ } CODE_STATE; /* Parse a debug command string */ @@ -370,8 +371,10 @@ static CODE_STATE *code_state(void) #define code_state() (&static_code_state) #define pthread_mutex_lock(A) {} #define pthread_mutex_unlock(A) {} -static CODE_STATE static_code_state = { 0,0,"?func","?file",NULL,0,NULL, - NULL,0,"?",0}; +static CODE_STATE static_code_state= +{ + "?func", "?file", NULL, NullS, NullS, 0,0,0,0,0,0, NullS +}; #endif @@ -728,9 +731,12 @@ char ***_sframep_ __attribute__((unused))) if (DoProfile ()) { long stackused; - if (*state->framep == NULL) { + if (*state->framep == NULL) + { stackused = 0; - } else { + } + else + { stackused = ((long)(*state->framep)) - ((long)(state->framep)); stackused = stackused > 0 ? stackused : -stackused; } @@ -744,7 +750,7 @@ char ***_sframep_ __attribute__((unused))) (void) fflush (_db_pfp_); } #endif - if (DoTrace (state)) + if (DoTrace(state)) { if (!state->locked) pthread_mutex_lock(&THR_LOCK_dbug); @@ -754,7 +760,7 @@ char ***_sframep_ __attribute__((unused))) dbug_flush (state); /* This does a unlock */ } #ifdef SAFEMALLOC - if (stack -> flags & SANITY_CHECK_ON) + if (stack->flags & SANITY_CHECK_ON && !state->disable_output) if (_sanity(_file_,_line_)) /* Check of safemalloc */ stack -> flags &= ~SANITY_CHECK_ON; #endif @@ -809,9 +815,11 @@ uint *_slevel_) else { #ifdef SAFEMALLOC - if (stack -> flags & SANITY_CHECK_ON) + if (stack->flags & SANITY_CHECK_ON && !state->disable_output) + { if (_sanity(*_sfile_,_line_)) stack->flags &= ~SANITY_CHECK_ON; + } #endif #ifndef THREAD if (DoProfile ()) @@ -954,7 +962,6 @@ uint length) int pos; char dbuff[90]; CODE_STATE *state; - /* Sasha: pre-my_thread_init() safety */ if (!(state=code_state())) return; @@ -994,6 +1001,25 @@ uint length) } } + +/* + Enable/Disable output for this thread + + SYNOPSIS + _db_output_() + flag 1 = enable output, 0 = disable_output + +*/ + +void _db_output_(uint flag) +{ + CODE_STATE *state; + if (!(state=code_state())) + return; + state->disable_output= !flag; +} + + /* * FUNCTION * @@ -1159,7 +1185,7 @@ static BOOLEAN DoTrace (CODE_STATE *state) { reg2 BOOLEAN trace=FALSE; - if (TRACING && + if (TRACING && !state->disable_output && state->level <= stack -> maxdepth && InList (stack -> functions, state->func) && InList (stack -> processes, _db_process_)) @@ -1195,7 +1221,7 @@ static BOOLEAN DoProfile () state=code_state(); profile = FALSE; - if (PROFILING && + if (PROFILING && !state->disable_output && state->level <= stack -> maxdepth && InList (stack -> p_functions, state->func) && InList (stack -> processes, _db_process_)) @@ -1242,7 +1268,7 @@ const char *keyword) if (!(state=code_state())) return FALSE; result = FALSE; - if (DEBUGGING && + if (DEBUGGING && !state->disable_output && state->level <= stack -> maxdepth && InList (stack -> functions, state->func) && InList (stack -> keywords, keyword) && diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index f4da839f8e2..d5836cb0dc8 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -55,6 +55,9 @@ static struct my_option my_long_options[] = {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; + +#include <help_start.h> + static void usage(my_bool version) { printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, @@ -69,6 +72,8 @@ static void usage(my_bool version) printf("\nExample usage:\n%s --config-file=my client mysql\n", my_progname); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), @@ -115,25 +120,33 @@ int main(int argc, char **argv) int count, error; char **load_default_groups, *tmp_arguments[2], **argument, **arguments; + char *defaults, *extra_defaults; MY_INIT(argv[0]); + get_defaults_files(argc, argv, &defaults, &extra_defaults); + /* ** Check out the args */ - if (get_options(&argc,&argv)) - exit(1); if (!(load_default_groups=(char**) my_malloc((argc+2)*sizeof(char*), MYF(MY_WME)))) exit(1); + if (get_options(&argc,&argv)) + exit(1); for (count=0; *argv ; argv++,count++) load_default_groups[count]= *argv; load_default_groups[count]=0; - count=1; + count=0; arguments=tmp_arguments; - arguments[0]=my_progname; - arguments[1]=0; + arguments[count++]=my_progname; + if (extra_defaults) + arguments[count++]= extra_defaults; + if (defaults) + arguments[count++]= defaults; + arguments[count]= 0; + if ((error= load_defaults(config_file, (const char **) load_default_groups, &count, &arguments))) { diff --git a/extra/perror.c b/extra/perror.c index a28626fd873..6e632b20d96 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -69,7 +69,7 @@ static HA_ERRORS ha_errlist[]= { { 120,"Didn't find key on read or update" }, { 121,"Duplicate key on write or update" }, - { 123,"Someone has changed the row since it was read; Update with is recoverable" }, + { 123,"Someone has changed the row since it was read (while the table was locked to prevent it)" }, { 124,"Wrong index given to function" }, { 126,"Index file is crashed" }, { 127,"Record-file is crashed" }, @@ -113,12 +113,15 @@ static HA_ERRORS ha_errlist[]= }; +#include <help_start.h> + static void print_version(void) { printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION, SYSTEM_TYPE,MACHINE_TYPE); } + static void usage(void) { print_version(); @@ -130,6 +133,8 @@ static void usage(void) my_print_variables(my_long_options); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), @@ -184,6 +189,7 @@ int main(int argc,char *argv[]) { int error,code,found; const char *msg; + char *unknown_error = 0; MY_INIT(argv[0]); if (get_options(&argc,&argv)) @@ -212,7 +218,14 @@ int main(int argc,char *argv[]) string 'Unknown Error'. To avoid printing it we try to find the error string by asking for an impossible big error message. */ - const char *unknown_error= strerror(10000); + msg= strerror(10000); + + /* + Allocate a buffer for unknown_error since strerror always returns + the same pointer on some platforms such as Windows + */ + unknown_error= malloc(strlen(msg)+1); + strmov(unknown_error, msg); for ( ; argc-- > 0 ; argv++) { @@ -232,16 +245,17 @@ int main(int argc,char *argv[]) msg = strerror(code); /* - Don't print message for not existing error messages or for - unknown errors. We test for 'Uknown Errors' just as an - extra safety for Netware + We don't print the OS error message if it is the same as the + unknown_error message we retrieved above, or it starts with + 'Unknown Error' (without regard to case). */ - if (msg && strcmp(msg, "Unknown Error") && + if (msg && + my_strnncoll(&my_charset_latin1, msg, 13, "Unknown Error", 13) && (!unknown_error || strcmp(msg, unknown_error))) { found=1; if (verbose) - printf("Error code %3d: %s\n",code,msg); + printf("OS error code %3d: %s\n",code,msg); else puts(msg); } @@ -256,12 +270,17 @@ int main(int argc,char *argv[]) else { if (verbose) - printf("MySQL error: %3d = %s\n",code,msg); + printf("MySQL error code %3d: %s\n",code,msg); else puts(msg); } } } + + /* if we allocated a buffer for unknown_error, free it now */ + if (unknown_error) + free(unknown_error); + exit(error); return error; } diff --git a/extra/replace.c b/extra/replace.c index 5a086e5ca9c..98945ed35b3 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -376,8 +376,8 @@ static REP_SET *make_new_set(REP_SETS *sets); static void make_sets_invisible(REP_SETS *sets); static void free_last_set(REP_SETS *sets); static void free_sets(REP_SETS *sets); -static void set_bit(REP_SET *set, uint bit); -static void clear_bit(REP_SET *set, uint bit); +static void internal_set_bit(REP_SET *set, uint bit); +static void internal_clear_bit(REP_SET *set, uint bit); static void or_bits(REP_SET *to,REP_SET *from); static void copy_bits(REP_SET *to,REP_SET *from); static int cmp_bits(REP_SET *set1,REP_SET *set2); @@ -454,7 +454,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, { if (from[i][0] == '\\' && from[i][1] == '^') { - set_bit(start_states,states+1); + internal_set_bit(start_states,states+1); if (!from[i][2]) { start_states->table_offset=i; @@ -463,8 +463,8 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, } else if (from[i][0] == '\\' && from[i][1] == '$') { - set_bit(start_states,states); - set_bit(word_states,states); + internal_set_bit(start_states,states); + internal_set_bit(word_states,states); if (!from[i][2] && start_states->table_offset == (uint) ~0) { start_states->table_offset=i; @@ -473,11 +473,11 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, } else { - set_bit(word_states,states); + internal_set_bit(word_states,states); if (from[i][0] == '\\' && (from[i][1] == 'b' && from[i][2])) - set_bit(start_states,states+1); + internal_set_bit(start_states,states+1); else - set_bit(start_states,states); + internal_set_bit(start_states,states); } for (pos=from[i], len=0; *pos ; pos++) { @@ -583,9 +583,9 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, follow[i].len > found_end) found_end=follow[i].len; if (chr && follow[i].chr) - set_bit(new_set,i+1); /* To next set */ + internal_set_bit(new_set,i+1); /* To next set */ else - set_bit(new_set,i); + internal_set_bit(new_set,i); } } if (found_end) @@ -602,7 +602,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, if (follow[bit_nr-1].len < found_end || (new_set->found_len && (chr == 0 || !follow[bit_nr].chr))) - clear_bit(new_set,i); + internal_clear_bit(new_set,i); else { if (chr == 0 || !follow[bit_nr].chr) @@ -751,13 +751,13 @@ static void free_sets(REP_SETS *sets) return; } -static void set_bit(REP_SET *set, uint bit) +static void internal_set_bit(REP_SET *set, uint bit) { set->bits[bit / WORD_BIT] |= 1 << (bit % WORD_BIT); return; } -static void clear_bit(REP_SET *set, uint bit) +static void internal_clear_bit(REP_SET *set, uint bit) { set->bits[bit / WORD_BIT] &= ~ (1 << (bit % WORD_BIT)); return; diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index 06a670b935d..666125990d2 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -65,12 +65,16 @@ static struct my_option my_long_options[] = static void verify_sort(); + +#include <help_start.h> + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); } + static void usage() { print_version(); @@ -87,6 +91,7 @@ The numeric-dump-file should contain a numeric stack trace from mysqld.\n\ If the numeric-dump-file is not given, the stack trace is read from stdin.\n"); } +#include <help_end.h> static void die(const char* fmt, ...) diff --git a/heap/_check.c b/heap/_check.c index 233cb8cb0c5..a745aee48bf 100644 --- a/heap/_check.c +++ b/heap/_check.c @@ -102,9 +102,11 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, int error; uint i,found,max_links,seek,links; uint rec_link; /* Only used with debugging */ + uint hash_buckets_found; HASH_INFO *hash_info; error=0; + hash_buckets_found= 0; for (i=found=max_links=seek=0 ; i < records ; i++) { hash_info=hp_find_hash(&keydef->block,i); @@ -128,21 +130,32 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, found++; } if (links > max_links) max_links=links; + hash_buckets_found++; } } if (found != records) { - DBUG_PRINT("error",("Found %ld of %ld records")); + DBUG_PRINT("error",("Found %ld of %ld records", found, records)); + error=1; + } + if (keydef->hash_buckets != hash_buckets_found) + { + DBUG_PRINT("error",("Found %ld buckets, stats shows %ld buckets", + hash_buckets_found, keydef->hash_buckets)); error=1; } DBUG_PRINT("info", - ("records: %ld seeks: %d max links: %d hitrate: %.2f", + ("records: %ld seeks: %d max links: %d hitrate: %.2f " + "buckets: %d", records,seek,max_links, - (float) seek / (float) (records ? records : 1))); + (float) seek / (float) (records ? records : 1), + hash_buckets_found)); if (print_status) - printf("Key: %d records: %ld seeks: %d max links: %d hitrate: %.2f\n", + printf("Key: %d records: %ld seeks: %d max links: %d " + "hitrate: %.2f buckets: %d\n", keynr, records, seek, max_links, - (float) seek / (float) (records ? records : 1)); + (float) seek / (float) (records ? records : 1), + hash_buckets_found); return error; } diff --git a/heap/hp_block.c b/heap/hp_block.c index 6a022fb3084..f26b208b521 100644 --- a/heap/hp_block.c +++ b/heap/hp_block.c @@ -18,12 +18,19 @@ #include "heapdef.h" - /* Find record according to record-position */ +/* + Find record according to record-position. + + The record is located by factoring position number pos into (p_0, p_1, ...) + such that + pos = SUM_i(block->level_info[i].records_under_level * p_i) + {p_0, p_1, ...} serve as indexes to descend the blocks tree. +*/ byte *hp_find_block(HP_BLOCK *block, ulong pos) { reg1 int i; - reg3 HP_PTRS *ptr; + reg3 HP_PTRS *ptr; /* block base ptr */ for (i=block->levels-1, ptr=block->root ; i > 0 ; i--) { @@ -34,8 +41,18 @@ byte *hp_find_block(HP_BLOCK *block, ulong pos) } - /* get one new block-of-records. Alloc ptr to block if neaded */ - /* Interrupts are stopped to allow ha_panic in interrupts */ +/* + Get one new block-of-records. Alloc ptr to block if needed + SYNOPSIS + hp_get_new_block() + block HP_BLOCK tree-like block + alloc_length OUT Amount of memory allocated from the heap + + Interrupts are stopped to allow ha_panic in interrupts + RETURN + 0 OK + 1 Out of memory +*/ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length) { @@ -46,6 +63,18 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length) if (block->level_info[i].free_ptrs_in_block) break; + /* + Allocate space for leaf block plus space for upper level blocks up to + first level that has a free slot to put the pointer. + In some cases we actually allocate more then we need: + Consider e.g. a situation where we have one level 1 block and one level 0 + block, the level 0 block is full and this function is called. We only + need a leaf block in this case. Nevertheless, we will get here with i=1 + and will also allocate sizeof(HP_PTRS) for non-leaf block and will never + use this space. + This doesn't add much overhead - with current values of sizeof(HP_PTRS) + and my_default_record_cache_size we get about 1/128 unused memory. + */ *alloc_length=sizeof(HP_PTRS)*i+block->records_in_block* block->recbuffer; if (!(root=(HP_PTRS*) my_malloc(*alloc_length,MYF(0)))) return 1; @@ -60,21 +89,33 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length) dont_break(); /* Dont allow SIGHUP or SIGINT */ if ((uint) i == block->levels) { + /* Adding a new level on top of the existing ones. */ block->levels=i+1; + /* + Use first allocated HP_PTRS as a top-level block. Put the current + block tree into the first slot of a new top-level block. + */ block->level_info[i].free_ptrs_in_block=HP_PTRS_IN_NOD-1; ((HP_PTRS**) root)[0]= block->root; block->root=block->level_info[i].last_blocks= root++; } + /* Occupy the free slot we've found at level i */ block->level_info[i].last_blocks-> blocks[HP_PTRS_IN_NOD - block->level_info[i].free_ptrs_in_block--]= (byte*) root; - + + /* Add a block subtree with each node having one left-most child */ for (j=i-1 ; j >0 ; j--) { block->level_info[j].last_blocks= root++; block->level_info[j].last_blocks->blocks[0]=(byte*) root; block->level_info[j].free_ptrs_in_block=HP_PTRS_IN_NOD-1; } + + /* + root now points to last (block->records_in_block* block->recbuffer) + allocated bytes. Use it as a leaf block. + */ block->level_info[0].last_blocks= root; allow_break(); /* Allow SIGHUP & SIGINT */ } diff --git a/heap/hp_clear.c b/heap/hp_clear.c index 4440344f990..596d71ebe9c 100644 --- a/heap/hp_clear.c +++ b/heap/hp_clear.c @@ -97,6 +97,7 @@ void hp_clear_keys(HP_SHARE *info) VOID(hp_free_level(block,block->levels,block->root,(byte*) 0)); block->levels=0; block->last_allocated=0; + keyinfo->hash_buckets= 0; } } info->index_length=0; diff --git a/heap/hp_create.c b/heap/hp_create.c index 02725576c8f..af32fefea1b 100644 --- a/heap/hp_create.c +++ b/heap/hp_create.c @@ -41,6 +41,13 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, { HP_KEYDEF *keyinfo; DBUG_PRINT("info",("Initializing new table")); + + /* + We have to store sometimes byte* del_link in records, + so the record length should be at least sizeof(byte*) + */ + set_if_bigger(reclength, sizeof (byte*)); + for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++) { bzero((char*) &keyinfo->block,sizeof(keyinfo->block)); @@ -116,22 +123,24 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, keyseg->flag= 0; keyseg->null_bit= 0; keyseg++; - - init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*), + + init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*), (qsort_cmp2)keys_compare, 1, NULL, NULL); keyinfo->delete_key= hp_rb_delete_key; keyinfo->write_key= hp_rb_write_key; } else { - init_block(&keyinfo->block, sizeof(HASH_INFO), min_records, + init_block(&keyinfo->block, sizeof(HASH_INFO), min_records, max_records); keyinfo->delete_key= hp_delete_key; keyinfo->write_key= hp_write_key; + keyinfo->hash_buckets= 0; } } share->min_records= min_records; share->max_records= max_records; + share->max_table_size= create_info->max_table_size; share->data_length= share->index_length= 0; share->reclength= reclength; share->blength= 1; diff --git a/heap/hp_delete.c b/heap/hp_delete.c index c918cf37f05..9cf8b8936b6 100644 --- a/heap/hp_delete.c +++ b/heap/hp_delete.c @@ -97,8 +97,8 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, flag Is set if we want's to correct info->current_ptr RETURN - 0 ok - # error number + 0 Ok + other Error code */ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, @@ -151,6 +151,8 @@ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, pos->ptr_to_rec=empty->ptr_to_rec; pos->next_key=empty->next_key; } + else + keyinfo->hash_buckets--; if (empty == lastpos) /* deleted last hash key */ DBUG_RETURN (0); @@ -187,7 +189,11 @@ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, } pos3= pos; /* Link pos->next after lastpos */ } - else pos3= 0; /* Different positions merge */ + else + { + pos3= 0; /* Different positions merge */ + keyinfo->hash_buckets--; + } empty[0]=lastpos[0]; hp_movelink(pos3, empty, pos->next_key); diff --git a/heap/hp_hash.c b/heap/hp_hash.c index b54e76d79fe..ee5b4958e62 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -196,7 +196,18 @@ byte *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key, } - /* Calculate pos according to keys */ +/* + Calculate position number for hash value. + SYNOPSIS + hp_mask() + hashnr Hash value + buffmax Value such that + 2^(n-1) < maxlength <= 2^n = buffmax + maxlength + + RETURN + Array index, in [0..maxlength) +*/ ulong hp_mask(ulong hashnr, ulong buffmax, ulong maxlength) { @@ -205,7 +216,12 @@ ulong hp_mask(ulong hashnr, ulong buffmax, ulong maxlength) } - /* Change link from pos to new_link */ +/* + Change + next_link -> ... -> X -> pos + to + next_link -> ... -> X -> newlink +*/ void hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink) { diff --git a/heap/hp_rfirst.c b/heap/hp_rfirst.c index 1668376ed1c..85548fea212 100644 --- a/heap/hp_rfirst.c +++ b/heap/hp_rfirst.c @@ -52,6 +52,7 @@ int heap_rfirst(HP_INFO *info, byte *record, int inx) my_errno=HA_ERR_END_OF_FILE; DBUG_RETURN(my_errno); } + DBUG_ASSERT(0); /* TODO fix it */ info->current_record=0; info->current_hash_ptr=0; info->update=HA_STATE_PREV_FOUND; diff --git a/heap/hp_write.c b/heap/hp_write.c index 3b0ec76d616..808fe6608b1 100644 --- a/heap/hp_write.c +++ b/heap/hp_write.c @@ -36,7 +36,6 @@ int heap_write(HP_INFO *info, const byte *record) byte *pos; HP_SHARE *share=info->s; DBUG_ENTER("heap_write"); - #ifndef DBUG_OFF if (info->mode & O_RDONLY) { @@ -144,7 +143,8 @@ static byte *next_free_record_pos(HP_SHARE *info) } if (!(block_pos=(info->records % info->block.records_in_block))) { - if (info->records > info->max_records && info->max_records) + if ((info->records > info->max_records && info->max_records) || + (info->data_length + info->index_length >= info->max_table_size)) { my_errno=HA_ERR_RECORD_FILE_FULL; DBUG_RETURN(NULL); @@ -160,7 +160,31 @@ static byte *next_free_record_pos(HP_SHARE *info) block_pos*info->block.recbuffer); } - /* Write a hash-key to the hash-index */ + +/* + Write a hash-key to the hash-index + SYNOPSIS + info Heap table info + keyinfo Key info + record Table record to added + recpos Memory buffer where the table record will be stored if added + successfully + NOTE + Hash index uses HP_BLOCK structure as a 'growable array' of HASH_INFO + structs. Array size == number of entries in hash index. + hp_mask(hp_rec_hashnr()) maps hash entries values to hash array positions. + If there are several hash entries with the same hash array position P, + they are connected in a linked list via HASH_INFO::next_key. The first + list element is located at position P, next elements are located at + positions for which there is no record that should be located at that + position. The order of elements in the list is arbitrary. + + RETURN + 0 - OK + -1 - Out of memory + HA_ERR_FOUND_DUPP_KEY - Duplicate record on unique key. The record was + still added and the caller must call hp_delete_key for it. +*/ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record, byte *recpos) @@ -180,19 +204,54 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, DBUG_RETURN(-1); /* No more memory */ halfbuff= (long) share->blength >> 1; pos= hp_find_hash(&keyinfo->block,(first_index=share->records-halfbuff)); - + + /* + We're about to add one more hash array position, with hash_mask=#records. + The number of hash positions will change and some entries might need to + be relocated to the newly added position. Those entries are currently + members of the list that starts at #first_index position (this is + guaranteed by properties of hp_mask(hp_rec_hashnr(X)) mapping function) + At #first_index position currently there may be either: + a) An entry with hashnr != first_index. We don't need to move it. + or + b) A list of items with hash_mask=first_index. The list contains entries + of 2 types: + 1) entries that should be relocated to the list that starts at new + position we're adding ('uppper' list) + 2) entries that should be left in the list starting at #first_index + position ('lower' list) + */ if (pos != empty) /* If some records */ { do { hashnr = hp_rec_hashnr(keyinfo, pos->ptr_to_rec); - if (flag == 0) /* First loop; Check if ok */ + if (flag == 0) + { + /* + First loop, bail out if we're dealing with case a) from above + comment + */ if (hp_mask(hashnr, share->blength, share->records) != first_index) break; + } + /* + flag & LOWFIND - found a record that should be put into lower position + flag & LOWUSED - lower position occupied by the record + Same for HIGHFIND and HIGHUSED and 'upper' position + + gpos - ptr to last element in lower position's list + gpos2 - ptr to last element in upper position's list + + ptr_to_rec - ptr to last entry that should go into lower list. + ptr_to_rec2 - same for upper list. + */ if (!(hashnr & halfbuff)) - { /* Key will not move */ + { + /* Key should be put into 'lower' list */ if (!(flag & LOWFIND)) { + /* key is the first element to go into lower position */ if (flag & HIGHFIND) { flag=LOWFIND | HIGHFIND; @@ -203,16 +262,21 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } else { - flag=LOWFIND | LOWUSED; /* key isn't changed */ + /* + We can only get here at first iteration: key is at 'lower' + position pos and should be left here. + */ + flag=LOWFIND | LOWUSED; gpos=pos; ptr_to_rec=pos->ptr_to_rec; } } else - { + { + /* Already have another key for lower position */ if (!(flag & LOWUSED)) { - /* Change link of previous LOW-key */ + /* Change link of previous lower-list key */ gpos->ptr_to_rec=ptr_to_rec; gpos->next_key=pos; flag= (flag & HIGHFIND) | (LOWFIND | LOWUSED); @@ -222,19 +286,21 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } } else - { /* key will be moved */ + { + /* key will be put into 'higher' list */ if (!(flag & HIGHFIND)) { flag= (flag & LOWFIND) | HIGHFIND; /* key shall be moved to the last (empty) position */ - gpos2 = empty; empty=pos; + gpos2= empty; + empty= pos; ptr_to_rec2=pos->ptr_to_rec; } else { if (!(flag & HIGHUSED)) { - /* Change link of previous hash-key and save */ + /* Change link of previous upper-list key and save */ gpos2->ptr_to_rec=ptr_to_rec2; gpos2->next_key=pos; flag= (flag & LOWFIND) | (HIGHFIND | HIGHUSED); @@ -245,6 +311,15 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } } while ((pos=pos->next_key)); + + if ((flag & (LOWFIND | HIGHFIND)) == (LOWFIND | HIGHFIND)) + { + /* + If both 'higher' and 'lower' list have at least one element, now + there are two hash buckets instead of one. + */ + keyinfo->hash_buckets++; + } if ((flag & (LOWFIND | LOWUSED)) == LOWFIND) { @@ -265,6 +340,7 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, { pos->ptr_to_rec=recpos; pos->next_key=0; + keyinfo->hash_buckets++; } else { @@ -280,6 +356,7 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } else { + keyinfo->hash_buckets++; pos->ptr_to_rec=recpos; pos->next_key=0; hp_movelink(pos, gpos, empty); diff --git a/include/config-win.h b/include/config-win.h index d28bb25cd09..472190e53ca 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -31,18 +31,25 @@ functions */ #define HAVE_SMEM 1 -#if defined(__NT__) -#define SYSTEM_TYPE "NT" -#elif defined(__WIN2000__) -#define SYSTEM_TYPE "WIN2000" +#if defined(_WIN64) || defined(WIN64) +#define SYSTEM_TYPE "Win64" +#elif defined(_WIN32) || defined(WIN32) +#define SYSTEM_TYPE "Win32" #else -#define SYSTEM_TYPE "Win95/Win98" +#define SYSTEM_TYPE "Windows" #endif -#if defined(_WIN64) || defined(WIN64) -#define MACHINE_TYPE "ia64" /* Define to machine type name */ +#if defined(_M_IA64) +#define MACHINE_TYPE "ia64" +#elif defined(_M_IX86) +#define MACHINE_TYPE "ia32" +#elif defined(_M_ALPHA) +#define MACHINE_TYPE "axp" #else -#define MACHINE_TYPE "i32" /* Define to machine type name */ +#define MACHINE_TYPE "unknown" /* Define to machine type name */ +#endif + +#if !(defined(_WIN64) || defined(WIN64)) #ifndef _WIN32 #define _WIN32 /* Compatible with old source */ #endif @@ -175,6 +182,8 @@ typedef uint rf_SetTimer; #define sigset(A,B) signal((A),(B)) #define finite(A) _finite(A) #define sleep(A) Sleep((A)*1000) +#define popen(A) popen(A,B) _popen((A),(B)) +#define pclose(A) _pclose(A) #ifndef __BORLANDC__ #define access(A,B) _access(A,B) @@ -393,4 +402,5 @@ inline double ulonglong2double(ulonglong value) #define HAVE_CHARSET_ucs2 1 #define HAVE_CHARSET_ujis 1 #define HAVE_CHARSET_utf8 1 +#define HAVE_UCA_COLLATIONS 1 diff --git a/include/errmsg.h b/include/errmsg.h index 6115b24a3d8..96977227666 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -90,3 +90,4 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SECURE_AUTH 2049 #define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 +#define CR_NO_STMT_METADATA 2052 diff --git a/include/ft_global.h b/include/ft_global.h index 94f6ad9ef51..c3f60d13a7a 100644 --- a/include/ft_global.h +++ b/include/ft_global.h @@ -62,7 +62,7 @@ void ft_free_stopwords(void); #define FT_SORTED 2 #define FT_EXPAND 4 /* query expansion */ -FT_INFO *ft_init_search(uint,void *, uint, byte *, uint, byte *); +FT_INFO *ft_init_search(uint,void *, uint, byte *, uint,CHARSET_INFO *, byte *); my_bool ft_boolean_check_syntax_string(const byte *); #ifdef __cplusplus diff --git a/include/hash.h b/include/hash.h index cd7210a290c..9a6d91036e1 100644 --- a/include/hash.h +++ b/include/hash.h @@ -47,7 +47,7 @@ my_bool _hash_init(HASH *hash, CHARSET_INFO *charset, uint key_length, hash_get_key get_key, void (*free_element)(void*), uint flags CALLER_INFO_PROTO); void hash_free(HASH *tree); -void hash_reset(HASH *hash); +void my_hash_reset(HASH *hash); byte *hash_element(HASH *hash,uint idx); gptr hash_search(HASH *info,const byte *key,uint length); gptr hash_next(HASH *info,const byte *key,uint length); diff --git a/include/heap.h b/include/heap.h index 63f2abbabc7..ac2b38d1f2d 100644 --- a/include/heap.h +++ b/include/heap.h @@ -63,18 +63,48 @@ typedef struct st_heap_ptrs struct st_level_info { - uint free_ptrs_in_block,records_under_level; - HP_PTRS *last_blocks; /* pointers to HP_PTRS or records */ + /* Number of unused slots in *last_blocks HP_PTRS block (0 for 0th level) */ + uint free_ptrs_in_block; + + /* + Maximum number of records that can be 'contained' inside of each element + of last_blocks array. For level 0 - 1, for level 1 - HP_PTRS_IN_NOD, for + level 2 - HP_PTRS_IN_NOD^2 and so forth. + */ + uint records_under_level; + + /* + Ptr to last allocated HP_PTRS (or records buffer for level 0) on this + level. + */ + HP_PTRS *last_blocks; }; -typedef struct st_heap_block /* The data is saved in blocks */ + +/* + Heap table records and hash index entries are stored in HP_BLOCKs. + HP_BLOCK is used as a 'growable array' of fixed-size records. Size of record + is recbuffer bytes. + The internal representation is as follows: + HP_BLOCK is a hierarchical structure of 'blocks'. + A block at level 0 is an array records_in_block records. + A block at higher level is an HP_PTRS structure with pointers to blocks at + lower levels. + At the highest level there is one top block. It is stored in HP_BLOCK::root. + + See hp_find_block for a description of how record pointer is obtained from + its index. + See hp_get_new_block +*/ + +typedef struct st_heap_block { - HP_PTRS *root; + HP_PTRS *root; /* Top-level block */ struct st_level_info level_info[HP_MAX_LEVELS+1]; - uint levels; - uint records_in_block; /* Records in a heap-block */ + uint levels; /* number of used levels */ + uint records_in_block; /* Records in one heap-block */ uint recbuffer; /* Length of one saved record */ - ulong last_allocated; /* Blocks allocated, used by keys */ + ulong last_allocated; /* number of records there is allocated space for */ } HP_BLOCK; struct st_heap_info; /* For referense */ @@ -87,11 +117,16 @@ typedef struct st_hp_keydef /* Key definition with open */ uint8 algorithm; /* HASH / BTREE */ HA_KEYSEG *seg; HP_BLOCK block; /* Where keys are saved */ + /* + Number of buckets used in hash table. Used only to provide + #records estimates for heap key scans. + */ + ha_rows hash_buckets; TREE rb_tree; int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, const byte *record, byte *recpos); - int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, - const byte *record, byte *recpos, int flag); + int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, + const byte *record, byte *recpos, int flag); uint (*get_key_length)(struct st_hp_keydef *keydef, const byte *key); } HP_KEYDEF; @@ -100,9 +135,9 @@ typedef struct st_heap_share HP_BLOCK block; HP_KEYDEF *keydef; ulong min_records,max_records; /* Params to open */ - ulong data_length,index_length; + ulong data_length,index_length,max_table_size; uint records; /* records */ - uint blength; + uint blength; /* records rounded up to 2^n */ uint deleted; /* Deleted records in database */ uint reclength; /* Length of one record */ uint changed; @@ -150,6 +185,7 @@ typedef struct st_heap_create_info { uint auto_key; uint auto_key_type; + ulong max_table_size; ulonglong auto_increment; } HP_CREATE_INFO; diff --git a/include/help_end.h b/include/help_end.h index a63d9e7ca9f..3bd16c09e3b 100644 --- a/include/help_end.h +++ b/include/help_end.h @@ -2,5 +2,6 @@ #undef printf #undef puts #undef fputs +#undef fputc #undef putchar #endif diff --git a/include/help_start.h b/include/help_start.h index 38bb91f7655..7ffde1ab803 100644 --- a/include/help_start.h +++ b/include/help_start.h @@ -4,4 +4,6 @@ #define printf consoleprintf #define puts(s) consoleprintf("%s\n",s) #define fputs(s,f) puts(s) +#define fputc(s,f) consoleprintf("%c", s) +#define putchar(s) consoleprintf("%c", s) #endif diff --git a/include/keycache.h b/include/keycache.h index 26ee0ccadb1..a292a69b0a3 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -88,12 +88,13 @@ typedef struct st_key_cache ulong param_division_limit; /* min. percentage of warm blocks */ ulong param_age_threshold; /* determines when hot block is downgraded */ - /* Statistics variables */ + /* Statistics variables. These are reset in reset_key_cache_counters(). */ ulong global_blocks_changed; /* number of currently dirty blocks */ ulong global_cache_w_requests;/* number of write requests (write hits) */ ulong global_cache_write; /* number of writes from the cache to files */ ulong global_cache_r_requests;/* number of read requests (read hits) */ ulong global_cache_read; /* number of reads from files to the cache */ + int blocks; /* max number of blocks in the cache */ my_bool in_init; /* Set to 1 in MySQL during init/resize */ } KEY_CACHE; @@ -132,5 +133,7 @@ extern my_bool multi_key_cache_set(const byte *key, uint length, KEY_CACHE *key_cache); extern void multi_key_cache_change(KEY_CACHE *old_data, KEY_CACHE *new_data); +extern int reset_key_cache_counters(const char *name, + KEY_CACHE *key_cache); C_MODE_END #endif /* _keycache_h */ diff --git a/include/m_ctype.h b/include/m_ctype.h index ddc21070547..26e285b9683 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -63,7 +63,7 @@ typedef struct unicase_info_st #define MY_CS_UNICODE 128 /* is a charset is full unicode */ #define MY_CS_READY 256 /* if a charset is initialized */ #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ - +#define MY_CS_CSSORT 1024 /* if case sensitive sort order */ #define MY_CHARSET_UNDEFINED 0 diff --git a/include/m_string.h b/include/m_string.h index 97d34421537..d3465363beb 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -215,7 +215,7 @@ extern char *strstr(const char *, const char *); extern int is_prefix(const char *, const char *); /* Conversion routines */ -double my_strtod(const char *str, char **end); +double my_strtod(const char *str, char **end, int *error); double my_atof(const char *nptr); extern char *llstr(longlong value,char *buff); diff --git a/include/my_base.h b/include/my_base.h index d884113dc4d..d702ec45140 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -291,6 +291,7 @@ enum ha_base_keytype { #define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */ #define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */ #define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ +#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */ /* Other constants */ @@ -339,6 +340,7 @@ enum ha_base_keytype { #define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */ #define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */ #define HA_STATE_EXTEND_BLOCK 2048 +#define HA_STATE_RNEXT_SAME 4096 /* rnext_same was called */ enum en_fieldtype { FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE, diff --git a/include/my_dbug.h b/include/my_dbug.h index 9174a8b1ef9..711ece4335c 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -38,6 +38,7 @@ extern void _db_pargs_(uint _line_,const char *keyword); extern void _db_doprnt_ _VARARGS((const char *format,...)); extern void _db_dump_(uint _line_,const char *keyword,const char *memory, uint length); +extern void _db_output_(); extern void _db_lock_file(); extern void _db_unlock_file(); @@ -66,6 +67,7 @@ extern void _db_unlock_file(); #define DEBUGGER_ON _no_db_=0 #define DBUG_LOCK_FILE { _db_lock_file(); } #define DBUG_UNLOCK_FILE { _db_unlock_file(); } +#define DBUG_OUTPUT(A) { _db_output_(A); } #define DBUG_ASSERT(A) assert(A) #else /* No debugger */ @@ -86,6 +88,7 @@ extern void _db_unlock_file(); #define DEBUGGER_ON #define DBUG_LOCK_FILE #define DBUG_UNLOCK_FILE +#define DBUG_OUTPUT(A) #define DBUG_ASSERT(A) {} #endif #ifdef __cplusplus diff --git a/include/my_global.h b/include/my_global.h index f6200830ee3..7ca3d5e1e58 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -135,7 +135,13 @@ #ifdef HAVE_UNIXWARE7_THREADS #include <thread.h> #else +#if defined(HPUX10) || defined(HPUX11) +C_MODE_START /* HPUX needs this, signal.h bug */ +#include <pthread.h> +C_MODE_END +#else #include <pthread.h> /* AIX must have this included first */ +#endif #endif /* HAVE_UNIXWARE7_THREADS */ #endif /* HAVE_mit_thread */ #if !defined(SCO) && !defined(_REENTRANT) @@ -194,10 +200,10 @@ C_MODE_END /* Fix problem when linking c++ programs with gcc 3.x */ #ifdef DEFINE_CXA_PURE_VIRTUAL #define FIX_GCC_LINKING_PROBLEM \ -extern "C" { int __cxa_pure_virtual() {\ +C_MODE_START int __cxa_pure_virtual() {\ DBUG_ASSERT("Pure virtual method called." == "Aborted");\ return 0;\ -} } +} C_MODE_END #else #define FIX_GCC_LINKING_PROBLEM #endif @@ -370,6 +376,12 @@ int __void__; #define LINT_INIT(var) #endif +#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify) +#define PURIFY_OR_LINT_INIT(var) var=0 +#else +#define PURIFY_OR_LINT_INIT(var) +#endif + /* Define some useful general macros */ #if defined(__cplusplus) && defined(__GNUC__) #define max(a, b) ((a) >? (b)) @@ -524,7 +536,11 @@ typedef SOCKET_SIZE_TYPE size_socket; #define FN_LEN 256 /* Max file name len */ #define FN_HEADLEN 253 /* Max length of filepart of file name */ #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */ +#ifdef PATH_MAX +#define FN_REFLEN PATH_MAX/* Max length of full path-name */ +#else #define FN_REFLEN 512 /* Max length of full path-name */ +#endif #define FN_EXTCHAR '.' #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ @@ -1066,7 +1082,7 @@ do { doubleget_union _tmp; \ #define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float)) #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) -#define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\ +#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\ *(((char*)T)+1)=(char) ((byte *) &V)[5];\ *(((char*)T)+2)=(char) ((byte *) &V)[6];\ *(((char*)T)+3)=(char) ((byte *) &V)[7];\ diff --git a/include/my_list.h b/include/my_list.h index 789bbb50f97..f786621e311 100644 --- a/include/my_list.h +++ b/include/my_list.h @@ -33,8 +33,8 @@ extern LIST *list_delete(LIST *root,LIST *element); extern LIST *list_cons(void *data,LIST *root); extern LIST *list_reverse(LIST *root); extern void list_free(LIST *root,unsigned int free_data); -extern unsigned int list_length(LIST *list); -extern int list_walk(LIST *list,list_walk_action action,gptr argument); +extern unsigned int list_length(LIST *); +extern int list_walk(LIST *,list_walk_action action,gptr argument); #define rest(a) ((a)->next) #define list_push(a,b) (a)=list_cons((b),(a)) diff --git a/include/my_pthread.h b/include/my_pthread.h index cd0cf49a891..f8cd3e0de71 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -631,15 +631,17 @@ extern int pthread_dummy(int); /* All thread specific variables are in the following struct */ #define THREAD_NAME_SIZE 10 +#ifndef DEFAULT_THREAD_STACK #if defined(__ia64__) /* MySQL can survive with 32K, but some glibc libraries require > 128K stack To resolve hostnames */ -#define DEFAULT_THREAD_STACK (192*1024L) +#define DEFAULT_THREAD_STACK (256*1024L) #else #define DEFAULT_THREAD_STACK (192*1024) #endif +#endif struct st_my_thread_var { diff --git a/include/my_sys.h b/include/my_sys.h index 01a7482e4d0..79c7c8bd3c0 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -214,6 +214,7 @@ extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests, my_cache_read; extern ulong my_blocks_used, my_blocks_changed; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; +extern uint mysys_usage_id; extern my_bool my_init_done; /* Point to current my_message() */ @@ -657,6 +658,7 @@ extern int init_io_cache(IO_CACHE *info,File file,uint cachesize, extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, my_off_t seek_offset,pbool use_async_io, pbool clear_cache); +extern void setup_io_cache(IO_CACHE* info); extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count); #ifdef THREAD extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count); @@ -737,6 +739,8 @@ extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, extern char *strdup_root(MEM_ROOT *root,const char *str); extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); +extern void get_defaults_files(int argc, char **argv, + char **defaults, char **extra_defaults); extern int load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv); extern void free_defaults(char **argv); diff --git a/include/my_time.h b/include/my_time.h index dab17904b2d..94701e159c4 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -58,14 +58,15 @@ void init_time(void); my_time_t my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap); -void set_zero_time(MYSQL_TIME *tm); +void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); /* Required buffer length for my_time_to_str, my_date_to_str, my_datetime_to_str and TIME_to_string functions. Note, that the caller is still responsible to check that given TIME structure has values in valid ranges, otherwise size of the buffer could - be not enough. + be not enough. We also rely on the fact that even wrong values + sent using binary protocol fit in this buffer. */ #define MAX_DATE_STRING_REP_LENGTH 30 diff --git a/include/mysql.h b/include/mysql.h index 1c886020fdb..d8a56126756 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -334,6 +334,17 @@ typedef struct st_mysql_parameters */ int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); +/* + mysql_server_init/end need to be called when using libmysqld or + libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so + you don't need to call it explicitely; but you need to call + mysql_server_end() to free memory). The names are a bit misleading + (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general + names which suit well whether you're using libmysqld or libmysqlclient. We + intend to promote these aliases over the mysql_server* ones. +*/ +#define mysql_library_init mysql_server_init +#define mysql_library_end mysql_server_end MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); @@ -490,6 +501,8 @@ MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild); unsigned long STDCALL mysql_escape_string(char *to,const char *from, unsigned long from_length); +unsigned long STDCALL mysql_hex_string(char *to,const char *from, + unsigned long from_length); unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, unsigned long length); @@ -642,23 +655,6 @@ typedef struct st_mysql_methods #endif } MYSQL_METHODS; -#ifdef HAVE_DEPRECATED_411_API -/* Deprecated calls (since MySQL 4.1.2) */ - -/* Use mysql_stmt_init + mysql_stmt_prepare instead */ -MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query, - unsigned long length); -#define mysql_execute mysql_stmt_execute -#define mysql_fetch mysql_stmt_fetch -#define mysql_fetch_column mysql_stmt_fetch_column -#define mysql_bind_param mysql_stmt_bind_param -#define mysql_bind_result mysql_stmt_bind_result -#define mysql_param_count mysql_stmt_param_count -#define mysql_param_result mysql_stmt_param_metadata -#define mysql_get_metadata mysql_stmt_result_metadata -#define mysql_send_long_data mysql_stmt_send_long_data - -#endif /* HAVE_DEPRECATED_411_API */ MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, diff --git a/include/mysql_com.h b/include/mysql_com.h index 4686acc098f..56c7f7d2ab5 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -130,6 +130,7 @@ enum enum_server_command #define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ #define SERVER_QUERY_NO_GOOD_INDEX_USED 16 #define SERVER_QUERY_NO_INDEX_USED 32 +#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */ #define MYSQL_ERRMSG_SIZE 512 #define NET_READ_TIMEOUT 30 /* Timeout on read */ @@ -282,13 +283,7 @@ void my_net_local_init(NET *net); void net_end(NET *net); void net_clear(NET *net); my_bool net_realloc(NET *net, unsigned long length); - -#ifndef EMBEDDED_LIBRARY /* To be removed by HF */ my_bool net_flush(NET *net); -#else -#define net_flush(A) -#endif - my_bool my_net_write(NET *net,const char *packet,unsigned long len); my_bool net_write_command(NET *net,unsigned char command, const char *header, unsigned long head_len, diff --git a/include/mysql_time.h b/include/mysql_time.h index ec67d60dea5..5f4fc12c005 100644 --- a/include/mysql_time.h +++ b/include/mysql_time.h @@ -33,6 +33,18 @@ enum enum_mysql_timestamp_type }; +/* + Structure which is used to represent datetime values inside MySQL. + + We assume that values in this structure are normalized, i.e. year <= 9999, + month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions + in server such as my_system_gmt_sec() or make_time() family of functions + rely on this (actually now usage of make_*() family relies on a bit weaker + restriction). Also functions that produce MYSQL_TIME as result ensure this. + There is one exception to this rule though if this structure holds time + value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold + bigger values. +*/ typedef struct st_mysql_time { unsigned int year, month, day, hour, minute, second; diff --git a/include/mysys_err.h b/include/mysys_err.h index 230be5f4720..19106dc3553 100644 --- a/include/mysys_err.h +++ b/include/mysys_err.h @@ -21,7 +21,7 @@ extern "C" { #endif #define GLOB 0 /* Error maps */ -#define GLOBERRS 28 /* Max number of error messages in map's */ +#define GLOBERRS 29 /* Max number of error messages in map's */ #define EE(X) globerrs[ X ] /* Defines to add error to right map */ extern const char * NEAR globerrs[]; /* my_error_messages is here */ @@ -54,6 +54,7 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ #define EE_CANT_SYMLINK 25 #define EE_REALPATH 26 #define EE_SYNC 27 +#define EE_UNKNOWN_COLLATION 28 /* exit codes for all MySQL programs */ diff --git a/include/raid.h b/include/raid.h index b5a5e665824..04c54393e54 100644 --- a/include/raid.h +++ b/include/raid.h @@ -32,9 +32,6 @@ C_MODE_END #endif #if defined(USE_RAID) -#ifdef __GNUC__ -#pragma interface /* gcc class implementation */ -#endif #include "my_dir.h" /* Trap all occurences of my_...() in source and use our wrapper around this function */ @@ -92,6 +89,10 @@ extern "C" { #ifdef __cplusplus } +#ifdef __GNUC__ +#pragma interface /* gcc class implementation */ +#endif + class RaidName { public: RaidName(const char *FileName); diff --git a/include/violite.h b/include/violite.h index ba7de3ee175..855d8a3d490 100644 --- a/include/violite.h +++ b/include/violite.h @@ -39,16 +39,17 @@ enum enum_vio_type Vio* vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost); #ifdef __WIN__ -Vio* vio_new_win32pipe(HANDLE hPipe); -Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, - HANDLE handle_map, - HANDLE event_server_wrote, - HANDLE event_server_read, - HANDLE event_client_wrote, - HANDLE event_client_read); -int vio_read_pipe(Vio *vio, gptr buf, int size); -int vio_write_pipe(Vio *vio, const gptr buf, int size); -int vio_close_pipe(Vio * vio); +Vio* vio_new_win32pipe(HANDLE hPipe); +Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, + HANDLE handle_map, + HANDLE event_server_wrote, + HANDLE event_server_read, + HANDLE event_client_wrote, + HANDLE event_client_read, + HANDLE event_conn_closed); +int vio_read_pipe(Vio *vio, gptr buf, int size); +int vio_write_pipe(Vio *vio, const gptr buf, int size); +int vio_close_pipe(Vio * vio); #else #define HANDLE void * #endif /* __WIN__ */ @@ -197,6 +198,7 @@ struct st_vio HANDLE event_server_read; HANDLE event_client_wrote; HANDLE event_client_read; + HANDLE event_conn_closed; long shared_memory_remain; char *shared_memory_pos; NET *net; diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index adb69f3c3a7..699ad5fb42e 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -547,8 +547,9 @@ buf_pool_init( } /*----------------------------------------*/ } else { - buf_pool->frame_mem = ut_malloc( - UNIV_PAGE_SIZE * (n_frames + 1)); + buf_pool->frame_mem = ut_malloc_low( + UNIV_PAGE_SIZE * (n_frames + 1), + TRUE, FALSE); } if (buf_pool->frame_mem == NULL) { diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c index 796311f0157..f3fb19ae183 100644 --- a/innobase/buf/buf0lru.c +++ b/innobase/buf/buf0lru.c @@ -42,6 +42,10 @@ initial segment in buf_LRU_get_recent_limit */ #define BUF_LRU_INITIAL_RATIO 8 +/* If we switch on the InnoDB monitor because there are too few available +frames in the buffer pool, we set this to TRUE */ +ibool buf_lru_switched_on_innodb_mon = FALSE; + /********************************************************************** Takes a block out of the LRU list and page hash table and sets the block state to BUF_BLOCK_REMOVE_HASH. */ @@ -288,6 +292,32 @@ buf_LRU_try_free_flushed_blocks(void) } /********************************************************************** +Returns TRUE if less than 15 % of the buffer pool is available. This can be +used in heuristics to prevent huge transactions eating up the whole buffer +pool for their locks. */ + +ibool +buf_LRU_buf_pool_running_out(void) +/*==============================*/ + /* out: TRUE if less than 15 % of buffer pool + left */ +{ + ibool ret = FALSE; + + mutex_enter(&(buf_pool->mutex)); + + if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) + + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 7) { + + ret = TRUE; + } + + mutex_exit(&(buf_pool->mutex)); + + return(ret); +} + +/********************************************************************** Returns a free block from buf_pool. The block is taken off the free list. If it is empty, blocks are moved from the end of the LRU list to the free list. */ @@ -325,7 +355,8 @@ loop: } else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) { - if (!srv_print_innodb_monitor) { + + if (!buf_lru_switched_on_innodb_mon) { /* Over 80 % of the buffer pool is occupied by lock heaps or the adaptive hash index. This may be a memory @@ -342,16 +373,18 @@ loop: "InnoDB: lock heap and hash index sizes.\n", (ulong) (buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE))); + buf_lru_switched_on_innodb_mon = TRUE; srv_print_innodb_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); } - } else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) - + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 4) { + } else if (buf_lru_switched_on_innodb_mon) { /* Switch off the InnoDB Monitor; this is a simple way to stop the monitor if the situation becomes less urgent, - but may also surprise users! */ + but may also surprise users if the user also switched on the + monitor! */ + buf_lru_switched_on_innodb_mon = FALSE; srv_print_innodb_monitor = FALSE; } diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c index 11107d777c8..055eede5c1a 100644 --- a/innobase/buf/buf0rea.c +++ b/innobase/buf/buf0rea.c @@ -326,7 +326,7 @@ buf_read_page( if (err == DB_TABLESPACE_DELETED) { ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: error: trying to access tablespace %lu page no. %lu,\n" +" InnoDB: Error: trying to access tablespace %lu page no. %lu,\n" "InnoDB: but the tablespace does not exist or is just being dropped.\n", (ulong) space, (ulong) offset); } @@ -679,7 +679,9 @@ buf_read_recv_pages( fprintf(stderr, "InnoDB: Error: InnoDB has waited for 50 seconds for pending\n" "InnoDB: reads to the buffer pool to be finished.\n" -"InnoDB: Number of pending reads %lu\n", (ulong) buf_pool->n_pend_reads); +"InnoDB: Number of pending reads %lu, pending pread calls %lu\n", + (ulong) buf_pool->n_pend_reads, + (ulong)os_file_n_pending_preads); os_aio_print_debug = TRUE; } diff --git a/innobase/configure.in b/innobase/configure.in index 652291f1f38..baf11272ab9 100644 --- a/innobase/configure.in +++ b/innobase/configure.in @@ -41,7 +41,9 @@ AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(void*, 4) AC_CHECK_FUNCS(sched_yield) AC_CHECK_FUNCS(fdatasync) -#AC_CHECK_FUNCS(localtime_r) # Already checked by MySQL +AC_CHECK_FUNCS(localtime_r) +#AC_CHECK_FUNCS(readdir_r) MySQL checks that it has also the right args. +# Some versions of Unix only take 2 arguments. #AC_C_INLINE Already checked in MySQL AC_C_BIGENDIAN @@ -110,6 +112,9 @@ esac case "$target" in i[[4567]]86-*-*) CFLAGS="$CFLAGS -DUNIV_INTEL_X86";; + # The compiler on Linux/S390 does not seem to have inlining + s390-*-*) + CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; esac AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile dnl diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c index 714cf92bc65..dab14df4240 100644 --- a/innobase/data/data0type.c +++ b/innobase/data/data0type.c @@ -166,6 +166,17 @@ dtype_is_non_binary_string_type( } /************************************************************************* +Gets the MySQL charset-collation code for MySQL string types. */ + +ulint +dtype_get_charset_coll_noninline( +/*=============================*/ + ulint prtype) /* in: precise data type */ +{ + return(dtype_get_charset_coll(prtype)); +} + +/************************************************************************* Forms a precise type from the < 4.1.2 format precise type plus the charset-collation code. */ diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c index 137964b26c1..d9e89316613 100644 --- a/innobase/dict/dict0crea.c +++ b/innobase/dict/dict0crea.c @@ -81,6 +81,17 @@ dict_create_sys_tables_tuple( dfield_set_data(dfield, ptr, 8); /* 7: MIX_LEN --------------------------*/ + + /* Track corruption reported on mailing list Jan 14, 2005 */ + if (table->mix_len != 0 && table->mix_len != 0x80000000) { + fprintf(stderr, +"InnoDB: Error: mix_len is %lu in table %s\n", (ulong)table->mix_len, + table->name); + mem_analyze_corruption((byte*)&(table->mix_len)); + + ut_error; + } + dfield = dtuple_get_nth_field(entry, 5); ptr = mem_heap_alloc(heap, 4); @@ -1067,6 +1078,12 @@ dict_create_or_check_foreign_constraint_tables(void) there are 2 secondary indexes on SYS_FOREIGN, and they are defined just like below */ + /* NOTE: when designing InnoDB's foreign key support in 2001, we made + an error and made the table names and the foreign key id of type + 'CHAR' (internally, really a VARCHAR). We should have made the type + VARBINARY, like in other InnoDB system tables, to get a clean + design. */ + str = "PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n" "BEGIN\n" @@ -1284,9 +1301,17 @@ loop: fputs(".\nA foreign key constraint of name ", ef); ut_print_name(ef, trx, foreign->id); fputs("\nalready exists." - " (Note that internally InnoDB adds 'databasename/'\n" + " (Note that internally InnoDB adds 'databasename/'\n" "in front of the user-defined constraint name).\n", ef); + fputs("Note that InnoDB's FOREIGN KEY system tables store\n" + "constraint names as case-insensitive, with the\n" + "MySQL standard latin1_swedish_ci collation. If you\n" + "create tables or databases whose names differ only in\n" + "the character case, then collisions in constraint\n" + "names can occur. Workaround: name your constraints\n" + "explicitly with unique names.\n", + ef); mutex_exit(&dict_foreign_err_mutex); diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index c3d0d8d9ac1..a73dd8b9dd9 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -156,7 +156,7 @@ dict_index_build_internal_non_clust( dict_index_t* index); /* in: user representation of a non-clustered index */ /************************************************************************** -Removes a foreign constraint struct from the dictionet cache. */ +Removes a foreign constraint struct from the dictionary cache. */ static void dict_foreign_remove_from_cache( @@ -606,7 +606,7 @@ dict_table_get_on_id( dict_table_t* table; if (ut_dulint_cmp(table_id, DICT_FIELDS_ID) <= 0 - || trx->dict_operation) { + || trx->dict_operation_lock_mode == RW_X_LATCH) { /* It is a system table which will always exist in the table cache: we avoid acquiring the dictionary mutex, because if we are doing a rollback to handle an error in TABLE @@ -2266,8 +2266,8 @@ dict_foreign_add_to_cache( /************************************************************************* Scans from pointer onwards. Stops if is at the start of a copy of -'string' where characters are compared without case sensitivity. Stops -also at '\0'. */ +'string' where characters are compared without case sensitivity, and +only outside `` or "" quotes. Stops also at '\0'. */ const char* dict_scan_to( @@ -2276,31 +2276,34 @@ dict_scan_to( const char* ptr, /* in: scan from */ const char* string) /* in: look for this */ { - ibool success; - ulint i; -loop: - if (*ptr == '\0') { - return(ptr); - } - - success = TRUE; - - for (i = 0; i < ut_strlen(string); i++) { - if (toupper((ulint)(ptr[i])) != toupper((ulint)(string[i]))) { - success = FALSE; + char quote = '\0'; + for (; *ptr; ptr++) { + if (*ptr == quote) { + /* Closing quote character: do not look for + starting quote or the keyword. */ + quote = '\0'; + } else if (quote) { + /* Within quotes: do nothing. */ + } else if (*ptr == '`' || *ptr == '"') { + /* Starting quote: remember the quote character. */ + quote = *ptr; + } else { + /* Outside quotes: look for the keyword. */ + ulint i; + for (i = 0; string[i]; i++) { + if (toupper((ulint)(ptr[i])) + != toupper((ulint)(string[i]))) { + goto nomatch; + } + } break; + nomatch: + ; } } - if (success) { - - return(ptr); - } - - ptr++; - - goto loop; + return(ptr); } /************************************************************************* @@ -2361,6 +2364,8 @@ dict_scan_id( ulint len = 0; const char* s; char* d; + ulint id_len; + byte* b; *id = NULL; @@ -2422,6 +2427,28 @@ dict_scan_id( *id = s; } + if (heap && !quote) { + /* EMS MySQL Manager sometimes adds characters 0xA0 (in + latin1, a 'non-breakable space') to the end of a table name. + But isspace(0xA0) is not true, which confuses our foreign key + parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2 + and 0xA0 are at the end of the string. + + TODO: we should lex the string using thd->charset_info, and + my_isspace(). Only after that, convert id names to UTF-8. */ + + b = (byte*)(*id); + id_len = strlen(b); + + if (id_len >= 3 && b[id_len - 1] == 0xA0 + && b[id_len - 2] == 0xC2) { + + /* Strip the 2 last bytes */ + + b[id_len - 2] = '\0'; + } + } + return(ptr); } @@ -2476,7 +2503,7 @@ dict_scan_col( } /************************************************************************* -Scans the referenced table name from an SQL string. */ +Scans a table name from an SQL string. */ static const char* dict_scan_table_name( @@ -2487,7 +2514,7 @@ dict_scan_table_name( const char* name, /* in: foreign key table name */ ibool* success,/* out: TRUE if ok name found */ mem_heap_t* heap, /* in: heap where to allocate the id */ - const char** ref_name)/* out,own: the referenced table name; + const char** ref_name)/* out,own: the table name; NULL if no name was scannable */ { const char* database_name = NULL; @@ -2644,7 +2671,8 @@ scan_more: /* Starting quote: remember the quote character. */ quote = *sptr; } else if (*sptr == '#' - || (0 == memcmp("-- ", sptr, 3))) { + || (sptr[0] == '-' && sptr[1] == '-' && + sptr[2] == ' ')) { for (;;) { /* In Unix a newline is 0x0A while in Windows it is 0x0D followed by 0x0A */ @@ -2868,22 +2896,22 @@ loop: constraint_name = NULL; if (ptr1 < ptr2) { - /* The user has specified a constraint name. Pick it so + /* The user may have specified a constraint name. Pick it so that we can store 'databasename/constraintname' as the id of - the id of the constraint to system tables. */ + of the constraint to system tables. */ ptr = ptr1; ptr = dict_accept(ptr, "CONSTRAINT", &success); ut_a(success); - if (!isspace(*ptr)) { + if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') { goto loop; } - do { + while (isspace(*ptr)) { ptr++; - } while (isspace(*ptr)); + } /* read constraint name unless got "CONSTRAINT FOREIGN" */ if (ptr != ptr2) { @@ -2907,6 +2935,10 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); + if (!success) { + goto loop; + } + if (!isspace(*ptr)) { goto loop; } diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index d430eadc97b..717c64c3963 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -19,7 +19,9 @@ Created 4/24/1996 Heikki Tuuri #include "mach0data.h" #include "dict0dict.h" #include "dict0boot.h" +#include "rem0cmp.h" #include "srv0start.h" +#include "srv0srv.h" /************************************************************************ Finds the first table name in the given database. */ @@ -123,6 +125,13 @@ dict_print(void) ulint len; mtr_t mtr; + /* Enlarge the fatal semaphore wait timeout during the InnoDB table + monitor printout */ + + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ + mutex_exit(&kernel_mutex); + mutex_enter(&(dict_sys->mutex)); mtr_start(&mtr); @@ -145,6 +154,12 @@ loop: mutex_exit(&(dict_sys->mutex)); + /* Restore the fatal semaphore wait timeout */ + + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ + mutex_exit(&kernel_mutex); + return; } @@ -190,12 +205,14 @@ loop: In a crash recovery we already have all the tablespace objects created. This function compares the space id information in the InnoDB data dictionary to what we already read with fil_load_single_table_tablespaces(). -In a normal startup we just scan the biggest space id, and store it to -fil_system. */ + +In a normal startup, we create the tablespace objects for every table in +InnoDB's data dictionary, if the corresponding .ibd file exists. +We also scan the biggest space id, and store it to fil_system. */ void -dict_check_tablespaces_or_store_max_id( -/*===================================*/ +dict_check_tablespaces_and_store_max_id( +/*====================================*/ ibool in_crash_recovery) /* in: are we doing a crash recovery */ { dict_table_t* sys_tables; @@ -265,6 +282,14 @@ loop: FALSE, TRUE, TRUE); } + if (space_id != 0 && !in_crash_recovery) { + /* It is a normal database startup: create the space + object and check that the .ibd file exists. */ + + fil_open_single_table_tablespace(FALSE, space_id, + name); + } + mem_free(name); if (space_id > max_space_id) { @@ -704,6 +729,7 @@ dict_load_table( ulint space; ulint n_cols; ulint err; + ulint mix_len; mtr_t mtr; #ifdef UNIV_SYNC_DEBUG @@ -750,6 +776,38 @@ dict_load_table( return(NULL); } + /* Track a corruption bug reported on the MySQL mailing list Jan 14, + 2005: mix_len had a value different from 0 */ + + field = rec_get_nth_field(rec, 7, &len); + ut_a(len == 4); + + mix_len = mach_read_from_4(field); + + if (mix_len != 0 && mix_len != 0x80000000) { + ut_print_timestamp(stderr); + + fprintf(stderr, + " InnoDB: table %s has a nonsensical mix len %lu\n", + name, (ulong)mix_len); + } + +#if MYSQL_VERSION_ID < 50300 + /* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the + "compact format" flag. */ + field = rec_get_nth_field(rec, 7, &len); + if (mach_read_from_1(field) & 0x80) { + btr_pcur_close(&pcur); + mtr_commit(&mtr); + mem_heap_free(heap); + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: table %s is in the new compact format\n" + "InnoDB: of MySQL 5.0.3 or later\n", name); + return(NULL); + } +#endif /* MYSQL_VERSION_ID < 50300 */ + ut_a(0 == ut_strcmp("SPACE", dict_field_get_col( dict_index_get_nth_field( @@ -765,8 +823,18 @@ dict_load_table( /* Ok; (if we did a crash recovery then the tablespace can already be in the memory cache) */ } else { + /* In >= 4.1.9, InnoDB scans the data dictionary also + at a normal mysqld startup. It is an error if the + space object does not exist in memory. */ + + ut_print_timestamp(stderr); + fprintf(stderr, +" InnoDB: error: space object of table %s,\n" +"InnoDB: space id %lu did not exist in memory. Retrying an open.\n", + name, (ulong)space); /* Try to open the tablespace */ - if (!fil_open_single_table_tablespace(space, name)) { + if (!fil_open_single_table_tablespace(TRUE, + space, name)) { /* We failed to find a sensible tablespace file */ @@ -1242,12 +1310,26 @@ loop: rec = btr_pcur_get_rec(&pcur); field = rec_get_nth_field(rec, 0, &len); - /* Check if the table name in record is the one searched for */ - if (len != ut_strlen(table_name) - || 0 != ut_memcmp(field, table_name, len)) { + /* Check if the table name in the record is the one searched for; the + following call does the comparison in the latin1_swedish_ci + charset-collation, in a case-insensitive way. */ + if (0 != cmp_data_data(dfield_get_type(dfield), + dfield_get_data(dfield), dfield_get_len(dfield), + field, len)) { + goto load_next_index; } + + /* Since table names in SYS_FOREIGN are stored in a case-insensitive + order, we have to check that the table name matches also in a binary + string comparison. On Unix, MySQL allows table names that only differ + in character case. */ + + if (0 != ut_memcmp(field, table_name, len)) { + + goto next_rec; + } if (rec_get_deleted_flag(rec)) { diff --git a/innobase/eval/eval0eval.c b/innobase/eval/eval0eval.c index ebb6cb1b7d9..5b2d1f857b1 100644 --- a/innobase/eval/eval0eval.c +++ b/innobase/eval/eval0eval.c @@ -627,7 +627,11 @@ eval_concat( } /********************************************************************* -Evaluates a predefined function node. */ +Evaluates a predefined function node. If the first argument is an integer, +this function looks at the second argument which is the integer length in +bytes, and converts the integer to a VARCHAR. +If the first argument is of some other type, this function converts it to +BINARY. */ UNIV_INLINE void eval_to_binary( @@ -638,12 +642,24 @@ eval_to_binary( que_node_t* arg2; dfield_t* dfield; byte* str1; + ulint len; ulint len1; arg1 = func_node->args; str1 = dfield_get_data(que_node_get_val(arg1)); + if (dtype_get_mtype(que_node_get_data_type(arg1)) != DATA_INT) { + + len = dfield_get_len(que_node_get_val(arg1)); + + dfield = que_node_get_val(func_node); + + dfield_set_data(dfield, str1, len); + + return; + } + arg2 = que_node_get_next(arg1); len1 = (ulint)eval_node_get_int_val(arg2); diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index 7d57468f632..16ae8e6e228 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -106,7 +106,7 @@ struct fil_node_struct { device or a raw disk partition */ ulint size; /* size of the file in database pages, 0 if not known yet; the possible last incomplete - megabyte is ignored if space == 0 */ + megabyte may be ignored if space == 0 */ ulint n_pending; /* count of pending i/o's on this file; closing of the file is not allowed if @@ -160,7 +160,9 @@ struct fil_space_struct { UT_LIST_BASE_NODE_T(fil_node_t) chain; /* base node for the file chain */ ulint size; /* space size in pages; 0 if a single-table - tablespace whose size we do not know yet */ + tablespace whose size we do not know yet; + last incomplete megabytes in data files may be + ignored if space == 0 */ ulint n_reserved_extents; /* number of reserved free extents for ongoing operations like B-tree page split */ @@ -464,6 +466,10 @@ fil_node_open_file( ulint size_low; ulint size_high; ibool ret; + byte* buf2; + byte* page; + ibool success; + ulint space_id; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); @@ -471,27 +477,34 @@ fil_node_open_file( ut_a(node->n_pending == 0); ut_a(node->open == FALSE); - /* printf("Opening file %s\n", node->name); */ + if (node->size == 0) { + /* It must be a single-table tablespace and we do not know the + size of the file yet. First we open the file in the normal + mode, no async I/O here, for simplicity. Then do some checks, + and close the file again. + NOTE that we could not use the simple file read function + os_file_read() in Windows to read from a file opened for + async I/O! */ + + node->handle = os_file_create_simple_no_error_handling( + node->name, OS_FILE_OPEN, + OS_FILE_READ_ONLY, &success); + if (!success) { + /* The following call prints an error message */ + os_file_get_last_error(TRUE); - if (space->purpose == FIL_LOG) { - node->handle = os_file_create(node->name, OS_FILE_OPEN, - OS_FILE_AIO, OS_LOG_FILE, &ret); - } else if (node->is_raw_disk) { - node->handle = os_file_create(node->name, - OS_FILE_OPEN_RAW, - OS_FILE_AIO, OS_DATA_FILE, &ret); - } else { - node->handle = os_file_create(node->name, OS_FILE_OPEN, - OS_FILE_AIO, OS_DATA_FILE, &ret); - } - - ut_a(ret); - - node->open = TRUE; + ut_print_timestamp(stderr); - system->n_open++; + fprintf(stderr, +" InnoDB: Fatal error: cannot open %s\n." +"InnoDB: Have you deleted .ibd files under a running mysqld server?\n", + node->name); + ut_a(0); + } + + ut_a(space->purpose != FIL_LOG); + ut_a(space->id != 0); - if (node->size == 0) { os_file_get_size(node->handle, &size_low, &size_high); size_bytes = (((ib_longlong)size_high) << 32) @@ -500,10 +513,49 @@ fil_node_open_file( node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); #else - /* It must be a single-table tablespace and we do not know the - size of the file yet */ + if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { + fprintf(stderr, +"InnoDB: Error: the size of single-table tablespace file %s\n" +"InnoDB: is only %lu %lu, should be at least %lu!", node->name, + (ulong) size_high, + (ulong) size_low, (ulong) (4 * UNIV_PAGE_SIZE)); + + ut_a(0); + } - ut_a(space->id != 0); + /* Read the first page of the tablespace */ + + buf2 = ut_malloc(2 * UNIV_PAGE_SIZE); + /* Align the memory for file i/o if we might have O_DIRECT + set */ + page = ut_align(buf2, UNIV_PAGE_SIZE); + + success = os_file_read(node->handle, page, 0, 0, + UNIV_PAGE_SIZE); + space_id = fsp_header_get_space_id(page); + + ut_free(buf2); + + /* Close the file now that we have read the space id from it */ + + os_file_close(node->handle); + + if (space_id == ULINT_UNDEFINED || space_id == 0) { + fprintf(stderr, +"InnoDB: Error: tablespace id %lu in file %s is not sensible\n", + (ulong) space_id, + node->name); + + ut_a(0); + } + + if (space_id != space->id) { + fprintf(stderr, +"InnoDB: Error: tablespace id is %lu in the data dictionary\n" +"InnoDB: but in file %s it is %lu!\n", space->id, node->name, space_id); + + ut_a(0); + } if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) { node->size = (ulint) ((size_bytes / (1024 * 1024)) @@ -515,6 +567,30 @@ fil_node_open_file( space->size += node->size; } + /* printf("Opening file %s\n", node->name); */ + + /* Open the file for reading and writing, in Windows normally in the + unbuffered async I/O mode, though global variables may make + os_file_create() to fall back to the normal file I/O mode. */ + + if (space->purpose == FIL_LOG) { + node->handle = os_file_create(node->name, OS_FILE_OPEN, + OS_FILE_AIO, OS_LOG_FILE, &ret); + } else if (node->is_raw_disk) { + node->handle = os_file_create(node->name, + OS_FILE_OPEN_RAW, + OS_FILE_AIO, OS_DATA_FILE, &ret); + } else { + node->handle = os_file_create(node->name, OS_FILE_OPEN, + OS_FILE_AIO, OS_DATA_FILE, &ret); + } + + ut_a(ret); + + node->open = TRUE; + + system->n_open++; + if (space->purpose == FIL_TABLESPACE && space->id != 0) { /* Put the node to the LRU list */ UT_LIST_ADD_FIRST(LRU, system->LRU, node); @@ -609,9 +685,9 @@ fil_try_to_close_file_in_LRU( fputs("InnoDB: cannot close file ", stderr); ut_print_filename(stderr, node->name); fprintf(stderr, - ", because mod_count %lld != fl_count %lld\n", - node->modification_counter, - node->flush_counter); + ", because mod_count %ld != fl_count %ld\n", + (ulong) node->modification_counter, + (ulong) node->flush_counter); } node = UT_LIST_GET_PREV(LRU, node); @@ -2485,21 +2561,29 @@ func_exit: } /************************************************************************ -Tries to open a single-table tablespace and checks the space id is right in -it. If does not succeed, prints an error message to the .err log. This -function is used to open the tablespace when we load a table definition -to the dictionary cache. NOTE that we assume this operation is used under the -protection of the dictionary mutex, so that two users cannot race here. This -operation does not leave the file associated with the tablespace open, but -closes it after we have looked at the space id in it. */ +Tries to open a single-table tablespace and optionally checks the space id is +right in it. If does not succeed, prints an error message to the .err log. This +function is used to open a tablespace when we start up mysqld, and also in +IMPORT TABLESPACE. +NOTE that we assume this operation is used either at the database startup +or under the protection of the dictionary mutex, so that two users cannot +race here. This operation does not leave the file associated with the +tablespace open, but closes it after we have looked at the space id in it. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - const char* name) /* in: table name in the - databasename/tablename format */ + /* out: TRUE if success */ + ibool check_space_id, /* in: should we check that the space + id in the file is right; we assume + that this function runs much faster + if no check is made, since accessing + the file inode probably is much + faster (the OS caches them) than + accessing the first page of the file */ + ulint id, /* in: space id */ + const char* name) /* in: table name in the + databasename/tablename format */ { os_file_t file; char* filepath; @@ -2538,6 +2622,12 @@ fil_open_single_table_tablespace( return(FALSE); } + if (!check_space_id) { + space_id = id; + + goto skip_check; + } + /* Read the first page of the tablespace */ buf2 = ut_malloc(2 * UNIV_PAGE_SIZE); @@ -2550,6 +2640,8 @@ fil_open_single_table_tablespace( space_id = fsp_header_get_space_id(page); + ut_free(buf2); + if (space_id != id) { ut_print_timestamp(stderr); @@ -2570,6 +2662,7 @@ fil_open_single_table_tablespace( goto func_exit; } +skip_check: success = fil_space_create(filepath, space_id, FIL_TABLESPACE); if (!success) { @@ -2582,7 +2675,6 @@ fil_open_single_table_tablespace( fil_node_create(filepath, 0, space_id, FALSE); func_exit: os_file_close(file); - ut_free(buf2); mem_free(filepath); return(ret); @@ -2649,7 +2741,7 @@ fil_load_single_table_tablespace( fprintf(stderr, "InnoDB: Error: could not open single-table tablespace file\n" "InnoDB: %s!\n" -"InnoDB: We do not continue crash recovery, because the table will become\n" +"InnoDB: We do not continue the crash recovery, because the table may become\n" "InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.\n" "InnoDB: To fix the problem and start mysqld:\n" "InnoDB: 1) If there is a permission problem in the file and mysqld cannot\n" @@ -2820,8 +2912,9 @@ fil_load_single_table_tablespace( goto func_exit; } - /* We do not measure the size of the file, that is why we pass the 0 - below */ + /* We do not use the size information we have about the file, because + the rounding formula for extents and pages is somewhat complex; we + let fil_node_open() do that task. */ fil_node_create(filepath, 0, space_id, FALSE); func_exit: @@ -2909,8 +3002,8 @@ fil_load_single_table_tablespaces(void) /* printf( " Looking at file %s\n", fileinfo.name); */ - if (fileinfo.type == OS_FILE_TYPE_DIR - || dbinfo.type == OS_FILE_TYPE_UNKNOWN) { + if (fileinfo.type == OS_FILE_TYPE_DIR) { + goto next_file_item; } @@ -3255,7 +3348,7 @@ fil_extend_space_to_desired_size( ulint* actual_size, /* out: size of the space after extension; if we ran out of disk space this may be lower than the desired size */ - ulint space_id, /* in: space id, must be != 0 */ + ulint space_id, /* in: space id */ ulint size_after_extend)/* in: desired size in pages after the extension; if the current space size is bigger than this already, the function does nothing */ @@ -3352,6 +3445,17 @@ fil_extend_space_to_desired_size( fil_node_complete_io(node, system, OS_FILE_WRITE); *actual_size = space->size; + + if (space_id == 0) { + ulint pages_per_mb = (1024 * 1024) / UNIV_PAGE_SIZE; + + /* Keep the last data file size info up to date, rounded to + full megabytes */ + + srv_data_file_sizes[srv_n_data_files - 1] = + (node->size / pages_per_mb) * pages_per_mb; + } + /* printf("Extended %s to %lu, actual size %lu pages\n", space->name, size_after_extend, *actual_size); */ @@ -3696,13 +3800,6 @@ fil_io( node = UT_LIST_GET_FIRST(space->chain); for (;;) { - if (space->id != 0 && node->size == 0) { - /* We do not know the size of a single-table tablespace - before we open the file */ - - break; - } - if (node == NULL) { fprintf(stderr, "InnoDB: Error: trying to access page number %lu in space %lu,\n" @@ -3716,6 +3813,13 @@ fil_io( ut_error; } + if (space->id != 0 && node->size == 0) { + /* We do not know the size of a single-table tablespace + before we open the file */ + + break; + } + if (node->size > block_offset) { /* Found! */ break; @@ -4035,7 +4139,8 @@ fil_flush_file_spaces( space = UT_LIST_GET_FIRST(system->space_list); while (space) { - if (space->purpose == purpose) { + if (space->purpose == purpose && !space->is_being_deleted) { + space->n_pending_flushes++; /* prevent dropping of the space while we are flushing */ diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index b3c8ade2414..2191cdc0ee6 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -2866,6 +2866,8 @@ ibuf_delete_rec( #ifdef UNIV_IBUF_DEBUG ibuf_count_set(space, page_no, ibuf_count_get(space, page_no) - 1); +#else + UT_NOT_USED(space); #endif ibuf_data_sizes_update(ibuf_data, root, mtr); @@ -3267,11 +3269,11 @@ leave_loop: ibuf_data->n_merged_recs += n_inserts; mutex_exit(&ibuf_mutex); - + /* fprintf(stderr, "InnoDB: Discarded %lu ibuf entries for space %lu\n", (ulong) n_inserts, (ulong) space); - + */ ibuf_exit(); mem_heap_free(heap); diff --git a/innobase/include/buf0lru.h b/innobase/include/buf0lru.h index 69a376f8cab..45164dd561e 100644 --- a/innobase/include/buf0lru.h +++ b/innobase/include/buf0lru.h @@ -25,6 +25,16 @@ wasted. */ void buf_LRU_try_free_flushed_blocks(void); /*==================================*/ +/********************************************************************** +Returns TRUE if less than 15 % of the buffer pool is available. This can be +used in heuristics to prevent huge transactions eating up the whole buffer +pool for their locks. */ + +ibool +buf_LRU_buf_pool_running_out(void); +/*==============================*/ + /* out: TRUE if less than 15 % of buffer pool + left */ /*####################################################################### These are low-level functions diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h index c263d2bf613..02c874836fd 100644 --- a/innobase/include/data0type.h +++ b/innobase/include/data0type.h @@ -234,6 +234,13 @@ dtype_get_prtype( dtype_t* type); /************************************************************************* Gets the MySQL charset-collation code for MySQL string types. */ + +ulint +dtype_get_charset_coll_noninline( +/*=============================*/ + ulint prtype);/* in: precise data type */ +/************************************************************************* +Gets the MySQL charset-collation code for MySQL string types. */ UNIV_INLINE ulint dtype_get_charset_coll( diff --git a/innobase/include/db0err.h b/innobase/include/db0err.h index be7667bfd0c..de5ac44e73f 100644 --- a/innobase/include/db0err.h +++ b/innobase/include/db0err.h @@ -53,7 +53,11 @@ Created 5/24/1996 Heikki Tuuri name already exists */ #define DB_TABLESPACE_DELETED 44 /* tablespace does not exist or is being dropped right now */ - +#define DB_LOCK_TABLE_FULL 45 /* lock structs have exhausted the + buffer pool (for big transactions, + InnoDB stores the lock structs in the + buffer pool) */ + /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic index 0f7cc8973db..85e4aaf1a05 100644 --- a/innobase/include/dict0dict.ic +++ b/innobase/include/dict0dict.ic @@ -342,13 +342,16 @@ dict_index_rec_get_sys_col( ut_ad(len == 7); return(trx_read_roll_ptr(field)); - } else if ((type == DATA_ROW_ID) || (type == DATA_MIX_ID)) { + } else if (type == DATA_TRX_ID) { + + return(trx_read_trx_id(field)); + } else if (type == DATA_MIX_ID) { return(mach_dulint_read_compressed(field)); } else { - ut_ad(type == DATA_TRX_ID); + ut_a(type == DATA_ROW_ID); - return(trx_read_trx_id(field)); + return(mach_read_from_6(field)); } } diff --git a/innobase/include/dict0load.h b/innobase/include/dict0load.h index d4dccb33373..1f0a5407140 100644 --- a/innobase/include/dict0load.h +++ b/innobase/include/dict0load.h @@ -18,12 +18,14 @@ Created 4/24/1996 Heikki Tuuri In a crash recovery we already have all the tablespace objects created. This function compares the space id information in the InnoDB data dictionary to what we already read with fil_load_single_table_tablespaces(). -In a normal startup we just scan the biggest space id, and store it to -fil_system. */ + +In a normal startup, we create the tablespace objects for every table in +InnoDB's data dictionary, if the corresponding .ibd file exists. +We also scan the biggest space id, and store it to fil_system. */ void -dict_check_tablespaces_or_store_max_id( -/*===================================*/ +dict_check_tablespaces_and_store_max_id( +/*====================================*/ ibool in_crash_recovery); /* in: are we doing a crash recovery */ /************************************************************************ Finds the first table name in the given database. */ diff --git a/innobase/include/eval0eval.ic b/innobase/include/eval0eval.ic index 2530c869206..069cbfe5f37 100644 --- a/innobase/include/eval0eval.ic +++ b/innobase/include/eval0eval.ic @@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val( { byte* data; - ut_ad(UNIV_SQL_NULL > ULINT_MAX); - if (len == UNIV_SQL_NULL) { dfield_set_len(que_node_get_val(node), len); diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h index 5a5db77073a..c1a127aadca 100644 --- a/innobase/include/fil0fil.h +++ b/innobase/include/fil0fil.h @@ -364,19 +364,29 @@ fil_create_new_single_table_tablespace( tablespace file in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE */ /************************************************************************ -Tries to open a single-table tablespace and checks the space id is right in -it. If does not succeed, prints an error message to the .err log. This -function is used to open the tablespace when we load a table definition -to the dictionary cache. NOTE that we assume this operation is used under the -protection of the dictionary mutex, so that two users cannot race here. */ +Tries to open a single-table tablespace and optionally checks the space id is +right in it. If does not succeed, prints an error message to the .err log. This +function is used to open a tablespace when we start up mysqld, and also in +IMPORT TABLESPACE. +NOTE that we assume this operation is used either at the database startup +or under the protection of the dictionary mutex, so that two users cannot +race here. This operation does not leave the file associated with the +tablespace open, but closes it after we have looked at the space id in it. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - const char* name); /* in: table name in the - databasename/tablename format */ + /* out: TRUE if success */ + ibool check_space_id, /* in: should we check that the space + id in the file is right; we assume + that this function runs much faster + if no check is made, since accessing + the file inode probably is much + faster (the OS caches them) than + accessing the first page of the file */ + ulint id, /* in: space id */ + const char* name); /* in: table name in the + databasename/tablename format */ /************************************************************************ It is possible, though very improbable, that the lsn's in the tablespace to be imported have risen above the current system lsn, if a lengthy purge, ibuf @@ -478,7 +488,7 @@ fil_extend_space_to_desired_size( ulint* actual_size, /* out: size of the space after extension; if we ran out of disk space this may be lower than the desired size */ - ulint space_id, /* in: space id, must be != 0 */ + ulint space_id, /* in: space id */ ulint size_after_extend);/* in: desired size in pages after the extension; if the current space size is bigger than this already, the function does nothing */ diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h index 9f525042dcc..1fd7492d517 100644 --- a/innobase/include/lock0lock.h +++ b/innobase/include/lock0lock.h @@ -463,6 +463,33 @@ lock_rec_hash( ulint space, /* in: space */ ulint page_no);/* in: page number */ /************************************************************************* +Gets the source table of an ALTER TABLE transaction. The table must be +covered by an IX or IS table lock. */ + +dict_table_t* +lock_get_src_table( +/*===============*/ + /* out: the source table of transaction, + if it is covered by an IX or IS table lock; + dest if there is no source table, and + NULL if the transaction is locking more than + two tables or an inconsistency is found */ + trx_t* trx, /* in: transaction */ + dict_table_t* dest, /* in: destination of ALTER TABLE */ + ulint* mode); /* out: lock mode of the source table */ +/************************************************************************* +Determine if the given table is exclusively "owned" by the given +transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC +on the table. */ + +ibool +lock_is_table_exclusive( +/*====================*/ + /* out: TRUE if table is only locked by trx, + with LOCK_IX, and possibly LOCK_AUTO_INC */ + dict_table_t* table, /* in: table */ + trx_t* trx); /* in: transaction */ +/************************************************************************* Checks that a transaction id is sensible, i.e., not in the future. */ ibool diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 9437ed4b6ee..13773ed380d 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -175,8 +175,14 @@ int row_lock_table_for_mysql( /*=====================*/ /* out: error code or DB_SUCCESS */ - row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL + row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL table handle */ + dict_table_t* table, /* in: table to lock, or NULL + if prebuilt->table should be + locked as LOCK_TABLE_EXP | + prebuilt->select_lock_type */ + ulint mode); /* in: lock mode of table */ + /************************************************************************* Does an insert for MySQL. */ @@ -361,25 +367,7 @@ row_drop_table_for_mysql( /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding means that this function deletes the .ibd file and assigns a new table id for -the table. Also the flag table->ibd_file_missing is set TRUE. - -How do we prevent crashes caused by ongoing operations on the table? Old -operations could try to access non-existent pages. - -1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock -on the table before we can do DISCARD TABLESPACE. Then there are no running -queries on the table. -2) Purge and rollback: we assign a new table id for the table. Since purge and -rollback look for the table based on the table id, they see the table as -'dropped' and discard their operations. -3) Insert buffer: we remove all entries for the tablespace in the insert -buffer tree; as long as the tablespace mem object does not exist, ongoing -insert buffer page merges are discarded in buf0rea.c. If we recreate the -tablespace mem object with IMPORT TABLESPACE later, then the tablespace will -have the same id, but the tablespace_version field in the mem object is -different, and ongoing old insert buffer page merges get discarded. -4) Linear readahead and random readahead: we use the same method as in 3) to -discard ongoing operations. */ +the table. Also the flag table->ibd_file_missing is set TRUE. */ int row_discard_tablespace_for_mysql( @@ -448,6 +436,8 @@ struct mysql_row_templ_struct { zero if column cannot be NULL */ ulint type; /* column type in Innobase mtype numbers DATA_CHAR... */ + ulint charset; /* MySQL charset-collation code + of the column, or zero */ ulint is_unsigned; /* if a column type is an integer type and this field is != 0, then it is an unsigned integer type */ diff --git a/innobase/include/row0mysql.ic b/innobase/include/row0mysql.ic index 4ecd66e06ec..fc922b52d0a 100644 --- a/innobase/include/row0mysql.ic +++ b/innobase/include/row0mysql.ic @@ -91,12 +91,33 @@ row_mysql_store_col_in_innobase_format( } } else if (type == DATA_VARCHAR || type == DATA_VARMYSQL || type == DATA_BINARY) { + /* Remove trailing spaces. */ + + /* Handle UCS2 strings differently. As no new + collations will be introduced in 4.1, we hardcode the + charset-collation codes here. In 5.0, the logic will + be based on mbminlen. */ + ulint cset = dtype_get_charset_coll( + dtype_get_prtype(dfield_get_type(dfield))); ptr = row_mysql_read_var_ref(&col_len, mysql_data); - - /* Remove trailing spaces */ - while (col_len > 0 && ptr[col_len - 1] == ' ') { - col_len--; - } + if (cset == 35/*ucs2_general_ci*/ + || cset == 90/*ucs2_bin*/ + || (cset >= 128/*ucs2_unicode_ci*/ + && cset <= 144/*ucs2_persian_ci*/)) { + /* space=0x0020 */ + /* Trim "half-chars", just in case. */ + col_len &= ~1; + + while (col_len >= 2 && ptr[col_len - 2] == 0x00 + && ptr[col_len - 1] == 0x20) { + col_len -= 2; + } + } else { + /* space=0x20 */ + while (col_len > 0 && ptr[col_len - 1] == 0x20) { + col_len--; + } + } } else if (type == DATA_BLOB) { ptr = row_mysql_read_blob_ref(&col_len, mysql_data, col_len); } diff --git a/innobase/include/row0sel.h b/innobase/include/row0sel.h index bb6fb70ca86..8d5187bfc1c 100644 --- a/innobase/include/row0sel.h +++ b/innobase/include/row0sel.h @@ -120,6 +120,7 @@ row_search_for_mysql( /* out: DB_SUCCESS, DB_RECORD_NOT_FOUND, DB_END_OF_INDEX, DB_DEADLOCK, + DB_LOCK_TABLE_FULL, or DB_TOO_BIG_RECORD */ byte* buf, /* in/out: buffer for the fetched row in the MySQL format */ diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index ecd57bae47c..6cfe9cef927 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -111,6 +111,7 @@ extern ibool srv_use_doublewrite_buf; extern ibool srv_set_thread_priorities; extern int srv_query_thread_priority; +extern ulint srv_max_purge_lag; extern ibool srv_use_awe; extern ibool srv_use_adaptive_hash_indexes; diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h index 75af1a212b4..8df0f97c4ff 100644 --- a/innobase/include/srv0start.h +++ b/innobase/include/srv0start.h @@ -75,6 +75,10 @@ extern dulint srv_start_lsn; void set_panic_flag_for_netware(void); #endif +#ifdef HAVE_DARWIN_THREADS +extern ibool srv_have_fullfsync; +#endif + extern ulint srv_sizeof_trx_t_in_ha_innodb_cc; extern ibool srv_is_being_started; diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 7eb91048684..8336e05bdb0 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -378,6 +378,19 @@ struct trx_struct{ replication slave, this is the position in the log file up to which replication has processed */ + /* A MySQL variable mysql_thd->synchronous_repl tells if we have + to use synchronous replication. See ha_innodb.cc. */ + char* repl_wait_binlog_name;/* NULL, or if synchronous MySQL + replication is used, the binlog name + up to which we must communicate the + binlog to the slave, before returning + from a commit; this is the same as + mysql_log_file_name, but we allocate + and copy the name to a separate buffer + here */ + ib_longlong repl_wait_binlog_pos;/* see above at + repl_wait_binlog_name */ + os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated with this transaction object */ ulint mysql_process_no;/* since in Linux, 'top' reports diff --git a/innobase/include/univ.i b/innobase/include/univ.i index be71d4211b3..625978ffc38 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -119,7 +119,7 @@ by one. */ /* Definition for inline version */ #ifdef __WIN__ -#define UNIV_INLINE __inline +#define UNIV_INLINE __inline #else /* config.h contains the right def for 'inline' for the current compiler */ #if (__GNUC__ == 2) diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index 73ecb25101a..74357f6bf13 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -38,8 +38,10 @@ ut_malloc_low( /*==========*/ /* out, own: allocated memory */ ulint n, /* in: number of bytes to allocate */ - ibool set_to_zero); /* in: TRUE if allocated memory should be set + ibool set_to_zero, /* in: TRUE if allocated memory should be set to zero if UNIV_SET_MEM_TO_ZERO is defined */ + ibool assert_on_error); /* in: if TRUE, we crash mysqld if the memory + cannot be allocated */ /************************************************************************** Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is defined. */ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 68073647248..29a274261f8 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -365,6 +365,21 @@ lock_deadlock_recursive( ulint* cost); /* in/out: number of calculation steps thus far: if this exceeds LOCK_MAX_N_STEPS_... we return TRUE */ + +/************************************************************************* +Gets the type of a lock. */ +UNIV_INLINE +ulint +lock_get_type( +/*==========*/ + /* out: LOCK_TABLE or LOCK_REC */ + lock_t* lock) /* in: lock */ +{ + ut_ad(lock); + + return(lock->type_mode & LOCK_TYPE_MASK); +} + /************************************************************************* Gets the nth bit of a record lock. */ UNIV_INLINE @@ -569,20 +584,6 @@ lock_get_mode( } /************************************************************************* -Gets the type of a lock. */ -UNIV_INLINE -ulint -lock_get_type( -/*==========*/ - /* out: LOCK_TABLE or LOCK_REC */ - lock_t* lock) /* in: lock */ -{ - ut_ad(lock); - - return(lock->type_mode & LOCK_TYPE_MASK); -} - -/************************************************************************* Gets the wait flag of a lock. */ UNIV_INLINE ibool @@ -602,6 +603,128 @@ lock_get_wait( } /************************************************************************* +Gets the source table of an ALTER TABLE transaction. The table must be +covered by an IX or IS table lock. */ + +dict_table_t* +lock_get_src_table( +/*===============*/ + /* out: the source table of transaction, + if it is covered by an IX or IS table lock; + dest if there is no source table, and + NULL if the transaction is locking more than + two tables or an inconsistency is found */ + trx_t* trx, /* in: transaction */ + dict_table_t* dest, /* in: destination of ALTER TABLE */ + ulint* mode) /* out: lock mode of the source table */ +{ + dict_table_t* src; + lock_t* lock; + + src = NULL; + *mode = LOCK_NONE; + + for (lock = UT_LIST_GET_FIRST(trx->trx_locks); + lock; + lock = UT_LIST_GET_NEXT(trx_locks, lock)) { + lock_table_t* tab_lock; + ulint lock_mode; + if (!(lock_get_type(lock) & LOCK_TABLE)) { + /* We are only interested in table locks. */ + continue; + } + tab_lock = &lock->un_member.tab_lock; + if (dest == tab_lock->table) { + /* We are not interested in the destination table. */ + continue; + } else if (!src) { + /* This presumably is the source table. */ + src = tab_lock->table; + if (UT_LIST_GET_LEN(src->locks) != 1 || + UT_LIST_GET_FIRST(src->locks) != lock) { + /* We only support the case when + there is only one lock on this table. */ + return(NULL); + } + } else if (src != tab_lock->table) { + /* The transaction is locking more than + two tables (src and dest): abort */ + return(NULL); + } + + /* Check that the source table is locked by + LOCK_IX or LOCK_IS. */ + lock_mode = lock_get_mode(lock); + switch (lock_mode) { + case LOCK_IX: + case LOCK_IS: + if (*mode != LOCK_NONE && *mode != lock_mode) { + /* There are multiple locks on src. */ + return(NULL); + } + *mode = lock_mode; + break; + } + } + + if (!src) { + /* No source table lock found: flag the situation to caller */ + src = dest; + } + + return(src); +} + +/************************************************************************* +Determine if the given table is exclusively "owned" by the given +transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC +on the table. */ + +ibool +lock_is_table_exclusive( +/*====================*/ + /* out: TRUE if table is only locked by trx, + with LOCK_IX, and possibly LOCK_AUTO_INC */ + dict_table_t* table, /* in: table */ + trx_t* trx) /* in: transaction */ +{ + lock_t* lock; + bool ok = FALSE; + + ut_ad(table && trx); + + for (lock = UT_LIST_GET_FIRST(table->locks); + lock; + lock = UT_LIST_GET_NEXT(locks, &lock->un_member.tab_lock)) { + if (lock->trx != trx) { + /* A lock on the table is held + by some other transaction. */ + return(FALSE); + } + + if (!(lock_get_type(lock) & LOCK_TABLE)) { + /* We are interested in table locks only. */ + continue; + } + + switch (lock_get_mode(lock)) { + case LOCK_IX: + ok = TRUE; + break; + case LOCK_AUTO_INC: + /* It is allowed for trx to hold an + auto_increment lock. */ + break; + default: + /* Other table locks than LOCK_IX are not allowed. */ + return(FALSE); + } + } + + return(ok); +} + +/************************************************************************* Sets the wait flag of a lock and the back pointer in trx to lock. */ UNIV_INLINE void @@ -4051,6 +4174,9 @@ lock_print_info( (ulong) ut_dulint_get_low(purge_sys->purge_undo_no)); fprintf(file, + "History list length %lu\n", (ulong) trx_sys->rseg_history_len); + + fprintf(file, "Total number of lock structs in row lock hash table %lu\n", (ulong) lock_get_n_rec_locks()); diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 10f921bb1f0..ae84f085523 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -2990,8 +2990,7 @@ recv_reset_log_files_for_backup( memcpy(name + log_dir_len, logfilename, sizeof logfilename); buf = ut_malloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE); - memset(buf, LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE, '\0'); - + memset(buf, '\0', LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE); for (i = 0; i < n_log_files; i++) { diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c index 023369e8ec5..cb891a03092 100644 --- a/innobase/mem/mem0pool.c +++ b/innobase/mem/mem0pool.c @@ -199,7 +199,7 @@ mem_pool_create( but only when allocated at a higher level in mem0mem.c. This is to avoid masking useful Purify warnings. */ - pool->buf = ut_malloc_low(size, FALSE); + pool->buf = ut_malloc_low(size, FALSE, TRUE); pool->size = size; mutex_create(&(pool->mutex)); diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 5c140e4b798..cc743ffad41 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -394,10 +394,19 @@ os_file_lock( lk.l_start = lk.l_len = 0; if (fcntl(fd, F_SETLK, &lk) == -1) { fprintf(stderr, - "InnoDB: Unable to lock %s, error: %d", name, errno); + "InnoDB: Unable to lock %s, error: %d\n", name, errno); + + if (errno == EAGAIN || errno == EACCES) { + fprintf(stderr, +"InnoDB: Check that you do not already have another mysqld process\n" +"InnoDB: using the same InnoDB data or log files.\n"); + } + close(fd); + return(-1); } + return(0); } #endif /* USE_FILE_LOCK */ @@ -477,7 +486,7 @@ os_io_init_simple(void) } } -#ifndef UNIV_HOTBACKUP +#if !defined(UNIV_HOTBACKUP) && !defined(__NETWARE__) /************************************************************************* Creates a temporary file. This function is defined in ha_innodb.cc. */ @@ -485,7 +494,7 @@ int innobase_mysql_tmpfile(void); /*========================*/ /* out: temporary file descriptor, or < 0 on error */ -#endif /* !UNIV_HOTBACKUP */ +#endif /* !UNIV_HOTBACKUP && !__NETWARE__ */ /*************************************************************************** Creates a temporary file. */ @@ -495,9 +504,12 @@ os_file_create_tmpfile(void) /*========================*/ /* out: temporary file handle, or NULL on error */ { +#ifdef __NETWARE__ + FILE* file = tmpfile(); +#else /* __NETWARE__ */ FILE* file = NULL; int fd = -1; -#ifdef UNIV_HOTBACKUP +# ifdef UNIV_HOTBACKUP int tries; for (tries = 10; tries--; ) { char* name = tempnam(fil_path_to_mysql_datadir, "ib"); @@ -506,15 +518,15 @@ os_file_create_tmpfile(void) } fd = open(name, -# ifdef __WIN__ +# ifdef __WIN__ O_SEQUENTIAL | O_SHORT_LIVED | O_TEMPORARY | -# endif /* __WIN__ */ +# endif /* __WIN__ */ O_CREAT | O_EXCL | O_RDWR, S_IREAD | S_IWRITE); if (fd >= 0) { -# ifndef __WIN__ +# ifndef __WIN__ unlink(name); -# endif /* !__WIN__ */ +# endif /* !__WIN__ */ free(name); break; } @@ -525,22 +537,25 @@ os_file_create_tmpfile(void) name); free(name); } -#else /* UNIV_HOTBACKUP */ +# else /* UNIV_HOTBACKUP */ fd = innobase_mysql_tmpfile(); -#endif /* UNIV_HOTBACKUP */ +# endif /* UNIV_HOTBACKUP */ if (fd >= 0) { file = fdopen(fd, "w+b"); } +#endif /* __NETWARE__ */ if (!file) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error: unable to create temporary file;" " errno: %d\n", errno); +#ifndef __NETWARE__ if (fd >= 0) { close(fd); } +#endif /* !__NETWARE__ */ } return(file); @@ -685,12 +700,12 @@ http://www.mysql.com/doc/en/Windows_symbolic_links.html */ } else if (lpFindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { info->type = OS_FILE_TYPE_DIR; - } else if (lpFindFileData->dwFileAttributes - & FILE_ATTRIBUTE_NORMAL) { -/* TODO: are FILE_ATTRIBUTE_NORMAL files really all normal files? */ - info->type = OS_FILE_TYPE_FILE; } else { - info->type = OS_FILE_TYPE_UNKNOWN; + /* It is probably safest to assume that all other + file types are normal. Better to check them rather + than blindly skip them. */ + + info->type = OS_FILE_TYPE_FILE; } } @@ -711,13 +726,41 @@ http://www.mysql.com/doc/en/Windows_symbolic_links.html */ char* full_path; int ret; struct stat statinfo; +#ifdef HAVE_READDIR_R + char dirent_buf[sizeof(struct dirent) + _POSIX_PATH_MAX + + 100]; + /* In /mysys/my_lib.c, _POSIX_PATH_MAX + 1 is used as + the max file name len; but in most standards, the + length is NAME_MAX; we add 100 to be even safer */ +#endif + next_file: - ent = readdir(dir); + +#ifdef HAVE_READDIR_R + ret = readdir_r(dir, (struct dirent*)dirent_buf, &ent); + + if (ret != 0) { + fprintf(stderr, +"InnoDB: cannot read directory %s, error %lu\n", dirname, (ulong)ret); + + return(-1); + } if (ent == NULL) { + /* End of directory */ + return(1); } + ut_a(strlen(ent->d_name) < _POSIX_PATH_MAX + 100 - 1); +#else + ent = readdir(dir); + + if (ent == NULL) { + + return(1); + } +#endif ut_a(strlen(ent->d_name) < OS_FILE_MAX_PATH); if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) { @@ -780,7 +823,7 @@ os_file_create_directory( rcode = CreateDirectory(pathname, NULL); if (!(rcode != 0 || - (GetLastError() == ERROR_FILE_EXISTS && !fail_if_exists))) { + (GetLastError() == ERROR_ALREADY_EXISTS && !fail_if_exists))) { /* failure */ os_file_handle_error(pathname, "CreateDirectory"); @@ -864,8 +907,9 @@ try_again: file = CreateFile(name, access, - FILE_SHARE_READ,/* file can be read also by other - processes */ + FILE_SHARE_READ | FILE_SHARE_WRITE, + /* file can be read ansd written also + by other processes */ NULL, /* default security attributes */ create_flag, attributes, @@ -970,7 +1014,7 @@ os_file_create_simple_no_error_handling( DWORD create_flag; DWORD access; DWORD attributes = 0; - DWORD share_mode = FILE_SHARE_READ; + DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE; ut_a(name); @@ -1293,7 +1337,7 @@ loop: return(TRUE); } - if (GetLastError() == ERROR_PATH_NOT_FOUND) { + if (GetLastError() == ERROR_FILE_NOT_FOUND) { /* the file does not exist, this not an error */ return(TRUE); @@ -1354,7 +1398,7 @@ loop: return(TRUE); } - if (GetLastError() == ERROR_PATH_NOT_FOUND) { + if (GetLastError() == ERROR_FILE_NOT_FOUND) { /* If the file does not exist, we classify this as a 'mild' error and return */ @@ -1726,7 +1770,33 @@ os_file_flush( #else int ret; -#ifdef HAVE_FDATASYNC +#if defined(HAVE_DARWIN_THREADS) +# ifndef F_FULLFSYNC + /* The following definition is from the Mac OS X 10.3 <sys/fcntl.h> */ +# define F_FULLFSYNC 51 /* fsync + ask the drive to flush to the media */ +# elif F_FULLFSYNC != 51 +# error "F_FULLFSYNC != 51: ABI incompatibility with Mac OS X 10.3" +# endif + /* Apple has disabled fsync() for internal disk drives in OS X. That + caused corruption for a user when he tested a power outage. Let us in + OS X use a nonstandard flush method recommended by an Apple + engineer. */ + + if (!srv_have_fullfsync) { + /* If we are not on an operating system that supports this, + then fall back to a plain fsync. */ + + ret = fsync(file); + } else { + ret = fcntl(file, F_FULLFSYNC, NULL); + + if (ret) { + /* If we are not on a file system that supports this, + then fall back to a plain fsync. */ + ret = fsync(file); + } + } +#elif HAVE_FDATASYNC ret = fdatasync(file); #else /* fprintf(stderr, "Flushing to file %p\n", file); */ @@ -1813,6 +1883,7 @@ os_file_pread( return(n_bytes); #else { + off_t ret_offset; ssize_t ret; ulint i; @@ -1821,12 +1892,12 @@ os_file_pread( os_mutex_enter(os_file_seek_mutexes[i]); - ret = lseek(file, offs, 0); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret < 0) { + if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); - return(ret); + return(-1); } ret = read(file, buf, (ssize_t)n); @@ -1899,6 +1970,7 @@ os_file_pwrite( return(ret); #else { + off_t ret_offset; ulint i; /* Protect the seek / write operation with a mutex */ @@ -1906,12 +1978,12 @@ os_file_pwrite( os_mutex_enter(os_file_seek_mutexes[i]); - ret = lseek(file, offs, 0); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret < 0) { + if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); - return(ret); + return(-1); } ret = write(file, buf, (ssize_t)n); diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c index 846cb060a7e..16d630dd318 100644 --- a/innobase/pars/pars0pars.c +++ b/innobase/pars/pars0pars.c @@ -259,9 +259,13 @@ pars_resolve_func_data_type( dtype_set(que_node_get_data_type(node), DATA_VARCHAR, DATA_ENGLISH, 0, 0); } else if (func == PARS_TO_BINARY_TOKEN) { - ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT); - dtype_set(que_node_get_data_type(node), DATA_VARCHAR, + if (dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT) { + dtype_set(que_node_get_data_type(node), DATA_VARCHAR, DATA_ENGLISH, 0, 0); + } else { + dtype_set(que_node_get_data_type(node), DATA_BINARY, + 0, 0, 0); + } } else if (func == PARS_TO_NUMBER_TOKEN) { ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_VARCHAR); diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c index 041fb7914e2..cf549284acc 100644 --- a/innobase/rem/rem0cmp.c +++ b/innobase/rem/rem0cmp.c @@ -261,22 +261,6 @@ cmp_whole_field( "InnoDB: comparison!\n"); } - /* MySQL does not pad the ends of strings with spaces in a - comparison. That would cause a foreign key check to fail for - non-latin1 character sets if we have different length columns. - To prevent that we remove trailing spaces here before doing - the comparison. NOTE that if we in the future map more MySQL - types to DATA_MYSQL or DATA_VARMYSQL, we have to change this - code. */ - - while (a_length > 0 && a[a_length - 1] == ' ') { - a_length--; - } - - while (b_length > 0 && b[b_length - 1] == ' ') { - b_length--; - } - return(innobase_mysql_cmp( (int)(type->prtype & DATA_MYSQL_TYPE_MASK), (uint)dtype_get_charset_coll(type->prtype), diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index c45818ddd26..15ffabf70cc 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1105,7 +1105,6 @@ row_ins_check_foreign_constraint( dict_table_t* check_table; dict_index_t* check_index; ulint n_fields_cmp; - ibool unique_search; rec_t* rec; btr_pcur_t pcur; ibool moved; @@ -1173,7 +1172,7 @@ run_again: check_index = foreign->foreign_index; } - if (check_table == NULL) { + if (check_table == NULL || check_table->ibd_file_missing) { if (check_ref) { FILE* ef = dict_foreign_err_file; mutex_enter(&dict_foreign_err_mutex); @@ -1192,7 +1191,7 @@ run_again: dtuple_print(ef, entry); fputs("\nBut the parent table ", ef); ut_print_name(ef, trx, foreign->referenced_table_name); - fputs(" does not currently exist!\n", ef); + fputs("\nor its .ibd file does not currently exist!\n", ef); mutex_exit(&dict_foreign_err_mutex); return(DB_NO_REFERENCED_ROW); @@ -1223,14 +1222,6 @@ run_again: dtuple_set_n_fields_cmp(entry, foreign->n_fields); - if (dict_index_get_n_unique(check_index) <= foreign->n_fields) { - /* We can just set a LOCK_REC_NOT_GAP type lock */ - - unique_search = TRUE; - } else { - unique_search = FALSE; - } - btr_pcur_open(check_index, entry, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); @@ -1268,17 +1259,13 @@ run_again: break; } } else { - /* Found a matching record */ + /* Found a matching record. Lock only + a record because we can allow inserts + into gaps */ - if (unique_search) { - err = row_ins_set_shared_rec_lock( - LOCK_REC_NOT_GAP, - rec, check_index, thr); - } else { - err = row_ins_set_shared_rec_lock( - LOCK_ORDINARY, - rec, check_index, thr); - } + err = row_ins_set_shared_rec_lock( + LOCK_REC_NOT_GAP, + rec, check_index, thr); if (err != DB_SUCCESS) { @@ -1415,8 +1402,34 @@ row_ins_check_foreign_constraints( row_mysql_freeze_data_dictionary(trx); } + if (foreign->referenced_table) { + mutex_enter(&(dict_sys->mutex)); + + (foreign->referenced_table + ->n_foreign_key_checks_running)++; + + mutex_exit(&(dict_sys->mutex)); + } + + /* NOTE that if the thread ends up waiting for a lock + we will release dict_operation_lock temporarily! + But the counter on the table protects the referenced + table from being dropped while the check is running. */ + err = row_ins_check_foreign_constraint(TRUE, foreign, table, entry, thr); + + if (foreign->referenced_table) { + mutex_enter(&(dict_sys->mutex)); + + ut_a(foreign->referenced_table + ->n_foreign_key_checks_running > 0); + (foreign->referenced_table + ->n_foreign_key_checks_running)--; + + mutex_exit(&(dict_sys->mutex)); + } + if (got_s_lock) { row_mysql_unfreeze_data_dictionary(trx); } @@ -1509,7 +1522,6 @@ row_ins_scan_sec_index_for_duplicate( ibool moved; mtr_t mtr; trx_t* trx; - const char* ptr; n_unique = dict_index_get_n_unique(index); @@ -1630,7 +1642,6 @@ row_ins_duplicate_error_in_clust( page_t* page; ulint n_unique; trx_t* trx = thr_get_trx(thr); - const char* ptr; UT_NOT_USED(mtr); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 241ddc310e8..482cf698547 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -308,7 +308,8 @@ handle_new_error: return(TRUE); - } else if (err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT) { + } else if (err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT + || err == DB_LOCK_TABLE_FULL) { /* Roll back the whole transaction; this resolution was added to version 3.23.43 */ @@ -416,7 +417,7 @@ row_create_prebuilt( prebuilt->sel_graph = NULL; prebuilt->search_tuple = dtuple_create(heap, - dict_table_get_n_cols(table)); + 2 * dict_table_get_n_cols(table)); clust_index = dict_table_get_first_index(table); @@ -779,8 +780,13 @@ int row_lock_table_for_mysql( /*=====================*/ /* out: error code or DB_SUCCESS */ - row_prebuilt_t* prebuilt) /* in: prebuilt struct in the MySQL + row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL table handle */ + dict_table_t* table, /* in: table to lock, or NULL + if prebuilt->table should be + locked as LOCK_TABLE_EXP | + prebuilt->select_lock_type */ + ulint mode) /* in: lock mode of table */ { trx_t* trx = prebuilt->trx; que_thr_t* thr; @@ -813,8 +819,12 @@ run_again: trx_start_if_not_started(trx); - err = lock_table(LOCK_TABLE_EXP, prebuilt->table, - prebuilt->select_lock_type, thr); + if (table) { + err = lock_table(0, table, mode, thr); + } else { + err = lock_table(LOCK_TABLE_EXP, prebuilt->table, + prebuilt->select_lock_type, thr); + } trx->error_state = err; @@ -859,7 +869,21 @@ row_insert_for_mysql( ut_ad(trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); - + + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" @@ -1077,6 +1101,20 @@ row_update_for_mysql( ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); UT_NOT_USED(mysql_rec); + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" @@ -1795,20 +1833,19 @@ row_drop_table_for_mysql_in_background( trx = trx_allocate_for_background(); + /* If the original transaction was dropping a table referenced by + foreign keys, we must set the following to be able to drop the + table: */ + + trx->check_foreigns = FALSE; + /* fputs("InnoDB: Error: Dropping table ", stderr); ut_print_name(stderr, name); fputs(" in background drop list\n", stderr); */ - /* Drop the table in InnoDB */ + /* Try to drop the table in InnoDB */ error = row_drop_table_for_mysql(name, trx, FALSE); - - if (error != DB_SUCCESS) { - ut_print_timestamp(stderr); - fputs(" InnoDB: Error: Dropping table ", stderr); - ut_print_name(stderr, trx, name); - fputs(" in background drop list failed\n", stderr); - } /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs @@ -1820,7 +1857,7 @@ row_drop_table_for_mysql_in_background( trx_free_for_background(trx); - return(DB_SUCCESS); + return(error); } /************************************************************************* @@ -1854,6 +1891,7 @@ loop: mutex_exit(&kernel_mutex); if (drop == NULL) { + /* All tables dropped */ return(n_tables + n_tables_dropped); } @@ -1868,16 +1906,16 @@ loop: goto already_dropped; } - - if (table->n_mysql_handles_opened > 0 - || table->n_foreign_key_checks_running > 0) { + + if (DB_SUCCESS != row_drop_table_for_mysql_in_background( + drop->table_name)) { + /* If the DROP fails for some table, we return, and let the + main thread retry later */ return(n_tables + n_tables_dropped); } n_tables_dropped++; - - row_drop_table_for_mysql_in_background(drop->table_name); already_dropped: mutex_enter(&kernel_mutex); @@ -1921,21 +1959,21 @@ row_get_background_drop_list_len_low(void) } /************************************************************************* -Adds a table to the list of tables which the master thread drops in -background. We need this on Unix because in ALTER TABLE MySQL may call -drop table even if the table has running queries on it. */ +If a table is not yet in the drop list, adds the table to the list of tables +which the master thread drops in background. We need this on Unix because in +ALTER TABLE MySQL may call drop table even if the table has running queries on +it. Also, if there are running foreign key checks on the table, we drop the +table lazily. */ static -void +ibool row_add_table_to_background_drop_list( /*==================================*/ + /* out: TRUE if the table was not yet in the + drop list, and was added there */ dict_table_t* table) /* in: table */ { row_mysql_drop_t* drop; - drop = mem_alloc(sizeof(row_mysql_drop_t)); - - drop->table_name = mem_strdup(table->name); - mutex_enter(&kernel_mutex); if (!row_mysql_drop_list_inited) { @@ -1943,7 +1981,26 @@ row_add_table_to_background_drop_list( UT_LIST_INIT(row_mysql_drop_list); row_mysql_drop_list_inited = TRUE; } + + /* Look if the table already is in the drop list */ + drop = UT_LIST_GET_FIRST(row_mysql_drop_list); + + while (drop != NULL) { + if (strcmp(drop->table_name, table->name) == 0) { + /* Already in the list */ + + mutex_exit(&kernel_mutex); + return(FALSE); + } + + drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop); + } + + drop = mem_alloc(sizeof(row_mysql_drop_t)); + + drop->table_name = mem_strdup(table->name); + UT_LIST_ADD_LAST(row_mysql_drop_list, row_mysql_drop_list, drop); /* fputs("InnoDB: Adding table ", stderr); @@ -1951,14 +2008,32 @@ row_add_table_to_background_drop_list( fputs(" to background drop list\n", stderr); */ mutex_exit(&kernel_mutex); + + return(TRUE); } /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding means that this function deletes the .ibd file and assigns a new table id for -the table. Also the flag table->ibd_file_missing is set TRUE. +the table. Also the flag table->ibd_file_missing is set TRUE. */ -How do we prevent crashes caused by ongoing operations on the table? Old +int +row_discard_tablespace_for_mysql( +/*=============================*/ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx) /* in: transaction handle */ +{ + dict_foreign_t* foreign; + dulint new_id; + dict_table_t* table; + que_thr_t* thr; + que_t* graph = NULL; + ibool success; + ulint err; + char* buf; + +/* How do we prevent crashes caused by ongoing operations on the table? Old operations could try to access non-existent pages. 1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock @@ -1974,22 +2049,9 @@ tablespace mem object with IMPORT TABLESPACE later, then the tablespace will have the same id, but the tablespace_version field in the mem object is different, and ongoing old insert buffer page merges get discarded. 4) Linear readahead and random readahead: we use the same method as in 3) to -discard ongoing operations. */ - -int -row_discard_tablespace_for_mysql( -/*=============================*/ - /* out: error code or DB_SUCCESS */ - const char* name, /* in: table name */ - trx_t* trx) /* in: transaction handle */ -{ - dulint new_id; - dict_table_t* table; - que_thr_t* thr; - que_t* graph = NULL; - ibool success; - ulint err; - char* buf; +discard ongoing operations. +5) FOREIGN KEY operations: if table->n_foreign_key_checks_running > 0, we +do not allow the discard. We also reserve the data dictionary latch. */ static const char discard_tablespace_proc1[] = "PROCEDURE DISCARD_TABLESPACE_PROC () IS\n" @@ -2050,6 +2112,54 @@ row_discard_tablespace_for_mysql( goto funct_exit; } + if (table->n_foreign_key_checks_running > 0) { + + ut_print_timestamp(stderr); + fputs(" InnoDB: You are trying to DISCARD table ", stderr); + ut_print_name(stderr, trx, table->name); + fputs("\n" + "InnoDB: though there is a foreign key check running on it.\n" + "InnoDB: Cannot discard the table.\n", + stderr); + + err = DB_ERROR; + + goto funct_exit; + } + + /* Check if the table is referenced by foreign key constraints from + some other table (not the table itself) */ + + foreign = UT_LIST_GET_FIRST(table->referenced_list); + + while (foreign && foreign->foreign_table == table) { + foreign = UT_LIST_GET_NEXT(referenced_list, foreign); + } + + if (foreign && trx->check_foreigns) { + + FILE* ef = dict_foreign_err_file; + + /* We only allow discarding a referenced table if + FOREIGN_KEY_CHECKS is set to 0 */ + + err = DB_CANNOT_DROP_CONSTRAINT; + + mutex_enter(&dict_foreign_err_mutex); + rewind(ef); + ut_print_timestamp(ef); + + fputs(" Cannot DISCARD table ", ef); + ut_print_name(ef, trx, name); + fputs("\n" + "because it is referenced by ", ef); + ut_print_name(ef, trx, foreign->foreign_table_name); + putc('\n', ef); + mutex_exit(&dict_foreign_err_mutex); + + goto funct_exit; + } + new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); buf = mem_alloc((sizeof discard_tablespace_proc1) + @@ -2067,6 +2177,10 @@ row_discard_tablespace_for_mysql( ut_a(graph); + /* Remove any locks there are on the table or its records */ + + lock_reset_all_on_table(table); + graph->trx = trx; trx->graph = NULL; @@ -2217,8 +2331,8 @@ row_import_tablespace_for_mysql( ibuf_delete_for_discarded_space(table->space); - success = fil_open_single_table_tablespace(table->space, table->name); - + success = fil_open_single_table_tablespace(TRUE, table->space, + table->name); if (success) { table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; @@ -2226,7 +2340,7 @@ row_import_tablespace_for_mysql( if (table->ibd_file_missing) { ut_print_timestamp(stderr); fputs( -" InnoDB: cannot find of open in the database directory the .ibd file of\n" +" InnoDB: cannot find or open in the database directory the .ibd file of\n" "InnoDB: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" @@ -2248,7 +2362,7 @@ funct_exit: } /************************************************************************* -Drops a table for MySQL. If the name of the table to be dropped is equal +Drops a table for MySQL. If the name of the table to be dropped is equal with one of the predefined magic table names, then this also stops printing the corresponding monitor output by the master thread. */ @@ -2314,7 +2428,8 @@ row_drop_table_for_mysql( "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" - " WHERE FOR_NAME = table_name;\n" + " WHERE FOR_NAME = table_name\n" + " AND TO_BINARY(FOR_NAME) = TO_BINARY(table_name);\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSE" @@ -2481,36 +2596,60 @@ row_drop_table_for_mysql( } if (table->n_mysql_handles_opened > 0) { + ibool added; - ut_print_timestamp(stderr); - fputs(" InnoDB: Warning: MySQL is trying to drop table ", - stderr); - ut_print_name(stderr, trx, table->name); - fputs("\n" - "InnoDB: though there are still open handles to it.\n" - "InnoDB: Adding the table to the background drop queue.\n", - stderr); + added = row_add_table_to_background_drop_list(table); - row_add_table_to_background_drop_list(table); + if (added) { + ut_print_timestamp(stderr); +fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); + ut_print_name(stderr, trx, table->name); + fputs("\n" +"InnoDB: though there are still open handles to it.\n" +"InnoDB: Adding the table to the background drop queue.\n", + stderr); + + /* We return DB_SUCCESS to MySQL though the drop will + happen lazily later */ - err = DB_SUCCESS; + err = DB_SUCCESS; + } else { + /* The table is already in the background drop list */ + err = DB_ERROR; + } goto funct_exit; } + /* TODO: could we replace the counter n_foreign_key_checks_running + with lock checks on the table? Acquire here an exclusive lock on the + table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that + they can cope with the table having been dropped here? Foreign key + checks take an IS or IX lock on the table. */ + if (table->n_foreign_key_checks_running > 0) { - ut_print_timestamp(stderr); - fputs(" InnoDB: You are trying to drop table ", stderr); - ut_print_name(stderr, trx, table->name); - fputs("\n" - "InnoDB: though there is a foreign key check running on it.\n" - "InnoDB: Adding the table to the background drop queue.\n", + ibool added; + + added = row_add_table_to_background_drop_list(table); + + if (added) { + ut_print_timestamp(stderr); +fputs(" InnoDB: You are trying to drop table ", stderr); + ut_print_name(stderr, trx, table->name); + fputs("\n" +"InnoDB: though there is a foreign key check running on it.\n" +"InnoDB: Adding the table to the background drop queue.\n", stderr); - row_add_table_to_background_drop_list(table); + /* We return DB_SUCCESS to MySQL though the drop will + happen lazily later */ - err = DB_SUCCESS; + err = DB_SUCCESS; + } else { + /* The table is already in the background drop list */ + err = DB_ERROR; + } goto funct_exit; } @@ -2769,7 +2908,8 @@ row_rename_table_for_mysql( "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" - " WHERE FOR_NAME = old_table_name;\n" + " WHERE FOR_NAME = old_table_name\n" + " AND TO_BINARY(FOR_NAME) = TO_BINARY(old_table_name);\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSE\n" @@ -2802,7 +2942,8 @@ row_rename_table_for_mysql( " END IF;\n" "END LOOP;\n" "UPDATE SYS_FOREIGN SET REF_NAME = new_table_name\n" - "WHERE REF_NAME = old_table_name;\n"; + "WHERE REF_NAME = old_table_name\n" + " AND TO_BINARY(REF_NAME) = TO_BINARY(old_table_name);\n"; static const char str5[] = "END;\n"; @@ -3012,7 +3153,11 @@ row_rename_table_for_mysql( if (err != DB_SUCCESS) { if (err == DB_DUPLICATE_KEY) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs( + " InnoDB: Error; possible reasons:\n" + "InnoDB: 1) Table rename would cause two FOREIGN KEY constraints\n" + "InnoDB: to have the same internal name in case-insensitive comparison.\n" + "InnoDB: 2) table ", stderr); ut_print_name(stderr, trx, new_name); fputs(" exists in the InnoDB internal data\n" "InnoDB: dictionary though MySQL is trying rename table ", stderr); @@ -3267,6 +3412,20 @@ row_check_table_for_mysql( ulint ret = DB_SUCCESS; ulint old_isolation_level; + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + prebuilt->trx->op_info = "checking table"; old_isolation_level = prebuilt->trx->isolation_level; diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 740241fa210..2de02081176 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -31,6 +31,7 @@ Created 12/19/1997 Heikki Tuuri #include "pars0pars.h" #include "row0mysql.h" #include "read0read.h" +#include "buf0lru.h" /* Maximum number of rows to prefetch; MySQL interface has another parameter */ #define SEL_MAX_N_PREFETCH 16 @@ -638,23 +639,24 @@ row_sel_get_clust_rec( if (!node->read_view) { /* Try to place a lock on the index record */ - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ - if ( srv_locks_unsafe_for_binlog ) - { - err = lock_clust_rec_read_check_and_lock(0, clust_rec, - index,node->row_lock_mode, LOCK_REC_NOT_GAP, thr); - } - else - { - err = lock_clust_rec_read_check_and_lock(0, clust_rec, index, - node->row_lock_mode, LOCK_ORDINARY, thr); - - } - - if (err != DB_SUCCESS) { + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. + */ + + if (srv_locks_unsafe_for_binlog) { + err = lock_clust_rec_read_check_and_lock(0, + clust_rec, + index, node->row_lock_mode, + LOCK_REC_NOT_GAP, thr); + } else { + err = lock_clust_rec_read_check_and_lock(0, + clust_rec, + index, node->row_lock_mode, + LOCK_ORDINARY, thr); + } + + if (err != DB_SUCCESS) { return(err); } @@ -729,8 +731,18 @@ sel_set_rec_lock( ulint type, /* in: LOCK_ORDINARY, LOCK_GAP, or LOC_REC_NOT_GAP */ que_thr_t* thr) /* in: query thread */ { + trx_t* trx; ulint err; + trx = thr_get_trx(thr); + + if (UT_LIST_GET_LEN(trx->trx_locks) > 10000) { + if (buf_LRU_buf_pool_running_out()) { + + return(DB_LOCK_TABLE_FULL); + } + } + if (index->type & DICT_CLUSTERED) { err = lock_clust_rec_read_check_and_lock(0, rec, index, mode, type, thr); @@ -1205,22 +1217,24 @@ rec_loop: if (!consistent_read) { - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ - - if ( srv_locks_unsafe_for_binlog ) - { - err = sel_set_rec_lock(page_rec_get_next(rec), index, - node->row_lock_mode, LOCK_REC_NOT_GAP, thr); - } - else - { - err = sel_set_rec_lock(page_rec_get_next(rec), index, - node->row_lock_mode, LOCK_ORDINARY, thr); - } - if (err != DB_SUCCESS) { + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. + */ + + if (srv_locks_unsafe_for_binlog) { + err = sel_set_rec_lock(page_rec_get_next(rec), + index, + node->row_lock_mode, + LOCK_REC_NOT_GAP, thr); + } else { + err = sel_set_rec_lock(page_rec_get_next(rec), + index, + node->row_lock_mode, + LOCK_ORDINARY, thr); + } + + if (err != DB_SUCCESS) { /* Note that in this case we will store in pcur the PREDECESSOR of the record we are waiting the lock for */ @@ -1245,21 +1259,18 @@ rec_loop: if (!consistent_read) { /* Try to place a lock on the index record */ - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. + */ - if ( srv_locks_unsafe_for_binlog ) - { - err = sel_set_rec_lock(rec, index, node->row_lock_mode, + if (srv_locks_unsafe_for_binlog) { + err = sel_set_rec_lock(rec, index, node->row_lock_mode, LOCK_REC_NOT_GAP, thr); - } - else - { - err = sel_set_rec_lock(rec, index, node->row_lock_mode, + } else { + err = sel_set_rec_lock(rec, index, node->row_lock_mode, LOCK_ORDINARY, thr); - } + } if (err != DB_SUCCESS) { @@ -2193,9 +2204,6 @@ row_sel_field_store_in_mysql_format( dest = row_mysql_store_var_len(dest, len); ut_memcpy(dest, data, len); - /* Pad with trailing spaces */ - memset(dest + len, ' ', col_len - len); - /* ut_ad(col_len >= len + 2); No real var implemented in MySQL yet! */ @@ -2323,7 +2331,45 @@ row_sel_store_mysql_rec( mysql_rec + templ->mysql_col_offset, templ->mysql_col_len, data, len, templ->type, templ->is_unsigned); - + + if (templ->type == DATA_VARCHAR + || templ->type == DATA_VARMYSQL + || templ->type == DATA_BINARY) { + /* Pad with trailing spaces */ + data = mysql_rec + templ->mysql_col_offset; + + /* Handle UCS2 strings differently. As no new + collations will be introduced in 4.1, we + hardcode the charset-collation codes here. + 5.0 will use a different approach. */ + if (templ->charset == 35 + || templ->charset == 90 + || (templ->charset >= 128 + && templ->charset <= 144)) { + /* space=0x0020 */ + ulint col_len = templ->mysql_col_len; + + ut_a(!(col_len & 1)); + if (len & 1) { + /* A 0x20 has been stripped + from the column. + Pad it back. */ + goto pad_0x20; + } + /* Pad the rest of the string + with 0x0020 */ + while (len < col_len) { + data[len++] = 0x00; + pad_0x20: + data[len++] = 0x20; + } + } else { + /* space=0x20 */ + memset(data + len, 0x20, + templ->mysql_col_len - len); + } + } + /* Cleanup */ if (extern_field_heap) { mem_heap_free(extern_field_heap); @@ -2357,8 +2403,29 @@ row_sel_store_mysql_rec( pad_char = '\0'; } - memset(mysql_rec + templ->mysql_col_offset, pad_char, - templ->mysql_col_len); + /* Handle UCS2 strings differently. As no new + collations will be introduced in 4.1, + we hardcode the charset-collation codes here. + 5.0 will use a different approach. */ + if (templ->charset == 35 + || templ->charset == 90 + || (templ->charset >= 128 + && templ->charset <= 144)) { + /* There are two bytes per char, so the length + has to be an even number. */ + ut_a(!(templ->mysql_col_len & 1)); + data = mysql_rec + templ->mysql_col_offset; + len = templ->mysql_col_len; + /* Pad with 0x0020. */ + while (len >= 2) { + *data++ = 0x00; + *data++ = 0x20; + len -= 2; + } + } else { + memset(mysql_rec + templ->mysql_col_offset, + pad_char, templ->mysql_col_len); + } } } @@ -2765,6 +2832,7 @@ row_search_for_mysql( /* out: DB_SUCCESS, DB_RECORD_NOT_FOUND, DB_END_OF_INDEX, DB_DEADLOCK, + DB_LOCK_TABLE_FULL, DB_CORRUPTION, or DB_TOO_BIG_RECORD */ byte* buf, /* in/out: buffer for the fetched row in the MySQL format */ @@ -2816,7 +2884,21 @@ row_search_for_mysql( ut_ad(index && pcur && search_tuple); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); - + + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" @@ -2830,14 +2912,19 @@ row_search_for_mysql( ut_error; } - if (trx->n_mysql_tables_in_use == 0) { + if (trx->n_mysql_tables_in_use == 0 + && prebuilt->select_lock_type == LOCK_NONE) { + /* Note that if MySQL uses an InnoDB temp table that it + created inside LOCK TABLES, then n_mysql_tables_in_use can + be zero; in that case select_lock_type is set to LOCK_X in + ::start_stmt. */ + fputs( "InnoDB: Error: MySQL is trying to perform a SELECT\n" "InnoDB: but it has not locked any tables in ::external_lock()!\n", stderr); trx_print(stderr, trx); fputc('\n', stderr); - ut_a(0); } /* fprintf(stderr, "Match mode %lu\n search tuple ", (ulong) match_mode); @@ -3209,8 +3296,7 @@ rec_loop: we do not lock gaps. Supremum record is really a gap and therefore we do not set locks there. */ - if ( srv_locks_unsafe_for_binlog == FALSE ) - { + if (srv_locks_unsafe_for_binlog == FALSE) { err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_ORDINARY, thr); @@ -3312,11 +3398,18 @@ rec_loop: if (prebuilt->select_lock_type != LOCK_NONE && set_also_gap_locks) { - /* Try to place a lock on the index record */ - err = sel_set_rec_lock(rec, index, + /* Try to place a gap lock on the index + record only if innodb_locks_unsafe_for_binlog + option is not set */ + + if (srv_locks_unsafe_for_binlog == FALSE) { + + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_GAP, thr); + } + if (err != DB_SUCCESS) { goto lock_wait_or_error; @@ -3338,11 +3431,18 @@ rec_loop: if (prebuilt->select_lock_type != LOCK_NONE && set_also_gap_locks) { - /* Try to place a lock on the index record */ - err = sel_set_rec_lock(rec, index, + /* Try to place a gap lock on the index + record only if innodb_locks_unsafe_for_binlog + option is not set */ + + if (srv_locks_unsafe_for_binlog == FALSE) { + + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_GAP, thr); + } + if (err != DB_SUCCESS) { goto lock_wait_or_error; @@ -3376,19 +3476,16 @@ rec_loop: prebuilt->select_lock_type, LOCK_REC_NOT_GAP, thr); } else { - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ - if ( srv_locks_unsafe_for_binlog ) - { - err = sel_set_rec_lock(rec, index, + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. */ + + if (srv_locks_unsafe_for_binlog) { + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_REC_NOT_GAP, thr); - } - else - { - err = sel_set_rec_lock(rec, index, + } else { + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_ORDINARY, thr); } diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index a449b9f1736..9192f6dc692 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -381,8 +381,14 @@ row_upd_changes_field_size_or_external( new_len = new_val->len; if (new_len == UNIV_SQL_NULL) { + /* A bug fixed on Dec 31st, 2004: we looked at the + SQL NULL size from the wrong field! We may backport + this fix also to 4.0. The merge to 5.0 will be made + manually immediately after we commit this to 4.1. */ + new_len = dtype_get_sql_null_size( - dict_index_get_nth_type(index, i)); + dict_index_get_nth_type(index, + upd_field->field_no)); } old_len = rec_get_nth_field_size(rec, upd_field->field_no); diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index b8d03cfab5f..f61cc569f6b 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1490,7 +1490,6 @@ srv_printf_innodb_monitor( srv_last_monitor_time = time(NULL); - rewind(file); fputs("\n=====================================\n", file); ut_print_timestamp(file); @@ -1677,11 +1676,13 @@ loop: srv_printf_innodb_monitor(stderr); } - mutex_enter(&srv_monitor_file_mutex); - rewind(srv_monitor_file); - srv_printf_innodb_monitor(srv_monitor_file); - os_file_set_eof(srv_monitor_file); - mutex_exit(&srv_monitor_file_mutex); + if (srv_innodb_status) { + mutex_enter(&srv_monitor_file_mutex); + rewind(srv_monitor_file); + srv_printf_innodb_monitor(srv_monitor_file); + os_file_set_eof(srv_monitor_file); + mutex_exit(&srv_monitor_file_mutex); + } if (srv_print_innodb_tablespace_monitor && difftime(current_time, last_table_monitor_time) > 60) { diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 9709f5235de..fe05f07df21 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -61,6 +61,11 @@ dulint srv_start_lsn; /* Log sequence number at shutdown */ dulint srv_shutdown_lsn; +#ifdef HAVE_DARWIN_THREADS +# include <sys/utsname.h> +ibool srv_have_fullfsync = FALSE; +#endif + ibool srv_start_raw_disk_in_use = FALSE; static ibool srv_start_has_been_called = FALSE; @@ -935,6 +940,28 @@ innobase_start_or_create_for_mysql(void) ulint i; ibool srv_file_per_table_original_value = srv_file_per_table; mtr_t mtr; +#ifdef HAVE_DARWIN_THREADS +# ifdef F_FULLFSYNC + /* This executable has been compiled on Mac OS X 10.3 or later. + Assume that F_FULLFSYNC is available at run-time. */ + srv_have_fullfsync = TRUE; +# else /* F_FULLFSYNC */ + /* This executable has been compiled on Mac OS X 10.2 + or earlier. Determine if the executable is running + on Mac OS X 10.3 or later. */ + struct utsname utsname; + if (uname(&utsname)) { + fputs("InnoDB: cannot determine Mac OS X version!\n", stderr); + } else { + srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0; + } + if (!srv_have_fullfsync) { + fputs( +"InnoDB: On Mac OS X, fsync() may be broken on internal drives,\n" +"InnoDB: making transactions unsafe!\n", stderr); + } +# endif /* F_FULLFSYNC */ +#endif /* HAVE_DARWIN_THREADS */ if (sizeof(ulint) != sizeof(void*)) { fprintf(stderr, @@ -1172,6 +1199,9 @@ NetWare. */ } if (ret == NULL) { + fprintf(stderr, +"InnoDB: Fatal error: cannot allocate the memory for the buffer pool\n"); + return(DB_ERROR); } @@ -1375,14 +1405,39 @@ NetWare. */ return(DB_ERROR); } - /* Since ibuf init is in dict_boot, and ibuf is needed - in any disk i/o, first call dict_boot */ + /* Since the insert buffer init is in dict_boot, and the + insert buffer is needed in any disk i/o, first we call + dict_boot(). Note that trx_sys_init_at_db_start() only needs + to access space 0, and the insert buffer at this stage already + works for space 0. */ dict_boot(); trx_sys_init_at_db_start(); - /* The following needs trx lists which are initialized in - trx_sys_init_at_db_start */ + if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { + /* The following call is necessary for the insert + buffer to work with multiple tablespaces. We must + know the mapping between space id's and .ibd file + names. + + In a crash recovery, we check that the info in data + dictionary is consistent with what we already know + about space id's from the call of + fil_load_single_table_tablespaces(). + + In a normal startup, we create the space objects for + every table in the InnoDB data dictionary that has + an .ibd file. + + We also determine the maximum tablespace id used. + + TODO: We may have incomplete transactions in the + data dictionary tables. Does that harm the scanning of + the data dictionary below? */ + + dict_check_tablespaces_and_store_max_id( + recv_needed_recovery); + } srv_startup_is_before_trx_rollback_phase = FALSE; @@ -1390,6 +1445,9 @@ NetWare. */ system */ fsp_header_get_free_limit(0); + /* recv_recovery_from_checkpoint_finish needs trx lists which + are initialized in trx_sys_init_at_db_start(). */ + recv_recovery_from_checkpoint_finish(); } @@ -1430,13 +1488,6 @@ NetWare. */ } } #endif /* UNIV_LOG_ARCHIVE */ - if (!create_new_db && srv_force_recovery == 0) { - /* After a crash recovery we only check that the info in data - dictionary is consistent with what we already know about space - id's from the call of fil_load_single_table_tablespaces(). */ - - dict_check_tablespaces_or_store_max_id(recv_needed_recovery); - } if (srv_measure_contention) { /* os_thread_create(&test_measure_cont, NULL, thread_ids + @@ -1504,6 +1555,21 @@ NetWare. */ "InnoDB: the sum of data file sizes is %lu pages\n", (ulong) tablespace_size_in_header, (ulong) sum_of_data_file_sizes); + + if (srv_force_recovery == 0 + && sum_of_data_file_sizes < tablespace_size_in_header) { + /* This is a fatal error, the tail of a tablespace is + missing */ + + fprintf(stderr, +"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n" +"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n" +"InnoDB: inappropriate way, removing ibdata files from there?\n" +"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n" +"InnoDB: a startup if you are trying to recover a badly corrupt database.\n"); + + return(DB_ERROR); + } } if (srv_auto_extend_last_data_file @@ -1514,6 +1580,18 @@ NetWare. */ "InnoDB: the sum of data file sizes is only %lu pages\n", (ulong) tablespace_size_in_header, (ulong) sum_of_data_file_sizes); + + if (srv_force_recovery == 0) { + + fprintf(stderr, +"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n" +"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n" +"InnoDB: inappropriate way, removing ibdata files from there?\n" +"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n" +"InnoDB: a startup if you are trying to recover a badly corrupt database.\n"); + + return(DB_ERROR); + } } /* Check that os_fast_mutexes work as expected */ diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c index 5c62640e011..3df34111281 100644 --- a/innobase/trx/trx0purge.c +++ b/innobase/trx/trx0purge.c @@ -289,7 +289,7 @@ trx_purge_add_update_undo_to_history( flst_get_len(seg_header + TRX_UNDO_PAGE_LIST, mtr)); mlog_write_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE, - hist_size + undo->size, MLOG_4BYTES, mtr); + hist_size + undo->size, MLOG_4BYTES, mtr); } /* Add the log as the first in the history list */ @@ -646,6 +646,27 @@ trx_purge_rseg_get_next_history_log( mutex_exit(&(rseg->mutex)); mtr_commit(&mtr); + mutex_enter(&kernel_mutex); + + /* Add debug code to track history list corruption reported + on the MySQL mailing list on Nov 9, 2004. The fut0lst.c + file-based list was corrupt. The prev node pointer was + FIL_NULL, even though the list length was over 8 million nodes! + We assume that purge truncates the history list in moderate + size pieces, and if we here reach the head of the list, the + list cannot be longer than 20 000 undo logs now. */ + + if (trx_sys->rseg_history_len > 20000) { + ut_print_timestamp(stderr); + fprintf(stderr, +" InnoDB: Warning: purge reached the head of the history list,\n" +"InnoDB: but its length is still reported as %lu! Make a detailed bug\n" +"InnoDB: report, and post it to bugs.mysql.com\n", + (ulong)trx_sys->rseg_history_len); + } + + mutex_exit(&kernel_mutex); + return; } diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index f7497ac4090..af4f1979858 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -109,6 +109,9 @@ trx_create( trx->mysql_log_offset = 0; trx->mysql_master_log_file_name = ""; trx->mysql_master_log_pos = 0; + + trx->repl_wait_binlog_name = NULL; + trx->repl_wait_binlog_pos = 0; mutex_create(&(trx->undo_mutex)); mutex_set_level(&(trx->undo_mutex), SYNC_TRX_UNDO); @@ -271,6 +274,11 @@ trx_free( trx_undo_arr_free(trx->undo_no_arr); } + if (trx->repl_wait_binlog_name != NULL) { + + mem_free(trx->repl_wait_binlog_name); + } + ut_a(UT_LIST_GET_LEN(trx->signals) == 0); ut_a(UT_LIST_GET_LEN(trx->reply_signals) == 0); diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c index c1edc223cbc..8d1518753dd 100644 --- a/innobase/trx/trx0undo.c +++ b/innobase/trx/trx0undo.c @@ -1241,7 +1241,7 @@ trx_undo_lists_init( if (page_no != FIL_NULL && srv_force_recovery < SRV_FORCE_NO_UNDO_LOG_SCAN) { - + undo = trx_undo_mem_create_at_db_start(rseg, i, page_no, &mtr); size += undo->size; diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index a6002d7fd83..6ed61b0b5de 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -61,8 +61,10 @@ ut_malloc_low( /*==========*/ /* out, own: allocated memory */ ulint n, /* in: number of bytes to allocate */ - ibool set_to_zero) /* in: TRUE if allocated memory should be set + ibool set_to_zero, /* in: TRUE if allocated memory should be set to zero if UNIV_SET_MEM_TO_ZERO is defined */ + ibool assert_on_error) /* in: if TRUE, we crash mysqld if the memory + cannot be allocated */ { void* ret; @@ -86,9 +88,7 @@ ut_malloc_low( "InnoDB: Check if you should increase the swap file or\n" "InnoDB: ulimits of your operating system.\n" "InnoDB: On FreeBSD check you have compiled the OS with\n" - "InnoDB: a big enough maximum process size.\n" - "InnoDB: We now intentionally generate a seg fault so that\n" - "InnoDB: on Linux we get a stack trace.\n", + "InnoDB: a big enough maximum process size.\n", (ulong) n, (ulong) ut_total_allocated_memory, #ifdef __WIN__ (ulong) GetLastError() @@ -110,7 +110,15 @@ ut_malloc_low( /* Intentional segfault on NetWare causes an abend. Avoid this by graceful exit handling in ut_a(). */ #if (!defined __NETWARE__) - if (*ut_mem_null_ptr) ut_mem_null_ptr = 0; + if (assert_on_error) { + fprintf(stderr, + "InnoDB: We now intentionally generate a seg fault so that\n" + "InnoDB: on Linux we get a stack trace.\n"); + + if (*ut_mem_null_ptr) ut_mem_null_ptr = 0; + } else { + return(NULL); + } #else ut_a(0); #endif @@ -144,7 +152,7 @@ ut_malloc( /* out, own: allocated memory */ ulint n) /* in: number of bytes to allocate */ { - return(ut_malloc_low(n, TRUE)); + return(ut_malloc_low(n, TRUE, TRUE)); } /************************************************************************** diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index b67be77b29e..18722149a8f 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -44,13 +44,13 @@ ut_get_high32( /* out: a >> 32 */ ulint a) /* in: ulint */ { -#if SIZEOF_LONG == 4 - UT_NOT_USED(a); + ib_longlong i; - return 0; -#else - return(a >> 32); -#endif + i = (ib_longlong)a; + + i = i >> 32; + + return((ulint)i); } /************************************************************ @@ -235,13 +235,18 @@ ut_get_year_month_day( *month = (ulint)cal_tm.wMonth; *day = (ulint)cal_tm.wDay; #else + struct tm cal_tm; struct tm* cal_tm_ptr; time_t tm; time(&tm); +#ifdef HAVE_LOCALTIME_R + localtime_r(&tm, &cal_tm); + cal_tm_ptr = &cal_tm; +#else cal_tm_ptr = localtime(&tm); - +#endif *year = (ulint)cal_tm_ptr->tm_year + 1900; *month = (ulint)cal_tm_ptr->tm_mon + 1; *day = (ulint)cal_tm_ptr->tm_mday; diff --git a/isam/pack_isam.c b/isam/pack_isam.c index aa83b2b2a96..0134e0411b2 100644 --- a/isam/pack_isam.c +++ b/isam/pack_isam.c @@ -260,6 +260,8 @@ static struct my_option my_long_options[] = }; +#include <help_start.h> + static void print_version(void) { printf("%s Ver 5.10 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); @@ -283,6 +285,8 @@ static void usage(void) my_print_variables(my_long_options); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/isam/sort.c b/isam/sort.c index d22b0e648a0..5d13f8085d2 100644 --- a/isam/sort.c +++ b/isam/sort.c @@ -122,7 +122,10 @@ uint sortbuff_size; MYF(0)))) break; else + { my_free((gptr) sort_keys,MYF(0)); + sort_keys= 0; + } } old_memavl=memavl; if ((memavl=memavl/4*3) < MIN_SORT_MEMORY && old_memavl > MIN_SORT_MEMORY) diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index 5c2dc9c7ba6..72ff44ecef3 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -30,7 +30,7 @@ include $(srcdir)/Makefile.shared libmysqlclient_la_SOURCES = $(target_sources) libmysqlclient_la_LIBADD = $(target_libadd) libmysqlclient_la_LDFLAGS = $(target_ldflags) -EXTRA_DIST = Makefile.shared +EXTRA_DIST = Makefile.shared libmysql.def noinst_HEADERS = client_settings.h # This is called from the toplevel makefile diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index 710bf4ccd8d..5fa94e5ff0d 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -78,7 +78,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; /* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ @@ -137,7 +139,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; #else /* ENGLISH */ @@ -194,7 +198,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; #endif diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 2dfdfbb687b..16dda115ee9 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -158,7 +158,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), (void) signal(SIGPIPE, SIG_IGN); #endif #ifdef EMBEDDED_LIBRARY - result= init_embedded_server(argc, argv, groups); + if (argc > -1) + result= init_embedded_server(argc, argv, groups); #endif } #ifdef THREAD @@ -851,6 +852,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) err: /* free up memory allocated with _init, usually */ (*options->local_infile_end)(li_ptr); + my_free(buf, MYF(0)); DBUG_RETURN(result); } @@ -1503,7 +1505,7 @@ ulong STDCALL mysql_thread_id(MYSQL *mysql) const char * STDCALL mysql_character_set_name(MYSQL *mysql) { - return mysql->charset->name; + return mysql->charset->csname; } @@ -1563,7 +1565,8 @@ void my_net_local_init(NET *net) trailing '. The caller must supply whichever of those is desired. */ -ulong mysql_hex_string(char *to, const char *from, ulong length) +ulong STDCALL +mysql_hex_string(char *to, const char *from, ulong length) { char *to0= to; const char *end; @@ -1752,6 +1755,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); */ #define MAX_DATETIME_REP_LENGTH 12 +#define MAX_DOUBLE_STRING_REP_LENGTH 331 /**************** Misc utility functions ****************************/ @@ -1784,6 +1788,18 @@ static my_bool my_realloc_str(NET *net, ulong length) } +/* Clear possible error statee of struct NET */ + +static void net_clear_error(NET *net) +{ + if (net->last_errno) + { + net->last_errno= 0; + net->last_error[0]= '\0'; + strmov(net->sqlstate, not_error_sqlstate); + } +} + /* Set statement error code, sqlstate, and error message from given errcode and sqlstate. @@ -1885,22 +1901,6 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) DBUG_RETURN(0); } -#ifdef HAVE_DEPRECATED_411_API -MYSQL_STMT * STDCALL mysql_prepare(MYSQL *mysql, const char *query, - unsigned long query_length) -{ - MYSQL_STMT *stmt; - DBUG_ENTER("mysql_prepare"); - - stmt= mysql_stmt_init(mysql); - if (stmt && mysql_stmt_prepare(stmt, query, query_length)) - { - mysql_stmt_close(stmt); - DBUG_RETURN(0); - } - DBUG_RETURN(stmt); -} -#endif /* Allocate memory and init prepared statement structure. @@ -2153,12 +2153,12 @@ static void update_stmt_fields(MYSQL_STMT *stmt) DESCRIPTION This function should be used after mysql_stmt_execute(). You can safely check that prepared statement has a result set by calling - mysql_stmt_num_fields(): if number of fields is not zero, you can call + mysql_stmt_field_count(): if number of fields is not zero, you can call this function to get fields metadata. Next steps you may want to make: - find out number of columns in result set by calling mysql_num_fields(res) (the same value is returned by - mysql_stmt_num_fields) + mysql_stmt_field_count()) - fetch metadata for any column with mysql_fetch_field, mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek. - free returned MYSQL_RES structure with mysql_free_result. @@ -2479,6 +2479,11 @@ int cli_stmt_execute(MYSQL_STMT *stmt) set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate); DBUG_RETURN(1); } + if (stmt->mysql->status != MYSQL_STATUS_READY) + { + set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); + DBUG_RETURN(1); + } net_clear(net); /* Sets net->write_pos */ /* Reserve place for null-marker bytes */ @@ -2990,7 +2995,7 @@ static my_bool int_is_null_false= 0; values and mysql_stmt_execute() the statement. See also: mysql_stmt_send_long_data() for sending long text/blob - data in pieces, examples in tests/client_test.c. + data in pieces, examples in tests/mysql_client_test.c. Next steps you might want to make: - execute statement with mysql_stmt_execute(), - reset statement using mysql_stmt_reset() or reprepare it with @@ -3265,12 +3270,18 @@ static void read_binary_time(MYSQL_TIME *tm, uchar **pos) tm->second= (uint) to[7]; tm->second_part= (length > 8) ? (ulong) sint4korr(to+8) : 0; tm->year= tm->month= 0; + if (tm->day) + { + /* Convert days to hours at once */ + tm->hour+= tm->day*24; + tm->day= 0; + } + tm->time_type= MYSQL_TIMESTAMP_TIME; *pos+= length; } else - set_zero_time(tm); - tm->time_type= MYSQL_TIMESTAMP_TIME; + set_zero_time(tm, MYSQL_TIMESTAMP_TIME); } static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos) @@ -3295,12 +3306,12 @@ static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos) else tm->hour= tm->minute= tm->second= 0; tm->second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; + tm->time_type= MYSQL_TIMESTAMP_DATETIME; *pos+= length; } else - set_zero_time(tm); - tm->time_type= MYSQL_TIMESTAMP_DATETIME; + set_zero_time(tm, MYSQL_TIMESTAMP_DATETIME); } static void read_binary_date(MYSQL_TIME *tm, uchar **pos) @@ -3317,12 +3328,12 @@ static void read_binary_date(MYSQL_TIME *tm, uchar **pos) tm->hour= tm->minute= tm->second= 0; tm->second_part= 0; tm->neg= 0; + tm->time_type= MYSQL_TIMESTAMP_DATE; *pos+= length; } else - set_zero_time(tm); - tm->time_type= MYSQL_TIMESTAMP_DATE; + set_zero_time(tm, MYSQL_TIMESTAMP_DATE); } @@ -3379,14 +3390,17 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value, } case MYSQL_TYPE_FLOAT: { + char *end_not_used; float data = (float) my_strntod(&my_charset_latin1, value, length, - NULL, &err); + &end_not_used, &err); floatstore(buffer, data); break; } case MYSQL_TYPE_DOUBLE: { - double data= my_strntod(&my_charset_latin1, value, length, NULL, &err); + char *end_not_used; + double data= my_strntod(&my_charset_latin1, value, length, &end_not_used, + &err); doublestore(buffer, data); break; } @@ -3558,7 +3572,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, floating point -> string conversion nicely, honor all typecodes and param->offset possibly set in mysql_stmt_fetch_column */ - char buff[331]; + char buff[MAX_DOUBLE_STRING_REP_LENGTH]; char *end; /* TODO: move this to a header shared between client and server. */ #define NOT_FIXED_DEC 31 @@ -3671,8 +3685,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */ case MYSQL_TYPE_LONG: { - long value= sint4korr(*row); - longlong data= field_is_unsigned ? (longlong) (unsigned long) value : + int32 value= sint4korr(*row); + longlong data= field_is_unsigned ? (longlong) (uint32) value : (longlong) value; fetch_long_with_conversion(param, field, data); *row+= 4; @@ -3890,11 +3904,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) if (!bind_count) { - if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE) - { - set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); - } - DBUG_RETURN(0); + int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ? + CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA; + set_stmt_error(stmt, errorcode, unknown_sqlstate); + DBUG_RETURN(1); } /* @@ -3992,32 +4005,43 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) switch (field->type) { case MYSQL_TYPE_NULL: /* for dummy binds */ param->pack_length= 0; + field->max_length= 0; break; case MYSQL_TYPE_TINY: param->pack_length= 1; + field->max_length= 4; /* as in '-127' */ break; case MYSQL_TYPE_YEAR: case MYSQL_TYPE_SHORT: param->pack_length= 2; + field->max_length= 6; /* as in '-32767' */ break; case MYSQL_TYPE_INT24: + field->max_length= 9; /* as in '16777216' or in '-8388607' */ + param->pack_length= 4; + break; case MYSQL_TYPE_LONG: + field->max_length= 11; /* '-2147483647' */ param->pack_length= 4; break; case MYSQL_TYPE_LONGLONG: + field->max_length= 21; /* '18446744073709551616' */ param->pack_length= 8; break; case MYSQL_TYPE_FLOAT: param->pack_length= 4; + field->max_length= MAX_DOUBLE_STRING_REP_LENGTH; break; case MYSQL_TYPE_DOUBLE: param->pack_length= 8; + field->max_length= MAX_DOUBLE_STRING_REP_LENGTH; break; case MYSQL_TYPE_TIME: case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_TIMESTAMP: param->skip_result= skip_result_with_length; + field->max_length= MAX_DATE_STRING_REP_LENGTH; break; case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_ENUM: @@ -4275,7 +4299,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data) row+= (stmt->field_count+9)/8; /* skip null bits */ bit= 4; /* first 2 bits are reserved */ - /* Go throw all fields and calculate metadata */ + /* Go through all fields and calculate metadata */ for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ; bind < end ; bind++, field++) @@ -4410,6 +4434,12 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row) for (; tmp && row; --row, tmp= tmp->next) ; stmt->data_cursor= tmp; + if (!row && tmp) + { + /* Rewind the counter */ + stmt->read_row_func= stmt_read_row_buffered; + stmt->state= MYSQL_STMT_EXECUTE_DONE; + } DBUG_VOID_RETURN; } @@ -4491,6 +4521,11 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) if (mysql) { mysql->stmts= list_delete(mysql->stmts, &stmt->list); + /* + Clear NET error state: if the following commands come through + successfully, connection will still be usable for other commands. + */ + net_clear_error(&mysql->net); if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) { char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index bc91e90a41c..c5579e9ec2b 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -47,6 +47,7 @@ EXPORTS mysql_errno mysql_error mysql_escape_string + mysql_hex_string mysql_stmt_execute mysql_stmt_fetch mysql_stmt_fetch_column @@ -145,3 +146,4 @@ EXPORTS mysql_rpl_query_type mysql_slave_query mysql_embedded + get_defaults_files diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am index 939cb4c73dd..0a5c380ff35 100644 --- a/libmysql_r/Makefile.am +++ b/libmysql_r/Makefile.am @@ -22,7 +22,7 @@ target = libmysqlclient_r.la target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ -LIBS = @LIBS@ @openssl_libs@ +LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ INCLUDES = @MT_INCLUDES@ \ -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 75a5ef7ff91..ba30a41c32b 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -26,7 +26,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \ - -I$(top_srcdir)/sql -I$(top_srcdir)/regex \ + -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples -I$(top_srcdir)/regex \ $(openssl_includes) @ZLIB_INCLUDES@ noinst_LIBRARIES = libmysqld_int.a @@ -35,6 +35,7 @@ SUBDIRS = . examples libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ my_time.c +sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc noinst_HEADERS = embedded_priv.h emb_qcache.h @@ -59,7 +60,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) libmysqld_a_SOURCES= # automake misses these @@ -123,12 +124,16 @@ link_sources: rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../libmysql/$$f $(srcdir)/$$f; \ done; \ + for f in $(sqlexamplessources); do \ + rm -f $(srcdir)/$$f; \ + @LN_CP_F@ $(srcdir)/../sql/examples/$$f $(srcdir)/$$f; \ + done; \ rm -f $(srcdir)/client_settings.h; \ @LN_CP_F@ $(srcdir)/../libmysql/client_settings.h $(srcdir)/client_settings.h; clean-local: - rm -f `echo $(sqlsources) $(libmysqlsources) | sed "s;\.lo;.c;g"` \ + rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \ $(top_srcdir)/linked_libmysqld_sources; \ rm -f client_settings.h diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc index 7d83023abd5..2d3d82b7952 100644 --- a/libmysqld/emb_qcache.cc +++ b/libmysqld/emb_qcache.cc @@ -71,9 +71,11 @@ void Querycache_stream::store_int(uint i) cur_data+= 4; return; } - memcpy(cur_data, &i, rest_len); + char buf[4]; + int4store(buf, i); + memcpy(cur_data, buf, rest_len); use_next_block(); - memcpy(cur_data, ((byte*)&i)+rest_len, 4-rest_len); + memcpy(cur_data, buf+rest_len, 4-rest_len); cur_data+= 4-rest_len; } @@ -186,10 +188,12 @@ uint Querycache_stream::load_int() cur_data+= 4; return result; } - memcpy(&result, cur_data, rest_len); + char buf[4]; + memcpy(buf, cur_data, rest_len); use_next_block(); - memcpy(((byte*)&result)+rest_len, cur_data, 4-rest_len); + memcpy(buf+rest_len, cur_data, 4-rest_len); cur_data+= 4-rest_len; + result= uint4korr(buf); return result; } @@ -270,10 +274,10 @@ int Querycache_stream::load_column(MEM_ROOT *alloc, char** column) return 0; } len--; - if (!(*column= (char *)alloc_root(alloc, len + 4 + 1))) + if (!(*column= (char *)alloc_root(alloc, len + sizeof(uint) + 1))) return 1; - int4store(*column, len); - (*column)+= 4; + *((uint*)*column)= len; + (*column)+= sizeof(uint); load_str_only(*column, len); return 1; } diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index 5b0a86e679c..51a7252440a 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -1,6 +1,7 @@ -noinst_PROGRAMS = mysqltest mysql client_test -client_sources = $(mysqltest_SOURCES) $(mysql_SOURCES) -tests_sources= $(client_test_SOURCES) +noinst_PROGRAMS = mysql +bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded +client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES) +tests_sources= $(mysql_client_test_embedded_SOURCES) link_sources: for f in $(client_sources); do \ @@ -19,16 +20,16 @@ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \ LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) -mysqltest_LINK = $(CXXLINK) -mysqltest_SOURCES = mysqltest.c -mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a +mysqltest_embedded_LINK = $(CXXLINK) +mysqltest_embedded_SOURCES = mysqltest.c +mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ my_readline.h sql_string.h completion_hash.h mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) -client_test_LINK = $(CXXLINK) -client_test_SOURCES = client_test.c +mysql_client_test_embedded_LINK = $(CXXLINK) +mysql_client_test_embedded_SOURCES = mysql_client_test.c clean: rm -f $(client_sources) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 8092d87b97c..15fe3a03390 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -219,12 +219,13 @@ static my_bool emb_mysql_read_query_result(MYSQL *mysql) static int emb_stmt_execute(MYSQL_STMT *stmt) { DBUG_ENTER("emb_stmt_execute"); + char header[4]; + int4store(header, stmt->stmt_id); THD *thd= (THD*)stmt->mysql->thd; thd->client_param_count= stmt->param_count; thd->client_params= stmt->params; if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0, - (const char*)&stmt->stmt_id,sizeof(stmt->stmt_id), - 1) || + header, sizeof(header), 1) || emb_mysql_read_query_result(stmt->mysql)) { NET *net= &stmt->mysql->net; @@ -591,6 +592,32 @@ err: C_MODE_END +static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length, + CHARSET_INFO *fromcs, CHARSET_INFO *tocs) +{ + uint32 dummy32; + uint dummy_err; + char *result; + + /* 'tocs' is set 0 when client issues SET character_set_results=NULL */ + if (tocs && String::needs_conversion(0, fromcs, tocs, &dummy32)) + { + uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1; + result= (char *)alloc_root(root, new_len); + length= copy_and_convert(result, new_len, + tocs, from, length, fromcs, &dummy_err); + } + else + { + result= (char *)alloc_root(root, length + 1); + memcpy(result, from, length); + } + + result[length]= 0; + return result; +} + + bool Protocol::send_fields(List<Item> *list, uint flag) { List_iterator_fast<Item> it(*list); @@ -598,6 +625,8 @@ bool Protocol::send_fields(List<Item> *list, uint flag) MYSQL_FIELD *client_field; MYSQL *mysql= thd->mysql; MEM_ROOT *field_alloc; + CHARSET_INFO *thd_cs= thd->variables.character_set_results; + CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("send_fields"); @@ -616,12 +645,29 @@ bool Protocol::send_fields(List<Item> *list, uint flag) Send_field server_field; item->make_field(&server_field); - client_field->db= strdup_root(field_alloc, server_field.db_name); - client_field->table= strdup_root(field_alloc, server_field.table_name); - client_field->name= strdup_root(field_alloc, server_field.col_name); - client_field->org_table= strdup_root(field_alloc, server_field.org_table_name); - client_field->org_name= strdup_root(field_alloc, server_field.org_col_name); - client_field->length= server_field.length; + client_field->db= dup_str_aux(field_alloc, server_field.db_name, + strlen(server_field.db_name), cs, thd_cs); + client_field->table= dup_str_aux(field_alloc, server_field.table_name, + strlen(server_field.table_name), cs, thd_cs); + client_field->name= dup_str_aux(field_alloc, server_field.col_name, + strlen(server_field.col_name), cs, thd_cs); + client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name, + strlen(server_field.org_table_name), cs, thd_cs); + client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name, + strlen(server_field.org_col_name), cs, thd_cs); + if (item->collation.collation == &my_charset_bin || thd_cs == NULL) + { + /* No conversion */ + client_field->charsetnr= server_field.charsetnr; + client_field->length= server_field.length; + } + else + { + /* With conversion */ + client_field->charsetnr= thd_cs->number; + uint char_len= server_field.length / item->collation.collation->mbmaxlen; + client_field->length= char_len * thd_cs->mbmaxlen; + } client_field->type= server_field.type; client_field->flags= server_field.flags; client_field->decimals= server_field.decimals; @@ -630,9 +676,8 @@ bool Protocol::send_fields(List<Item> *list, uint flag) client_field->name_length= strlen(client_field->name); client_field->org_name_length= strlen(client_field->org_name); client_field->org_table_length= strlen(client_field->org_table); - client_field->charsetnr= server_field.charsetnr; - client_field->catalog= strdup_root(field_alloc, "def"); + client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs); client_field->catalog_length= 3; if (INTERNAL_NUM_FIELD(client_field)) @@ -710,6 +755,7 @@ bool Protocol_prep::write() } cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS)); memcpy(cur->data, packet->ptr()+1, packet->length()-1); + cur->length= packet->length(); /* To allow us to do sanity checks */ *data->prev_ptr= cur; data->prev_ptr= &cur->next; @@ -804,21 +850,3 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } -#if 0 -/* The same as Protocol::net_store_data but does the converstion -*/ -bool Protocol::convert_str(const char *from, uint length) -{ - if (!(*next_field=alloc_root(alloc, length + 1))) - return true; - convert->store_dest(*next_field, from, length); - (*next_field)[length]= 0; - if (next_mysql_field->max_length < length) - next_mysql_field->max_length=length; - ++next_field; - ++next_mysql_field; - - return false; -} -#endif - diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index a2c4be1a078..6fa41fb3fd0 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -143,6 +143,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, db ? db : "(Null)", user ? user : "(Null)")); + if (!host || !host[0]) + host= mysql->options.host; + if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION || (mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION && host && *host && strcmp(host,LOCAL_HOST))) diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index 14c6725bcb5..ea3133594f5 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -157,3 +157,4 @@ EXPORTS mysql_stmt_attr_get mysql_stmt_attr_set mysql_stmt_field_count + get_defaults_files diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 196cb5c21fb..62c68322595 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -155,7 +155,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root, sizeof(FTB_WORD) + (param.trunc ? MI_MAX_KEY_BUFF : - w.len+extra)); + w.len*ftb->charset->mbmaxlen+extra)); ftbw->len=w.len+1; ftbw->flags=0; ftbw->off=0; @@ -164,9 +164,9 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, if (param.trunc) ftbw->flags|=FTB_FLAG_TRUNC; ftbw->weight=weight; ftbw->up=up; - ftbw->docid[0]=ftbw->docid[1]=HA_POS_ERROR; + ftbw->docid[0]=ftbw->docid[1]=HA_OFFSET_ERROR; ftbw->ndepth= (param.yesno<0) + depth; - ftbw->key_root=HA_POS_ERROR; + ftbw->key_root=HA_OFFSET_ERROR; memcpy(ftbw->word+1, w.pos, w.len); ftbw->word[0]=w.len; if (param.yesno > 0) up->ythresh++; @@ -181,7 +181,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ftbe->weight=weight; ftbe->up=up; ftbe->ythresh=ftbe->yweaks=0; - ftbe->docid[0]=ftbe->docid[1]=HA_POS_ERROR; + ftbe->docid[0]=ftbe->docid[1]=HA_OFFSET_ERROR; if ((ftbe->quot=param.quot)) ftb->with_scan|=2; if (param.yesno > 0) up->ythresh++; _ftb_parse_query(ftb, start, end, ftbe, depth+1); @@ -259,7 +259,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) { if (!ftbw->off || !(ftbw->flags & FTB_FLAG_TRUNC)) { - ftbw->docid[0]=HA_POS_ERROR; + ftbw->docid[0]=HA_OFFSET_ERROR; if ((ftbw->flags & FTB_FLAG_YES) && ftbw->up->up==0) { /* @@ -345,25 +345,27 @@ static void _ftb_init_index_search(FT_INFO *ftb) if (ftbe->flags & FTB_FLAG_NO || /* 2 */ ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */ { - FTB_EXPR *top_ftbe=ftbe->up->up; - ftbw->docid[0]=HA_POS_ERROR; - for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up) - if (ftbe->flags & FTB_FLAG_YES) - ftbe->yweaks++; + FTB_EXPR *top_ftbe=ftbe->up; + ftbw->docid[0]=HA_OFFSET_ERROR; + for (ftbe=(FTB_EXPR *)ftbw; + ftbe != top_ftbe && !(ftbe->flags & FTB_FLAG_NO); + ftbe=ftbe->up) + ftbe->up->yweaks++; ftbe=0; break; } } if (!ftbe) continue; - /* 3 */ + /* 4 */ if (!is_tree_inited(& ftb->no_dupes)) init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), _ftb_no_dupes_cmp,0,0,0); else reset_tree(& ftb->no_dupes); } - + + ftbw->off=0; /* in case of reinit */ if (_ft2_search(ftb, ftbw, 1)) return; } @@ -372,7 +374,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, - uint query_len) + uint query_len, CHARSET_INFO *cs) { FTB *ftb; FTB_EXPR *ftbe; @@ -384,10 +386,10 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, ftb->state=UNINITIALIZED; ftb->info=info; ftb->keynr=keynr; - ftb->charset= ((keynr==NO_SUCH_KEY) ? - default_charset_info : info->s->keyinfo[keynr].seg->charset); + ftb->charset=cs; + DBUG_ASSERT(keynr==NO_SUCH_KEY || cs == info->s->keyinfo[keynr].seg->charset); ftb->with_scan=0; - ftb->lastpos=HA_POS_ERROR; + ftb->lastpos=HA_OFFSET_ERROR; bzero(& ftb->no_dupes, sizeof(TREE)); init_alloc_root(&ftb->mem_root, 1024, 1024); @@ -410,7 +412,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, ftbe->quot=0; ftbe->up=0; ftbe->ythresh=ftbe->yweaks=0; - ftbe->docid[0]=ftbe->docid[1]=HA_POS_ERROR; + ftbe->docid[0]=ftbe->docid[1]=HA_OFFSET_ERROR; ftb->root=ftbe; _ftb_parse_query(ftb, &query, query+query_len, ftbe, 0); ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root, @@ -433,32 +435,24 @@ static int _ftb_strstr(const byte *s0, const byte *e0, const byte *s1, const byte *e1, CHARSET_INFO *cs) { - const byte *p0, *p1; - my_bool s_after, e_before; - - s_after=true_word_char(cs, s1[0]); - e_before=true_word_char(cs, e1[-1]); - p0=s0; + const byte *p0= s0; + my_bool s_after= true_word_char(cs, s1[0]); + my_bool e_before= true_word_char(cs, e1[-1]); + uint p0_len; + my_match_t m[2]; while (p0 < e0) { - while (p0 < e0 && cs->to_upper[(uint) (uchar) *p0++] != - cs->to_upper[(uint) (uchar) *s1]) - /* no-op */; - if (p0 >= e0) - return 0; - - if (s_after && p0-1 > s0 && true_word_char(cs, p0[-2])) - continue; - - p1=s1+1; - while (p0 < e0 && p1 < e1 && cs->to_upper[(uint) (uchar) *p0] == - cs->to_upper[(uint) (uchar) *p1]) - p0++, p1++; - if (p1 == e1 && (!e_before || p0 == e0 || !true_word_char(cs, p0[0]))) - return 1; + if (cs->coll->instr(cs, p0, e0 - p0, s1, e1 - s1, m, 2) != 2) + return(0); + if ((!s_after || p0 + m[1].beg == s0 || !true_word_char(cs, p0[m[1].beg-1])) && + (!e_before || p0 + m[1].end == e0 || !true_word_char(cs, p0[m[1].end]))) + return(1); + p0+= m[1].beg; + p0+= (p0_len= my_mbcharlen(cs, *(uchar *)p0)) ? p0_len : 1; } - return 0; + + return(0); } @@ -561,7 +555,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record) while (ftb->state == INDEX_SEARCH && (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) != - HA_POS_ERROR) + HA_OFFSET_ERROR) { while (curdoc == (ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid[0]) { @@ -615,7 +609,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) const byte *end; my_off_t docid=ftb->info->lastpos; - if (docid == HA_POS_ERROR) + if (docid == HA_OFFSET_ERROR) return -2.0; if (!ftb->queue.elements) return 0; @@ -627,9 +621,9 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) for (i=0; i < ftb->queue.elements; i++) { - ftb->list[i]->docid[1]=HA_POS_ERROR; + ftb->list[i]->docid[1]=HA_OFFSET_ERROR; for (x=ftb->list[i]->up; x; x=x->up) - x->docid[1]=HA_POS_ERROR; + x->docid[1]=HA_OFFSET_ERROR; } } diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c index 83de6acdab9..7a506fd11c6 100644 --- a/myisam/ft_nlq_search.c +++ b/myisam/ft_nlq_search.c @@ -261,6 +261,10 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query, } + /* + If ndocs == 0, this will not allocate RAM for FT_INFO.doc[], + so if ndocs == 0, FT_INFO.doc[] must not be accessed. + */ dlist=(FT_INFO *)my_malloc(sizeof(FT_INFO)+ sizeof(FT_DOC)*(aio.dtree.elements_in_tree-1), MYF(0)); @@ -329,7 +333,8 @@ float ft_nlq_find_relevance(FT_INFO *handler, else a=c; } - if (docs[a].dpos == docid) + /* bounds check to avoid accessing unallocated handler->doc */ + if (a < handler->ndocs && docs[a].dpos == docid) return (float) docs[a].weight; else return 0.0; diff --git a/myisam/ft_static.c b/myisam/ft_static.c index 7168406d027..994a94d0c49 100644 --- a/myisam/ft_static.c +++ b/myisam/ft_static.c @@ -55,11 +55,12 @@ const struct _ft_vft _ft_vft_boolean = { FT_INFO *ft_init_search(uint flags, void *info, uint keynr, - byte *query, uint query_len, byte *record) + byte *query, uint query_len, CHARSET_INFO *cs, + byte *record) { FT_INFO *res; if (flags & FT_BOOL) - res= ft_init_boolean_search((MI_INFO *)info, keynr, query, query_len); + res= ft_init_boolean_search((MI_INFO *)info, keynr, query, query_len,cs); else res= ft_init_nlq_search((MI_INFO *)info, keynr, query, query_len, flags, record); diff --git a/myisam/ft_stopwords.c b/myisam/ft_stopwords.c index 112af87d201..a4bce6ad4e8 100644 --- a/myisam/ft_stopwords.c +++ b/myisam/ft_stopwords.c @@ -125,4 +125,5 @@ void ft_free_stopwords() my_free((char*) stopwords3,MYF(0)); stopwords3=0; } + ft_stopword_file= 0; } diff --git a/myisam/ftdefs.h b/myisam/ftdefs.h index e7a0829e140..ddb9fbfead2 100644 --- a/myisam/ftdefs.h +++ b/myisam/ftdefs.h @@ -131,7 +131,7 @@ FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const byte *); uint _mi_ft_parse(TREE *, MI_INFO *, uint, const byte *, my_bool); FT_INFO *ft_init_nlq_search(MI_INFO *, uint, byte *, uint, uint, byte *); -FT_INFO *ft_init_boolean_search(MI_INFO *, uint, byte *, uint); +FT_INFO *ft_init_boolean_search(MI_INFO *, uint, byte *, uint, CHARSET_INFO *); extern const struct _ft_vft _ft_vft_nlq; int ft_nlq_read_next(FT_INFO *, char *); diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 4da388af1c7..0123278a23f 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -26,6 +26,7 @@ #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif +#include "rt_index.h" #ifndef USE_RAID #define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G) @@ -656,6 +657,15 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, if (chk_index_down(param,info,&info->s->ft2_keyinfo,record, temp_buff,&tmp_keys,key_checksum,1)) goto err; + if (tmp_keys + subkeys) + { + mi_check_print_error(param, + "Number of words in the 2nd level tree " + "does not match the number in the header. " + "Parent word in on the page %s, offset %u", + llstr(page,llbuff), (uint) (old_keypos-buff)); + goto err; + } (*keys)+=tmp_keys-1; continue; } @@ -1456,6 +1466,14 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff, if (_mi_ft_add(info,i,(char*) key,buff,filepos)) goto err; } +#ifdef HAVE_SPATIAL + else if (info->s->keyinfo[i].flag & HA_SPATIAL) + { + uint key_length=_mi_make_key(info,i,key,buff,filepos); + if (rtree_insert(info, i, key, key_length)) + goto err; + } +#endif /*HAVE_SPATIAL*/ else { uint key_length=_mi_make_key(info,i,key,buff,filepos); @@ -2037,7 +2055,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* sort_param.keyinfo->seg->charset->mbmaxlen; sort_info.max_records= - (ha_rows) (sort_info.filelength/ft_max_word_len_for_sort+1); + (ha_rows) (sort_info.filelength/ft_min_word_len+1); sort_param.key_read=sort_ft_key_read; sort_param.key_write=sort_ft_key_write; @@ -3978,7 +3996,8 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) key->seg->charset->mbmaxlen; key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; } - return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && + return (key->flag & HA_SPATIAL) || + (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && ((ulonglong) rows * key_maxlength > (ulonglong) myisam_max_temp_length)); } diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 7fc7cc4edf1..f99a2c655d2 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -16,7 +16,7 @@ /* Create a MyISAM table */ -#include "fulltext.h" +#include "ftdefs.h" #include "sp_defs.h" #if defined(MSDOS) || defined(__WIN__) @@ -41,7 +41,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, File dfile,file; int errpos,save_errno; myf create_flag; - uint fields,length,max_key_length,packed,pointer, + uint fields,length,max_key_length,packed,pointer,real_length_diff, key_length,info_length,key_segs,options,min_key_length_skip, base_pos,varchar_count,long_varchar_count,varchar_length, max_key_block_length,unique_key_parts,fulltext_keys,offset; @@ -238,7 +238,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, { share.state.key_root[i]= HA_OFFSET_ERROR; - min_key_length_skip=length=0; + min_key_length_skip=length=real_length_diff=0; key_length=pointer; if (keydef->flag & HA_SPATIAL) { @@ -297,6 +297,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN; length++; /* At least one length byte */ min_key_length_skip+=HA_FT_MAXBYTELEN; + real_length_diff=HA_FT_MAXBYTELEN-FT_MAX_WORD_LEN_FOR_SORT; } else { @@ -397,7 +398,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, key_segs) share.state.rec_per_key_part[key_segs-1]=1L; length+=key_length; - keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE); + keydef->block_length= MI_BLOCK_SIZE(length-real_length_diff, + pointer,MI_MAX_KEYPTR_SIZE); if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH || length >= MI_MAX_KEY_BUFF) { diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 562227d2f03..2a327e4bd35 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -142,9 +142,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) goto err; } /* Don't call realpath() if the name can't be a link */ - if (strcmp(name_buff, org_name)) - (void) my_readlink(index_name, org_name, MYF(0)); - else + if (!strcmp(name_buff, org_name) || + my_readlink(index_name, org_name, MYF(0)) == -1) (void) strmov(index_name, org_name); (void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16); diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index 94eb2de17e2..1a71d43a7f1 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -42,8 +42,9 @@ { bits-=(bit+1); break; } \ pos+= *pos +#define OFFSET_TABLE_SIZE 512 -static void read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, +static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, uint16 **decode_table,byte **intervall_buff, uint16 *tmp_buff); static void make_quick_table(uint16 *to_table,uint16 *decode_table, @@ -53,7 +54,7 @@ static void fill_quick_table(uint16 *table,uint bits, uint max_bits, uint value); static uint copy_decode_table(uint16 *to_pos,uint offset, uint16 *decode_table); -static uint find_longest_bitstream(uint16 *table); +static uint find_longest_bitstream(uint16 *table, uint16 *end); static void (*get_unpack_function(MI_COLUMNDEF *rec))(MI_COLUMNDEF *field, MI_BIT_BUFF *buff, uchar *to, @@ -146,12 +147,12 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) { if (!my_errno) my_errno=HA_ERR_END_OF_FILE; - DBUG_RETURN(1); + goto err0; } if (memcmp((byte*) header,(byte*) myisam_pack_file_magic,4)) { my_errno=HA_ERR_WRONG_IN_RECORD; - DBUG_RETURN(1); + goto err0; } share->pack.header_length= uint4korr(header+4); share->min_pack_length=(uint) uint4korr(header+8); @@ -173,29 +174,22 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+ intervall_length*sizeof(byte)), MYF(MY_WME)))) - DBUG_RETURN(1); + goto err0; intervall_buff=(byte*) (share->decode_trees+trees); length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits)); if (!(share->decode_tables=(uint16*) - my_malloc((length+512)*sizeof(uint16)+ + my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+ (uint) (share->pack.header_length+7), MYF(MY_WME | MY_ZEROFILL)))) - { - my_free((gptr) share->decode_trees,MYF(0)); - DBUG_RETURN(1); - } + goto err1; tmp_buff=share->decode_tables+length; - disk_cache=(byte*) (tmp_buff+512); + disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE); if (my_read(file,disk_cache, (uint) (share->pack.header_length-sizeof(header)), MYF(MY_NABP))) - { - my_free((gptr) share->decode_trees,MYF(0)); - my_free((gptr) share->decode_tables,MYF(0)); - DBUG_RETURN(1); - } + goto err2; huff_tree_bits=max_bit(trees ? trees-1 : 0); init_bit_buffer(&bit_buff, (uchar*) disk_cache, @@ -213,8 +207,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) skip_to_next_byte(&bit_buff); decode_table=share->decode_tables; for (i=0 ; i < trees ; i++) - read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, - &intervall_buff,tmp_buff); + if (read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, + &intervall_buff,tmp_buff)) + goto err3; decode_table=(uint16*) my_realloc((gptr) share->decode_tables, (uint) ((byte*) decode_table - (byte*) share->decode_tables), @@ -224,8 +219,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) share->decode_tables=decode_table; for (i=0 ; i < trees ; i++) share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, - diff, - uint16*); + diff, uint16*); } /* Fix record-ref-length for keys */ @@ -242,19 +236,24 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) } if (bit_buff.error || bit_buff.pos < bit_buff.end) - { /* info_length was wrong */ - my_errno=HA_ERR_WRONG_IN_RECORD; - my_free((gptr) share->decode_trees,MYF(0)); - my_free((gptr) share->decode_tables,MYF(0)); - DBUG_RETURN(1); - } + goto err3; + DBUG_RETURN(0); + +err3: + my_errno=HA_ERR_WRONG_IN_RECORD; +err2: + my_free((gptr) share->decode_tables,MYF(0)); +err1: + my_free((gptr) share->decode_trees,MYF(0)); +err0: + DBUG_RETURN(1); } /* Read on huff-code-table from datafile */ -static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, +static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, uint16 **decode_table, byte **intervall_buff, uint16 *tmp_buff) { @@ -297,7 +296,9 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, decode_tree->intervalls= *intervall_buff; if (! intervall_length) { - table_bits=find_longest_bitstream(tmp_buff); + table_bits=find_longest_bitstream(tmp_buff, tmp_buff+OFFSET_TABLE_SIZE); + if (table_bits == (uint) ~0) + return 1; if (table_bits > myisam_quick_table_bits) table_bits=myisam_quick_table_bits; next_free_offset= (1 << table_bits); @@ -315,7 +316,7 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, bit_buff->pos+=intervall_length; bit_buff->bits=0; } - return; + return 0; } @@ -390,15 +391,23 @@ static uint copy_decode_table(uint16 *to_pos, uint offset, } -static uint find_longest_bitstream(uint16 *table) +static uint find_longest_bitstream(uint16 *table, uint16 *end) { uint length=1,length2; if (!(*table & IS_CHAR)) - length=find_longest_bitstream(table+ *table)+1; + { + uint16 *next= table + *table; + if (next > end || next == table) + return ~0; + length=find_longest_bitstream(next, end)+1; + } table++; if (!(*table & IS_CHAR)) { - length2=find_longest_bitstream(table+ *table)+1; + uint16 *next= table + *table; + if (next > end || next == table) + return ~0; + length2=find_longest_bitstream(table+ *table, end)+1; length=max(length,length2); } return length; diff --git a/myisam/mi_preload.c b/myisam/mi_preload.c index 5e03d489efe..317ab4ad7fe 100644 --- a/myisam/mi_preload.c +++ b/myisam/mi_preload.c @@ -71,15 +71,15 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_RELEASE)) goto err; - + do { /* Read the next block of index file into the preload buffer */ if ((my_off_t) length > (key_file_length-pos)) length= (ulong) (key_file_length-pos); - if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE))) + if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE|MY_FNABP))) goto err; - + if (ignore_leaves) { uchar *end= buff+length; @@ -88,7 +88,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) if (mi_test_if_nod(buff)) { if (key_cache_insert(share->key_cache, - share->kfile, pos, DFLT_INIT_HITS, + share->kfile, pos, DFLT_INIT_HITS, (byte*) buff, block_length)) goto err; } diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 1342718d6aa..06408f57a3f 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -57,7 +57,11 @@ int mi_rnext_same(MI_INFO *info, byte *buf) #endif case HA_KEY_ALG_BTREE: default: - memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + if (!(info->update & HA_STATE_RNEXT_SAME)) + { + /* First rnext_same; Store old key */ + memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + } for (;;) { if ((error=_mi_search_next(info,keyinfo,info->lastkey, @@ -81,13 +85,17 @@ int mi_rnext_same(MI_INFO *info, byte *buf) rw_unlock(&info->s->key_root_lock[inx]); /* Don't clear if database-changed */ info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); - info->update|= HA_STATE_NEXT_FOUND; + info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; if (error) { if (my_errno == HA_ERR_KEY_NOT_FOUND) my_errno=HA_ERR_END_OF_FILE; } + else if (!buf) + { + DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0); + } else if (!(*info->read_record)(info,info->lastpos,buf)) { info->update|= HA_STATE_AKTIV; /* Record is read */ diff --git a/myisam/mi_test3.c b/myisam/mi_test3.c index dca04a9a64b..27d23317b5c 100644 --- a/myisam/mi_test3.c +++ b/myisam/mi_test3.c @@ -40,7 +40,7 @@ #endif -const char *filename= "test3.MSI"; +const char *filename= "test3"; uint tests=10,forks=10,key_cacheing=0,use_log=0; static void get_options(int argc, char *argv[]); @@ -363,7 +363,7 @@ int test_write(MI_INFO *file,int id,int lock_type) } sprintf(record.id,"%7d",getpid()); - strmov(record.text,"Testing..."); + strnmov(record.text,"Testing...", sizeof(record.text)); tries=(uint) rnd(100)+10; for (i=count=0 ; i < tries ; i++) diff --git a/myisam/mi_write.c b/myisam/mi_write.c index dc596672a84..7d053ddfd22 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -124,8 +124,8 @@ int mi_write(MI_INFO *info, byte *record) { if (local_lock_tree) rw_unlock(&share->key_root_lock[i]); - DBUG_PRINT("error",("Got error: %d on write",my_errno)); - goto err; + DBUG_PRINT("error",("Got error: %d on write",my_errno)); + goto err; } } if (local_lock_tree) @@ -159,18 +159,14 @@ int mi_write(MI_INFO *info, byte *record) err: save_errno=my_errno; - if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL) + if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL || + my_errno == HA_ERR_NULL_IN_SPATIAL) { if (info->bulk_insert) { uint j; for (j=0 ; j < share->base.keys ; j++) - { - if (is_tree_inited(&info->bulk_insert[j])) - { - reset_tree(&info->bulk_insert[j]); - } - } + mi_flush_bulk_insert(info, j); } info->errkey= (int) i; while ( i-- > 0) @@ -329,7 +325,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *temp_buff,*keypos; uchar keybuff[MI_MAX_KEY_BUFF]; my_bool was_last_key; - my_off_t next_page; + my_off_t next_page, dupp_key_pos; DBUG_ENTER("w_search"); DBUG_PRINT("enter",("page: %ld",page)); @@ -349,9 +345,9 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, /* get position to record with duplicated key */ tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,keybuff); if (tmp_key_length) - info->dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length); + dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length); else - info->dupp_key_pos= HA_OFFSET_ERROR; + dupp_key_pos= HA_OFFSET_ERROR; if (keyinfo->flag & HA_FULLTEXT) { uint off; @@ -370,8 +366,9 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, else { /* popular word. two-level tree. going down */ - my_off_t root=info->dupp_key_pos; + my_off_t root=dupp_key_pos; keyinfo=&info->s->ft2_keyinfo; + get_key_full_length_rdonly(off, key); key+=off; keypos-=keyinfo->keylength+nod_flag; /* we'll modify key entry 'in vivo' */ error=_mi_ck_real_write_btree(info, keyinfo, key, 0, @@ -388,6 +385,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, } else /* not HA_FULLTEXT, normal HA_NOSAME key */ { + info->dupp_key_pos= dupp_key_pos; my_afree((byte*) temp_buff); my_errno=HA_ERR_FOUND_DUPP_KEY; DBUG_RETURN(-1); diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 648e29e1e9e..21b56669ea6 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -41,8 +41,8 @@ SET_STACK_SIZE(9000) /* Minimum stack size for program */ static uint decode_bits; static char **default_argv; static const char *load_default_groups[]= { "myisamchk", 0 }; -static const char *set_charset_name, *opt_tmpdir; -static CHARSET_INFO *set_charset; +static const char *set_collation_name, *opt_tmpdir; +static CHARSET_INFO *set_collation; static long opt_myisam_block_size; static long opt_key_cache_block_size; static const char *my_progname_short; @@ -149,7 +149,7 @@ int main(int argc, char **argv) } /* main */ enum options_mc { - OPT_CHARSETS_DIR=256, OPT_SET_CHARSET,OPT_START_CHECK_POS, + OPT_CHARSETS_DIR=256, OPT_SET_COLLATION,OPT_START_CHECK_POS, OPT_CORRECT_CHECKSUM, OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE, OPT_MYISAM_BLOCK_SIZE, OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE, @@ -252,9 +252,9 @@ static struct my_option my_long_options[] = (gptr*) &check_param.auto_increment_value, (gptr*) &check_param.auto_increment_value, 0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"set-character-set", OPT_SET_CHARSET, - "Change the character set used by the index", - (gptr*) &set_charset_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"set-collation", OPT_SET_COLLATION, + "Change the collation used by the index", + (gptr*) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"set-variable", 'O', "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -354,8 +354,12 @@ static void usage(void) puts("Description, check and repair of MyISAM tables."); puts("Used without options all tables on the command will be checked for errors"); printf("Usage: %s [OPTIONS] tables[.MYI]\n", my_progname_short); - printf("\nGlobal options:\n\ - -#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n\ + printf("\nGlobal options:\n"); +#ifndef DBUG_OFF + printf("\ + -#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n"); +#endif + printf("\ -?, --help Display this help and exit.\n\ -O, --set-variable var=option.\n\ Change the value of a variable. Please note that\n\ @@ -735,8 +739,9 @@ static void get_options(register int *argc,register char ***argv) check_param.tmpdir=&myisamchk_tmpdir; check_param.key_cache_block_size= opt_key_cache_block_size; - if (set_charset_name) - if (!(set_charset=get_charset_by_name(set_charset_name, MYF(MY_WME)))) + if (set_collation_name) + if (!(set_collation= get_charset_by_name(set_collation_name, + MYF(MY_WME)))) exit(1); myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size); @@ -870,11 +875,12 @@ static int myisamchk(MI_CHECK *param, my_string filename) (((ulonglong) 1L << share->base.keys)-1)) || test_if_almost_full(info) || info->s->state.header.file_version[3] != myisam_file_magic[3] || - (set_charset && set_charset->number != share->state.header.language) || + (set_collation && + set_collation->number != share->state.header.language) || myisam_block_size != MI_KEY_BLOCK_LENGTH)) { - if (set_charset) - param->language=set_charset->number; + if (set_collation) + param->language= set_collation->number; if (recreate_table(param, &info,filename)) { VOID(fprintf(stderr, diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c index 6679510227e..dc98d813266 100644 --- a/myisam/myisamlog.c +++ b/myisam/myisamlog.c @@ -247,6 +247,7 @@ static void get_options(register int *argc, register char ***argv) /* Fall through */ case 'I': case '?': +#include <help_start.h> printf("%s Ver 1.4 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); puts("By Monty, for your professional use\n"); @@ -268,6 +269,7 @@ static void get_options(register int *argc, register char ***argv) puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted."); puts("If one gives table names as arguments only these tables will be updated\n"); help=1; +#include <help_end.h> break; default: printf("illegal option: \"-%c\"\n",*pos); diff --git a/myisam/rt_index.c b/myisam/rt_index.c index cfb2ca877f4..97554dca4e6 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -710,7 +710,8 @@ err1: int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length) { - return (rtree_insert_level(info, keynr, key, key_length, -1) == -1) ? -1 : 0; + return (!key_length || + (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0; } @@ -947,15 +948,14 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) /* check for redundant root (not leaf, 1 child) and eliminate */ if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) goto err1; - if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, + if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, info->buff, 0)) goto err1; nod_flag = mi_test_if_nod(info->buff); page_size = mi_getint(info->buff); - if (nod_flag && (page_size == 2 + key_length + - (nod_flag ? nod_flag : info->s->base.rec_reflength))) + if (nod_flag && (page_size == 2 + key_length + nod_flag)) { - my_off_t new_root = _mi_kpos(nod_flag, + my_off_t new_root = _mi_kpos(nod_flag, rt_PAGE_FIRST_KEY(info->buff, nod_flag)); if (_mi_dispose(info, keyinfo, old_root, DFLT_INIT_HITS)) goto err1; diff --git a/myisam/sort.c b/myisam/sort.c index 3dc066e877c..7c6efa9a05b 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -84,7 +84,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info, IO_CACHE *to_file, char* key, uint sort_length, uint count); -inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs); +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs); + /* Creates a index of sorted keys @@ -160,7 +162,10 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2)) + { my_free((gptr) sort_keys,MYF(0)); + sort_keys= 0; + } else break; } @@ -625,7 +630,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, } /* write_keys */ -inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) { int err; uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs); diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 0e424a9e193..b61e8094cde 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, dlen = _mi_calc_blob_length(keyseg->bit_start, pos); memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*)); + if (!dptr) + { + my_errno= HA_ERR_NULL_IN_SPATIAL; + return 0; + } sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */ for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) diff --git a/myisammrg/myrg_rnext_same.c b/myisammrg/myrg_rnext_same.c index b569459b77d..997e4100acd 100644 --- a/myisammrg/myrg_rnext_same.c +++ b/myisammrg/myrg_rnext_same.c @@ -16,25 +16,36 @@ #include "myrg_def.h" + int myrg_rnext_same(MYRG_INFO *info, byte *buf) { - uint err; + int err; MI_INFO *mi; if (!info->current_table) return (HA_ERR_KEY_NOT_FOUND); - err=mi_rnext_same(info->current_table->table,buf); - if (err == HA_ERR_END_OF_FILE) + /* at first, do rnext for the table found before */ + if ((err=mi_rnext_same(info->current_table->table,NULL))) { - queue_remove(&(info->by_key),0); - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - mi->once_flags|= RRND_PRESERVE_LASTINX; - return mi_rrnd(mi,buf,mi->lastpos); + if (err == HA_ERR_END_OF_FILE) + { + queue_remove(&(info->by_key),0); + if (!info->by_key.elements) + return HA_ERR_END_OF_FILE; + } + else + return err; } - return err; + else + { + /* Found here, adding to queue */ + queue_top(&(info->by_key))=(byte *)(info->current_table); + queue_replaced(&(info->by_key)); + } + + /* now, mymerge's read_next is as simple as one queue_top */ + mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; + return _myrg_mi_read_record(mi,buf); } diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index c3f9eea875d..9426b20d09c 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -36,12 +36,19 @@ test_SCRIPTS = mysql-test-run install_test_db test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem CLEANFILES = $(test_SCRIPTS) $(test_DATA) +INCLUDES = -I$(srcdir)/../include -I../include -I.. +EXTRA_PROGRAMS = mysql_test_run_new +noinst_HEADERS = my_manage.h +mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c + + dist-hook: mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \ $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/t/*.test $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include - $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r + $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(srcdir)/r/*.require $(distdir)/r + $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data @@ -58,12 +65,13 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r + $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data std_data/%.pem: diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc new file mode 100644 index 00000000000..202c508a9c9 --- /dev/null +++ b/mysql-test/include/ctype_common.inc @@ -0,0 +1,58 @@ +# +# Common tests for all character sets and collations. +# Include this file from a test with @test_characrer_set +# and @test_collation set to desired values. +# +# Please don't use SHOW CREATE TABLE in this file, +# we want it to be HANDLER independent. You can +# use SHOW FULL COLUMNS instead. +# +# Please surround all CREATE TABLE with --disable_warnings +# and --enable_warnings to be able to set storage_engine +# without having to check if the hanlder exists. + +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; + +# +# Bug 1883: LIKE did not work in some cases with a key. +# +--disable_warnings +CREATE TABLE t1 (c CHAR(10), KEY(c)); +--enable_warnings +# check the column was created with the expected charset/collation +--replace_result select,insert,update,references "" +SHOW FULL COLUMNS FROM t1; +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +DROP TABLE t1; + +# +# Bug 6643 incorrect response with partial utf8 index +# +--disable_warnings +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +--enable_warnings +# check the column was created with the expected charset/collation +--replace_result select,insert,update,references "" +SHOW FULL COLUMNS FROM t1; +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +SELECT c1 as want3results from t1 where c1 like 'lo%'; +SELECT c1 as want1result from t1 where c1 like 'loc%'; +SELECT c1 as want1result from t1 where c1 like 'loca%'; +SELECT c1 as want1result from t1 where c1 like 'locat%'; +SELECT c1 as want1result from t1 where c1 like 'locati%'; +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +SELECT c1 as want1result from t1 where c1 like 'location%'; +DROP TABLE t1; + +DROP DATABASE d1; +# Restore settings +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; diff --git a/mysql-test/include/ctype_filesort.inc b/mysql-test/include/ctype_filesort.inc new file mode 100644 index 00000000000..2068463d4e2 --- /dev/null +++ b/mysql-test/include/ctype_filesort.inc @@ -0,0 +1,15 @@ +# +# Set desired charset_connection and collation_collation +# before including this file. +# + +# The next query creates a LONGTEXT column +# using the current character_set_connection +# and collation_connection. + +create table t1 select repeat('a',4000) a; +delete from t1; + +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +drop table t1; diff --git a/mysql-test/include/endspace.inc b/mysql-test/include/endspace.inc new file mode 100644 index 00000000000..1692a258bde --- /dev/null +++ b/mysql-test/include/endspace.inc @@ -0,0 +1,7 @@ +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +select 'a a' > 'a', 'a \0' < 'a'; +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index 84e60657876..9b85197abe8 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -1,3 +1,4 @@ +--exec test x$NDB_STATUS_OK = x1 -- require r/have_ndb.require disable_query_log; show variables like "have_ndbcluster"; diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc index 9cf11709e69..eb6820934f3 100644 --- a/mysql-test/include/ps_modify.inc +++ b/mysql-test/include/ps_modify.inc @@ -322,8 +322,11 @@ select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; ## replace ---error 1295 prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; + ## multi table statements diff --git a/mysql-test/include/ps_modify1.inc b/mysql-test/include/ps_modify1.inc index 5fba7faa59a..345654b2d66 100644 --- a/mysql-test/include/ps_modify1.inc +++ b/mysql-test/include/ps_modify1.inc @@ -65,6 +65,9 @@ execute stmt1 using @1000, @duplicate, @5; select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; --disable_warnings diff --git a/mysql-test/init_db.sql b/mysql-test/init_db.sql new file mode 100644 index 00000000000..63483af00d6 --- /dev/null +++ b/mysql-test/init_db.sql @@ -0,0 +1,58 @@ +CREATE DATABASE mysql; +CREATE DATABASE test; + +USE mysql; + + +CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db,User),KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; + +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); + + +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; + +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Password char(41) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,File_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,ssl_cipher BLOB NOT NULL,x509_issuer BLOB NOT NULL,x509_subject BLOB NOT NULL,max_questions int(11) unsigned DEFAULT 0 NOT NULL,max_updates int(11) unsigned DEFAULT 0 NOT NULL,max_connections int(11) unsigned DEFAULT 0 NOT NULL,PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; + +INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0); + +CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL,ret tinyint(1) DEFAULT '0' NOT NULL,dl char(128) DEFAULT '' NOT NULL,type enum ('function','aggregate') NOT NULL,PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; + +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Grantor char(77) DEFAULT '' NOT NULL,Timestamp timestamp(14),Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; + +CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Column_name char(64) binary DEFAULT '' NOT NULL,Timestamp timestamp(14),Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; + +CREATE TABLE help_topic (help_topic_id int unsigned not null,name varchar(64) not null,help_category_id smallint unsigned not null,description text not null,example text not null,url varchar(128) not null,primary key (help_topic_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help topics'; + +CREATE TABLE help_category (help_category_id smallint unsigned not null,name varchar(64) not null,parent_category_id smallint unsigned null,url varchar(128) not null,primary key (help_category_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help categories'; + +CREATE TABLE help_keyword (help_keyword_id int unsigned not null,name varchar(64) not null,primary key (help_keyword_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; + +CREATE TABLE help_relation (help_topic_id int unsigned not null references help_topic,help_keyword_id int unsigned not null references help_keyword,primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; + +CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; + +INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); + + +CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment,Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; + +INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); + + +CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; + +INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3),(1, 733280400, 2) ,(1, 749005200, 3),(1, 764730000, 2) ,(1, 780454800, 3),(1, 796179600, 2) ,(1, 811904400, 3),(1, 828234000, 2) ,(1, 846378000, 3),(1, 859683600, 2) ,(1, 877827600, 3),(1, 891133200, 2) ,(1, 909277200, 3),(1, 922582800, 2) ,(1, 941331600, 3),(1, 954032400, 2) ,(1, 972781200, 3),(1, 985482000, 2) ,(1, 1004230800, 3),(1, 1017536400, 2) ,(1, 1035680400, 3),(1, 1048986000, 2) ,(1, 1067130000, 3),(1, 1080435600, 2) ,(1, 1099184400, 3),(1, 1111885200, 2) ,(1, 1130634000, 3),(1, 1143334800, 2) ,(1, 1162083600, 3),(1, 1174784400, 2) ,(1, 1193533200, 3),(1, 1206838800, 2) ,(1, 1224982800, 3),(1, 1238288400, 2) ,(1, 1256432400, 3),(1, 1269738000, 2) ,(1, 1288486800, 3),(1, 1301187600, 2) ,(1, 1319936400, 3),(1, 1332637200, 2) ,(1, 1351386000, 3),(1, 1364691600, 2) ,(1, 1382835600, 3),(1, 1396141200, 2) ,(1, 1414285200, 3),(1, 1427590800, 2) ,(1, 1445734800, 3),(1, 1459040400, 2) ,(1, 1477789200, 3),(1, 1490490000, 2) ,(1, 1509238800, 3),(1, 1521939600, 2) ,(1, 1540688400, 3),(1, 1553994000, 2) ,(1, 1572138000, 3),(1, 1585443600, 2) ,(1, 1603587600, 3),(1, 1616893200, 2) ,(1, 1635642000, 3),(1, 1648342800, 2) ,(1, 1667091600, 3),(1, 1679792400, 2) ,(1, 1698541200, 3),(1, 1711846800, 2) ,(1, 1729990800, 3),(1, 1743296400, 2) ,(1, 1761440400, 3),(1, 1774746000, 2) ,(1, 1792890000, 3),(1, 1806195600, 2) ,(1, 1824944400, 3),(1, 1837645200, 2) ,(1, 1856394000, 3),(1, 1869094800, 2) ,(1, 1887843600, 3),(1, 1901149200, 2) ,(1, 1919293200, 3),(1, 1932598800, 2) ,(1, 1950742800, 3),(1, 1964048400, 2) ,(1, 1982797200, 3),(1, 1995498000, 2) ,(1, 2014246800, 3),(1, 2026947600, 2) ,(1, 2045696400, 3),(1, 2058397200, 2) ,(1, 2077146000, 3),(1, 2090451600, 2) ,(1, 2108595600, 3),(1, 2121901200, 2) ,(1, 2140045200, 3),(3, -1688265000, 2) ,(3, -1656819048, 1),(3, -1641353448, 2) ,(3, -1627965048, 3),(3, -1618716648, 1) ,(3, -1596429048, 3),(3, -1593829848, 5) ,(3, -1589860800, 4),(3, -1542427200, 5) ,(3, -1539493200, 6),(3, -1525323600, 5) ,(3, -1522728000, 4),(3, -1491188400, 7) ,(3, -1247536800, 4),(3, 354920400, 5) ,(3, 370728000, 4),(3, 386456400, 5) ,(3, 402264000, 4),(3, 417992400, 5) ,(3, 433800000, 4),(3, 449614800, 5) ,(3, 465346800, 8),(3, 481071600, 9) ,(3, 496796400, 8),(3, 512521200, 9) ,(3, 528246000, 8),(3, 543970800, 9) ,(3, 559695600, 8),(3, 575420400, 9) ,(3, 591145200, 8),(3, 606870000, 9) ,(3, 622594800, 8),(3, 638319600, 9) ,(3, 654649200, 8),(3, 670374000, 10) ,(3, 686102400, 11),(3, 695779200, 8) ,(3, 701812800, 5),(3, 717534000, 4) ,(3, 733273200, 9),(3, 748998000, 8) ,(3, 764722800, 9),(3, 780447600, 8) ,(3, 796172400, 9),(3, 811897200, 8) ,(3, 828226800, 9),(3, 846370800, 8) ,(3, 859676400, 9),(3, 877820400, 8) ,(3, 891126000, 9),(3, 909270000, 8) ,(3, 922575600, 9),(3, 941324400, 8) ,(3, 954025200, 9),(3, 972774000, 8) ,(3, 985474800, 9),(3, 1004223600, 8) ,(3, 1017529200, 9),(3, 1035673200, 8) ,(3, 1048978800, 9),(3, 1067122800, 8) ,(3, 1080428400, 9),(3, 1099177200, 8) ,(3, 1111878000, 9),(3, 1130626800, 8) ,(3, 1143327600, 9),(3, 1162076400, 8) ,(3, 1174777200, 9),(3, 1193526000, 8) ,(3, 1206831600, 9),(3, 1224975600, 8) ,(3, 1238281200, 9),(3, 1256425200, 8) ,(3, 1269730800, 9),(3, 1288479600, 8) ,(3, 1301180400, 9),(3, 1319929200, 8) ,(3, 1332630000, 9),(3, 1351378800, 8) ,(3, 1364684400, 9),(3, 1382828400, 8) ,(3, 1396134000, 9),(3, 1414278000, 8) ,(3, 1427583600, 9),(3, 1445727600, 8) ,(3, 1459033200, 9),(3, 1477782000, 8) ,(3, 1490482800, 9),(3, 1509231600, 8) ,(3, 1521932400, 9),(3, 1540681200, 8) ,(3, 1553986800, 9),(3, 1572130800, 8) ,(3, 1585436400, 9),(3, 1603580400, 8) ,(3, 1616886000, 9),(3, 1635634800, 8) ,(3, 1648335600, 9),(3, 1667084400, 8) ,(3, 1679785200, 9),(3, 1698534000, 8) ,(3, 1711839600, 9),(3, 1729983600, 8) ,(3, 1743289200, 9),(3, 1761433200, 8) ,(3, 1774738800, 9),(3, 1792882800, 8) ,(3, 1806188400, 9),(3, 1824937200, 8) ,(3, 1837638000, 9),(3, 1856386800, 8) ,(3, 1869087600, 9),(3, 1887836400, 8) ,(3, 1901142000, 9),(3, 1919286000, 8) ,(3, 1932591600, 9),(3, 1950735600, 8) ,(3, 1964041200, 9),(3, 1982790000, 8) ,(3, 1995490800, 9),(3, 2014239600, 8) ,(3, 2026940400, 9),(3, 2045689200, 8) ,(3, 2058390000, 9),(3, 2077138800, 8) ,(3, 2090444400, 9),(3, 2108588400, 8) ,(3, 2121894000, 9),(3, 2140038000, 8),(4, -1688265000, 2) ,(4, -1656819048, 1),(4, -1641353448, 2) ,(4, -1627965048, 3),(4, -1618716648, 1) ,(4, -1596429048, 3),(4, -1593829848, 5) ,(4, -1589860800, 4),(4, -1542427200, 5) ,(4, -1539493200, 6),(4, -1525323600, 5) ,(4, -1522728000, 4),(4, -1491188400, 7) ,(4, -1247536800, 4),(4, 354920409, 5) ,(4, 370728010, 4),(4, 386456410, 5) ,(4, 402264011, 4),(4, 417992411, 5) ,(4, 433800012, 4),(4, 449614812, 5) ,(4, 465346812, 8),(4, 481071612, 9) ,(4, 496796413, 8),(4, 512521213, 9) ,(4, 528246013, 8),(4, 543970813, 9) ,(4, 559695613, 8),(4, 575420414, 9) ,(4, 591145214, 8),(4, 606870014, 9) ,(4, 622594814, 8),(4, 638319615, 9) ,(4, 654649215, 8),(4, 670374016, 10) ,(4, 686102416, 11),(4, 695779216, 8) ,(4, 701812816, 5),(4, 717534017, 4) ,(4, 733273217, 9),(4, 748998018, 8) ,(4, 764722818, 9),(4, 780447619, 8) ,(4, 796172419, 9),(4, 811897219, 8) ,(4, 828226820, 9),(4, 846370820, 8) ,(4, 859676420, 9),(4, 877820421, 8) ,(4, 891126021, 9),(4, 909270021, 8) ,(4, 922575622, 9),(4, 941324422, 8) ,(4, 954025222, 9),(4, 972774022, 8) ,(4, 985474822, 9),(4, 1004223622, 8) ,(4, 1017529222, 9),(4, 1035673222, 8) ,(4, 1048978822, 9),(4, 1067122822, 8) ,(4, 1080428422, 9),(4, 1099177222, 8) ,(4, 1111878022, 9),(4, 1130626822, 8) ,(4, 1143327622, 9),(4, 1162076422, 8) ,(4, 1174777222, 9),(4, 1193526022, 8) ,(4, 1206831622, 9),(4, 1224975622, 8) ,(4, 1238281222, 9),(4, 1256425222, 8) ,(4, 1269730822, 9),(4, 1288479622, 8) ,(4, 1301180422, 9),(4, 1319929222, 8) ,(4, 1332630022, 9),(4, 1351378822, 8) ,(4, 1364684422, 9),(4, 1382828422, 8) ,(4, 1396134022, 9),(4, 1414278022, 8) ,(4, 1427583622, 9),(4, 1445727622, 8) ,(4, 1459033222, 9),(4, 1477782022, 8) ,(4, 1490482822, 9),(4, 1509231622, 8) ,(4, 1521932422, 9),(4, 1540681222, 8) ,(4, 1553986822, 9),(4, 1572130822, 8) ,(4, 1585436422, 9),(4, 1603580422, 8) ,(4, 1616886022, 9),(4, 1635634822, 8) ,(4, 1648335622, 9),(4, 1667084422, 8) ,(4, 1679785222, 9),(4, 1698534022, 8) ,(4, 1711839622, 9),(4, 1729983622, 8) ,(4, 1743289222, 9),(4, 1761433222, 8) ,(4, 1774738822, 9),(4, 1792882822, 8) ,(4, 1806188422, 9),(4, 1824937222, 8) ,(4, 1837638022, 9),(4, 1856386822, 8) ,(4, 1869087622, 9),(4, 1887836422, 8) ,(4, 1901142022, 9),(4, 1919286022, 8) ,(4, 1932591622, 9),(4, 1950735622, 8) ,(4, 1964041222, 9),(4, 1982790022, 8) ,(4, 1995490822, 9),(4, 2014239622, 8) ,(4, 2026940422, 9),(4, 2045689222, 8) ,(4, 2058390022, 9),(4, 2077138822, 8) ,(4, 2090444422, 9),(4, 2108588422, 8) ,(4, 2121894022, 9),(4, 2140038022, 8); + + +CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; + +INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') ,(2, 0, 0, 0, 'UTC') ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST'); + +CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; + +INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3) ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) ,(915148821, 22); + + diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql new file mode 100644 index 00000000000..cc44165405f --- /dev/null +++ b/mysql-test/lib/init_db.sql @@ -0,0 +1,470 @@ +USE mysql; + +CREATE TABLE db ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, + References_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, + PRIMARY KEY Host (Host,Db,User), + KEY User (User) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Database privileges'; + + +INSERT INTO db VALUES ('%','test' ,'','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); + + +CREATE TABLE host ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, + References_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, + PRIMARY KEY Host (Host,Db) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Host privileges; Merged with database privileges'; + + +CREATE TABLE user ( + Host char(60) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Password char(41) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, + File_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, + References_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, + ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, + ssl_cipher BLOB NOT NULL, + x509_issuer BLOB NOT NULL, + x509_subject BLOB NOT NULL, + max_questions int(11) unsigned DEFAULT 0 NOT NULL, + max_updates int(11) unsigned DEFAULT 0 NOT NULL, + max_connections int(11) unsigned DEFAULT 0 NOT NULL, + PRIMARY KEY Host (Host,User) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Users and global privileges'; + + +INSERT INTO user VALUES ('localhost' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('@HOSTNAME@%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +REPLACE INTO user VALUES ('127.0.0.1' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user (host,user) VALUES ('localhost',''); +INSERT INTO user (host,user) VALUES ('@HOSTNAME@%',''); + + +CREATE TABLE func ( + name char(64) binary DEFAULT '' NOT NULL, + ret tinyint(1) DEFAULT '0' NOT NULL, + dl char(128) DEFAULT '' NOT NULL, + type enum ('function','aggregate') NOT NULL, + PRIMARY KEY (name) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='User defined functions'; + + +CREATE TABLE tables_priv ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Table_name char(64) binary DEFAULT '' NOT NULL, + Grantor char(77) DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Table privileges'; + + +CREATE TABLE columns_priv ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Table_name char(64) binary DEFAULT '' NOT NULL, + Column_name char(64) binary DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name,Column_name) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Column privileges'; + + +CREATE TABLE help_topic ( + help_topic_id int unsigned not null, + name varchar(64) not null, + help_category_id smallint unsigned not null, + description text not null, + example text not null, + url varchar(128) not null, + primary key (help_topic_id), + unique index (name) +) engine=MyISAM +CHARACTER SET utf8 +comment='help topics'; + + +CREATE TABLE help_category ( + help_category_id smallint unsigned not null, + name varchar(64) not null, + parent_category_id smallint unsigned null, + url varchar(128) not null, + primary key (help_category_id),unique index (name) +) engine=MyISAM +CHARACTER SET utf8 +comment='help categories'; + + +CREATE TABLE help_keyword ( + help_keyword_id int unsigned not null, + name varchar(64) not null, + primary key (help_keyword_id),unique index (name) +) engine=MyISAM +CHARACTER SET utf8 +comment='help keywords'; + + +CREATE TABLE help_relation ( + help_topic_id int unsigned not null references help_topic, + help_keyword_id int unsigned not null references help_keyword, + primary key (help_keyword_id, help_topic_id) +) engine=MyISAM +CHARACTER SET utf8 +comment='keyword-topic relation'; + + +CREATE TABLE time_zone_name ( + Name char(64) NOT NULL, + Time_zone_id int unsigned NOT NULL, + PRIMARY KEY Name (Name) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zone names'; + + +INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES + ('MET', 1), ('UTC', 2), ('Universal', 2), + ('Europe/Moscow',3), ('leap/Europe/Moscow',4), + ('Japan', 5); + + +CREATE TABLE time_zone ( + Time_zone_id int unsigned NOT NULL auto_increment, + Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, + PRIMARY KEY TzId (Time_zone_id) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zones'; + + +INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) + VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); + + +CREATE TABLE time_zone_transition ( + Time_zone_id int unsigned NOT NULL, + Transition_time bigint signed NOT NULL, + Transition_type_id int unsigned NOT NULL, + PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zone transitions'; + + +INSERT INTO time_zone_transition + (Time_zone_id, Transition_time, Transition_type_id) +VALUES + (1, -1693706400, 0) ,(1, -1680483600, 1) + ,(1, -1663455600, 2) ,(1, -1650150000, 3) + ,(1, -1632006000, 2) ,(1, -1618700400, 3) + ,(1, -938905200, 2) ,(1, -857257200, 3) + ,(1, -844556400, 2) ,(1, -828226800, 3) + ,(1, -812502000, 2) ,(1, -796777200, 3) + ,(1, 228877200, 2) ,(1, 243997200, 3) + ,(1, 260326800, 2) ,(1, 276051600, 3) + ,(1, 291776400, 2) ,(1, 307501200, 3) + ,(1, 323830800, 2) ,(1, 338950800, 3) + ,(1, 354675600, 2) ,(1, 370400400, 3) + ,(1, 386125200, 2) ,(1, 401850000, 3) + ,(1, 417574800, 2) ,(1, 433299600, 3) + ,(1, 449024400, 2) ,(1, 465354000, 3) + ,(1, 481078800, 2) ,(1, 496803600, 3) + ,(1, 512528400, 2) ,(1, 528253200, 3) + ,(1, 543978000, 2) ,(1, 559702800, 3) + ,(1, 575427600, 2) ,(1, 591152400, 3) + ,(1, 606877200, 2) ,(1, 622602000, 3) + ,(1, 638326800, 2) ,(1, 654656400, 3) + ,(1, 670381200, 2) ,(1, 686106000, 3) + ,(1, 701830800, 2) ,(1, 717555600, 3) + ,(1, 733280400, 2) ,(1, 749005200, 3) + ,(1, 764730000, 2) ,(1, 780454800, 3) + ,(1, 796179600, 2) ,(1, 811904400, 3) + ,(1, 828234000, 2) ,(1, 846378000, 3) + ,(1, 859683600, 2) ,(1, 877827600, 3) + ,(1, 891133200, 2) ,(1, 909277200, 3) + ,(1, 922582800, 2) ,(1, 941331600, 3) + ,(1, 954032400, 2) ,(1, 972781200, 3) + ,(1, 985482000, 2) ,(1, 1004230800, 3) + ,(1, 1017536400, 2) ,(1, 1035680400, 3) + ,(1, 1048986000, 2) ,(1, 1067130000, 3) + ,(1, 1080435600, 2) ,(1, 1099184400, 3) + ,(1, 1111885200, 2) ,(1, 1130634000, 3) + ,(1, 1143334800, 2) ,(1, 1162083600, 3) + ,(1, 1174784400, 2) ,(1, 1193533200, 3) + ,(1, 1206838800, 2) ,(1, 1224982800, 3) + ,(1, 1238288400, 2) ,(1, 1256432400, 3) + ,(1, 1269738000, 2) ,(1, 1288486800, 3) + ,(1, 1301187600, 2) ,(1, 1319936400, 3) + ,(1, 1332637200, 2) ,(1, 1351386000, 3) + ,(1, 1364691600, 2) ,(1, 1382835600, 3) + ,(1, 1396141200, 2) ,(1, 1414285200, 3) + ,(1, 1427590800, 2) ,(1, 1445734800, 3) + ,(1, 1459040400, 2) ,(1, 1477789200, 3) + ,(1, 1490490000, 2) ,(1, 1509238800, 3) + ,(1, 1521939600, 2) ,(1, 1540688400, 3) + ,(1, 1553994000, 2) ,(1, 1572138000, 3) + ,(1, 1585443600, 2) ,(1, 1603587600, 3) + ,(1, 1616893200, 2) ,(1, 1635642000, 3) + ,(1, 1648342800, 2) ,(1, 1667091600, 3) + ,(1, 1679792400, 2) ,(1, 1698541200, 3) + ,(1, 1711846800, 2) ,(1, 1729990800, 3) + ,(1, 1743296400, 2) ,(1, 1761440400, 3) + ,(1, 1774746000, 2) ,(1, 1792890000, 3) + ,(1, 1806195600, 2) ,(1, 1824944400, 3) + ,(1, 1837645200, 2) ,(1, 1856394000, 3) + ,(1, 1869094800, 2) ,(1, 1887843600, 3) + ,(1, 1901149200, 2) ,(1, 1919293200, 3) + ,(1, 1932598800, 2) ,(1, 1950742800, 3) + ,(1, 1964048400, 2) ,(1, 1982797200, 3) + ,(1, 1995498000, 2) ,(1, 2014246800, 3) + ,(1, 2026947600, 2) ,(1, 2045696400, 3) + ,(1, 2058397200, 2) ,(1, 2077146000, 3) + ,(1, 2090451600, 2) ,(1, 2108595600, 3) + ,(1, 2121901200, 2) ,(1, 2140045200, 3) + ,(3, -1688265000, 2) ,(3, -1656819048, 1) + ,(3, -1641353448, 2) ,(3, -1627965048, 3) + ,(3, -1618716648, 1) ,(3, -1596429048, 3) + ,(3, -1593829848, 5) ,(3, -1589860800, 4) + ,(3, -1542427200, 5) ,(3, -1539493200, 6) + ,(3, -1525323600, 5) ,(3, -1522728000, 4) + ,(3, -1491188400, 7) ,(3, -1247536800, 4) + ,(3, 354920400, 5) ,(3, 370728000, 4) + ,(3, 386456400, 5) ,(3, 402264000, 4) + ,(3, 417992400, 5) ,(3, 433800000, 4) + ,(3, 449614800, 5) ,(3, 465346800, 8) + ,(3, 481071600, 9) ,(3, 496796400, 8) + ,(3, 512521200, 9) ,(3, 528246000, 8) + ,(3, 543970800, 9) ,(3, 559695600, 8) + ,(3, 575420400, 9) ,(3, 591145200, 8) + ,(3, 606870000, 9) ,(3, 622594800, 8) + ,(3, 638319600, 9) ,(3, 654649200, 8) + ,(3, 670374000, 10) ,(3, 686102400, 11) + ,(3, 695779200, 8) ,(3, 701812800, 5) + ,(3, 717534000, 4) ,(3, 733273200, 9) + ,(3, 748998000, 8) ,(3, 764722800, 9) + ,(3, 780447600, 8) ,(3, 796172400, 9) + ,(3, 811897200, 8) ,(3, 828226800, 9) + ,(3, 846370800, 8) ,(3, 859676400, 9) + ,(3, 877820400, 8) ,(3, 891126000, 9) + ,(3, 909270000, 8) ,(3, 922575600, 9) + ,(3, 941324400, 8) ,(3, 954025200, 9) + ,(3, 972774000, 8) ,(3, 985474800, 9) + ,(3, 1004223600, 8) ,(3, 1017529200, 9) + ,(3, 1035673200, 8) ,(3, 1048978800, 9) + ,(3, 1067122800, 8) ,(3, 1080428400, 9) + ,(3, 1099177200, 8) ,(3, 1111878000, 9) + ,(3, 1130626800, 8) ,(3, 1143327600, 9) + ,(3, 1162076400, 8) ,(3, 1174777200, 9) + ,(3, 1193526000, 8) ,(3, 1206831600, 9) + ,(3, 1224975600, 8) ,(3, 1238281200, 9) + ,(3, 1256425200, 8) ,(3, 1269730800, 9) + ,(3, 1288479600, 8) ,(3, 1301180400, 9) + ,(3, 1319929200, 8) ,(3, 1332630000, 9) + ,(3, 1351378800, 8) ,(3, 1364684400, 9) + ,(3, 1382828400, 8) ,(3, 1396134000, 9) + ,(3, 1414278000, 8) ,(3, 1427583600, 9) + ,(3, 1445727600, 8) ,(3, 1459033200, 9) + ,(3, 1477782000, 8) ,(3, 1490482800, 9) + ,(3, 1509231600, 8) ,(3, 1521932400, 9) + ,(3, 1540681200, 8) ,(3, 1553986800, 9) + ,(3, 1572130800, 8) ,(3, 1585436400, 9) + ,(3, 1603580400, 8) ,(3, 1616886000, 9) + ,(3, 1635634800, 8) ,(3, 1648335600, 9) + ,(3, 1667084400, 8) ,(3, 1679785200, 9) + ,(3, 1698534000, 8) ,(3, 1711839600, 9) + ,(3, 1729983600, 8) ,(3, 1743289200, 9) + ,(3, 1761433200, 8) ,(3, 1774738800, 9) + ,(3, 1792882800, 8) ,(3, 1806188400, 9) + ,(3, 1824937200, 8) ,(3, 1837638000, 9) + ,(3, 1856386800, 8) ,(3, 1869087600, 9) + ,(3, 1887836400, 8) ,(3, 1901142000, 9) + ,(3, 1919286000, 8) ,(3, 1932591600, 9) + ,(3, 1950735600, 8) ,(3, 1964041200, 9) + ,(3, 1982790000, 8) ,(3, 1995490800, 9) + ,(3, 2014239600, 8) ,(3, 2026940400, 9) + ,(3, 2045689200, 8) ,(3, 2058390000, 9) + ,(3, 2077138800, 8) ,(3, 2090444400, 9) + ,(3, 2108588400, 8) ,(3, 2121894000, 9) + ,(3, 2140038000, 8) + ,(4, -1688265000, 2) ,(4, -1656819048, 1) + ,(4, -1641353448, 2) ,(4, -1627965048, 3) + ,(4, -1618716648, 1) ,(4, -1596429048, 3) + ,(4, -1593829848, 5) ,(4, -1589860800, 4) + ,(4, -1542427200, 5) ,(4, -1539493200, 6) + ,(4, -1525323600, 5) ,(4, -1522728000, 4) + ,(4, -1491188400, 7) ,(4, -1247536800, 4) + ,(4, 354920409, 5) ,(4, 370728010, 4) + ,(4, 386456410, 5) ,(4, 402264011, 4) + ,(4, 417992411, 5) ,(4, 433800012, 4) + ,(4, 449614812, 5) ,(4, 465346812, 8) + ,(4, 481071612, 9) ,(4, 496796413, 8) + ,(4, 512521213, 9) ,(4, 528246013, 8) + ,(4, 543970813, 9) ,(4, 559695613, 8) + ,(4, 575420414, 9) ,(4, 591145214, 8) + ,(4, 606870014, 9) ,(4, 622594814, 8) + ,(4, 638319615, 9) ,(4, 654649215, 8) + ,(4, 670374016, 10) ,(4, 686102416, 11) + ,(4, 695779216, 8) ,(4, 701812816, 5) + ,(4, 717534017, 4) ,(4, 733273217, 9) + ,(4, 748998018, 8) ,(4, 764722818, 9) + ,(4, 780447619, 8) ,(4, 796172419, 9) + ,(4, 811897219, 8) ,(4, 828226820, 9) + ,(4, 846370820, 8) ,(4, 859676420, 9) + ,(4, 877820421, 8) ,(4, 891126021, 9) + ,(4, 909270021, 8) ,(4, 922575622, 9) + ,(4, 941324422, 8) ,(4, 954025222, 9) + ,(4, 972774022, 8) ,(4, 985474822, 9) + ,(4, 1004223622, 8) ,(4, 1017529222, 9) + ,(4, 1035673222, 8) ,(4, 1048978822, 9) + ,(4, 1067122822, 8) ,(4, 1080428422, 9) + ,(4, 1099177222, 8) ,(4, 1111878022, 9) + ,(4, 1130626822, 8) ,(4, 1143327622, 9) + ,(4, 1162076422, 8) ,(4, 1174777222, 9) + ,(4, 1193526022, 8) ,(4, 1206831622, 9) + ,(4, 1224975622, 8) ,(4, 1238281222, 9) + ,(4, 1256425222, 8) ,(4, 1269730822, 9) + ,(4, 1288479622, 8) ,(4, 1301180422, 9) + ,(4, 1319929222, 8) ,(4, 1332630022, 9) + ,(4, 1351378822, 8) ,(4, 1364684422, 9) + ,(4, 1382828422, 8) ,(4, 1396134022, 9) + ,(4, 1414278022, 8) ,(4, 1427583622, 9) + ,(4, 1445727622, 8) ,(4, 1459033222, 9) + ,(4, 1477782022, 8) ,(4, 1490482822, 9) + ,(4, 1509231622, 8) ,(4, 1521932422, 9) + ,(4, 1540681222, 8) ,(4, 1553986822, 9) + ,(4, 1572130822, 8) ,(4, 1585436422, 9) + ,(4, 1603580422, 8) ,(4, 1616886022, 9) + ,(4, 1635634822, 8) ,(4, 1648335622, 9) + ,(4, 1667084422, 8) ,(4, 1679785222, 9) + ,(4, 1698534022, 8) ,(4, 1711839622, 9) + ,(4, 1729983622, 8) ,(4, 1743289222, 9) + ,(4, 1761433222, 8) ,(4, 1774738822, 9) + ,(4, 1792882822, 8) ,(4, 1806188422, 9) + ,(4, 1824937222, 8) ,(4, 1837638022, 9) + ,(4, 1856386822, 8) ,(4, 1869087622, 9) + ,(4, 1887836422, 8) ,(4, 1901142022, 9) + ,(4, 1919286022, 8) ,(4, 1932591622, 9) + ,(4, 1950735622, 8) ,(4, 1964041222, 9) + ,(4, 1982790022, 8) ,(4, 1995490822, 9) + ,(4, 2014239622, 8) ,(4, 2026940422, 9) + ,(4, 2045689222, 8) ,(4, 2058390022, 9) + ,(4, 2077138822, 8) ,(4, 2090444422, 9) + ,(4, 2108588422, 8) ,(4, 2121894022, 9) + ,(4, 2140038022, 8) + ,(5, -1009875600, 1); + + +CREATE TABLE time_zone_transition_type ( + Time_zone_id int unsigned NOT NULL, + Transition_type_id int unsigned NOT NULL, + Offset int signed DEFAULT 0 NOT NULL, + Is_DST tinyint unsigned DEFAULT 0 NOT NULL, + Abbreviation char(8) DEFAULT '' NOT NULL, + PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zone transition types'; + + +INSERT INTO time_zone_transition_type ( + Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES + (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') + ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') + ,(2, 0, 0, 0, 'UTC') + ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') + ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') + ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') + ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') + ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') + ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') + ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') + ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') + ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') + ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') + ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') + ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') + ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST'); + + +CREATE TABLE time_zone_leap_second ( + Transition_time bigint signed NOT NULL, + Correction int signed NOT NULL, + PRIMARY KEY TranTime (Transition_time) +) engine=MyISAM +CHARACTER SET utf8 +comment='Leap seconds information for time zones'; + + +INSERT INTO time_zone_leap_second ( + Transition_time, Correction) VALUES + (78796800, 1) ,(94694401, 2) ,(126230402, 3) + ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) + ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) + ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) + ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) + ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) + ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) + ,(915148821, 22); diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl new file mode 100644 index 00000000000..5977bb380cf --- /dev/null +++ b/mysql-test/lib/mtr_cases.pl @@ -0,0 +1,270 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub collect_test_cases ($); +sub collect_one_test_case ($$$$$); + +############################################################################## +# +# Collect information about test cases we are to run +# +############################################################################## + +sub collect_test_cases ($) { + my $suite= shift; # Test suite name + + my $testdir; + my $resdir; + + if ( $suite eq "main" ) + { + $testdir= "$::glob_mysql_test_dir/t"; + $resdir= "$::glob_mysql_test_dir/r"; + } + else + { + $testdir= "$::glob_mysql_test_dir/suite/$suite/t"; + $resdir= "$::glob_mysql_test_dir/suite/$suite/r"; + } + + my $cases = []; # Array of hash, will be array of C struct + + opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); + + if ( @::opt_cases ) + { + foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort + my $elem= "$tname.test"; + if ( ! -f "$testdir/$elem") + { + mtr_error("Test case $tname ($testdir/$elem) is not found"); + } + collect_one_test_case($testdir,$resdir,$tname,$elem,$cases); + } + closedir TESTDIR; + } + else + { + foreach my $elem ( sort readdir(TESTDIR) ) { + my $tname= mtr_match_extension($elem,"test"); + next if ! defined $tname; + next if $::opt_do_test and ! defined mtr_match_prefix($elem,$::opt_do_test); + + collect_one_test_case($testdir,$resdir,$tname,$elem,$cases); + } + closedir TESTDIR; + } + + # To speed things up, we sort first in if the test require a restart + # or not, second in alphanumeric order. + +# @$cases = sort { +# if ( $a->{'master_restart'} and $b->{'master_restart'} or +# ! $a->{'master_restart'} and ! $b->{'master_restart'} ) +# { +# return $a->{'name'} cmp $b->{'name'}; +# } +# if ( $a->{'master_restart'} ) +# { +# return 1; # Is greater +# } +# else +# { +# return -1; # Is less +# } +# } @$cases; + + return $cases; +} + + +############################################################################## +# +# Collect information about a single test case +# +############################################################################## + + +sub collect_one_test_case($$$$$) { + my $testdir= shift; + my $resdir= shift; + my $tname= shift; + my $elem= shift; + my $cases= shift; + + my $path= "$testdir/$elem"; + + # ---------------------------------------------------------------------- + # Skip some tests silently + # ---------------------------------------------------------------------- + + if ( $::opt_start_from and $tname lt $::opt_start_from ) + { + return; + } + + # ---------------------------------------------------------------------- + # Skip some tests but include in list, just mark them to skip + # ---------------------------------------------------------------------- + + my $tinfo= {}; + $tinfo->{'name'}= $tname; + $tinfo->{'result_file'}= "$resdir/$tname.result"; + push(@$cases, $tinfo); + + if ( $::opt_skip_test and defined mtr_match_prefix($tname,$::opt_skip_test) ) + { + $tinfo->{'skip'}= 1; + return; + } + + # FIXME temporary solution, we have a hard coded list of test cases to + # skip if we are using the embedded server + + if ( $::glob_use_embedded_server and + mtr_match_any_exact($tname,\@::skip_if_embedded_server) ) + { + $tinfo->{'skip'}= 1; + return; + } + + # ---------------------------------------------------------------------- + # Collect information about test case + # ---------------------------------------------------------------------- + + $tinfo->{'path'}= $path; + $tinfo->{'timezone'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work + + if ( defined mtr_match_prefix($tname,"rpl") ) + { + if ( $::opt_skip_rpl ) + { + $tinfo->{'skip'}= 1; + return; + } + + $tinfo->{'slave_num'}= 1; # Default, use one slave + + # FIXME currently we always restart slaves + $tinfo->{'slave_restart'}= 1; + + if ( $tname eq 'rpl_failsafe' or $tname eq 'rpl_chain_temp_table' ) + { +# $tinfo->{'slave_num'}= 3; # Not 3 ? Check old code, strange + } + } + + # FIXME what about embedded_server + ndbcluster, skip ?! + + my $master_opt_file= "$testdir/$tname-master.opt"; + my $slave_opt_file= "$testdir/$tname-slave.opt"; + my $slave_mi_file= "$testdir/$tname.slave-mi"; + my $master_sh= "$testdir/$tname-master.sh"; + my $slave_sh= "$testdir/$tname-slave.sh"; + my $disabled= "$testdir/$tname.disabled"; + + $tinfo->{'master_opt'}= []; + $tinfo->{'slave_opt'}= []; + $tinfo->{'slave_mi'}= []; + + if ( -f $master_opt_file ) + { + $tinfo->{'master_restart'}= 1; # We think so for now + # This is a dirty hack from old mysql-test-run, we use the opt file + # to flag other things as well, it is not a opt list at all + my $extra_master_opt= mtr_get_opts_from_file($master_opt_file); + + foreach my $opt (@$extra_master_opt) + { + my $value; + + $value= mtr_match_prefix($opt, "--timezone="); + + if ( defined $value ) + { + $tinfo->{'timezone'}= $value; + $extra_master_opt= []; + $tinfo->{'master_restart'}= 0; + last; + } + + $value= mtr_match_prefix($opt, "--result-file="); + + if ( defined $value ) + { + $tinfo->{'result_file'}= "r/$value.result"; + if ( $::opt_result_ext and $::opt_record or + -f "$tinfo->{'result_file'}$::opt_result_ext") + { + $tinfo->{'result_file'}.= $::opt_result_ext; + } + $extra_master_opt= []; + $tinfo->{'master_restart'}= 0; + last; + } + } + + $tinfo->{'master_opt'}= $extra_master_opt; + } + + if ( -f $slave_opt_file ) + { + $tinfo->{'slave_opt'}= mtr_get_opts_from_file($slave_opt_file); + $tinfo->{'slave_restart'}= 1; + } + + if ( -f $slave_mi_file ) + { + $tinfo->{'slave_mi'}= mtr_get_opts_from_file($slave_mi_file); + $tinfo->{'slave_restart'}= 1; + } + + if ( -f $master_sh ) + { + if ( $::glob_win32_perl ) + { + $tinfo->{'skip'}= 1; + } + else + { + $tinfo->{'master_sh'}= $master_sh; + $tinfo->{'master_restart'}= 1; + } + } + + if ( -f $slave_sh ) + { + if ( $::glob_win32_perl ) + { + $tinfo->{'skip'}= 1; + } + else + { + $tinfo->{'slave_sh'}= $slave_sh; + $tinfo->{'slave_restart'}= 1; + } + } + + if ( -f $disabled ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'disable'}= 1; # Sub type of 'skip' + $tinfo->{'comment'}= mtr_fromfile($disabled); + } + + # We can't restart a running server that may be in use + + if ( $::glob_use_running_server and + ( $tinfo->{'master_restart'} or $tinfo->{'slave_restart'} ) ) + { + $tinfo->{'skip'}= 1; + } +} + + +1; diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl new file mode 100644 index 00000000000..07aac1d2017 --- /dev/null +++ b/mysql-test/lib/mtr_gcov.pl @@ -0,0 +1,44 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +# These are not to be prefixed with "mtr_" + +sub gcov_prepare (); +sub gcov_collect (); + +############################################################################## +# +# +# +############################################################################## + +sub gcov_prepare () { + + `find $::glob_basedir -name \*.gcov \ + -or -name \*.da | xargs rm`; +} + +sub gcov_collect () { + + print "Collecting source coverage info...\n"; + -f $::opt_gcov_msg and unlink($::opt_gcov_msg); + -f $::opt_gcov_err and unlink($::opt_gcov_err); + foreach my $d ( @::mysqld_src_dirs ) + { + chdir("$::glob_basedir/$d"); + foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) ) + { + `$::opt_gcov $f 2>>$::opt_gcov_err >>$::opt_gcov_msg`; + } + chdir($::glob_mysql_test_dir); + } + print "gcov info in $::opt_gcov_msg, errors in $::opt_gcov_err\n"; +} + + +1; diff --git a/mysql-test/lib/mtr_gprof.pl b/mysql-test/lib/mtr_gprof.pl new file mode 100644 index 00000000000..cc874eebfe5 --- /dev/null +++ b/mysql-test/lib/mtr_gprof.pl @@ -0,0 +1,50 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +# These are not to be prefixed with "mtr_" + +sub gprof_prepare (); +sub gprof_collect (); + +############################################################################## +# +# +# +############################################################################## + +sub gprof_prepare () { + + rmtree($::opt_gprof_dir); + mkdir($::opt_gprof_dir); +} + +# FIXME what about master1 and slave1?! +sub gprof_collect () { + + if ( -f "$::master->[0]->{'path_myddir'}/gmon.out" ) + { + # FIXME check result code?! + mtr_run("gprof", + [$::exe_master_mysqld, + "$::master->[0]->{'path_myddir'}/gmon.out"], + $::opt_gprof_master, "", "", ""); + print "Master execution profile has been saved in $::opt_gprof_master\n"; + } + if ( -f "$::slave->[0]->{'path_myddir'}/gmon.out" ) + { + # FIXME check result code?! + mtr_run("gprof", + [$::exe_slave_mysqld, + "$::slave->[0]->{'path_myddir'}/gmon.out"], + $::opt_gprof_slave, "", "", ""); + print "Slave execution profile has been saved in $::opt_gprof_slave\n"; + } +} + + +1; diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl new file mode 100644 index 00000000000..b3da6d97664 --- /dev/null +++ b/mysql-test/lib/mtr_io.pl @@ -0,0 +1,133 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_get_pid_from_file ($); +sub mtr_get_opts_from_file ($); +sub mtr_fromfile ($); +sub mtr_tofile ($@); +sub mtr_tonewfile($@); + +############################################################################## +# +# +# +############################################################################## + +sub mtr_get_pid_from_file ($) { + my $file= shift; + + open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); + my $pid= <FILE>; + chomp($pid); + close FILE; + return $pid; +} + +sub mtr_get_opts_from_file ($) { + my $file= shift; + + open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); + my @args; + while ( <FILE> ) + { + chomp; + + # --set-variable=init_connect=set @a='a\\0c' + s/^\s+//; # Remove leading space + s/\s+$//; # Remove ending space + + # This is strange, but we need to fill whitespace inside + # quotes with something, to remove later. We do this to + # be able to split on space. Else, we have trouble with + # options like + # + # --someopt="--insideopt1 --insideopt2" + # + # But still with this, we are not 100% sure it is right, + # we need a shell to do it right. + +# print STDERR "\n"; +# print STDERR "AAA: $_\n"; + + s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge; + s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge; + s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge; + s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge; + +# print STDERR "BBB: $_\n"; + +# foreach my $arg (/(--?\w.*?)(?=\s+--?\w|$)/) + + # FIXME ENV vars should be expanded!!!! + + foreach my $arg (split(/[ \t]+/)) + { + $arg =~ tr/\x11\x0a\x0b/ \'\"/; # Put back real chars + # The outermost quotes has to go + $arg =~ s/^([^\'\"]*)\'(.*)\'([^\'\"]*)$/$1$2$3/ + or $arg =~ s/^([^\'\"]*)\"(.*)\"([^\'\"]*)$/$1$2$3/; + $arg =~ s/\\\\/\\/g; + + $arg =~ s/\$\{(\w+)\}/envsubst($1)/ge; + $arg =~ s/\$(\w+)/envsubst($1)/ge; + +# print STDERR "ARG: $arg\n"; + push(@args, $arg); + } + } + close FILE; + return \@args; +} + +sub envsubst { + my $string= shift; + + if ( ! defined $ENV{$string} ) + { + mtr_error("opt file referense \$$string that is unknown"); + } + + return $ENV{$string}; +} + +sub unspace { + my $string= shift; + my $quote= shift; + $string =~ s/[ \t]/\x11/g; + return "$quote$string$quote"; +} + +sub mtr_fromfile ($) { + my $file= shift; + + open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); + my $text= join('', <FILE>); + close FILE; + $text =~ s/^\s+//; # Remove starting space, incl newlines + $text =~ s/\s+$//; # Remove ending space, incl newlines + return $text; +} + +sub mtr_tofile ($@) { + my $file= shift; + + open(FILE,">>",$file) or mtr_error("can't open file \"$file\": $!"); + print FILE join("", @_); + close FILE; +} + +sub mtr_tonewfile ($@) { + my $file= shift; + + open(FILE,">",$file) or mtr_error("can't open file \"$file\": $!"); + print FILE join("", @_); + close FILE; +} + + +1; diff --git a/mysql-test/lib/mtr_match.pl b/mysql-test/lib/mtr_match.pl new file mode 100644 index 00000000000..eb5de655520 --- /dev/null +++ b/mysql-test/lib/mtr_match.pl @@ -0,0 +1,67 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_match_prefix ($$); +sub mtr_match_extension ($$); +sub mtr_match_any_exact ($$); + +############################################################################## +# +# +# +############################################################################## + +# Match a prefix and return what is after the prefix + +sub mtr_match_prefix ($$) { + my $string= shift; + my $prefix= shift; + + if ( $string =~ /^\Q$prefix\E(.*)$/ ) # strncmp + { + return $1; + } + else + { + return undef; # NULL + } +} + + +# Match extension and return the name without extension + +sub mtr_match_extension ($$) { + my $file= shift; + my $ext= shift; + + if ( $file =~ /^(.*)\.\Q$ext\E$/ ) # strchr+strcmp or something + { + return $1; + } + else + { + return undef; # NULL + } +} + + +sub mtr_match_any_exact ($$) { + my $string= shift; + my $mlist= shift; + + foreach my $m (@$mlist) + { + if ( $string eq $m ) + { + return 1; + } + } + return 0; +} + +1; diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl new file mode 100644 index 00000000000..5f80864d1f7 --- /dev/null +++ b/mysql-test/lib/mtr_misc.pl @@ -0,0 +1,50 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_full_hostname (); +sub mtr_init_args ($); +sub mtr_add_arg ($$); + +############################################################################## +# +# Misc +# +############################################################################## + +# We want the fully qualified host name and hostname() may have returned +# only the short name. So we use the resolver to find out. + +sub mtr_full_hostname () { + + my $hostname= hostname(); + if ( $hostname !~ /\./ ) + { + my $address= gethostbyname($hostname) + or die "Couldn't resolve $hostname : $!"; + my $fullname= gethostbyaddr($address, AF_INET); + $hostname= $fullname if $fullname; + } + return $hostname; +} + +# FIXME move to own lib + +sub mtr_init_args ($) { + my $args = shift; + $$args = []; # Empty list +} + +sub mtr_add_arg ($$) { + my $args= shift; + my $format= shift; + my @fargs = @_; + + push(@$args, sprintf($format, @fargs)); +} + +1; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl new file mode 100644 index 00000000000..8aefc235d72 --- /dev/null +++ b/mysql-test/lib/mtr_process.pl @@ -0,0 +1,787 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +#use Carp qw(cluck); +use Socket; +use Errno; +use strict; + +#use POSIX ":sys_wait_h"; +use POSIX 'WNOHANG'; + +sub mtr_run ($$$$$$); +sub mtr_spawn ($$$$$$); +sub mtr_stop_mysqld_servers ($); +sub mtr_kill_leftovers (); +sub mtr_record_dead_children (); +sub sleep_until_file_created ($$$); + +# static in C +sub spawn_impl ($$$$$$$); + +############################################################################## +# +# Execute an external command +# +############################################################################## + +# This function try to mimic the C version used in "netware/mysql_test_run.c" +# FIXME learn it to handle append mode as well, a "new" flag or a "append" + +sub mtr_run ($$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; + + return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,$pid_file); +} + +sub mtr_run_test ($$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; + + return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,$pid_file); +} + +sub mtr_spawn ($$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; + + return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,$pid_file); +} + + +############################################################################## +# +# If $join is set, we return the error code, else we return the PID +# +############################################################################## + +sub spawn_impl ($$$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $mode= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; # FIXME + + if ( $::opt_script_debug ) + { + print STDERR "\n"; + print STDERR "#### ", "-" x 78, "\n"; + print STDERR "#### ", "STDIN $input\n" if $input; + print STDERR "#### ", "STDOUT $output\n" if $output; + print STDERR "#### ", "STDERR $error\n" if $error; + print STDERR "#### ", "$mode : $path ", join(" ",@$arg_list_t), "\n"; + print STDERR "#### ", "-" x 78, "\n"; + } + + FORK: + { + my $pid= fork(); + + if ( ! defined $pid ) + { + if ( $! == $!{EAGAIN} ) # See "perldoc Errno" + { + mtr_debug("Got EAGAIN from fork(), sleep 1 second and redo"); + sleep(1); + redo FORK; + } + else + { + mtr_error("$path ($pid) can't be forked"); + } + } + + if ( $pid ) + { + spawn_parent_impl($pid,$mode,$path); + } + else + { + # Child, redirect output and exec + # FIXME I tried POSIX::setsid() here to detach and, I hoped, + # avoid zombies. But everything went wild, somehow the parent + # became a deamon as well, and was hard to kill ;-) + # Need to catch SIGCHLD and do waitpid or something instead...... + + $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't + + if ( $::glob_cygwin_shell and $mode eq 'test' ) + { + # Programs started from mysqltest under Cygwin, are to + # execute them within Cygwin. Else simple things in test + # files like + # --system "echo 1 > file" + # will fail. + # FIXME not working :-( +# $ENV{'COMSPEC'}= "$::glob_cygwin_shell -c"; + } + + if ( $output ) + { + if ( ! open(STDOUT,">",$output) ) + { + mtr_error("can't redirect STDOUT to \"$output\": $!"); + } + } + + if ( $error ) + { + if ( $output eq $error ) + { + if ( ! open(STDERR,">&STDOUT") ) + { + mtr_error("can't dup STDOUT: $!"); + } + } + else + { + if ( ! open(STDERR,">",$error) ) + { + mtr_error("can't redirect STDERR to \"$output\": $!"); + } + } + } + + if ( $input ) + { + if ( ! open(STDIN,"<",$input) ) + { + mtr_error("can't redirect STDIN to \"$input\": $!"); + } + } + + if ( ! exec($path,@$arg_list_t) ) + { + mtr_error("failed to execute \"$path\": $!"); + } + } + } +} + + +sub spawn_parent_impl { + my $pid= shift; + my $mode= shift; + my $path= shift; + + if ( $mode eq 'run' or $mode eq 'test' ) + { + my $exit_value= -1; + my $signal_num= 0; + my $dumped_core= 0; + + if ( $mode eq 'run' ) + { + # Simple run of command, we wait for it to return + my $ret_pid= waitpid($pid,0); + + if ( $ret_pid <= 0 ) + { + mtr_error("$path ($pid) got lost somehow"); + } + + $exit_value= $? >> 8; + $signal_num= $? & 127; + $dumped_core= $? & 128; + + return $exit_value; + } + else + { + # We run mysqltest and wait for it to return. But we try to + # catch dying mysqld processes as well. + # + # We do blocking waitpid() until we get the return from the + # "mysqltest" call. But if a mysqld process dies that we + # started, we take this as an error, and kill mysqltest. + # + # FIXME is this as it should be? Can't mysqld terminate + # normally from running a test case? + + my $ret_pid; # What waitpid() returns + + while ( ($ret_pid= waitpid(-1,0)) != -1 ) + { + # Someone terminated, don't know who. Collect + # status info first before $? is lost, + # but not $exit_value, this is flagged from + # + + if ( $ret_pid == $pid ) + { + # We got termination of mysqltest, we are done + $exit_value= $? >> 8; + $signal_num= $? & 127; + $dumped_core= $? & 128; + last; + } + + # If one of the mysqld processes died, we want to + # mark this, and kill the mysqltest process. + + foreach my $idx (0..1) + { + if ( $::master->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was master[$idx], " . + "exit during mysqltest run"); + $::master->[$idx]->{'pid'}= 0; + last; + } + } + + foreach my $idx (0..2) + { + if ( $::slave->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was slave[$idx], " . + "exit during mysqltest run"); + $::slave->[$idx]->{'pid'}= 0; + last; + } + } + + mtr_debug("waitpid() catched exit of unknown child $ret_pid, " . + "exit during mysqltest run"); + } + + if ( $ret_pid != $pid ) + { + # We terminated the waiting because a "mysqld" process died. + # Kill the mysqltest process. + + kill(9,$pid); + + $ret_pid= waitpid($pid,0); + + if ( $ret_pid == -1 ) + { + mtr_error("$path ($pid) got lost somehow"); + } + } + + return $exit_value; + } + } + else + { + # We spawned a process we don't wait for + return $pid; + } +} + + + +############################################################################## +# +# Kill processes left from previous runs +# +############################################################################## + +# We just "ping" on the ports, and if we can't do a socket connect +# we assume the server is dead. So we don't *really* know a server +# is dead, we just hope that it after letting the listen port go, +# it is dead enough for us to start a new server. + +sub mtr_kill_leftovers () { + + # First, kill all masters and slaves that would conflict with + # this run. Make sure to remove the PID file, if any. + + my @args; + + for ( my $idx; $idx < 2; $idx++ ) + { + push(@args,{ + pid => 0, # We don't know the PID + pidfile => $::master->[$idx]->{'path_mypid'}, + sockfile => $::master->[$idx]->{'path_mysock'}, + port => $::master->[$idx]->{'path_myport'}, + }); + } + + for ( my $idx; $idx < 3; $idx++ ) + { + push(@args,{ + pid => 0, # We don't know the PID + pidfile => $::slave->[$idx]->{'path_mypid'}, + sockfile => $::slave->[$idx]->{'path_mysock'}, + port => $::slave->[$idx]->{'path_myport'}, + }); + } + + mtr_mysqladmin_shutdown(\@args); + + # We now have tried to terminate nice. We have waited for the listen + # port to be free, but can't really tell if the mysqld process died + # or not. We now try to find the process PID from the PID file, and + # send a kill to that process. Note that Perl let kill(0,@pids) be + # a way to just return the numer of processes the kernel can send + # signals to. So this can be used (except on Cygwin) to determine + # if there are processes left running that we cound out might exists. + # + # But still after all this work, all we know is that we have + # the ports free. + + # We scan the "var/run/" directory for other process id's to kill + + # FIXME $path_run_dir or something + my $rundir= "$::glob_mysql_test_dir/var/run"; + + if ( -d $rundir ) + { + opendir(RUNDIR, $rundir) + or mtr_error("can't open directory \"$rundir\": $!"); + + my @pids; + + while ( my $elem= readdir(RUNDIR) ) + { + my $pidfile= "$rundir/$elem"; + + if ( -f $pidfile ) + { + my $pid= mtr_get_pid_from_file($pidfile); + + # Race, could have been removed between I tested with -f + # and the unlink() below, so I better check again with -f + + if ( ! unlink($pidfile) and -f $pidfile ) + { + mtr_error("can't remove $pidfile"); + } + + if ( $::glob_cygwin_perl or kill(0, $pid) ) + { + push(@pids, $pid); # We know (cygwin guess) it exists + } + } + } + closedir(RUNDIR); + + if ( @pids ) + { + if ( $::glob_cygwin_perl ) + { + # We have no (easy) way of knowing the Cygwin controlling + # process, in the PID file we only have the Windows process id. + system("kill -f " . join(" ",@pids)); # Hope for the best.... + mtr_debug("Sleep 5 seconds waiting for processes to die"); + sleep(5); + } + else + { + my $retries= 10; # 10 seconds + do + { + kill(9, @pids); + mtr_debug("Sleep 1 second waiting for processes to die"); + sleep(1) # Wait one second + } while ( $retries-- and kill(0, @pids) ); + + if ( kill(0, @pids) ) # Check if some left + { + # FIXME maybe just mtr_warning() ? + mtr_error("can't kill process(es) " . join(" ", @pids)); + } + } + } + } + + # We may have failed everything, bug we now check again if we have + # the listen ports free to use, and if they are free, just go for it. + + foreach my $srv ( @args ) + { + if ( mtr_ping_mysqld_server($srv->{'port'}, $srv->{'sockfile'}) ) + { + mtr_error("can't kill old mysqld holding port $srv->{'port'}"); + } + } +} + +############################################################################## +# +# Shut down mysqld servers we have started from this run of this script +# +############################################################################## + +# To speed things we kill servers in parallel. The argument is a list +# of 'ports', 'pids', 'pidfiles' and 'socketfiles'. + +# FIXME On Cygwin, and maybe some other platforms, $srv->{'pid'} and +# $srv->{'pidfile'} will not be the same PID. We need to try to kill +# both I think. + +sub mtr_stop_mysqld_servers ($) { + my $spec= shift; + + # ---------------------------------------------------------------------- + # First try nice normal shutdown using 'mysqladmin' + # ---------------------------------------------------------------------- + + mtr_mysqladmin_shutdown($spec); + + # ---------------------------------------------------------------------- + # We loop with waitpid() nonblocking to see how many of the ones we + # are to kill, actually got killed by mtr_mysqladmin_shutdown(). + # Note that we don't rely on this, the mysqld server might have stop + # listening to the port, but still be alive. But it is a start. + # ---------------------------------------------------------------------- + + foreach my $srv ( @$spec ) + { + if ( $srv->{'pid'} and (waitpid($srv->{'pid'},&WNOHANG) == $srv->{'pid'}) ) + { + $srv->{'pid'}= 0; + } + } + + # ---------------------------------------------------------------------- + # We know the process was started from this file, so there is a PID + # saved, or else we have nothing to do. + # Might be that is is recorded to be missing, but we failed to + # take away the PID file earlier, then we do it now. + # ---------------------------------------------------------------------- + + my %mysqld_pids; + + foreach my $srv ( @$spec ) + { + if ( $srv->{'pid'} ) + { + $mysqld_pids{$srv->{'pid'}}= 1; + } + else + { + # Race, could have been removed between I tested with -f + # and the unlink() below, so I better check again with -f + + if ( -f $srv->{'pidfile'} and ! unlink($srv->{'pidfile'}) and + -f $srv->{'pidfile'} ) + { + mtr_error("can't remove $srv->{'pidfile'}"); + } + } + } + + # ---------------------------------------------------------------------- + # If the processes where started from this script, and we had no PIDS + # then we don't have to do anything. + # ---------------------------------------------------------------------- + + if ( ! keys %mysqld_pids ) + { + # cluck "This is how we got here!"; + return; + } + + # ---------------------------------------------------------------------- + # In mtr_mysqladmin_shutdown() we only waited for the mysqld servers + # not to listen to the port. But we are not sure we got them all + # killed. If we suspect it lives, try nice kill with SIG_TERM. Note + # that for true Win32 processes, kill(0,$pid) will not return 1. + # ---------------------------------------------------------------------- + + SIGNAL: + foreach my $sig (15,9) + { + my $retries= 10; # 10 seconds + kill($sig, keys %mysqld_pids); + while ( $retries-- and kill(0, keys %mysqld_pids) ) + { + mtr_debug("Sleep 1 second waiting for processes to die"); + sleep(1) # Wait one second + } + } + + # ---------------------------------------------------------------------- + # Now, we check if all we can find using kill(0,$pid) are dead, + # and just assume the rest are. We cleanup socket and PID files. + # ---------------------------------------------------------------------- + + { + my $errors= 0; + foreach my $srv ( @$spec ) + { + if ( $srv->{'pid'} ) + { + if ( kill(0,$srv->{'pid'}) ) + { + # FIXME In Cygwin there seem to be some fast reuse + # of PIDs, so dying may not be the right thing to do. + $errors++; + mtr_warning("can't kill process $srv->{'pid'}"); + } + else + { + # We managed to kill it at last + # FIXME In Cygwin, we will get here even if the process lives. + + # Not needed as we know the process is dead, but to be safe + # we unlink and check success in two steps. We first unlink + # without checking the error code, and then check if the + # file still exists. + + foreach my $file ($srv->{'pidfile'}, $srv->{'sockfile'}) + { + # Know it is dead so should be no race, careful anyway + if ( -f $file and ! unlink($file) and -f $file ) + { + $errors++; + mtr_warning("couldn't delete $file"); + } + } + } + } + } + if ( $errors ) + { + # We are in trouble, just die.... + mtr_error("we could not kill or clean up all processes"); + } + } + + # FIXME We just assume they are all dead, for Cygwin we are not + # really sure + +} + + +############################################################################## +# +# Shut down mysqld servers using "mysqladmin ... shutdown". +# To speed this up, we start them in parallel and use waitpid() to +# catch their termination. Note that this doesn't say the servers +# are terminated, just that 'mysqladmin' is terminated. +# +# Note that mysqladmin will ask the server about what PID file it uses, +# and mysqladmin will wait for it to be removed before it terminates +# (unless passes timeout). +# +# This function will take at most about 20 seconds, and we still are not +# sure we killed them all. If none is responding to ping, we return 1, +# else we return 0. +# +############################################################################## + +sub mtr_mysqladmin_shutdown () { + my $spec= shift; + + my %mysql_admin_pids; + my @to_kill_specs; + + foreach my $srv ( @$spec ) + { + if ( mtr_ping_mysqld_server($srv->{'port'}, $srv->{'sockfile'}) ) + { + push(@to_kill_specs, $srv); + } + } + + + foreach my $srv ( @to_kill_specs ) + { + # FIXME wrong log..... + # FIXME, stderr..... + # Shutdown time must be high as slave may be in reconnect + my $args; + + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--user=%s", $::opt_user); + mtr_add_arg($args, "--password="); + if ( -e $srv->{'sockfile'} ) + { + mtr_add_arg($args, "--socket=%s", $srv->{'sockfile'}); + } + if ( $srv->{'port'} ) + { + mtr_add_arg($args, "--port=%s", $srv->{'port'}); + } + if ( $srv->{'port'} and ! -e $srv->{'sockfile'} ) + { + mtr_add_arg($args, "--protocol=tcp"); # Needed if no --socket + } + mtr_add_arg($args, "--connect_timeout=5"); + mtr_add_arg($args, "--shutdown_timeout=20"); + mtr_add_arg($args, "shutdown"); + # We don't wait for termination of mysqladmin + my $pid= mtr_spawn($::exe_mysqladmin, $args, + "", $::path_manager_log, $::path_manager_log, ""); + $mysql_admin_pids{$pid}= 1; + } + + # We wait blocking, we wait for the last one anyway + while (keys %mysql_admin_pids) + { + foreach my $pid (keys %mysql_admin_pids) + { + if ( waitpid($pid,0) > 0 ) + { + delete $mysql_admin_pids{$pid}; + } + } + } + + # If we trusted "mysqladmin --shutdown_timeout= ..." we could just + # terminate now, but we don't (FIXME should be debugged). + # So we try again to ping and at least wait the same amount of time + # mysqladmin would for all to die. + + my $timeout= 20; # 20 seconds max + my $res= 1; # If we just fall through, we are done + + TIME: + while ( $timeout-- ) + { + foreach my $srv ( @to_kill_specs ) + { + $res= 1; # We are optimistic + if ( mtr_ping_mysqld_server($srv->{'port'}, $srv->{'sockfile'}) ) + { + mtr_debug("Sleep 1 second waiting for processes to stop using port"); + sleep(1); # One second + $res= 0; + next TIME; + } + } + last; # If we got here, we are done + } + + return $res; +} + +############################################################################## +# +# The operating system will keep information about dead children, +# we read this information here, and if we have records the process +# is alive, we mark it as dead. +# +############################################################################## + +sub mtr_record_dead_children () { + + my $ret_pid; + + # FIXME the man page says to wait for -1 to terminate, + # but on OS X we get '0' all the time... + while ( ($ret_pid= waitpid(-1,&WNOHANG)) > 0 ) + { + mtr_debug("waitpid() catched exit of child $ret_pid"); + foreach my $idx (0..1) + { + if ( $::master->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was master[$idx]"); + $::master->[$idx]->{'pid'}= 0; + } + } + + foreach my $idx (0..2) + { + if ( $::slave->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was slave[$idx]"); + $::slave->[$idx]->{'pid'}= 0; + last; + } + } + } +} + +sub start_reap_all { + $SIG{CHLD}= 'IGNORE'; # FIXME is this enough? +} + +sub stop_reap_all { + $SIG{CHLD}= 'DEFAULT'; +} + +sub mtr_ping_mysqld_server () { + my $port= shift; + + my $remote= "localhost"; + my $iaddr= inet_aton($remote); + if ( ! $iaddr ) + { + mtr_error("can't find IP number for $remote"); + } + my $paddr= sockaddr_in($port, $iaddr); + my $proto= getprotobyname('tcp'); + if ( ! socket(SOCK, PF_INET, SOCK_STREAM, $proto) ) + { + mtr_error("can't create socket: $!"); + } + if ( connect(SOCK, $paddr) ) + { + close(SOCK); # FIXME check error? + return 1; + } + else + { + return 0; + } +} + +############################################################################## +# +# Wait for a file to be created +# +############################################################################## + + +sub sleep_until_file_created ($$$) { + my $pidfile= shift; + my $timeout= shift; + my $pid= shift; + + for ( my $loop= 1; $loop <= $timeout; $loop++ ) + { + if ( -r $pidfile ) + { + return 1; + } + + # Check if it died after the fork() was successful + if ( waitpid($pid,&WNOHANG) == $pid ) + { + return 0; + } + + mtr_debug("Sleep 1 second waiting for creation of $pidfile"); + + if ( $loop % 60 == 0 ) + { + my $left= $timeout - $loop; + mtr_warning("Waited $loop seconds for $pidfile to be created, " . + "still waiting for $left seconds..."); + } + + sleep(1); + } + + return 0; +} + + +1; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl new file mode 100644 index 00000000000..3729ff512ee --- /dev/null +++ b/mysql-test/lib/mtr_report.pl @@ -0,0 +1,281 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_report_test_name($); +sub mtr_report_test_passed($); +sub mtr_report_test_failed($); +sub mtr_report_test_skipped($); +sub mtr_report_test_disabled($); + +sub mtr_show_failed_diff ($); +sub mtr_report_stats ($); +sub mtr_print_line (); +sub mtr_print_thick_line (); +sub mtr_print_header (); +sub mtr_report (@); +sub mtr_warning (@); +sub mtr_error (@); +sub mtr_debug (@); + + +############################################################################## +# +# +# +############################################################################## + +# We can't use diff -u or diff -a as these are not portable + +sub mtr_show_failed_diff ($) { + my $tname= shift; + + my $reject_file= "r/$tname.reject"; + my $result_file= "r/$tname.result"; + my $eval_file= "r/$tname.eval"; + + if ( -f $eval_file ) + { + $result_file= $eval_file; + } + elsif ( $::opt_result_ext and + ( $::opt_record or -f "$result_file$::opt_result_ext" )) + { + # If we have an special externsion for result files we use it if we are + # recording or a result file with that extension exists. + $result_file= "$result_file$::opt_result_ext"; + } + + my $diffopts= $::opt_udiff ? "-u" : "-c"; + + if ( -f $reject_file ) + { + print "Below are the diffs between actual and expected results:\n"; + print "-------------------------------------------------------\n"; + # FIXME check result code?! + mtr_run("diff",[$diffopts,$result_file,$reject_file], "", "", "", ""); + print "-------------------------------------------------------\n"; + print "Please follow the instructions outlined at\n"; + print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n"; + print "to find the reason to this problem and how to report this.\n\n"; + } +} + +sub mtr_report_test_name ($) { + my $tinfo= shift; + + printf "%-31s ", $tinfo->{'name'}; +} + +sub mtr_report_test_skipped ($) { + my $tinfo= shift; + + $tinfo->{'result'}= 'MTR_RES_SKIPPED'; + if ( $tinfo->{'disable'} ) + { + print "[ disabled ] $tinfo->{'comment'}\n"; + } + else + { + print "[ skipped ]\n"; + } +} + +sub mtr_report_test_passed ($) { + my $tinfo= shift; + + my $timer= ""; +# FIXME +# if ( $::opt_timer and -f "$::glob_mysql_test_dir/var/log/timer" ) +# { +# $timer= `cat var/log/timer`; +# $timer= sprintf "%13s", $timer; +# } + $tinfo->{'result'}= 'MTR_RES_PASSED'; + print "[ pass ] $timer\n"; +} + +sub mtr_report_test_failed ($) { + my $tinfo= shift; + + $tinfo->{'result'}= 'MTR_RES_FAILED'; + print "[ fail ]\n"; + + # FIXME Instead of this test, and meaningless error message in 'else' + # we should write out into $::path_timefile when the error occurs. + if ( -f $::path_timefile ) + { + print "Errors are (from $::path_timefile) :\n"; + print mtr_fromfile($::path_timefile); # FIXME print_file() instead + print "\n(the last lines may be the most important ones)\n"; + } + else + { + print "Unexpected termination, probably when starting mysqld\n"; + } +} + +sub mtr_report_stats ($) { + my $tests= shift; + + # ---------------------------------------------------------------------- + # Find out how we where doing + # ---------------------------------------------------------------------- + + my $tot_skiped= 0; + my $tot_passed= 0; + my $tot_failed= 0; + my $tot_tests= 0; + + foreach my $tinfo (@$tests) + { + if ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' ) + { + $tot_skiped++; + } + elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' ) + { + $tot_tests++; + $tot_passed++; + } + elsif ( $tinfo->{'result'} eq 'MTR_RES_FAILED' ) + { + $tot_tests++; + $tot_failed++; + } + } + + # ---------------------------------------------------------------------- + # Print out a summary report to screen + # ---------------------------------------------------------------------- + + if ( ! $tot_failed ) + { + print "All $tot_tests tests were successful.\n"; + } + else + { + my $ratio= $tot_passed * 100 / $tot_tests; + printf "Failed $tot_failed/$tot_tests tests, " . + "%.2f\% successful.\n\n", $ratio; + print + "The log files in var/log may give you some hint\n", + "of what when wrong.\n", + "If you want to report this error, please read first ", + "the documentation at\n", + "http://www.mysql.com/doc/en/MySQL_test_suite.html\n"; + } + + # ---------------------------------------------------------------------- + # ---------------------------------------------------------------------- + + if ( ! $::glob_use_running_server ) + { + + # Report if there was any fatal warnings/errors in the log files + # + unlink("$::glob_mysql_test_dir/var/log/warnings"); + unlink("$::glob_mysql_test_dir/var/log/warnings.tmp"); + # Remove some non fatal warnings from the log files + +# FIXME what is going on ????? ;-) +# sed -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \ +# var/log/*.err \ +# | sed -e 's!Warning: Table:.* on rename!!g' \ +# > var/log/warnings.tmp; +# +# found_error=0; +# # Find errors +# for i in "^Warning:" "^Error:" "^==.* at 0x" +# do +# if ( $GREP "$i" var/log/warnings.tmp >> var/log/warnings ) +# { +# found_error=1 +# } +# done +# unlink("$::glob_mysql_test_dir/var/log/warnings.tmp"); +# if ( $found_error= "1" ) +# { +# print "WARNING: Got errors/warnings while running tests. Please examine\n" +# print "$::glob_mysql_test_dir/var/log/warnings for details.\n" +# } +# } + } + + print "\n"; + + if ( $tot_failed != 0 ) + { + print "mysql-test-run: *** Failing the test(s):"; + + foreach my $tinfo (@$tests) + { + if ( $tinfo->{'result'} eq 'MTR_RES_FAILED' ) + { + print " $tinfo->{'name'}"; + } + } + print "\n"; + mtr_error("there where failing test cases"); + } +} + +############################################################################## +# +# Text formatting +# +############################################################################## + +sub mtr_print_line () { + print '-' x 55, "\n"; +} + +sub mtr_print_thick_line () { + print '=' x 55, "\n"; +} + +sub mtr_print_header () { + print "\n"; + if ( $::opt_timer ) + { + print "TEST RESULT TIME (ms)\n"; + } + else + { + print "TEST RESULT\n"; + } + mtr_print_line(); + print "\n"; +} + + +############################################################################## +# +# Misc +# +############################################################################## + +sub mtr_report (@) { + print join(" ", @_),"\n"; +} + +sub mtr_warning (@) { + print STDERR "mysql-test-run: WARNING: ",join(" ", @_),"\n"; +} + +sub mtr_error (@) { + die "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; +} + +sub mtr_debug (@) { + if ( $::opt_script_debug ) + { + print STDERR "####: ",join(" ", @_),"\n"; + } +} + +1; diff --git a/mysql-test/my_create_tables.c b/mysql-test/my_create_tables.c new file mode 100644 index 00000000000..06a6fabf022 --- /dev/null +++ b/mysql-test/my_create_tables.c @@ -0,0 +1,673 @@ +#include <stdio.h> +#include <errno.h> +#ifndef __WIN__ +#include <dirent.h> +#endif +#include <string.h> +#ifdef __NETWARE__ +#include <screen.h> +#include <proc.h> +#else +#include <sys/types.h> +#ifndef __WIN__ +#include <sys/wait.h> +#include <unistd.h> +#else +#include <direct.h> +#include <stdlib.h> +#include <stdio.h> +#endif +#endif +#include <ctype.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <assert.h> +#include "my_manage.h" + +/* + Synopsis: + This function testes a exist file + +Arguments: + mdata: path to data + file_name: name of file +Output: + A zero value indicates that file is exist. +*/ +bool test_sys_file(const char *mdata,const char *file_name) +{ + struct stat file; + char path_file_name[PATH_MAX]; + snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name); + return(stat(path_file_name,&file)); +} + +/* + Synopsis: + This function creates a file with sql requstes for creating + system data files. + +Arguments: + mdata: path to data + output_file: file name for output file + test: to create system files with test data +Output: + A zero value indicates a success. +*/ +bool create_system_files(const char *mdata,const char *output_file, bool test) +{ + FILE *out; + + out = fopen(output_file, "w+"); + + if (!out) + return 1; + + if (test_sys_file(mdata,"mysql")) + { + fprintf(out,"CREATE DATABASE mysql;\n"); + } + + if (test && test_sys_file(mdata,"test")) + { + fprintf(out,"CREATE DATABASE test;\n"); + } + + fprintf(out,"USE mysql;\n"); + + if (test_sys_file(mdata,"mysql/db.frm")) + { + fprintf(out, + "CREATE TABLE db (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "PRIMARY KEY Host (Host,Db,User)," + "KEY User (User))" + "engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Database privileges';\n"); + + if (test) + { + fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'" + ",'Y','Y','N','Y','Y','Y','Y','Y');\n"); + fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'" + ",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n"); + } + } + + if (test_sys_file(mdata,"mysql/host.frm")) + { + fprintf(out, + "CREATE TABLE host (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "PRIMARY KEY Host (Host,Db))" + "engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Host privileges; Merged with database privileges';\n"); + } + + + if (test_sys_file(mdata,"mysql/user.frm")) + { +#ifdef __WIN__ + WSADATA wsa_data; +#endif + char hostname[FN_REFLEN]; + +#ifdef __WIN__ + if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data)) + return 1; +#endif + if (gethostname(hostname, FN_REFLEN)) + return 1; +#ifdef __WIN__ + WSACleanup( ); +#endif + + if (strchr(hostname, '.') == NULL) + strcat(hostname, "%"); + + fprintf(out, + "CREATE TABLE user (" + "Host char(60) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Password char(41) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "File_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," + "ssl_cipher BLOB NOT NULL," + "x509_issuer BLOB NOT NULL," + "x509_subject BLOB NOT NULL," + "max_questions int(11) unsigned DEFAULT 0 NOT NULL," + "max_updates int(11) unsigned DEFAULT 0 NOT NULL," + "max_connections int(11) unsigned DEFAULT 0 NOT NULL," + "PRIMARY KEY Host (Host,User)" + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Users and global privileges';\n"); + + + if (test) + { + fprintf(out, + "INSERT INTO user VALUES ('localhost','root',''" + ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','','','','',0,0,0);\n"); + fprintf(out, + "INSERT INTO user VALUES ('%s','root','','Y','Y'," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','','','','',0,0,0);\n",hostname); + fprintf(out, + "REPLACE INTO user VALUES ('127.0.0.1','root',''," + "'Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'" + ",'Y','','','','',0,0,0);\n"); + fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n"); + fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname); + } + else + { + fprintf(out, + "INSERT INTO user VALUES ('localhost','root',''," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','','','','',0,0,0);\n"); +#ifndef __WIN__ + fprintf(out, + "INSERT INTO user VALUES ('%s','root','','Y','Y'," + "'Y','Y','Y','Y','Y','Y'" + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''" + ",'','',0,0,0);\n",hostname); + fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname); + fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n"); +#else + fprintf(out, + "INSERT INTO user VALUES ('localhost','','','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''," + "'','',0,0,0);\n"); +#endif + } + } + + + if (test_sys_file(mdata,"mysql/func.frm")) + { + fprintf(out, + "CREATE TABLE func (" + "name char(64) binary DEFAULT '' NOT NULL," + "ret tinyint(1) DEFAULT '0' NOT NULL," + "dl char(128) DEFAULT '' NOT NULL," + "type enum ('function','aggregate') NOT NULL," + "PRIMARY KEY (name)" + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='User defined functions';\n"); + } + + if (test_sys_file(mdata,"mysql/tables_priv.frm")) + { + fprintf(out, + "CREATE TABLE tables_priv (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Table_name char(64) binary DEFAULT '' NOT NULL," + "Grantor char(77) DEFAULT '' NOT NULL," + "Timestamp timestamp(14)," + "Table_priv set('Select','Insert','Update','Delete'," + "'Create','Drop','Grant','References','Index','Alter')" + " DEFAULT '' NOT NULL," + "Column_priv set('Select','Insert','Update','References')" + " DEFAULT '' NOT NULL," + "PRIMARY KEY (Host,Db,User,Table_name)," + "KEY Grantor (Grantor)" + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Table privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/columns_priv.frm")) + { + fprintf(out, + "CREATE TABLE columns_priv (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Table_name char(64) binary DEFAULT '' NOT NULL," + "Column_name char(64) binary DEFAULT '' NOT NULL," + "Timestamp timestamp(14)," + "Column_priv set('Select','Insert','Update','References')" + " DEFAULT '' NOT NULL," + "PRIMARY KEY (Host,Db,User,Table_name,Column_name)" + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Column privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/help_topic.frm")) + { + fprintf(out, + "CREATE TABLE help_topic (" + "help_topic_id int unsigned not null," + "name varchar(64) not null," + "help_category_id smallint unsigned not null," + "description text not null," + "example text not null," + "url varchar(128) not null," + "primary key (help_topic_id)," + "unique index (name)" + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help topics';\n"); + } + + if (test_sys_file(mdata,"mysql/help_category.frm")) + { + fprintf(out, + "CREATE TABLE help_category (" + "help_category_id smallint unsigned not null," + "name varchar(64) not null," + "parent_category_id smallint unsigned null," + "url varchar(128) not null," + "primary key (help_category_id)," + "unique index (name)" + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help categories';\n"); + } + + if (test_sys_file(mdata,"mysql/help_keyword.frm")) + { + fprintf(out, + "CREATE TABLE help_keyword (" + "help_keyword_id int unsigned not null," + "name varchar(64) not null," + "primary key (help_keyword_id)," + "unique index (name)" + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help keywords';\n"); + } + + if (test_sys_file(mdata,"mysql/help_relation.frm")) + { + fprintf(out, + "CREATE TABLE help_relation (" + "help_topic_id int unsigned not null references help_topic," + "help_keyword_id int unsigned not null references help_keyword," + "primary key (help_keyword_id, help_topic_id)" + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='keyword-topic relation';\n"); + } + + if (test_sys_file(mdata,"mysql/time_zone_name.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_name (" + "Name char(64) NOT NULL," + "Time_zone_id int unsigned NOT NULL," + "PRIMARY KEY Name (Name)" + ") engine=MyISAM CHARACTER SET utf8 " + "comment='Time zone names';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" + "('MET', 1), ('UTC', 2), ('Universal', 2), " + "('Europe/Moscow',3), ('leap/Europe/Moscow',4)," + "('Japan', 5);\n"); + + } + } + + + if (test_sys_file(mdata,"mysql/time_zone.frm")) + { + fprintf(out, + "CREATE TABLE time_zone (" + "Time_zone_id int unsigned NOT NULL auto_increment," + "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + "PRIMARY KEY TzId (Time_zone_id)" + ") engine=MyISAM CHARACTER SET utf8 " + "comment='Time zones';\n"); + + if (test) + { + fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" + "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n"); + } + } + + if (test_sys_file(mdata,"mysql/time_zone_transition.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_transition (" + "Time_zone_id int unsigned NOT NULL," + "Transition_time bigint signed NOT NULL," + "Transition_type_id int unsigned NOT NULL," + "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" + ") engine=MyISAM CHARACTER SET utf8 " + "comment='Time zone transitions';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_transition" + "(Time_zone_id, Transition_time, Transition_type_id)" + "VALUES" + " (1, -1693706400, 0) ,(1, -1680483600, 1)" + ",(1, -1663455600, 2) ,(1, -1650150000, 3)" + ",(1, -1632006000, 2) ,(1, -1618700400, 3)" + ",(1, -938905200, 2) ,(1, -857257200, 3)" + ",(1, -844556400, 2) ,(1, -828226800, 3)" + ",(1, -812502000, 2) ,(1, -796777200, 3)" + ",(1, 228877200, 2) ,(1, 243997200, 3)" + ",(1, 260326800, 2) ,(1, 276051600, 3)" + ",(1, 291776400, 2) ,(1, 307501200, 3)" + ",(1, 323830800, 2) ,(1, 338950800, 3)" + ",(1, 354675600, 2) ,(1, 370400400, 3)" + ",(1, 386125200, 2) ,(1, 401850000, 3)" + ",(1, 417574800, 2) ,(1, 433299600, 3)" + ",(1, 449024400, 2) ,(1, 465354000, 3)" + ",(1, 481078800, 2) ,(1, 496803600, 3)" + ",(1, 512528400, 2) ,(1, 528253200, 3)" + ",(1, 543978000, 2) ,(1, 559702800, 3)" + ",(1, 575427600, 2) ,(1, 591152400, 3)" + ",(1, 606877200, 2) ,(1, 622602000, 3)" + ",(1, 638326800, 2) ,(1, 654656400, 3)" + ",(1, 670381200, 2) ,(1, 686106000, 3)" + ",(1, 701830800, 2) ,(1, 717555600, 3)" + ",(1, 733280400, 2) ,(1, 749005200, 3)" + ",(1, 764730000, 2) ,(1, 780454800, 3)" + ",(1, 796179600, 2) ,(1, 811904400, 3)" + ",(1, 828234000, 2) ,(1, 846378000, 3)" + ",(1, 859683600, 2) ,(1, 877827600, 3)" + ",(1, 891133200, 2) ,(1, 909277200, 3)" + ",(1, 922582800, 2) ,(1, 941331600, 3)" + ",(1, 954032400, 2) ,(1, 972781200, 3)" + ",(1, 985482000, 2) ,(1, 1004230800, 3)" + ",(1, 1017536400, 2) ,(1, 1035680400, 3)" + ",(1, 1048986000, 2) ,(1, 1067130000, 3)" + ",(1, 1080435600, 2) ,(1, 1099184400, 3)" + ",(1, 1111885200, 2) ,(1, 1130634000, 3)" + ",(1, 1143334800, 2) ,(1, 1162083600, 3)" + ",(1, 1174784400, 2) ,(1, 1193533200, 3)" + ",(1, 1206838800, 2) ,(1, 1224982800, 3)" + ",(1, 1238288400, 2) ,(1, 1256432400, 3)" + ",(1, 1269738000, 2) ,(1, 1288486800, 3)" + ",(1, 1301187600, 2) ,(1, 1319936400, 3)" + ",(1, 1332637200, 2) ,(1, 1351386000, 3)" + ",(1, 1364691600, 2) ,(1, 1382835600, 3)" + ",(1, 1396141200, 2) ,(1, 1414285200, 3)" + ",(1, 1427590800, 2) ,(1, 1445734800, 3)" + ",(1, 1459040400, 2) ,(1, 1477789200, 3)" + ",(1, 1490490000, 2) ,(1, 1509238800, 3)" + ",(1, 1521939600, 2) ,(1, 1540688400, 3)" + ",(1, 1553994000, 2) ,(1, 1572138000, 3)" + ",(1, 1585443600, 2) ,(1, 1603587600, 3)" + ",(1, 1616893200, 2) ,(1, 1635642000, 3)" + ",(1, 1648342800, 2) ,(1, 1667091600, 3)" + ",(1, 1679792400, 2) ,(1, 1698541200, 3)" + ",(1, 1711846800, 2) ,(1, 1729990800, 3)" + ",(1, 1743296400, 2) ,(1, 1761440400, 3)" + ",(1, 1774746000, 2) ,(1, 1792890000, 3)" + ",(1, 1806195600, 2) ,(1, 1824944400, 3)" + ",(1, 1837645200, 2) ,(1, 1856394000, 3)" + ",(1, 1869094800, 2) ,(1, 1887843600, 3)" + ",(1, 1901149200, 2) ,(1, 1919293200, 3)" + ",(1, 1932598800, 2) ,(1, 1950742800, 3)" + ",(1, 1964048400, 2) ,(1, 1982797200, 3)" + ",(1, 1995498000, 2) ,(1, 2014246800, 3)" + ",(1, 2026947600, 2) ,(1, 2045696400, 3)" + ",(1, 2058397200, 2) ,(1, 2077146000, 3)" + ",(1, 2090451600, 2) ,(1, 2108595600, 3)" + ",(1, 2121901200, 2) ,(1, 2140045200, 3)" + ",(3, -1688265000, 2) ,(3, -1656819048, 1)" + ",(3, -1641353448, 2) ,(3, -1627965048, 3)" + ",(3, -1618716648, 1) ,(3, -1596429048, 3)" + ",(3, -1593829848, 5) ,(3, -1589860800, 4)" + ",(3, -1542427200, 5) ,(3, -1539493200, 6)" + ",(3, -1525323600, 5) ,(3, -1522728000, 4)" + ",(3, -1491188400, 7) ,(3, -1247536800, 4)" + ",(3, 354920400, 5) ,(3, 370728000, 4)" + ",(3, 386456400, 5) ,(3, 402264000, 4)" + ",(3, 417992400, 5) ,(3, 433800000, 4)" + ",(3, 449614800, 5) ,(3, 465346800, 8)" + ",(3, 481071600, 9) ,(3, 496796400, 8)" + ",(3, 512521200, 9) ,(3, 528246000, 8)" + ",(3, 543970800, 9) ,(3, 559695600, 8)" + ",(3, 575420400, 9) ,(3, 591145200, 8)" + ",(3, 606870000, 9) ,(3, 622594800, 8)" + ",(3, 638319600, 9) ,(3, 654649200, 8)" + ",(3, 670374000, 10) ,(3, 686102400, 11)" + ",(3, 695779200, 8) ,(3, 701812800, 5)" + ",(3, 717534000, 4) ,(3, 733273200, 9)" + ",(3, 748998000, 8) ,(3, 764722800, 9)" + ",(3, 780447600, 8) ,(3, 796172400, 9)" + ",(3, 811897200, 8) ,(3, 828226800, 9)" + ",(3, 846370800, 8) ,(3, 859676400, 9)" + ",(3, 877820400, 8) ,(3, 891126000, 9)" + ",(3, 909270000, 8) ,(3, 922575600, 9)" + ",(3, 941324400, 8) ,(3, 954025200, 9)" + ",(3, 972774000, 8) ,(3, 985474800, 9)" + ",(3, 1004223600, 8) ,(3, 1017529200, 9)" + ",(3, 1035673200, 8) ,(3, 1048978800, 9)" + ",(3, 1067122800, 8) ,(3, 1080428400, 9)" + ",(3, 1099177200, 8) ,(3, 1111878000, 9)" + ",(3, 1130626800, 8) ,(3, 1143327600, 9)" + ",(3, 1162076400, 8) ,(3, 1174777200, 9)" + ",(3, 1193526000, 8) ,(3, 1206831600, 9)" + ",(3, 1224975600, 8) ,(3, 1238281200, 9)" + ",(3, 1256425200, 8) ,(3, 1269730800, 9)" + ",(3, 1288479600, 8) ,(3, 1301180400, 9)" + ",(3, 1319929200, 8) ,(3, 1332630000, 9)" + ",(3, 1351378800, 8) ,(3, 1364684400, 9)" + ",(3, 1382828400, 8) ,(3, 1396134000, 9)" + ",(3, 1414278000, 8) ,(3, 1427583600, 9)" + ",(3, 1445727600, 8) ,(3, 1459033200, 9)" + ",(3, 1477782000, 8) ,(3, 1490482800, 9)" + ",(3, 1509231600, 8) ,(3, 1521932400, 9)" + ",(3, 1540681200, 8) ,(3, 1553986800, 9)" + ",(3, 1572130800, 8) ,(3, 1585436400, 9)" + ",(3, 1603580400, 8) ,(3, 1616886000, 9)" + ",(3, 1635634800, 8) ,(3, 1648335600, 9)" + ",(3, 1667084400, 8) ,(3, 1679785200, 9)" + ",(3, 1698534000, 8) ,(3, 1711839600, 9)" + ",(3, 1729983600, 8) ,(3, 1743289200, 9)" + ",(3, 1761433200, 8) ,(3, 1774738800, 9)" + ",(3, 1792882800, 8) ,(3, 1806188400, 9)" + ",(3, 1824937200, 8) ,(3, 1837638000, 9)" + ",(3, 1856386800, 8) ,(3, 1869087600, 9)" + ",(3, 1887836400, 8) ,(3, 1901142000, 9)" + ",(3, 1919286000, 8) ,(3, 1932591600, 9)" + ",(3, 1950735600, 8) ,(3, 1964041200, 9)" + ",(3, 1982790000, 8) ,(3, 1995490800, 9)" + ",(3, 2014239600, 8) ,(3, 2026940400, 9)" + ",(3, 2045689200, 8) ,(3, 2058390000, 9)" + ",(3, 2077138800, 8) ,(3, 2090444400, 9)" + ",(3, 2108588400, 8) ,(3, 2121894000, 9)" + ",(3, 2140038000, 8)" + ",(4, -1688265000, 2) ,(4, -1656819048, 1)" + ",(4, -1641353448, 2) ,(4, -1627965048, 3)" + ",(4, -1618716648, 1) ,(4, -1596429048, 3)" + ",(4, -1593829848, 5) ,(4, -1589860800, 4)" + ",(4, -1542427200, 5) ,(4, -1539493200, 6)" + ",(4, -1525323600, 5) ,(4, -1522728000, 4)" + ",(4, -1491188400, 7) ,(4, -1247536800, 4)" + ",(4, 354920409, 5) ,(4, 370728010, 4)" + ",(4, 386456410, 5) ,(4, 402264011, 4)" + ",(4, 417992411, 5) ,(4, 433800012, 4)" + ",(4, 449614812, 5) ,(4, 465346812, 8)" + ",(4, 481071612, 9) ,(4, 496796413, 8)" + ",(4, 512521213, 9) ,(4, 528246013, 8)" + ",(4, 543970813, 9) ,(4, 559695613, 8)" + ",(4, 575420414, 9) ,(4, 591145214, 8)" + ",(4, 606870014, 9) ,(4, 622594814, 8)" + ",(4, 638319615, 9) ,(4, 654649215, 8)" + ",(4, 670374016, 10) ,(4, 686102416, 11)" + ",(4, 695779216, 8) ,(4, 701812816, 5)" + ",(4, 717534017, 4) ,(4, 733273217, 9)" + ",(4, 748998018, 8) ,(4, 764722818, 9)" + ",(4, 780447619, 8) ,(4, 796172419, 9)" + ",(4, 811897219, 8) ,(4, 828226820, 9)" + ",(4, 846370820, 8) ,(4, 859676420, 9)" + ",(4, 877820421, 8) ,(4, 891126021, 9)" + ",(4, 909270021, 8) ,(4, 922575622, 9)" + ",(4, 941324422, 8) ,(4, 954025222, 9)" + ",(4, 972774022, 8) ,(4, 985474822, 9)" + ",(4, 1004223622, 8) ,(4, 1017529222, 9)" + ",(4, 1035673222, 8) ,(4, 1048978822, 9)" + ",(4, 1067122822, 8) ,(4, 1080428422, 9)" + ",(4, 1099177222, 8) ,(4, 1111878022, 9)" + ",(4, 1130626822, 8) ,(4, 1143327622, 9)" + ",(4, 1162076422, 8) ,(4, 1174777222, 9)" + ",(4, 1193526022, 8) ,(4, 1206831622, 9)" + ",(4, 1224975622, 8) ,(4, 1238281222, 9)" + ",(4, 1256425222, 8) ,(4, 1269730822, 9)" + ",(4, 1288479622, 8) ,(4, 1301180422, 9)" + ",(4, 1319929222, 8) ,(4, 1332630022, 9)" + ",(4, 1351378822, 8) ,(4, 1364684422, 9)" + ",(4, 1382828422, 8) ,(4, 1396134022, 9)" + ",(4, 1414278022, 8) ,(4, 1427583622, 9)" + ",(4, 1445727622, 8) ,(4, 1459033222, 9)" + ",(4, 1477782022, 8) ,(4, 1490482822, 9)" + ",(4, 1509231622, 8) ,(4, 1521932422, 9)" + ",(4, 1540681222, 8) ,(4, 1553986822, 9)" + ",(4, 1572130822, 8) ,(4, 1585436422, 9)" + ",(4, 1603580422, 8) ,(4, 1616886022, 9)" + ",(4, 1635634822, 8) ,(4, 1648335622, 9)" + ",(4, 1667084422, 8) ,(4, 1679785222, 9)" + ",(4, 1698534022, 8) ,(4, 1711839622, 9)" + ",(4, 1729983622, 8) ,(4, 1743289222, 9)" + ",(4, 1761433222, 8) ,(4, 1774738822, 9)" + ",(4, 1792882822, 8) ,(4, 1806188422, 9)" + ",(4, 1824937222, 8) ,(4, 1837638022, 9)" + ",(4, 1856386822, 8) ,(4, 1869087622, 9)" + ",(4, 1887836422, 8) ,(4, 1901142022, 9)" + ",(4, 1919286022, 8) ,(4, 1932591622, 9)" + ",(4, 1950735622, 8) ,(4, 1964041222, 9)" + ",(4, 1982790022, 8) ,(4, 1995490822, 9)" + ",(4, 2014239622, 8) ,(4, 2026940422, 9)" + ",(4, 2045689222, 8) ,(4, 2058390022, 9)" + ",(4, 2077138822, 8) ,(4, 2090444422, 9)" + ",(4, 2108588422, 8) ,(4, 2121894022, 9)" + ",(4, 2140038022, 8), (5, -1009875600, 1);\n"); + + + } + } + + if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_transition_type (" + "Time_zone_id int unsigned NOT NULL," + "Transition_type_id int unsigned NOT NULL," + "Offset int signed DEFAULT 0 NOT NULL," + "Is_DST tinyint unsigned DEFAULT 0 NOT NULL," + "Abbreviation char(8) DEFAULT '' NOT NULL," + "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" + ") engine=MyISAM CHARACTER SET utf8 " + "comment='Time zone transition types';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_transition_type (Time_zone_id," + "Transition_type_id, Offset, Is_DST, Abbreviation) VALUES" + "(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')" + ",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')" + ",(2, 0, 0, 0, 'UTC')" + ",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')" + ",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')" + ",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')" + ",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')" + ",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')" + ",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')" + ",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')" + ",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')" + ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" + ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" + ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" + ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')" + ",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n"); + + } + } + + if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_leap_second (" + "Transition_time bigint signed NOT NULL," + "Correction int signed NOT NULL," + "PRIMARY KEY TranTime (Transition_time)" + ") engine=MyISAM CHARACTER SET utf8 " + "comment='Leap seconds information for time zones';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_leap_second " + "(Transition_time, Correction) VALUES " + "(78796800, 1) ,(94694401, 2) ,(126230402, 3)" + ",(157766403, 4) ,(189302404, 5) ,(220924805, 6)" + ",(252460806, 7) ,(283996807, 8) ,(315532808, 9)" + ",(362793609, 10) ,(394329610, 11) ,(425865611, 12)" + ",(489024012, 13) ,(567993613, 14) ,(631152014, 15)" + ",(662688015, 16) ,(709948816, 17) ,(741484817, 18)" + ",(773020818, 19) ,(820454419, 20) ,(867715220, 21)" + ",(915148821, 22);\n"); + } + } + + return fclose(out); +} diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c new file mode 100644 index 00000000000..88e68dfc27e --- /dev/null +++ b/mysql-test/my_manage.c @@ -0,0 +1,887 @@ +/* + Copyright (c) 2003 Novell, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; 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 +*/ + +#include <stdio.h> +#include <errno.h> +#ifndef __WIN__ +#include <dirent.h> +#endif +#include <string.h> +#ifdef __NETWARE__ +#include <screen.h> +#include <proc.h> +#else +#include <sys/types.h> +#ifndef __WIN__ +#include <sys/wait.h> +#include <unistd.h> +#include <signal.h> +#include <fnmatch.h> /* FIXME HAVE_FNMATCH_H or something */ +#else +#include <direct.h> +#include <stdlib.h> +#include <stdio.h> +#endif +#endif +#include <ctype.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <assert.h> + +#include "my_manage.h" + +#ifndef __NETWARE__ +#define ASSERT assert +extern char **environ; +#endif + + + +/****************************************************************************** + + macros + +******************************************************************************/ + +/****************************************************************************** + + global variables + +******************************************************************************/ + +/****************************************************************************** + + functions + +******************************************************************************/ + +/****************************************************************************** + + init_args() + + Init an argument list. + +******************************************************************************/ + +void init_args(arg_list_t *al) +{ + ASSERT(al != NULL); + + al->argc= 0; + al->size= ARG_BUF; + al->argv= malloc(al->size * sizeof(char *)); + ASSERT(al->argv != NULL); + + return; +} + +/****************************************************************************** + + add_arg() + + Add an argument to a list. + +******************************************************************************/ + +void add_arg(arg_list_t *al, const char *format, ...) +{ + va_list ap; + char temp[FN_REFLEN]; + + ASSERT(al != NULL); + + /* increase size */ + if (al->argc >= (int)al->size) + { + al->size+= ARG_BUF; + al->argv= realloc(al->argv, al->size * sizeof(char *)); + ASSERT(al->argv != NULL); + } + + if (format) + { + va_start(ap, format); + vsprintf(temp, format, ap); + va_end(ap); + + al->argv[al->argc]= malloc(strlen(temp)+1); + ASSERT(al->argv[al->argc] != NULL); + strcpy(al->argv[al->argc], temp); + + ++(al->argc); + } + else + { + al->argv[al->argc]= NULL; + } + + return; +} + +/****************************************************************************** + + free_args() + + Free an argument list. + +******************************************************************************/ + +void free_args(arg_list_t *al) +{ + int i; + + ASSERT(al != NULL); + + for (i= 0; i < al->argc; i++) + { + ASSERT(al->argv[i] != NULL); + free(al->argv[i]); + al->argv[i]= NULL; + } + + free(al->argv); + al->argc= 0; + al->argv= NULL; + + return; +} + +/****************************************************************************** + + sleep_until_file_deleted() + + Sleep until the given file is no longer found. + +******************************************************************************/ + +#ifndef __WIN__ +int sleep_until_file_deleted(char *pid_file) +#else +int sleep_until_file_deleted(HANDLE pid_file) +#endif +{ + int err= 0; /* Initiate to supress warning */ +#ifndef __WIN__ + struct stat buf; + int i; + + for (i= 0; (i < TRY_MAX) && (err= !stat(pid_file, &buf)); i++) sleep(1); + + if (err != 0) err= errno; +#else + err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT); +#endif + return err; +} + +/****************************************************************************** + + sleep_until_file_exists() + + Sleep until the given file exists. + +******************************************************************************/ + +#ifndef __WIN__ +int sleep_until_file_exists(char *pid_file) +#else +int sleep_until_file_exists(HANDLE pid_file) +#endif +{ + int err= 0; /* Initiate to supress warning */ +#ifndef __WIN__ + struct stat buf; + int i; + + for (i= 0; (i < TRY_MAX) && (err= stat(pid_file, &buf)); i++) sleep(1); + + if (err != 0) err= errno; +#else + err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT); +#endif + return err; +} + +/****************************************************************************** + + wait_for_server_start() + + Wait for the server on the given port to start. + +******************************************************************************/ + +int wait_for_server_start(char *bin_dir __attribute__((unused)), + char *mysqladmin_file, + char *user, char *password, int port,char *tmp_dir) +{ + arg_list_t al; + int err= 0, i; + char trash[FN_REFLEN]; + + /* mysqladmin file */ + snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir); + + /* args */ + init_args(&al); + add_arg(&al, "%s", mysqladmin_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", port); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "--silent"); + +/* #ifdef NOT_USED */ +#ifndef __NETWARE__ + add_arg(&al, "-O"); + add_arg(&al, "connect_timeout=10"); + add_arg(&al, "-w"); +#endif + + add_arg(&al, "--host=localhost"); +#ifndef __NETWARE__ + add_arg(&al, "--protocol=tcp"); +#endif + add_arg(&al, "ping"); + + /* + NetWare does not support the connect timeout in the TCP/IP stack + -- we will try the ping multiple times + */ +#ifndef __WIN__ + for (i= 0; (i < TRY_MAX) + && (err= spawn(mysqladmin_file, &al, TRUE, NULL, + trash, NULL, NULL)); i++) sleep(1); +#else + err= spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL); +#endif + + /* free args */ + free_args(&al); + + return err; +} + +/****************************************************************************** + + spawn() + + Spawn the given path with the given arguments. + +******************************************************************************/ + +#ifdef __NETWARE__ +int spawn(char *path, arg_list_t *al, int join, char *input, + char *output, char *error, char *pid_file) +{ + pid_t pid; + int result= 0; + wiring_t wiring= { FD_UNUSED, FD_UNUSED, FD_UNUSED }; + unsigned long flags= PROC_CURRENT_SPACE | PROC_INHERIT_CWD; + + /* open wiring */ + if (input) + wiring.infd= open(input, O_RDONLY); + + if (output) + wiring.outfd= open(output, O_WRONLY | O_CREAT | O_TRUNC); + + if (error) + wiring.errfd= open(error, O_WRONLY | O_CREAT | O_TRUNC); + + /* procve requires a NULL */ + add_arg(al, NULL); + + /* go */ + pid= procve(path, flags, NULL, &wiring, NULL, NULL, 0, + NULL, (const char **)al->argv); + + /* close wiring */ + if (wiring.infd != -1) + close(wiring.infd); + + if (wiring.outfd != -1) + close(wiring.outfd); + + if (wiring.errfd != -1) + close(wiring.errfd); + + return result; +} +#elif __WIN__ + +int spawn(char *path, arg_list_t *al, int join, char *input, + char *output, char *error, HANDLE *pid) +{ + bool result; + int i; + STARTUPINFO startup_info; + PROCESS_INFORMATION process_information; + DWORD exit_code; + char win_args[1024]= ""; + + /* Skip the first parameter */ + for (i= 1; i < al->argc; i++) + { + ASSERT(al->argv[i] != NULL); + strcat(win_args,al->argv[i]); + strcat(win_args," "); + } + + memset(&startup_info,0,sizeof(STARTUPINFO)); + startup_info.cb= sizeof(STARTUPINFO); + + if (input) + freopen(input, "rb", stdin); + + if (output) + freopen(output, "wb", stdout); + + if (error) + freopen(error, "wb", stderr); + + result= CreateProcess( + path, + (LPSTR)&win_args, + NULL, + NULL, + TRUE, + 0, + NULL, + NULL, + &startup_info, + &process_information + ); + + if (result && process_information.hProcess) + { + if (join) + { + if (WaitForSingleObject(process_information.hProcess, mysqld_timeout) + == WAIT_TIMEOUT) + { + exit_code= -1; + } + else + { + GetExitCodeProcess(process_information.hProcess, &exit_code); + } + CloseHandle(process_information.hProcess); + } + else + { + exit_code= 0; + } + if (pid != NULL) + *pid= process_information.hProcess; + } + else + { + exit_code= -1; + } + if (input) + freopen("CONIN$","rb",stdin); + if (output) + freopen("CONOUT$","wb",stdout); + if (error) + freopen("CONOUT$","wb",stderr); + + return exit_code; +} +#else +int spawn(char *path, arg_list_t *al, int join, char *input, + char *output, char *error, char *pid_file __attribute__((unused))) +{ + pid_t pid; + int res_exec= 0; + int result= 0; + + pid= fork(); + + if (pid == -1) + { + fprintf(stderr, "fork was't created\n"); + /* We can't create the fork...exit with error */ + return EXIT_FAILURE; + } + + if (pid > 0) + { + /* The parent process is waiting for child process if join is not zero */ + if (join) + { + waitpid(pid, &result, 0); + if (WIFEXITED(result) != 0) + { + result= WEXITSTATUS(result); + } + else + { + result= EXIT_FAILURE; + } + } + } + else + { + + /* Child process */ + add_arg(al, NULL); + + /* Reassign streams */ + if (input) + freopen(input, "r", stdin); + + if (output) + freopen(output, "w", stdout); + + if (error) + freopen(error, "w", stderr); + + /* Spawn the process */ + if ((res_exec= execve(path, al->argv, environ)) < 0) + exit(EXIT_FAILURE); + + /* Restore streams */ + if (input) + freopen("/dev/tty", "r", stdin); + + if (output) + freopen("/dev/tty", "w", stdout); + + if (error) + freopen("/dev/tty", "w", stderr); + + exit(0); + } + + return result; +} +#endif +/****************************************************************************** + + stop_server() + + Stop the server with the given port and pid file. + +******************************************************************************/ + +int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file, + char *user, char *password, int port, +#ifndef __WIN__ + char *pid_file, +#else + HANDLE pid_file, +#endif + char *tmp_dir) +{ + arg_list_t al; + int err= 0; + char trash[FN_REFLEN]; + + snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir); + + /* args */ + init_args(&al); + add_arg(&al, "%s", mysqladmin_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", port); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "-O"); + add_arg(&al, "shutdown_timeout=20"); +#ifndef __NETWARE__ + add_arg(&al, "--protocol=tcp"); +#endif + add_arg(&al, "shutdown"); + + /* spawn */ + if ((err= spawn(mysqladmin_file, &al, TRUE, NULL, + trash, NULL, NULL)) == 0) + { + sleep_until_file_deleted(pid_file); + } + else + { +#ifndef __WIN__ + pid_t pid= get_server_pid(pid_file); + + /* shutdown failed - kill server */ + kill_server(pid); + + sleep(TRY_MAX); + + /* remove pid file if possible */ + err= remove(pid_file); +#else + TerminateProcess(pid_file,err); +#endif + } + + /* free args */ + free_args(&al); + + return err; +} + +/****************************************************************************** + + get_server_pid() + + Get the VM id with the given pid file. + +******************************************************************************/ + +#ifndef __WIN__ +pid_t get_server_pid(char *pid_file) +{ + char buf[FN_REFLEN]; + int fd, err; + char *p; + pid_t id= 0; + + /* discover id */ + fd= open(pid_file, O_RDONLY); + + err= read(fd, buf, FN_REFLEN); + + close(fd); + + if (err > 0) + { + /* terminate string */ + if ((p= strchr(buf, '\n')) != NULL) + { + *p= '\0'; + + /* check for a '\r' */ + if ((p= strchr(buf, '\r')) != NULL) + { + *p= '\0'; + } + } + else + { + buf[err]= '\0'; + } + + id= strtol(buf, NULL, 0); + } + + return id; +} + +/****************************************************************************** + + kill_server() + + Force a kill of the server with the given pid. + +******************************************************************************/ + +void kill_server(pid_t pid) +{ + if (pid > 0) + { +#if !defined(__NETWARE__) + /* Send SIGTERM to pid */ + kill(pid, SIGTERM); +#else /* __NETWARE__ */ + /* destroy vm */ + NXVmDestroy(pid); +#endif + } +} +#endif +/****************************************************************************** + + del_tree() + + Delete the directory and subdirectories. + +******************************************************************************/ + +void del_tree(char *dir) +{ +#ifndef __WIN__ + DIR *parent= opendir(dir); + struct dirent *entry; + char temp[FN_REFLEN]; + + if (parent == NULL) + { + return; + } + + while ((entry= readdir(parent)) != NULL) + { + /* create long name */ + snprintf(temp, FN_REFLEN, "%s/%s", dir, entry->d_name); + + if (entry->d_name[0] == '.') + { + /* Skip */ + } + else + { +/* FIXME missing test in acinclude.m4 */ +#ifndef STRUCT_DIRENT_HAS_D_TYPE + struct stat st; + + if (lstat(entry->d_name, &st) == -1) + { + /* FIXME error */ + return; + } + if (S_ISDIR(st.st_mode)) +#else + if (S_ISDIR(entry->d_type)) +#endif + { + /* delete subdirectory */ + del_tree(temp); + } + else + { + /* remove file */ + remove(temp); + } + } + } + /* remove directory */ + rmdir(dir); +#else + struct _finddata_t parent; +#if defined(_MSC_VER) && _MSC_VER > 1200 + intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ + char temp[FN_REFLEN]; + char mask[FN_REFLEN]; + + snprintf(mask,FN_REFLEN,"%s/*.*",dir); + + if ((handle=_findfirst(mask,&parent)) == -1L) + { + return; + } + + do + { + /* create long name */ + snprintf(temp, FN_REFLEN, "%s/%s", dir, parent.name); + if (parent.name[0] == '.') + { + /* Skip */ + } + else + if (parent.attrib & _A_SUBDIR) + { + /* delete subdirectory */ + del_tree(temp); + } + else + { + /* remove file */ + remove(temp); + } + } while (_findnext(handle,&parent) == 0); + + _findclose(handle); + + /* remove directory */ + _rmdir(dir); +#endif +} + +/****************************************************************************** + + removef() + +******************************************************************************/ + +int removef(const char *format, ...) +{ +#ifdef __NETWARE__ + va_list ap; + char path[FN_REFLEN]; + + va_start(ap, format); + + vsnprintf(path, FN_REFLEN, format, ap); + + va_end(ap); + return remove(path); + +#elif __WIN__ + { + va_list ap; + char path[FN_REFLEN]; + struct _finddata_t parent; +#if defined(_MSC_VER) && _MSC_VER > 1200 + intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ + char temp[FN_REFLEN]; + char *p; + + va_start(ap, format); + + vsnprintf(path, FN_REFLEN, format, ap); + + va_end(ap); + + p= path + strlen(path); + while (*p != '\\' && *p != '/' && p > path) p--; + + if ((handle=_findfirst(path,&parent)) == -1L) + { + /* if there is not files....it's ok */ + return 0; + } + + *p= '\0'; + + do + { + if (! (parent.attrib & _A_SUBDIR)) + { + snprintf(temp, FN_REFLEN, "%s/%s", path, parent.name); + remove(temp); + } + }while (_findnext(handle,&parent) == 0); + + _findclose(handle); + } +#else + DIR *parent; + struct dirent *entry; + char temp[FN_REFLEN]; + va_list ap; + char path[FN_REFLEN]; + char *p; + /* Get path with mask */ + va_start(ap, format); + + vsnprintf(path, FN_REFLEN, format, ap); + + va_end(ap); + + p= path + strlen(path); + while (*p != '\\' && *p != '/' && p > path) p--; + *p= '\0'; + p++; + + parent= opendir(path); + + if (parent == NULL) + { + return 1; /* Error, directory missing */ + } + + while ((entry= readdir(parent)) != NULL) + { + /* entry is not directory and entry matches with mask */ +#ifndef STRUCT_DIRENT_HAS_D_TYPE + struct stat st; + + /* create long name */ + snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name); + + if (lstat(temp, &st) == -1) + { + return 1; /* Error couldn't lstat file */ + } + + if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) +#else + if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) +#endif + { + /* create long name */ + snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name); + /* Delete only files */ + remove(temp); + } + } +#endif + return 0; +} + +/****************************************************************************** + + get_basedir() + +******************************************************************************/ + +void get_basedir(char *argv0, char *basedir) +{ + char temp[FN_REFLEN]; + char *p; + int position; + + ASSERT(argv0 != NULL); + ASSERT(basedir != NULL); + + strcpy(temp, strlwr(argv0)); + while ((p= strchr(temp, '\\')) != NULL) *p= '/'; + + if ((position= strinstr(temp, "/bin/")) != 0) + { + p= temp + position; + *p= '\0'; + strcpy(basedir, temp); + } +} + +uint strinstr(reg1 const char *str,reg4 const char *search) +{ + reg2 my_string i,j; + my_string start= (my_string) str; + + skipp: + while (*str != '\0') + { + if (*str++ == *search) + { + i=(my_string) str; + j= (my_string) search+1; + while (*j) + if (*i++ != *j++) goto skipp; + return ((uint) (str - start)); + } + } + return (0); +} + +/****************************************************************************** + + remove_empty_file() + +******************************************************************************/ + +void remove_empty_file(const char *file_name) +{ + struct stat file; + + if (!stat(file_name,&file)) + { + if (!file.st_size) + remove(file_name); + } +} diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h new file mode 100644 index 00000000000..5df77b01af8 --- /dev/null +++ b/mysql-test/my_manage.h @@ -0,0 +1,137 @@ +/* + Copyright (c) 2002 Novell, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; 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 +*/ + +#ifndef _MY_MANAGE +#define _MY_MANAGE + +/****************************************************************************** + + includes + +******************************************************************************/ + +#include <stdlib.h> +#ifndef __WIN__ +#include <unistd.h> +#endif +#ifndef __NETWARE__ +#include <string.h> +#include <my_global.h> +#include <m_string.h> + +#ifndef __WIN__ +#define strnicmp strncasecmp +#define strlwr(STRARG) (STRARG) +#else +int my_vsnprintf_(char *to, size_t n, const char* value, ...); +#endif +#endif + +/****************************************************************************** + + macros + +******************************************************************************/ + +#define ARG_BUF 10 +#define TRY_MAX 5 + +#ifdef __WIN__ +#define PATH_MAX _MAX_PATH +#define NAME_MAX _MAX_FNAME +#define kill(A,B) TerminateProcess((HANDLE)A,0) +#define NOT_NEED_PID 0 +#define MASTER_PID 1 +#define SLAVE_PID 2 +#define mysqld_timeout 60000 + +int pid_mode; +bool run_server; +bool skip_first_param; + +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#endif + + +/****************************************************************************** + + structures + +******************************************************************************/ + +typedef struct +{ + + int argc; + char **argv; + + size_t size; + +} arg_list_t; + +#ifdef __WIN__ +typedef int pid_t; +#endif +/****************************************************************************** + + global variables + +******************************************************************************/ + +/****************************************************************************** + + prototypes + +******************************************************************************/ + +void init_args(arg_list_t *); +void add_arg(arg_list_t *, const char *, ...); +void free_args(arg_list_t *); + +#ifndef __WIN__ +int sleep_until_file_exists(char *); +int sleep_until_file_deleted(char *); +#else +int sleep_until_file_exists(HANDLE); +int sleep_until_file_deleted(HANDLE); +#endif +int wait_for_server_start(char *, char *, char *, char *, int,char *); + +#ifndef __WIN__ +int spawn(char *, arg_list_t *, int, char *, char *, char *, char *); +#else +int spawn(char *, arg_list_t *, int , char *, char *, char *, HANDLE *); +#endif + +#ifndef __WIN__ +int stop_server(char *, char *, char *, char *, int, char *,char *); +pid_t get_server_pid(char *); +void kill_server(pid_t pid); +#else +int stop_server(char *, char *, char *, char *, int, HANDLE,char *); +#endif +void del_tree(char *); +int removef(const char *, ...); + +void get_basedir(char *, char *); +void remove_empty_file(const char *file_name); + +bool create_system_files(const char *mdata,const char *output_file, bool test); + +#endif /* _MY_MANAGE */ diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl new file mode 100755 index 00000000000..795df3623b0 --- /dev/null +++ b/mysql-test/mysql-test-run.pl @@ -0,0 +1,2190 @@ +#!/usr/bin/perl +# -*- cperl -*- + +# This is a transformation of the "mysql-test-run" Bourne shell script +# to Perl. This is just an intermediate step, the goal is to rewrite +# the Perl script to C. The complexity of the mysql-test-run script +# makes it a bit hard to write and debug it as a C program directly, +# so this is considered a prototype. +# +# Because of this the Perl coding style may in some cases look a bit +# funny. The rules used are +# +# - The coding style is as close as possible to the C/C++ MySQL +# coding standard. +# +# - Where NULL is to be returned, the undefined value is used. +# +# - Regexp comparisons are simple and can be translated to strcmp +# and other string functions. To ease this transformation matching +# is done in the lib "lib/mtr_match.pl", i.e. regular expressions +# should be avoided in the main program. +# +# - The "unless" construct is not to be used. It is the same as "if !". +# +# - opendir/readdir/closedir is used instead of glob()/<*>. +# +# - All lists of arguments to send to commands are Perl lists/arrays, +# not strings we append args to. Within reason, most string +# concatenation for arguments should be avoided. +# +# - sprintf() is to be used, within reason, for all string creation. +# This mtr_add_arg() function is also based on sprintf(), i.e. you +# use a format string and put the variable argument in the argument +# list. +# +# - Functions defined in the main program are not to be prefixed, +# functions in "library files" are to be prefixed with "mtr_" (for +# Mysql-Test-Run). There are some exceptions, code that fits best in +# the main program, but are put into separate files to avoid +# clutter, may be without prefix. +# +# - All stat/opendir/-f/ is to be kept in collect_test_cases(). It +# will create a struct that the rest of the program can use to get +# the information. This separates the "find information" from the +# "do the work" and makes the program more easy to maintain. +# +# - At the moment, there are tons of "global" variables that control +# this script, even accessed from the files in "lib/*.pl". This +# will change over time, for now global variables are used instead +# of using %opt, %path and %exe hashes, because I want more +# compile time checking, that hashes would not give me. Once this +# script is debugged, hashes will be used and passed as parameters +# to functions, to more closely mimic how it would be coded in C +# using structs. +# +# - The rule when it comes to the logic of this program is +# +# command_line_setup() - is to handle the logic between flags +# collect_test_cases() - is to do its best to select what tests +# to run, dig out options, if needs restart etc. +# run_testcase() - is to run a single testcase, and follow the +# logic set in both above. No, or rare file +# system operations. If a test seems complex, +# it should probably not be here. +# +# A nice way to trace the execution of this script while debugging +# is to use the Devel::Trace package found at +# "http://www.plover.com/~mjd/perl/Trace/" and run this script like +# "perl -d:Trace mysql-test-run.pl" +# +# FIXME Save a PID file from this code as well, to record the process +# id we think it has. In Cygwin, a fork creates one Cygwin process, +# and then the real Win32 process. Cygwin Perl can only kill Cygwin +# processes. And "mysqld --bootstrap ..." doesn't save a PID file. + +$Devel::Trace::TRACE= 0; # Don't trace boring init stuff + +#require 5.6.1; +use File::Path; +use File::Basename; +use Cwd; +use Getopt::Long; +use Sys::Hostname; +#use Carp; +use IO::Socket; +use IO::Socket::INET; +#use Data::Dumper; +use strict; +#use diagnostics; + +require "lib/mtr_cases.pl"; +require "lib/mtr_process.pl"; +require "lib/mtr_io.pl"; +require "lib/mtr_gcov.pl"; +require "lib/mtr_gprof.pl"; +require "lib/mtr_report.pl"; +require "lib/mtr_match.pl"; +require "lib/mtr_misc.pl"; + +$Devel::Trace::TRACE= 1; + +my @skip_if_embedded_server= + ( + "alter_table", + "bdb-deadlock", + "connect", + "flush_block_commit", + "grant2", + "grant_cache", + "grant", + "init_connect", + "innodb-deadlock", + "innodb-lock", + "mix_innodb_myisam_binlog", + "mysqlbinlog2", + "mysqlbinlog", + "mysqldump", + "mysql_protocols", + "ps_1general", + "rename", + "show_check", + "system_mysql_db_fix", + "user_var", + "variables", + ); + +# Used by gcov +our @mysqld_src_dirs= + ( + "strings", + "mysys", + "include", + "extra", + "regex", + "isam", + "merge", + "myisam", + "myisammrg", + "heap", + "sql", + ); + +############################################################################## +# +# Default settings +# +############################################################################## + +# We are to use handle_options() in "mysys/my_getopt.c" for the C version +# +# In the C version we want to use structs and, in some cases, arrays of +# structs. We let each struct be a separate hash. + +# Misc global variables + +our $glob_win32= 0; # OS and native Win32 executables +our $glob_win32_perl= 0; # ActiveState Win32 Perl +our $glob_cygwin_perl= 0; # Cygwin Perl +our $glob_cygwin_shell= undef; +our $glob_mysql_test_dir= undef; +our $glob_mysql_bench_dir= undef; +our $glob_hostname= undef; +our $glob_scriptname= undef; +our $glob_use_running_server= 0; +our $glob_use_running_ndbcluster= 0; +our $glob_use_embedded_server= 0; + +our $glob_basedir; + +# The total result + +our $path_charsetsdir; +our $path_client_bindir; +our $path_language; +our $path_timefile; +our $path_manager_log; # Used by mysqldadmin +our $path_slave_load_tmpdir; # What is this?! +our $path_my_basedir; +our $opt_tmpdir; # A path but set directly on cmd line + +our $opt_usage; +our $opt_suite; + +our $opt_netware; + +our $opt_script_debug= 0; # Script debugging, enable with --script-debug + +# Options FIXME not all.... + +our $exe_master_mysqld; +our $exe_mysql; +our $exe_mysqladmin; +our $exe_mysqlbinlog; +our $exe_mysql_client_test; +our $exe_mysqld; +our $exe_mysqldump; # Called from test case +our $exe_mysql_fix_system_tables; +our $exe_mysqltest; +our $exe_slave_mysqld; + +our $opt_bench= 0; +our $opt_small_bench= 0; +our $opt_big_test= 0; # Send --big-test to mysqltest + +our $opt_extra_mysqld_opt; # FIXME not handled + +our $opt_compress; +our $opt_current_test; +our $opt_ddd; +our $opt_debug; +our $opt_do_test; +our @opt_cases; # The test cases names in argv +our $opt_embedded_server; +our $opt_extern; +our $opt_fast; +our $opt_force; + +our $opt_gcov; +our $opt_gcov_err; +our $opt_gcov_msg; + +our $opt_gdb; +our $opt_client_gdb; +our $opt_manual_gdb; + +our $opt_gprof; +our $opt_gprof_dir; +our $opt_gprof_master; +our $opt_gprof_slave; + +our $opt_local; +our $opt_local_master; + +our $master; # Will be struct in C +our $slave; + +our $opt_ndbcluster_port; +our $opt_ndbconnectstring; + +our $opt_no_manager; # Does nothing now, we never use manager + +our $opt_old_master; + +our $opt_record; + +our $opt_result_ext; + +our $opt_skip; +our $opt_skip_rpl; +our $opt_skip_test; + +our $opt_sleep; +our $opt_ps_protocol; + +our $opt_sleep_time_after_restart= 1; +our $opt_sleep_time_for_delete= 10; + +our $opt_socket; + +our $opt_source_dist; + +our $opt_start_and_exit; +our $opt_start_from; + +our $opt_strace_client; + +our $opt_timer; + +our $opt_user; +our $opt_user_test; + +our $opt_valgrind; +our $opt_valgrind_all; +our $opt_valgrind_options; + +our $opt_verbose; + +our $opt_wait_for_master; +our $opt_wait_for_slave; +our $opt_wait_timeout= 10; + +our $opt_warnings; + +our $opt_udiff; + +our $opt_with_ndbcluster; +our $opt_with_openssl; + +our $exe_ndb_mgm; +our $path_ndb_tools_dir; +our $path_ndb_backup_dir; +our $file_ndb_testrun_log; +our $flag_ndb_status_ok= 1; + +###################################################################### +# +# Function declarations +# +###################################################################### + +sub main (); +sub initial_setup (); +sub command_line_setup (); +sub executable_setup (); +sub environment_setup (); +sub kill_and_cleanup (); +sub ndbcluster_install (); +sub ndbcluster_start (); +sub ndbcluster_stop (); +sub run_benchmarks ($); +sub run_tests (); +sub mysql_install_db (); +sub install_db ($$); +sub run_testcase ($); +sub report_failure_and_restart ($); +sub do_before_start_master ($$); +sub do_before_start_slave ($$); +sub mysqld_start ($$$$); +sub mysqld_arguments ($$$$$); +sub stop_masters_slaves (); +sub stop_masters (); +sub stop_slaves (); +sub run_mysqltest ($$); +sub usage ($); + +###################################################################### +# +# Main program +# +###################################################################### + +main(); + +sub main () { + + initial_setup(); + command_line_setup(); + executable_setup(); + environment_setup(); + signal_setup(); + + if ( $opt_gcov ) + { + gcov_prepare(); + } + + if ( $opt_gprof ) + { + gprof_prepare(); + } + + if ( ! $glob_use_running_server ) + { + kill_and_cleanup(); + mysql_install_db(); + +# mysql_loadstd(); FIXME copying from "std_data" .frm and +# .MGR but there are none?! + } + + if ( $opt_start_and_exit ) + { + if ( ndbcluster_start() ) + { + mtr_error("Can't start ndbcluster"); + } + if ( mysqld_start('master',0,[],[]) ) + { + mtr_report("Servers started, exiting"); + } + else + { + mtr_error("Can't start the mysqld server"); + } + } + else + { + if ( $opt_bench ) + { + run_benchmarks(shift); # Shift what? Extra arguments?! + } + else + { + run_tests(); + } + } + + exit(0); +} + +############################################################################## +# +# Initial setup independent on command line arguments +# +############################################################################## + +sub initial_setup () { + + select(STDOUT); + $| = 1; # Make unbuffered + + $glob_scriptname= basename($0); + + $glob_win32_perl= ($^O eq "MSWin32"); + $glob_cygwin_perl= ($^O eq "cygwin"); + $glob_win32= ($glob_win32_perl or $glob_cygwin_perl); + + # We require that we are in the "mysql-test" directory + # to run mysql-test-run + + if (! -f $glob_scriptname) + { + mtr_error("Can't find the location for the mysql-test-run script\n" . + "Go to to the mysql-test directory and execute the script " . + "as follows:\n./$glob_scriptname"); + } + + if ( -d "../sql" ) + { + $opt_source_dist= 1; + } + + $glob_hostname= mtr_full_hostname(); + + # 'basedir' is always parent of "mysql-test" directory + $glob_mysql_test_dir= cwd(); + if ( $glob_cygwin_perl ) + { + # Windows programs like 'mysqld' needs Windows paths + $glob_mysql_test_dir= `cygpath -m $glob_mysql_test_dir`; + $glob_cygwin_shell= `cygpath -w $ENV{'SHELL'}`; # The Windows path c:\... + chomp($glob_mysql_test_dir); + chomp($glob_cygwin_shell); + } + $glob_basedir= dirname($glob_mysql_test_dir); + $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable + + $path_timefile= "$glob_mysql_test_dir/var/log/mysqltest-time"; + + # needs to be same length to test logging (FIXME what???) + $path_slave_load_tmpdir= "../../var/tmp"; + + $path_my_basedir= + $opt_source_dist ? $glob_mysql_test_dir : $glob_basedir; +} + + + +############################################################################## +# +# Default settings +# +############################################################################## + +sub command_line_setup () { + + # These are defaults for things that are set on the command line + + $opt_suite= "main"; # Special default suite + $opt_tmpdir= "$glob_mysql_test_dir/var/tmp"; + # FIXME maybe unneded? + $path_manager_log= "$glob_mysql_test_dir/var/log/manager.log"; + $opt_current_test= "$glob_mysql_test_dir/var/log/current_test"; + + my $opt_master_myport= 9306; + my $opt_slave_myport= 9308; + $opt_ndbcluster_port= 9350; + + # Read the command line + # Note: Keep list, and the order, in sync with usage at end of this file + + GetOptions( + # Control what engine/variation to run + 'embedded-server' => \$opt_embedded_server, + 'ps-protocol' => \$opt_ps_protocol, + 'bench' => \$opt_bench, + 'small-bench' => \$opt_small_bench, + 'no-manager' => \$opt_no_manager, + + # Control what test suites or cases to run + 'force' => \$opt_force, + 'with-ndbcluster' => \$opt_with_ndbcluster, + 'do-test=s' => \$opt_do_test, + 'suite=s' => \$opt_suite, + 'skip-rpl' => \$opt_skip_rpl, + 'skip-test=s' => \$opt_skip_test, + + # Specify ports + 'master_port=i' => \$opt_master_myport, + 'slave_port=i' => \$opt_slave_myport, + 'ndbcluster_port=i' => \$opt_ndbcluster_port, + + # Test case authoring + 'record' => \$opt_record, + + # ??? + 'mysqld=s' => \$opt_extra_mysqld_opt, + + # Run test on running server + 'extern' => \$opt_extern, + 'ndbconnectstring=s' => \$opt_ndbconnectstring, + + # Debugging + 'gdb' => \$opt_gdb, + 'manual-gdb' => \$opt_manual_gdb, + 'client-gdb' => \$opt_client_gdb, + 'ddd' => \$opt_ddd, + 'strace-client' => \$opt_strace_client, + 'master-binary=s' => \$exe_master_mysqld, + 'slave-binary=s' => \$exe_slave_mysqld, + + # Coverage, profiling etc + 'gcov' => \$opt_gcov, + 'gprof' => \$opt_gprof, + 'valgrind' => \$opt_valgrind, + 'valgrind-all' => \$opt_valgrind_all, + 'valgrind-options=s' => \$opt_valgrind_options, + + # Misc + 'big-test' => \$opt_big_test, + 'compress' => \$opt_compress, + 'debug' => \$opt_debug, + 'fast' => \$opt_fast, + 'local' => \$opt_local, + 'local-master' => \$opt_local_master, + 'netware' => \$opt_netware, + 'old-master' => \$opt_old_master, + 'script-debug' => \$opt_script_debug, + 'sleep=i' => \$opt_sleep, + 'socket=s' => \$opt_socket, + 'start-and-exit' => \$opt_start_and_exit, + 'start-from=s' => \$opt_start_from, + 'timer' => \$opt_timer, + 'tmpdir=s' => \$opt_tmpdir, + 'unified-diff|udiff' => \$opt_udiff, + 'user-test=s' => \$opt_user_test, + 'user=s' => \$opt_user, + 'verbose' => \$opt_verbose, + 'wait-timeout=i' => \$opt_wait_timeout, + 'warnings|log-warnings' => \$opt_warnings, + 'with-openssl' => \$opt_with_openssl, + + 'help|h' => \$opt_usage, + ) or usage("Can't read options"); + + if ( $opt_usage ) + { + usage(""); + } + + @opt_cases= @ARGV; + + # Put this into a hash, will be a C struct + + $master->[0]->{'path_myddir'}= "$glob_mysql_test_dir/var/master-data"; + $master->[0]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/master.err"; + $master->[0]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/master.log"; + $master->[0]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/master.pid"; + $master->[0]->{'path_mysock'}= "$opt_tmpdir/master.sock"; + $master->[0]->{'path_myport'}= $opt_master_myport; + $master->[0]->{'start_timeout'}= 400; # enough time create innodb tables + + $master->[0]->{'ndbcluster'}= 1; # ndbcluster not started + + $master->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/master1-data"; + $master->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/master1.err"; + $master->[1]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/master1.log"; + $master->[1]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/master1.pid"; + $master->[1]->{'path_mysock'}= "$opt_tmpdir/master1.sock"; + $master->[1]->{'path_myport'}= $opt_master_myport + 1; + $master->[1]->{'start_timeout'}= 400; # enough time create innodb tables + + $slave->[0]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave-data"; + $slave->[0]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave.err"; + $slave->[0]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/slave.log"; + $slave->[0]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave.pid"; + $slave->[0]->{'path_mysock'}= "$opt_tmpdir/slave.sock"; + $slave->[0]->{'path_myport'}= $opt_slave_myport; + $slave->[0]->{'start_timeout'}= 400; + + $slave->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave1-data"; + $slave->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave1.err"; + $slave->[1]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/slave1.log"; + $slave->[1]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave1.pid"; + $slave->[1]->{'path_mysock'}= "$opt_tmpdir/slave1.sock"; + $slave->[1]->{'path_myport'}= $opt_slave_myport + 1; + $slave->[1]->{'start_timeout'}= 30; + + $slave->[2]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave2-data"; + $slave->[2]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave2.err"; + $slave->[2]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/slave2.log"; + $slave->[2]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave2.pid"; + $slave->[2]->{'path_mysock'}= "$opt_tmpdir/slave2.sock"; + $slave->[2]->{'path_myport'}= $opt_slave_myport + 2; + $slave->[2]->{'start_timeout'}= 30; + + # Do sanity checks of command line arguments + + if ( $opt_extern and $opt_local ) + { + mtr_error("Can't use --extern and --local at the same time"); + } + + if ( ! $opt_socket ) + { # FIXME set default before reading options? +# $opt_socket= '@MYSQL_UNIX_ADDR@'; + $opt_socket= "/tmp/mysql.sock"; # FIXME + } + + if ( $opt_extern ) + { + $glob_use_running_server= 1; + $opt_skip_rpl= 1; # We don't run rpl test cases + $master->[0]->{'path_mysock'}= $opt_socket; + } + + # -------------------------------------------------------------------------- + # Look at the command line options and set script flags + # -------------------------------------------------------------------------- + + if ( $opt_record and ! @opt_cases ) + { + mtr_error("Will not run in record mode without a specific test case"); + } + + if ( $opt_embedded_server ) + { + $glob_use_embedded_server= 1; + $opt_skip_rpl= 1; # We never run replication with embedded + + if ( $opt_extern ) + { + mtr_error("Can't use --extern with --embedded-server"); + } + $opt_result_ext= ".es"; + } + + # FIXME don't understand what this is +# if ( $opt_local_master ) +# { +# $opt_master_myport= 3306; +# } + + if ( $opt_small_bench ) + { + $opt_bench= 1; + } + + if ( $opt_sleep ) + { + $opt_sleep_time_after_restart= $opt_sleep; + } + + if ( $opt_gcov and ! $opt_source_dist ) + { + mtr_error("Coverage test needs the source - please use source dist"); + } + + if ( $glob_use_embedded_server and ! $opt_source_dist ) + { + mtr_error("Embedded server needs source tree - please use source dist"); + } + + if ( $opt_gdb ) + { + $opt_wait_timeout= 300; + if ( $opt_extern ) + { + mtr_error("Can't use --extern with --gdb"); + } + } + + if ( $opt_manual_gdb ) + { + $opt_gdb= 1; + if ( $opt_extern ) + { + mtr_error("Can't use --extern with --manual-gdb"); + } + } + + if ( $opt_ddd ) + { + if ( $opt_extern ) + { + mtr_error("Can't use --extern with --ddd"); + } + } + + if ( $opt_ndbconnectstring ) + { + $glob_use_running_ndbcluster= 1; + $opt_with_ndbcluster= 1; + } + else + { + $opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port"; + } + + # FIXME + + #if ( $opt_valgrind or $opt_valgrind_all ) + #{ + # VALGRIND=`which valgrind` # this will print an error if not found FIXME + # Give good warning to the user and stop + # if ( ! $VALGRIND ) + # { + # print "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org.\n" + # exit 1 + # } + # >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr + # valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck" + # VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16" + # $opt_extra_mysqld_opt.= " --skip-safemalloc --skip-bdb"; + # SLEEP_TIME_AFTER_RESTART=10 + # $opt_sleep_time_for_delete= 60 + # $glob_use_running_server= "" + # if ( "$1"= "--valgrind-all" ) + # { + # VALGRIND="$VALGRIND -v --show-reachable=yes" + # } + #} + + if ( ! $opt_user ) + { + if ( $glob_use_running_server ) + { + $opt_user= "test"; + } + else + { + $opt_user= "root"; # We want to do FLUSH xxx commands + } + } + +} + + +############################################################################## +# +# Set paths to various executable programs +# +############################################################################## + +sub executable_setup () { + + if ( $opt_source_dist ) + { + if ( $glob_use_embedded_server ) + { + if ( -f "$glob_basedir/libmysqld/examples/mysqltest" ) + { + $exe_mysqltest= "$glob_basedir/libmysqld/examples/mysqltest"; + } + else + { + mtr_error("Can't find embedded server 'mysqltest'"); + } + $exe_mysql_client_test= + "$glob_basedir/libmysqld/examples/mysql_client_test_embedded"; + } + else + { + if ( -f "$glob_basedir/client/.libs/lt-mysqltest" ) + { + $exe_mysqltest= "$glob_basedir/client/.libs/lt-mysqltest"; + } + elsif ( -f "$glob_basedir/client/.libs/mysqltest" ) + { + $exe_mysqltest= "$glob_basedir/client/.libs/mysqltest"; + } + else + { + $exe_mysqltest= "$glob_basedir/client/mysqltest"; + } + $exe_mysql_client_test= + "$glob_basedir/tests/mysql_client_test"; + } + if ( -f "$glob_basedir/client/.libs/mysqldump" ) + { + $exe_mysqldump= "$glob_basedir/client/.libs/mysqldump"; + } + else + { + $exe_mysqldump= "$glob_basedir/client/mysqldump"; + } + if ( -f "$glob_basedir/client/.libs/mysqlbinlog" ) + { + $exe_mysqlbinlog= "$glob_basedir/client/.libs/mysqlbinlog"; + } + else + { + $exe_mysqlbinlog= "$glob_basedir/client/mysqlbinlog"; + } + + $path_client_bindir= "$glob_basedir/client"; + $exe_mysqld= "$glob_basedir/sql/mysqld"; + $exe_mysqladmin= "$path_client_bindir/mysqladmin"; + $exe_mysql= "$path_client_bindir/mysql"; + $exe_mysql_fix_system_tables= "$glob_basedir/scripts/mysql_fix_privilege_tables"; + $path_language= "$glob_basedir/sql/share/english/"; + $path_charsetsdir= "$glob_basedir/sql/share/charsets"; + + $path_ndb_tools_dir= "$glob_basedir/ndb/tools"; + $exe_ndb_mgm= "$glob_basedir/ndb/src/mgmclient/ndb_mgm"; + } + else + { + my $path_tests_bindir= "$glob_basedir/tests"; + + $path_client_bindir= "$glob_basedir/bin"; + $exe_mysqltest= "$path_client_bindir/mysqltest"; + $exe_mysqldump= "$path_client_bindir/mysqldump"; + $exe_mysqlbinlog= "$path_client_bindir/mysqlbinlog"; + $exe_mysqladmin= "$path_client_bindir/mysqladmin"; + $exe_mysql= "$path_client_bindir/mysql"; + $exe_mysql_fix_system_tables= "$path_client_bindir/scripts/mysql_fix_privilege_tables"; + + if ( -d "$glob_basedir/share/mysql/english" ) + { + $path_language ="$glob_basedir/share/mysql/english/"; + $path_charsetsdir ="$glob_basedir/share/mysql/charsets"; + } + else + { + $path_language ="$glob_basedir/share/english/"; + $path_charsetsdir ="$glob_basedir/share/charsets"; + } + + if ( -x "$glob_basedir/libexec/mysqld" ) + { + $exe_mysqld= "$glob_basedir/libexec/mysqld"; + } + else + { + $exe_mysqld= "$glob_basedir/bin/mysqld"; + } + + if ( $glob_use_embedded_server ) + { + if ( -f "$path_client_bindir/mysqltest_embedded" ) + { + # FIXME valgrind? + $exe_mysqltest="$path_client_bindir/mysqltest_embedded"; + } + else + { + mtr_error("Cannot find embedded server 'mysqltest_embedded'"); + } + if ( -d "$path_tests_bindir/mysql_client_test_embedded" ) + { + $exe_mysql_client_test= + "$path_tests_bindir/mysql_client_test_embedded"; + } + else + { + $exe_mysql_client_test= + "$path_client_bindir/mysql_client_test_embedded"; + } + } + else + { + $exe_mysqltest="$path_client_bindir/mysqltest"; + $exe_mysql_client_test="$path_client_bindir/mysql_client_test"; + } + + $path_ndb_tools_dir= "$glob_basedir/bin"; + $exe_ndb_mgm= "$glob_basedir/bin/ndb_mgm"; + } + + if ( ! $exe_master_mysqld ) + { + $exe_master_mysqld= $exe_mysqld; + } + + if ( ! $exe_slave_mysqld ) + { + $exe_slave_mysqld= $exe_mysqld; + } + + $path_ndb_backup_dir= + "$glob_mysql_test_dir/var/ndbcluster-$opt_ndbcluster_port"; + $file_ndb_testrun_log= "$glob_mysql_test_dir/var/log/ndb_testrun.log"; +} + + +############################################################################## +# +# Set environment to be used by childs of this process +# +############################################################################## + +# Note that some env is setup in spawn/run, in "mtr_process.pl" + +sub environment_setup () { + + # -------------------------------------------------------------------------- + # Set LD_LIBRARY_PATH if we are using shared libraries + # -------------------------------------------------------------------------- + + $ENV{'LD_LIBRARY_PATH'}= + "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . + ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); + $ENV{'DYLD_LIBRARY_PATH'}= + "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . + ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); + + # -------------------------------------------------------------------------- + # Also command lines in .opt files may contain env vars + # -------------------------------------------------------------------------- + + $ENV{'UMASK'}= "0660"; # The octal *string* + $ENV{'UMASK_DIR'}= "0770"; # The octal *string* + $ENV{'LC_COLLATE'}= "C"; + $ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server; + $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; + $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; + $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'}; + $ENV{'MASTER_MYPORT'}= $master->[0]->{'path_myport'}; + $ENV{'MASTER_MYPORT1'}= $master->[1]->{'path_myport'}; + $ENV{'SLAVE_MYPORT'}= $slave->[0]->{'path_myport'}; +# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME + $ENV{'MYSQL_TCP_PORT'}= 3306; +} + + +############################################################################## +# +# If we get a ^C, we try to clean up before termination +# +############################################################################## +# FIXME check restrictions what to do in a signal handler + +sub signal_setup () { + $SIG{INT}= \&handle_int_signal; +} + +sub handle_int_signal () { + $SIG{INT}= 'DEFAULT'; # If we get a ^C again, we die... + mtr_warning("got INT signal, cleaning up....."); + stop_masters_slaves(); + mtr_error("We die from ^C signal from user"); +} + + +############################################################################## +# +# Handle left overs from previous runs +# +############################################################################## + +sub kill_and_cleanup () { + + if ( $opt_fast or $glob_use_embedded_server ) + { + # FIXME is embedded server really using PID files?! + unlink($master->[0]->{'path_mypid'}); + unlink($master->[1]->{'path_mypid'}); + unlink($slave->[0]->{'path_mypid'}); + unlink($slave->[1]->{'path_mypid'}); + unlink($slave->[2]->{'path_mypid'}); + } + else + { + # Ensure that no old mysqld test servers are running + # This is different from terminating processes we have + # started from ths run of the script, this is terminating + # leftovers from previous runs. + + mtr_report("Killing Possible Leftover Processes"); + mkpath("$glob_mysql_test_dir/var/log"); # Needed for mysqladmin log + mtr_kill_leftovers(); + + ndbcluster_stop(); + $master->[0]->{'ndbcluster'}= 1; + } + + mtr_report("Removing Stale Files"); + + rmtree("$glob_mysql_test_dir/var/log"); + rmtree("$glob_mysql_test_dir/var/ndbcluster-$opt_ndbcluster_port"); + rmtree("$glob_mysql_test_dir/var/run"); + rmtree("$glob_mysql_test_dir/var/tmp"); + + mkpath("$glob_mysql_test_dir/var/log"); + mkpath("$glob_mysql_test_dir/var/run"); + mkpath("$glob_mysql_test_dir/var/tmp"); + mkpath($opt_tmpdir); + + # FIXME do we really need to create these all, or are they + # created for us when tables are created? + + rmtree("$master->[0]->{'path_myddir'}"); + mkpath("$master->[0]->{'path_myddir'}/mysql"); + mkpath("$master->[0]->{'path_myddir'}/test"); + + rmtree("$master->[1]->{'path_myddir'}"); + mkpath("$master->[1]->{'path_myddir'}/mysql"); + mkpath("$master->[1]->{'path_myddir'}/test"); + + rmtree("$slave->[0]->{'path_myddir'}"); + mkpath("$slave->[0]->{'path_myddir'}/mysql"); + mkpath("$slave->[0]->{'path_myddir'}/test"); + + rmtree("$slave->[1]->{'path_myddir'}"); + mkpath("$slave->[1]->{'path_myddir'}/mysql"); + mkpath("$slave->[1]->{'path_myddir'}/test"); + + rmtree("$slave->[2]->{'path_myddir'}"); + mkpath("$slave->[2]->{'path_myddir'}/mysql"); + mkpath("$slave->[2]->{'path_myddir'}/test"); +} + + +############################################################################## +# +# Start the ndb cluster +# +############################################################################## + +# FIXME why is there a different start below?! + +sub ndbcluster_install () { + + if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster ) + { + return 0; + } + mtr_report("Install ndbcluster"); + my $ndbcluster_opts= $opt_bench ? "" : "--small"; + my $ndbcluster_port_base= $opt_ndbcluster_port + 2; + if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", + ["--port=$opt_ndbcluster_port", + "--port-base=$ndbcluster_port_base", + "--data-dir=$glob_mysql_test_dir/var", + $ndbcluster_opts, + "--initial"], + "", "", "", "") ) + { + mtr_error("Error ndbcluster_install"); + return 1; + } + + ndbcluster_stop(); + $master->[0]->{'ndbcluster'}= 1; + + return 0; +} + +sub ndbcluster_start () { + + if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster ) + { + return 0; + } + # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null + if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", + ["--port=$opt_ndbcluster_port", + "--data-dir=$glob_mysql_test_dir/var"], + "", "/dev/null", "", "") ) + { + mtr_error("Error ndbcluster_start"); + return 1; + } + + return 0; +} + +sub ndbcluster_stop () { + + if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster ) + { + return; + } + my $ndbcluster_port_base= $opt_ndbcluster_port + 2; + # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null + mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", + ["--port=$opt_ndbcluster_port", + "--data-dir=$glob_mysql_test_dir/var", + "--stop"], + "", "/dev/null", "", ""); + + return; +} + + +############################################################################## +# +# Run the benchmark suite +# +############################################################################## + +sub run_benchmarks ($) { + my $benchmark= shift; + + my $args; + + if ( ! $glob_use_embedded_server and ! $opt_local_master ) + { + $master->[0]->{'pid'}= mysqld_start('master',0,[],[]); + if ( ! $master->[0]->{'pid'} ) + { + mtr_error("Can't start the mysqld server"); + } + } + + mtr_init_args(\$args); + + mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); + mtr_add_arg($args, "--user=%s", $opt_user); + + if ( $opt_small_bench ) + { + mtr_add_arg($args, "--small-test"); + mtr_add_arg($args, "--small-tables"); + } + + if ( $opt_with_ndbcluster ) + { + mtr_add_arg($args, "--create-options=TYPE=ndb"); + } + + my $benchdir= "$glob_basedir/sql-bench"; + chdir($benchdir); # FIXME check error + + # FIXME write shorter.... + + if ( ! $benchmark ) + { + mtr_add_arg($args, "--log"); + mtr_run("$glob_mysql_bench_dir/run-all-tests", $args, "", "", "", ""); + # FIXME check result code?! + } + elsif ( -x $benchmark ) + { + mtr_run("$glob_mysql_bench_dir/$benchmark", $args, "", "", "", ""); + # FIXME check result code?! + } + else + { + mtr_error("Benchmark $benchmark not found"); + } + + chdir($glob_mysql_test_dir); # Go back + + if ( ! $glob_use_embedded_server ) + { + stop_masters(); + } +} + + +############################################################################## +# +# Run the test suite +# +############################################################################## + +# FIXME how to specify several suites to run? Comma separated list? + +sub run_tests () { + run_suite($opt_suite); +} + +sub run_suite () { + my $suite= shift; + + mtr_print_thick_line(); + + mtr_report("Finding Tests in the '$suite' suite"); + + my $tests= collect_test_cases($suite); + + mtr_report("Starting Tests in the '$suite' suite"); + + mtr_print_header(); + + foreach my $tinfo ( @$tests ) + { + run_testcase($tinfo); + } + + mtr_print_line(); + + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + + if ( $opt_gcov ) + { + gcov_collect(); # collect coverage information + } + if ( $opt_gprof ) + { + gprof_collect(); # collect coverage information + } + + mtr_report_stats($tests); +} + + +############################################################################## +# +# Initiate the test databases +# +############################################################################## + +sub mysql_install_db () { + + # FIXME not exactly true I think, needs improvements + install_db('master', $master->[0]->{'path_myddir'}); + install_db('master', $master->[1]->{'path_myddir'}); + install_db('slave', $slave->[0]->{'path_myddir'}); + install_db('slave', $slave->[1]->{'path_myddir'}); + install_db('slave', $slave->[2]->{'path_myddir'}); + + if ( ndbcluster_install() ) + { + # failed to install, disable usage but flag that its no ok + $opt_with_ndbcluster= 0; + $flag_ndb_status_ok= 0; + } + + return 0; +} + + +sub install_db ($$) { + my $type= shift; + my $data_dir= shift; + + my $init_db_sql= "lib/init_db.sql"; + my $init_db_sql_tmp= "/tmp/init_db.sql$$"; + my $args; + + mtr_report("Installing \u$type Databases"); + + open(IN, $init_db_sql) + or error("Can't open $init_db_sql: $!"); + open(OUT, ">", $init_db_sql_tmp) + or error("Can't write to $init_db_sql_tmp: $!"); + while (<IN>) + { + chomp; + s/\@HOSTNAME\@/$glob_hostname/; + if ( /^\s*$/ ) + { + print OUT "\n"; + } + elsif (/;$/) + { + print OUT "$_\n"; + } + else + { + print OUT "$_ "; + } + } + close OUT; + close IN; + + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--bootstrap"); + mtr_add_arg($args, "--console"); + mtr_add_arg($args, "--skip-grant-tables"); + mtr_add_arg($args, "--basedir=%s", $path_my_basedir); + mtr_add_arg($args, "--datadir=%s", $data_dir); + mtr_add_arg($args, "--skip-innodb"); + mtr_add_arg($args, "--skip-ndbcluster"); + mtr_add_arg($args, "--skip-bdb"); + + if ( ! $opt_netware ) + { + mtr_add_arg($args, "--language=%s", $path_language); + mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); + } + + if ( mtr_run($exe_mysqld, $args, $init_db_sql_tmp, + $path_manager_log, $path_manager_log, "") != 0 ) + { + unlink($init_db_sql_tmp); + mtr_error("Error executing mysqld --bootstrap\n" . + "Could not install $type test DBs"); + } + unlink($init_db_sql_tmp); +} + + +############################################################################## +# +# Run a single test case +# +############################################################################## + +# When we get here, we have already filtered out test cases that doesn't +# apply to the current setup, for example if we use a running server, test +# cases that restart the server are dropped. So this function should mostly +# be about doing things, not a lot of logic. + +# We don't start and kill the servers for each testcase. But some +# testcases needs a restart, because they specify options to start +# mysqld with. After that testcase, we need to restart again, to set +# back the normal options. + +sub run_testcase ($) { + my $tinfo= shift; + + my $tname= $tinfo->{'name'}; + + mtr_tonewfile($opt_current_test,"$tname\n"); # Always tell where we are + + # output current test to ndbcluster log file to enable diagnostics + mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n"); + + # ---------------------------------------------------------------------- + # If marked to skip, just print out and return. + # Note that a test case not marked as 'skip' can still be + # skipped later, because of the test case itself in cooperation + # with the mysqltest program tells us so. + # ---------------------------------------------------------------------- + + if ( $tinfo->{'skip'} ) + { + mtr_report_test_name($tinfo); + mtr_report_test_skipped($tinfo); + return; + } + + # ---------------------------------------------------------------------- + # If not using a running servers we may need to stop and restart. + # We restart in the case we have initiation scripts, server options + # etc to run. But we also restart again after the test first restart + # and test is run, to get back to normal server settings. + # + # To make the code a bit more clean, we actually only stop servers + # here, and mark this to be done. Then a generic "start" part will + # start up the needed servers again. + # ---------------------------------------------------------------------- + + if ( ! $glob_use_running_server and ! $glob_use_embedded_server ) + { + if ( $tinfo->{'master_restart'} or $master->[0]->{'uses_special_flags'} ) + { + stop_masters(); + $master->[0]->{'uses_special_flags'}= 0; # Forget about why we stopped + } + + # ---------------------------------------------------------------------- + # Always terminate all slaves, if any. Else we may have useless + # reconnection attempts and error messages in case the slave and + # master servers restart. + # ---------------------------------------------------------------------- + + stop_slaves(); + } + + # ---------------------------------------------------------------------- + # Prepare to start masters. Even if we use embedded, we want to run + # the preparation. + # ---------------------------------------------------------------------- + + $ENV{'TZ'}= $tinfo->{'timezone'}; + + mtr_report_test_name($tinfo); + + mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); + do_before_start_master($tname,$tinfo->{'master_sh'}); + + # ---------------------------------------------------------------------- + # If any mysqld servers running died, we have to know + # ---------------------------------------------------------------------- + + mtr_record_dead_children(); + + # ---------------------------------------------------------------------- + # Start masters + # ---------------------------------------------------------------------- + + if ( ! $glob_use_running_server and ! $glob_use_embedded_server ) + { + # FIXME give the args to the embedded server?! + # FIXME what does $opt_local_master mean?! + # FIXME split up start and check that started so that can do + # starts in parallel, masters and slaves at the same time. + + if ( ! $opt_local_master ) + { + if ( $master->[0]->{'ndbcluster'} ) + { + $master->[0]->{'ndbcluster'}= ndbcluster_start(); + if ( $master->[0]->{'ndbcluster'} ) + { + report_failure_and_restart($tinfo); + return; + } + } + if ( ! $master->[0]->{'pid'} ) + { + $master->[0]->{'pid'}= + mysqld_start('master',0,$tinfo->{'master_opt'},[]); + if ( ! $master->[0]->{'pid'} ) + { + report_failure_and_restart($tinfo); + return; + } + } + if ( $opt_with_ndbcluster and ! $master->[1]->{'pid'} ) + { + $master->[1]->{'pid'}= + mysqld_start('master',1,$tinfo->{'master_opt'},[]); + if ( ! $master->[1]->{'pid'} ) + { + report_failure_and_restart($tinfo); + return; + } + } + + if ( @{$tinfo->{'master_opt'}} ) + { + $master->[0]->{'uses_special_flags'}= 1; + } + } + + # ---------------------------------------------------------------------- + # Start slaves - if needed + # ---------------------------------------------------------------------- + + if ( $tinfo->{'slave_num'} ) + { + mtr_tofile($slave->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); + + do_before_start_slave($tname,$tinfo->{'slave_sh'}); + + for ( my $idx= 0; $idx < $tinfo->{'slave_num'}; $idx++ ) + { + if ( ! $slave->[$idx]->{'pid'} ) + { + $slave->[$idx]->{'pid'}= + mysqld_start('slave',$idx, + $tinfo->{'slave_opt'}, $tinfo->{'slave_mi'}); + if ( ! $slave->[$idx]->{'pid'} ) + { + report_failure_and_restart($tinfo); + return; + } + } + } + } + } + + # ---------------------------------------------------------------------- + # Run the test case + # ---------------------------------------------------------------------- + + { + unlink("r/$tname.reject"); + unlink($path_timefile); + + my $res= run_mysqltest($tinfo, $tinfo->{'master_opt'}); + + if ( $res == 0 ) + { + mtr_report_test_passed($tinfo); + } + elsif ( $res == 2 ) + { + # Testcase itself tell us to skip this one + mtr_report_test_skipped($tinfo); + } + else + { + # Test case failed + if ( $res > 2 ) + { + mtr_tofile($path_timefile, + "mysqltest returned unexpected code $res, " . + "it has probably crashed"); + } + report_failure_and_restart($tinfo); + } + } +} + + +sub report_failure_and_restart ($) { + my $tinfo= shift; + + mtr_report_test_failed($tinfo); + mtr_show_failed_diff($tinfo->{'name'}); + print "\n"; + if ( ! $opt_force ) + { + print "Aborting: $tinfo->{'name'} failed. To continue, re-run with '--force'."; + print "\n"; + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + exit(1); + } + + # FIXME always terminate on failure?! + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + print "Resuming Tests\n\n"; +} + + +############################################################################## +# +# Start and stop servers +# +############################################################################## + +# The embedded server needs the cleanup so we do some of the start work +# but stop before actually running mysqld or anything. + +sub do_before_start_master ($$) { + my $tname= shift; + my $init_script= shift; + + # FIXME what about second master..... + + # Remove stale binary logs except for 2 tests which need them FIXME here???? + if ( $tname ne "rpl_crash_binlog_ib_1b" and + $tname ne "rpl_crash_binlog_ib_2b" and + $tname ne "rpl_crash_binlog_ib_3b") + { + # FIXME we really want separate dir for binlogs + `rm -f $glob_mysql_test_dir/var/log/master-bin*`; +# unlink("$glob_mysql_test_dir/var/log/master-bin*"); + } + + # Remove old master.info and relay-log.info files + unlink("$glob_mysql_test_dir/var/master-data/master.info"); + unlink("$glob_mysql_test_dir/var/master-data/relay-log.info"); + unlink("$glob_mysql_test_dir/var/master1-data/master.info"); + unlink("$glob_mysql_test_dir/var/master1-data/relay-log.info"); + + # Run master initialization shell script if one exists + if ( $init_script ) + { + # We ignore the return code + mtr_run("/bin/sh", ["-c",$init_script], "", "", "", ""); + } + # for gcov FIXME needed? If so we need more absolute paths +# chdir($glob_basedir); +} + +sub do_before_start_slave ($$) { + my $tname= shift; + my $init_script= shift; + + # Remove stale binary logs and old master.info files + # except for too tests which need them + if ( $tname ne "rpl_crash_binlog_ib_1b" and + $tname ne "rpl_crash_binlog_ib_2b" and + $tname ne "rpl_crash_binlog_ib_3b" ) + { + # FIXME we really want separate dir for binlogs + `rm -fr $glob_mysql_test_dir/var/log/slave*-bin.*`; +# unlink("$glob_mysql_test_dir/var/log/slave*-bin.*"); # FIXME idx??? + # FIXME really master?! + unlink("$glob_mysql_test_dir/var/slave-data/master.info"); + unlink("$glob_mysql_test_dir/var/slave-data/relay-log.info"); + } + + # Run slave initialization shell script if one exists + if ( $init_script ) + { + # We ignore the return code + mtr_run("/bin/sh", ["-c",$init_script], "", "", "", ""); + } + + `rm -f $glob_mysql_test_dir/var/slave-data/log.*`; +# unlink("$glob_mysql_test_dir/var/slave-data/log.*"); +} + +sub mysqld_arguments ($$$$$) { + my $args= shift; + my $type= shift; # master/slave/bootstrap + my $idx= shift; + my $extra_opt= shift; + my $slave_master_info= shift; + +# print STDERR Dumper($extra_opt); + + my $sidx= ""; # Index as string, 0 is empty string + if ( $idx > 0 ) + { + $sidx= sprintf("%d", $idx); # sprintf not needed in Perl for this + } + + my $prefix= ""; # If mysqltest server arg + + if ( $glob_use_embedded_server ) + { + $prefix= "--server-arg="; + } else { + # We can't pass embedded server --no-defaults + mtr_add_arg($args, "%s--no-defaults", $prefix); + } + + mtr_add_arg($args, "%s--console", $prefix); + mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); + mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); + mtr_add_arg($args, "%s--core", $prefix); + mtr_add_arg($args, "%s--default-character-set=latin1", $prefix); + mtr_add_arg($args, "%s--language=%s", $prefix, $path_language); + mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix); + + if ( $opt_valgrind ) + { + mtr_add_arg($args, "%s--skip-safemalloc", $prefix); + mtr_add_arg($args, "%s--skip-bdb", $prefix); + } + + my $pidfile; + + if ( $type eq 'master' ) + { + mtr_add_arg($args, "%s--log-bin=%s/var/log/master-bin", $prefix, + $glob_mysql_test_dir); + mtr_add_arg($args, "%s--pid-file=%s", $prefix, + $master->[$idx]->{'path_mypid'}); + mtr_add_arg($args, "%s--port=%d", $prefix, + $master->[$idx]->{'path_myport'}); + mtr_add_arg($args, "%s--server-id=1", $prefix); + mtr_add_arg($args, "%s--socket=%s", $prefix, + $master->[$idx]->{'path_mysock'}); + mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:50M", $prefix); + mtr_add_arg($args, "%s--local-infile", $prefix); + mtr_add_arg($args, "%s--datadir=%s", $prefix, + $master->[$idx]->{'path_myddir'}); + } + + if ( $type eq 'slave' ) + { + my $slave_server_id= 2 + $idx; + my $slave_rpl_rank= $idx > 0 ? 2 : $slave_server_id; + + mtr_add_arg($args, "%s--datadir=%s", $prefix, + $slave->[$idx]->{'path_myddir'}); + mtr_add_arg($args, "%s--exit-info=256", $prefix); + mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix); + mtr_add_arg($args, "%s--log-bin=%s/var/log/slave%s-bin", $prefix, + $glob_mysql_test_dir, $sidx); # FIXME use own dir for binlogs + mtr_add_arg($args, "%s--log-slave-updates", $prefix); + mtr_add_arg($args, "%s--log=%s", $prefix, + $slave->[$idx]->{'path_myerr'}); + mtr_add_arg($args, "%s--master-retry-count=10", $prefix); + mtr_add_arg($args, "%s--pid-file=%s", $prefix, + $slave->[$idx]->{'path_mypid'}); + mtr_add_arg($args, "%s--port=%d", $prefix, + $slave->[$idx]->{'path_myport'}); + mtr_add_arg($args, "%s--relay-log=%s/var/log/slave%s-relay-bin", $prefix, + $glob_mysql_test_dir, $sidx); + mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix); + mtr_add_arg($args, "%s--report-port=%d", $prefix, + $slave->[$idx]->{'path_myport'}); + mtr_add_arg($args, "%s--report-user=root", $prefix); + mtr_add_arg($args, "%s--skip-innodb", $prefix); + mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); + mtr_add_arg($args, "%s--skip-slave-start", $prefix); + mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix, + $path_slave_load_tmpdir); + mtr_add_arg($args, "%s--socket=%s", $prefix, + $slave->[$idx]->{'path_mysock'}); + mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix); + + if ( @$slave_master_info ) + { + foreach my $arg ( @$slave_master_info ) + { + mtr_add_arg($args, "%s%s", $prefix, $arg); + } + } + else + { + mtr_add_arg($args, "%s--master-user=root", $prefix); + mtr_add_arg($args, "%s--master-connect-retry=1", $prefix); + mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix); + mtr_add_arg($args, "%s--master-password=", $prefix); + mtr_add_arg($args, "%s--master-port=%d", $prefix, + $master->[0]->{'path_myport'}); # First master + mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id); + mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank); + } + } # end slave + + if ( $opt_debug ) + { + if ( $type eq 'master' ) + { + mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/master%s.trace", + $prefix, $glob_mysql_test_dir, $sidx); + } + if ( $type eq 'slave' ) + { + mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/slave%s.trace", + $prefix, $glob_mysql_test_dir, $sidx); + } + } + + if ( $opt_with_ndbcluster ) + { + mtr_add_arg($args, "%s--ndbcluster", $prefix); + mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix, + $opt_ndbconnectstring); + } + + # FIXME always set nowdays??? SMALL_SERVER + mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix); + mtr_add_arg($args, "%s--sort_buffer=256K", $prefix); + mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); + + if ( $opt_with_openssl ) + { + mtr_add_arg($args, "%s--ssl-ca=%s/SSL/cacert.pem", $prefix, $glob_basedir); + mtr_add_arg($args, "%s--ssl-cert=%s/SSL/server-cert.pem", $prefix, + $glob_basedir); + mtr_add_arg($args, "%s--ssl-key=%s/SSL/server-key.pem", $prefix, + $glob_basedir); + } + + if ( $opt_warnings ) + { + mtr_add_arg($args, "%s--log-warnings", $prefix); + } + + if ( $opt_gdb or $opt_client_gdb or $opt_manual_gdb or $opt_ddd) + { + mtr_add_arg($args, "%s--gdb", $prefix); + } + + # If we should run all tests cases, we will use a local server for that + + if ( -w "/" ) + { + # We are running as root; We need to add the --root argument + mtr_add_arg($args, "%s--user=root", $prefix); + } + + if ( $type eq 'master' ) + { + + if ( ! $opt_old_master ) + { + mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix); + mtr_add_arg($args, "%s--init-rpl-role=master", $prefix); + } + + # FIXME strange,..... + # FIXME MYSQL_MYPORT is not set anythere?! + if ( $opt_local_master ) + { + mtr_add_arg($args, "%s--host=127.0.0.1", $prefix); + mtr_add_arg($args, "%s--port=%s", $prefix, $ENV{'MYSQL_MYPORT'}); + } + } + + foreach my $arg ( @$extra_opt ) + { + mtr_add_arg($args, "%s%s", $prefix, $arg); + } + + if ( $opt_bench ) + { + mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix); + mtr_add_arg($args, "%s--init-rpl-role=master", $prefix); + } + else + { + mtr_add_arg($args, "%s--exit-info=256", $prefix); + mtr_add_arg($args, "%s--open-files-limit=1024", $prefix); + + if ( $type eq 'master' ) + { + mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); + } + if ( $type eq 'slave' ) + { + mtr_add_arg($args, "%s--log=%s", $prefix, $slave->[0]->{'path_mylog'}); + } + } + + return $args; +} + +# FIXME +# if ( $type eq 'master' and $glob_use_embedded_server ) +# { +# # Add a -A to each argument to pass it to embedded server +# my @mysqltest_opt= map {("-A",$_)} @args; +# $opt_extra_mysqltest_opt= \@mysqltest_opt; +# return; +# } + +############################################################################## +# +# Start mysqld and return the PID +# +############################################################################## + +sub mysqld_start ($$$$) { + my $type= shift; # master/slave/bootstrap + my $idx= shift; + my $extra_opt= shift; + my $slave_master_info= shift; + + my $args; # Arg vector + my $exe; + my $pid; + + if ( $type eq 'master' ) + { + $exe= $exe_master_mysqld; + } + elsif ( $type eq 'slave' ) + { + $exe= $exe_slave_mysqld; + } + else + { + $exe= $exe_mysqld; + } + + mtr_init_args(\$args); + + if ( $opt_valgrind ) + { + + mtr_add_arg($args, "--tool=memcheck"); + mtr_add_arg($args, "--alignment=8"); + mtr_add_arg($args, "--leak-check=yes"); + mtr_add_arg($args, "--num-callers=16"); + + if ( $opt_valgrind_all ) + { + mtr_add_arg($args, "-v"); + mtr_add_arg($args, "--show-reachable=yes"); + } + + if ( $opt_valgrind_options ) + { + # FIXME split earlier and put into @glob_valgrind_* + mtr_add_arg($args, split(' ', $opt_valgrind_options)); + } + + mtr_add_arg($args, $exe); + + $exe= $opt_valgrind; + } + + mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info); + + if ( $type eq 'master' ) + { + if ( $pid= mtr_spawn($exe, $args, "", + $master->[$idx]->{'path_myerr'}, + $master->[$idx]->{'path_myerr'}, "") ) + { + return sleep_until_file_created($master->[$idx]->{'path_mypid'}, + $master->[$idx]->{'start_timeout'}, $pid); + } + } + + if ( $type eq 'slave' ) + { + if ( $pid= mtr_spawn($exe, $args, "", + $slave->[$idx]->{'path_myerr'}, + $slave->[$idx]->{'path_myerr'}, "") ) + { + return sleep_until_file_created($slave->[$idx]->{'path_mypid'}, + $master->[$idx]->{'start_timeout'}, $pid); + } + } + + return 0; +} + +sub stop_masters_slaves () { + + print "Ending Tests\n"; + print "Shutting-down MySQL daemon\n\n"; + stop_masters(); + print "Master(s) shutdown finished\n"; + stop_slaves(); + print "Slave(s) shutdown finished\n"; +} + +sub stop_masters () { + + my @args; + + for ( my $idx; $idx < 2; $idx++ ) + { + # FIXME if we hit ^C before fully started, this test will prevent + # the mysqld process from being killed + if ( $master->[$idx]->{'pid'} ) + { + push(@args,{ + pid => $master->[$idx]->{'pid'}, + pidfile => $master->[$idx]->{'path_mypid'}, + sockfile => $master->[$idx]->{'path_mysock'}, + port => $master->[$idx]->{'path_myport'}, + }); + $master->[$idx]->{'pid'}= 0; # Assume we are done with it + } + } + + if ( ! $master->[0]->{'ndbcluster'} ) + { + ndbcluster_stop(); + $master->[0]->{'ndbcluster'}= 1; + } + + mtr_stop_mysqld_servers(\@args); +} + +sub stop_slaves () { + my $force= shift; + + my @args; + + for ( my $idx; $idx < 3; $idx++ ) + { + if ( $slave->[$idx]->{'pid'} ) + { + push(@args,{ + pid => $slave->[$idx]->{'pid'}, + pidfile => $slave->[$idx]->{'path_mypid'}, + sockfile => $slave->[$idx]->{'path_mysock'}, + port => $slave->[$idx]->{'path_myport'}, + }); + $slave->[$idx]->{'pid'}= 0; # Assume we are done with it + } + } + + mtr_stop_mysqld_servers(\@args); +} + + +sub run_mysqltest ($$) { + my $tinfo= shift; + my $master_opts= shift; + + my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " . + "--socket=$master->[0]->{'path_mysock'} --password="; + if ( $opt_debug ) + { + $cmdline_mysqldump .= + " --debug=d:t:A,$glob_mysql_test_dir/var/log/mysqldump.trace"; + } + + my $cmdline_mysqlbinlog= + "$exe_mysqlbinlog --no-defaults --local-load=$opt_tmpdir"; + + if ( $opt_debug ) + { + $cmdline_mysqlbinlog .= + " --debug=d:t:A,$glob_mysql_test_dir/var/log/mysqlbinlog.trace"; + } + + my $cmdline_mysql= + "$exe_mysql --host=localhost --user=root --password= " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'}"; + + my $cmdline_mysql_client_test= + "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'}"; + + my $cmdline_mysql_fix_system_tables= + "$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " . + "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'}"; + + + + # FIXME really needing a PATH??? + # $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}"; + + $ENV{'MYSQL'}= $cmdline_mysql; + $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; + $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog; + $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; + $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test; + $ENV{'CHARSETSDIR'}= $path_charsetsdir; + + $ENV{'NDB_STATUS_OK'}= $flag_ndb_status_ok; + $ENV{'NDB_MGM'}= $exe_ndb_mgm; + $ENV{'NDB_BACKUP_DIR'}= $path_ndb_backup_dir; + $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir; + $ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log; + $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring; + + my $exe= $exe_mysqltest; + my $args; + + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); + mtr_add_arg($args, "--database=test"); + mtr_add_arg($args, "--user=%s", $opt_user); + mtr_add_arg($args, "--password="); + mtr_add_arg($args, "--silent"); + mtr_add_arg($args, "-v"); + mtr_add_arg($args, "--skip-safemalloc"); + mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); + mtr_add_arg($args, "--port=%d", $master->[0]->{'path_myport'}); + + if ( $opt_ps_protocol ) + { + mtr_add_arg($args, "--ps-protocol"); + } + + if ( $opt_strace_client ) + { + $exe= "strace"; # FIXME there are ktrace, .... + mtr_add_arg($args, "-o"); + mtr_add_arg($args, "%s/var/log/mysqltest.strace", $glob_mysql_test_dir); + mtr_add_arg($args, "$exe_mysqltest"); + } + + if ( $opt_timer ) + { + mtr_add_arg($args, "--timer-file=var/log/timer"); + } + + if ( $opt_big_test ) + { + mtr_add_arg($args, "--big-test"); + } + + if ( $opt_record ) + { + mtr_add_arg($args, "--record"); + } + + if ( $opt_compress ) + { + mtr_add_arg($args, "--compress"); + } + + if ( $opt_sleep ) + { + mtr_add_arg($args, "--sleep=%d", $opt_sleep); + } + + if ( $opt_debug ) + { + mtr_add_arg($args, "--debug=d:t:A,%s/var/log/mysqltest.trace", + $glob_mysql_test_dir); + } + + if ( $opt_with_openssl ) + { + mtr_add_arg($args, "--ssl-ca=%s/SSL/cacert.pem", $glob_basedir); + mtr_add_arg($args, "--ssl-cert=%s/SSL/client-cert.pem", $glob_basedir); + mtr_add_arg($args, "--ssl-key=%s/SSL/client-key.pem", $glob_basedir); + } + + mtr_add_arg($args, "-R"); + mtr_add_arg($args, $tinfo->{'result_file'}); + + # ---------------------------------------------------------------------- + # If embedded server, we create server args to give mysqltest to pass on + # ---------------------------------------------------------------------- + + if ( $glob_use_embedded_server ) + { + mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]); + } + + return mtr_run_test($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,""); +} + +############################################################################## +# +# Usage +# +############################################################################## + +sub usage ($) +{ + print STDERR <<HERE; + +mysql-test-run [ OPTIONS ] [ TESTCASE ] + +FIXME when is TESTCASE arg used or not?! + +Options to control what engine/variation to run + + embedded-server Use the embedded server, i.e. no mysqld daemons + ps-protocol Use the binary protocol between client and server + bench Run the benchmark suite FIXME + small-bench FIXME + no-manager Use the istanse manager (currently disabled) + +Options to control what test suites or cases to run + + force Continue to run the suite after failure + with-ndbcluster Use cluster, and enable test cases that requres it + do-test=PREFIX Run test cases which name are prefixed with PREFIX + start-from=PREFIX Run test cases starting from test prefixed with PREFIX + suite=NAME Run the test suite named NAME. The default is "main" + skip-rpl Skip the replication test cases. + skip-test=PREFIX Skip test cases which name are prefixed with PREFIX + +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=i Specify the port number used by cluster FIXME + +Options for test case authoring + + record TESTNAME (Re)genereate the result file for TESTNAME + +Options that pass on options + + mysqld=ARGS Specify additional arguments to "mysqld" + +Options to run test on running server + + extern Use running server for tests FIXME DANGEROUS + ndbconnectstring=STR Use running cluster, and connect using STR + user=USER The databse user name + +Options for debugging the product + + gdb FIXME + manual-gdb FIXME + client-gdb FIXME + ddd FIXME + strace-client FIXME + master-binary=PATH Specify the master "mysqld" to use + slave-binary=PATH Specify the slave "mysqld" to use + +Options for coverage, profiling etc + + gcov FIXME + gprof FIXME + valgrind FIXME + valgrind-all FIXME + valgrind-options=ARGS Extra options to give valgrind + +Misc options + + verbose Verbose output from this script + script-debug Debug this script itself + compress Use the compressed protocol between client and server + timer Show test case execution time + start-and-exit Only initiate and start the "mysqld" servers + fast Don't try to cleanup from earlier runs + help Get this help text + unified-diff | udiff When presenting differences, use unified diff + +Options not yet described, or that I want to look into more + + big-test + debug + local + local-master + netware + old-master + sleep=SECONDS + socket=PATH + tmpdir=DIR + user-test=s + wait-timeout=SECONDS + warnings + log-warnings + with-openssl + +HERE + exit(1); +} diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 6b40fb3e974..8c484d2ddb1 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -4,6 +4,7 @@ # Slightly updated by Monty # Cleaned up again by Matt # Fixed by Sergei +# List of failed cases (--force) backported from 4.1 by Joerg # :-) #++ @@ -193,8 +194,8 @@ MY_LOG_DIR="$MYSQL_TEST_DIR/var/log" # # Set LD_LIBRARY_PATH if we are using shared libraries # -LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$LD_LIBRARY_PATH" -DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$DYLD_LIBRARY_PATH" +LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/zlib/.libs:$LD_LIBRARY_PATH" +DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/zlib/.libs:$DYLD_LIBRARY_PATH" export LD_LIBRARY_PATH DYLD_LIBRARY_PATH MASTER_RUNNING=0 @@ -219,6 +220,8 @@ EXTRA_MYSQLBINLOG_OPT="" USE_RUNNING_SERVER="" USE_NDBCLUSTER="" USE_RUNNING_NDBCLUSTER="" +USE_PURIFY="" +PURIFY_LOGS="" DO_GCOV="" DO_GDB="" MANUAL_GDB="" @@ -227,7 +230,7 @@ DO_CLIENT_GDB="" SLEEP_TIME_AFTER_RESTART=1 SLEEP_TIME_FOR_DELETE=10 SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables -SLEEP_TIME_FOR_SECOND_MASTER=30 +SLEEP_TIME_FOR_SECOND_MASTER=400 SLEEP_TIME_FOR_FIRST_SLAVE=400 SLEEP_TIME_FOR_SECOND_SLAVE=30 CHARACTER_SET=latin1 @@ -238,11 +241,25 @@ MYSQL_TEST_SSL_OPTS="" USE_TIMER="" USE_EMBEDDED_SERVER="" RESULT_EXT="" +TEST_MODE="" + +NDB_MGM_EXTRA_OPTS= +NDB_MGMD_EXTRA_OPTS= +NDBD_EXTRA_OPTS= while test $# -gt 0; do case "$1" in - --embedded-server) USE_EMBEDDED_SERVER=1 ; USE_MANAGER=0 ; NO_SLAVE=1 ; \ - USE_RUNNING_SERVER="" RESULT_EXT=".es" ;; + --embedded-server) + USE_EMBEDDED_SERVER=1 + USE_MANAGER=0 NO_SLAVE=1 + USE_RUNNING_SERVER="" + RESULT_EXT=".es" + TEST_MODE="$TEST_MODE embedded" ;; + --purify) + USE_PURIFY=1 + USE_MANAGER=0 + USE_RUNNING_SERVER="" + TEST_MODE="$TEST_MODE purify" ;; --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;; --force) FORCE=1 ;; --timer) USE_TIMER=1 ;; @@ -259,6 +276,12 @@ while test $# -gt 0; do --ndb-connectstring=*) USE_NDBCLUSTER="--ndbcluster" ; USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;; + --ndb_mgm-extra-opts=*) + NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;; + --ndb_mgmd-extra-opts=*) + NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;; + --ndbd-extra-opts=*) + NDBD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndbd-extra-opts=;;"` ;; --tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;; --local-master) MASTER_MYPORT=3306; @@ -322,7 +345,7 @@ while test $# -gt 0; do SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"` ;; --ps-protocol) - EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; + TEST_MODE="$TEST_MODE ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; --user-test=*) USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` ;; @@ -421,6 +444,7 @@ while test $# -gt 0; do --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace" EXTRA_MYSQLBINLOG_OPT="$EXTRA_MYSQLBINLOG_OPT \ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlbinlog.trace" + EXTRA_MYSQL_CLIENT_TEST_OPT="--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysql_client_test.trace" ;; --fast) FAST_START=1 @@ -432,6 +456,13 @@ while test $# -gt 0; do shift done +if [ -z "$TEST_MODE" ] ; then + TEST_MODE="default" +else + # Remove the leading space if any + TEST_MODE=`echo $TEST_MODE | sed 's/^ *//'` +fi + #++ # mysqld Environment Parameters #-- @@ -457,6 +488,11 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 +NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` +NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS" +NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT +NDB_TOOLS_OUTPUT=$MYSQL_TEST_DIR/var/log/ndb_tools.log + if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR else @@ -481,14 +517,18 @@ DASH72=`$ECHO '-------------------------------------------------------'|$CUT -c # on binary, use what is installed if [ x$SOURCE_DIST = x1 ] ; then if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then - if [ -f "$BASEDIR/libmysqld/examples/mysqltest" ] ; then - MYSQL_TEST="$VALGRIND $BASEDIR/libmysqld/examples/mysqltest" + if [ -f "$BASEDIR/libmysqld/examples/mysqltest_embedded" ] ; then + MYSQL_TEST="$VALGRIND $BASEDIR/libmysqld/examples/mysqltest_embedded" else - echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2 + echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2 exit 1 fi + MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded" else - MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" + MYSQLD="$BASEDIR/sql/mysqld" + if [ -n "$VALGRIND" ] ; then + MYSQLD="$VALGRIND $MYSQLD" + fi if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest" elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then @@ -496,6 +536,7 @@ if [ x$SOURCE_DIST = x1 ] ; then else MYSQL_TEST="$BASEDIR/client/mysqltest" fi + MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test" fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" @@ -512,7 +553,6 @@ if [ x$SOURCE_DIST = x1 ] ; then fi CLIENT_BINDIR="$BASEDIR/client" - TESTS_BINDIR="$BASEDIR/tests" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" WAIT_PID="$BASEDIR/extra/mysql_waitpid" MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc" @@ -524,7 +564,41 @@ if [ x$SOURCE_DIST = x1 ] ; then INSTALL_DB="./install_test_db" MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$BASEDIR/ndb/tools" + NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm" + + if [ -n "$USE_PURIFY" ] ; then + PSUP="$MYSQL_TEST_DIR/purify.suppress" + echo "suppress UMR rw_read_held; mi_open; ha_myisam::open64; handler::ha_open; openfrm" > $PSUP + echo "suppress UMR my_end; main" >> $PSUP + echo "suppress UMR _doprnt; fprintf; my_end; main" >> $PSUP + PURIFYOPTIONS="-windows=no -log-file=%v.purifylog -append-logfile -add-suppression-files=$PSUP" + if [ -f "${MYSQL_TEST}-purify" ] ; then + MYSQL_TEST="${MYSQL_TEST}-purify" + PLOG="$MYSQL_TEST.purifylog" + if [ -f $PLOG ]; then + mv $PLOG $PLOG.$$ + fi + PURIFY_LOGS="$PLOG" + fi + if [ -f "${MYSQLD}-purify" ] ; then + MYSQLD="${MYSQLD}-purify" + PLOG="$MYSQLD.purifylog" + if [ -f $PLOG ]; then + mv $PLOG $PLOG.$$ + fi + PURIFY_LOGS="$PURIFY_LOGS $PLOG" + fi + fi + else + + # We have a binary installation. Note that this can be both from + # unpacking a MySQL AB binary distribution (created using + # "scripts/make_binary_distribution", and from a "make install". + # Unfortunately the structure differs a bit, for a "make install" + # currently all binaries are in "bin", for a MySQL AB packaging + # some are in "tests". + if test -x "$BASEDIR/libexec/mysqld" then MYSQLD="$VALGRIND $BASEDIR/libexec/mysqld" @@ -532,7 +606,12 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi CLIENT_BINDIR="$BASEDIR/bin" - TESTS_BINDIR="$BASEDIR/tests" + if test -d "$BASEDIR/tests" + then + TESTS_BINDIR="$BASEDIR/tests" + else + TESTS_BINDIR="$BASEDIR/bin" + fi MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" @@ -545,6 +624,7 @@ else INSTALL_DB="./install_test_db --bin" MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$CLIENT_BINDIR" + NDB_MGM="$CLIENT_BINDIR/ndb_mgm" if test -d "$BASEDIR/share/mysql/english" then LANGUAGE="$BASEDIR/share/mysql/english/" @@ -552,7 +632,23 @@ else else LANGUAGE="$BASEDIR/share/english/" CHARSETSDIR="$BASEDIR/share/charsets" - fi + fi + if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then + if [ -f "$CLIENT_BINDIR/mysqltest_embedded" ] ; then + MYSQL_TEST="$VALGRIND $CLIENT_BINDIR/mysqltest_embedded" + else + echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2 + exit 1 + fi + if [ -d "$BASEDIR/tests/mysql_client_test_embedded" ] ; then + MYSQL_CLIENT_TEST="$TESTS_BINDIR/mysql_client_test_embedded" + else + MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test_embedded" + fi + else + MYSQL_TEST="$CLIENT_BINDIR/mysqltest" + MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test" + fi fi if [ -z "$MASTER_MYSQLD" ] @@ -586,13 +682,20 @@ then EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root" fi - +MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent $EXTRA_MYSQL_CLIENT_TEST_OPT" MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" -export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR TESTS_BINDIR +export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES +export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR export NDB_TOOLS_DIR +export NDB_MGM +export NDB_BACKUP_DIR +export NDB_TOOLS_OUTPUT +export PURIFYOPTIONS +NDB_STATUS_OK=1 +export NDB_STATUS_OK MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ @@ -709,6 +812,17 @@ skip_test() { $ECHO "$RES$RES_SPACE [ skipped ]" } +report_current_test () { + tname=$1 + echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + if [ -n "$PURIFY_LOGS" ] ; then + for log in $PURIFY_LOGS + do + echo "CURRENT_TEST: $tname" >> $log + done + fi +} + report_stats () { if [ $TOT_FAIL = 0 ]; then $ECHO "All $TOT_TEST tests were successful." @@ -934,16 +1048,25 @@ start_ndbcluster() { if [ ! -z "$USE_NDBCLUSTER" ] then + rm -f $NDB_TOOLS_OUTPUT if [ -z "$USE_RUNNING_NDBCLUSTER" ] then echo "Starting ndbcluster" if [ "$DO_BENCH" = 1 ] then - NDBCLUSTER_OPTS="" + NDBCLUSTER_EXTRA_OPTS="" else - NDBCLUSTER_OPTS="--small" + NDBCLUSTER_EXTRA_OPTS="--small" fi - ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 + ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --initial || NDB_STATUS_OK=0 + if [ x$NDB_STATUS_OK != x1 ] ; then + if [ x$FORCE != x1 ] ; then + exit 1 + fi + USE_NDBCLUSTER= + return + fi + NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" else NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" @@ -961,7 +1084,7 @@ stop_ndbcluster() if [ -z "$USE_RUNNING_NDBCLUSTER" ] then # Kill any running ndbcluster stuff - ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop + ./ndb/ndbcluster $NDBCLUSTER_OPTS --stop fi fi } @@ -994,9 +1117,11 @@ start_master() if [ -n "$1" ] ; then id=`$EXPR $1 + 101`; this_master_myport=`$EXPR $MASTER_MYPORT + $1` + NOT_FIRST_MASTER_EXTRA_OPTS="--skip-innodb" else id=1; this_master_myport=$MASTER_MYPORT + NOT_FIRST_MASTER_EXTRA_OPTS="" fi if [ -z "$DO_BENCH" ] then @@ -1020,7 +1145,8 @@ start_master() --open-files-limit=1024 \ $MASTER_40_ARGS \ $SMALL_SERVER \ - $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" + $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \ + $NOT_FIRST_MASTER_EXTRA_OPTS" else master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \ --server-id=$id --rpl-recovery-rank=1 \ @@ -1039,7 +1165,8 @@ start_master() --innodb_data_file_path=ibdata1:50M \ $MASTER_40_ARGS \ $SMALL_SERVER \ - $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" + $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \ + $NOT_FIRST_MASTER_EXTRA_OPTS" fi CUR_MYERR=$MASTER_MYERR @@ -1340,7 +1467,7 @@ run_testcase () result_file="$result_file$RESULT_EXT" fi if [ "$USE_MANAGER" = 1 ] ; then - many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)` + many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)` fi if $EXPR "$tname" '<' "$START_FROM" > /dev/null ; then #skip_test $tname @@ -1380,13 +1507,18 @@ run_testcase () # script soon anyway so it is not worth it spending the time if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then for t in \ + "alter_table" \ "bdb-deadlock" \ "connect" \ + "ctype_latin1_de" \ + "ctype_ucs" \ "flush_block_commit" \ "grant2" \ "grant_cache" \ "grant" \ "init_connect" \ + "init_file" \ + "innodb" \ "innodb-deadlock" \ "innodb-lock" \ "mix_innodb_myisam_binlog" \ @@ -1394,10 +1526,12 @@ run_testcase () "mysqlbinlog" \ "mysqldump" \ "mysql_protocols" \ + "packet" \ "ps_1general" \ "rename" \ "show_check" \ "system_mysql_db_fix" \ + "timezone2" \ "user_var" \ "variables" do @@ -1432,7 +1566,7 @@ run_testcase () esac stop_master stop_master 1 - echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + report_current_test $tname start_master if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then start_master 1 @@ -1448,13 +1582,13 @@ run_testcase () EXTRA_MASTER_OPT="" stop_master stop_master 1 - echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + report_current_test $tname start_master if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then start_master 1 fi else - echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + report_current_test $tname fi fi @@ -1497,6 +1631,12 @@ run_testcase () fi fi fi + + if [ "x$START_AND_EXIT" = "x1" ] ; then + echo "Servers started, exiting" + exit + fi + cd $MYSQL_TEST_DIR if [ -f $tf ] ; then @@ -1544,7 +1684,7 @@ run_testcase () show_failed_diff $tname $ECHO if [ x$FORCE != x1 ] ; then - $ECHO "Aborting: $tname failed. To continue, re-run with '--force'." + $ECHO "Aborting: $tname failed in $TEST_MODE mode. To continue, re-run with '--force'." $ECHO if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && \ [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ] @@ -1634,11 +1774,6 @@ then mysql_loadstd fi -if [ "x$START_AND_EXIT" = "x1" ] ; then - echo "Servers started, exiting" - exit -fi - $ECHO "Starting Tests" # @@ -1725,7 +1860,7 @@ $ECHO [ "$DO_GPROF" ] && gprof_collect # collect coverage information if [ $TOT_FAIL -ne 0 ]; then - $ECHO "mysql-test-run: *** Failing the test(s):$FAILED_CASES" + $ECHO "mysql-test-run in $TEST_MODE mode: *** Failing the test(s):$FAILED_CASES" $ECHO exit 1 else diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c new file mode 100644 index 00000000000..40e45a92851 --- /dev/null +++ b/mysql-test/mysql_test_run_new.c @@ -0,0 +1,1909 @@ +/* + Copyright (c) 2002, 2003 Novell, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; 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 +*/ + +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> +#ifndef __WIN__ +#include <dirent.h> +#endif +#include <string.h> +#ifdef __NETWARE__ +#include <screen.h> +#include <nks/vm.h> +#endif +#include <ctype.h> +#include <sys/stat.h> +#ifndef __WIN__ +#include <unistd.h> +#endif +#include <fcntl.h> +#ifdef __NETWARE__ +#include <sys/mode.h> +#endif +#ifdef __WIN__ +#include <windows.h> +#include <shlwapi.h> +#include <direct.h> +#endif + +#include "my_manage.h" + +/****************************************************************************** + + macros + +******************************************************************************/ + +#define HEADER "TEST RESULT \n" +#define DASH "-------------------------------------------------------\n" + +#define NW_TEST_SUFFIX ".nw-test" +#define NW_RESULT_SUFFIX ".nw-result" +#define TEST_SUFFIX ".test" +#define RESULT_SUFFIX ".result" +#define REJECT_SUFFIX ".reject" +#define OUT_SUFFIX ".out" +#define ERR_SUFFIX ".err" + +const char *TEST_PASS= "[ pass ]"; +const char *TEST_SKIP= "[ skip ]"; +const char *TEST_FAIL= "[ fail ]"; +const char *TEST_BAD= "[ bad ]"; +const char *TEST_IGNORE= "[ignore]"; + +/****************************************************************************** + + global variables + +******************************************************************************/ + +#ifdef __NETWARE__ +static char base_dir[FN_REFLEN]= "sys:/mysql"; +#else +static char base_dir[FN_REFLEN]= ".."; +#endif +static char db[FN_LEN]= "test"; +static char user[FN_LEN]= "root"; +static char password[FN_LEN]= ""; + +int master_port= 9306; +int slave_port= 9307; + +#if !defined(__NETWARE__) && !defined(__WIN__) +static char master_socket[FN_REFLEN]= "./var/tmp/master.sock"; +static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock"; +#endif + +#define MAX_COUNT_TESTES 1024 + +#ifdef __WIN__ +# define sting_compare_func _stricmp +#else +# ifdef HAVE_STRCASECMP +# define sting_compare_func strcasecmp +# else +# define sting_compare_func strcmp +# endif +#endif + +/* comma delimited list of tests to skip or empty string */ +#ifndef __WIN__ +static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix "; +#else +/* + The most ignore testes contain the calls of system command + + lowercase_table3 is disabled by Gerg + system_mysql_db_fix is disabled by Gerg + sp contains a command system + rpl_EE_error contains a command system + rpl_loaddatalocal contains a command system + ndb_autodiscover contains a command system + rpl_rotate_logs contains a command system + repair contains a command system + rpl_trunc_binlog contains a command system + mysqldump contains a command system + rpl000001 makes non-exit loop...temporary skiped +*/ +static char skip_test[FN_REFLEN]= +" lowercase_table3 ," +" system_mysql_db_fix ," +" sp ," +" rpl_EE_error ," +" rpl_loaddatalocal ," +" ndb_autodiscover ," +" rpl_rotate_logs ," +" repair ," +" rpl_trunc_binlog ," +" mysqldump ," +" rpl000001 ," + +" derived ," +" group_by ," +" select ," +" rpl000015 ," +" subselect "; +#endif +static char ignore_test[FN_REFLEN]= ""; + +static char bin_dir[FN_REFLEN]; +static char mysql_test_dir[FN_REFLEN]; +static char test_dir[FN_REFLEN]; +static char mysql_tmp_dir[FN_REFLEN]; +static char result_dir[FN_REFLEN]; +static char master_dir[FN_REFLEN]; +static char slave_dir[FN_REFLEN]; +static char slave1_dir[FN_REFLEN]; +static char slave2_dir[FN_REFLEN]; +static char lang_dir[FN_REFLEN]; +static char char_dir[FN_REFLEN]; + +static char mysqladmin_file[FN_REFLEN]; +static char mysqld_file[FN_REFLEN]; +static char mysqltest_file[FN_REFLEN]; +#ifndef __WIN__ +static char master_pid[FN_REFLEN]; +static char slave_pid[FN_REFLEN]; +static char sh_file[FN_REFLEN]= "/bin/sh"; +#else +static HANDLE master_pid; +static HANDLE slave_pid; +#endif + +static char master_opt[FN_REFLEN]= ""; +static char slave_opt[FN_REFLEN]= ""; + +static char slave_master_info[FN_REFLEN]= ""; + +static char master_init_script[FN_REFLEN]= ""; +static char slave_init_script[FN_REFLEN]= ""; + +/* OpenSSL */ +static char ca_cert[FN_REFLEN]; +static char server_cert[FN_REFLEN]; +static char server_key[FN_REFLEN]; +static char client_cert[FN_REFLEN]; +static char client_key[FN_REFLEN]; + +int total_skip= 0; +int total_pass= 0; +int total_fail= 0; +int total_test= 0; + +int total_ignore= 0; + +int use_openssl= FALSE; +int master_running= FALSE; +int slave_running= FALSE; +int skip_slave= TRUE; +int single_test= TRUE; + +int restarts= 0; + +FILE *log_fd= NULL; + +static char argument[FN_REFLEN]; + +/****************************************************************************** + + functions + +******************************************************************************/ + +/****************************************************************************** + + prototypes + +******************************************************************************/ + +void report_stats(); +void install_db(char *); +void mysql_install_db(); +void start_master(); +void start_slave(); +void mysql_start(); +void stop_slave(); +void stop_master(); +void mysql_stop(); +void mysql_restart(); +int read_option(char *, char *); +void run_test(char *); +void setup(char *); +void vlog(const char *, va_list); +void mlog(const char *, ...); +void log_info(const char *, ...); +void log_error(const char *, ...); +void log_errno(const char *, ...); +void die(const char *); +char *str_tok(char* dest, char *string, const char *delim); +#ifndef __WIN__ +void run_init_script(const char *script_name); +#endif +/****************************************************************************** + + report_stats() + + Report the gathered statistics. + +******************************************************************************/ + +void report_stats() +{ + if (total_fail == 0) + { + mlog("\nAll %d test(s) were successful.\n", total_test); + } + else + { + double percent= ((double)total_pass / total_test) * 100; + + mlog("\nFailed %u/%u test(s), %.02f%% successful.\n", + total_fail, total_test, percent); + mlog("\nThe .out and .err files in %s may give you some\n", result_dir); + mlog("hint of what when wrong.\n"); + mlog("\nIf you want to report this error, please first read " + "the documentation\n"); + mlog("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n"); + } +} + +/****************************************************************************** + + install_db() + + Install the a database. + +******************************************************************************/ + +void install_db(char *datadir) +{ + arg_list_t al; + int err; + char input[FN_REFLEN]; + char output[FN_REFLEN]; + char error[FN_REFLEN]; + + /* input file */ +#ifdef __NETWARE__ + snprintf(input, FN_REFLEN, "%s/bin/init_db.sql", base_dir); +#else + snprintf(input, FN_REFLEN, "%s/mysql-test/init_db.sql", base_dir); +#endif + snprintf(output, FN_REFLEN, "%s/install.out", datadir); + snprintf(error, FN_REFLEN, "%s/install.err", datadir); + + if (create_system_files(datadir,input, TRUE)) + die("Unable to create init_db.sql."); + /* args */ + init_args(&al); + add_arg(&al, mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--bootstrap"); + add_arg(&al, "--skip-grant-tables"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--datadir=%s", datadir); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-ndbcluster"); + add_arg(&al, "--skip-bdb"); +#ifndef __NETWARE__ + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--language=%s", lang_dir); +#endif +// added + add_arg(&al, "--default-character-set=latin1"); + add_arg(&al, "--innodb_data_file_path=ibdata1:50M"); + + /* spawn */ + if ((err= spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) + { + die("Unable to create database."); + } + + /* free args */ + free_args(&al); +} + +/****************************************************************************** + + mysql_install_db() + + Install the test databases. + +******************************************************************************/ + +void mysql_install_db() +{ + char temp[FN_REFLEN]; + + /* var directory */ + snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir); + + /* create var directory */ +#ifndef __WIN__ + mkdir(temp, S_IRWXU); + /* create subdirectories */ + mlog("Creating test-suite folders...\n"); + snprintf(temp, FN_REFLEN, "%s/var/run", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/master-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); + + snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); + + snprintf(temp, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave1-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave1-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); + + snprintf(temp, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave2-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave2-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); +#else + mkdir(temp); + /* create subdirectories */ + mlog("Creating test-suite folders...\n"); + snprintf(temp, FN_REFLEN, "%s/var/run", mysql_test_dir); + mkdir(temp); + snprintf(temp, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + mkdir(temp); + snprintf(temp, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + mkdir(temp); + snprintf(temp, FN_REFLEN, "%s/var/master-data/mysql", mysql_test_dir); + mkdir(temp); + snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir); + mkdir(temp); + snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + mkdir(temp); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir); + mkdir(temp); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir); + mkdir(temp); +#endif + + /* install databases */ + mlog("Creating test databases for master... \n"); + install_db(master_dir); + mlog("Creating test databases for slave... \n"); + install_db(slave_dir); + install_db(slave1_dir); + install_db(slave2_dir); +} + +/****************************************************************************** + + start_master() + + Start the master server. + +******************************************************************************/ + +void start_master() +{ + arg_list_t al; + int err; + char master_out[FN_REFLEN]; + char master_err[FN_REFLEN]; + char temp2[FN_REFLEN]; + + /* remove old berkeley db log files that can confuse the server */ + removef("%s/log.*", master_dir); + + /* remove stale binary logs */ + removef("%s/var/log/*-bin.*", mysql_test_dir); + + /* remove stale binary logs */ + removef("%s/var/log/*.index", mysql_test_dir); + + /* remove master.info file */ + removef("%s/master.info", master_dir); + + /* remove relay files */ + removef("%s/var/log/*relay*", mysql_test_dir); + + /* remove relay-log.info file */ + removef("%s/relay-log.info", master_dir); + + /* init script */ + if (master_init_script[0] != 0) + { +#ifdef __NETWARE__ + /* TODO: use the scripts */ + if (strinstr(master_init_script, "repair_part2-master.sh") != 0) + { + FILE *fp; + + /* create an empty index file */ + snprintf(temp, FN_REFLEN, "%s/test/t1.MYI", master_dir); + fp= fopen(temp, "wb+"); + + fputs("1", fp); + + fclose(fp); + } +#elif !defined(__WIN__) + run_init_script(master_init_script); +#endif + } + + /* redirection files */ + snprintf(master_out, FN_REFLEN, "%s/var/run/master%u.out", + mysql_test_dir, restarts); + snprintf(master_err, FN_REFLEN, "%s/var/run/master%u.err", + mysql_test_dir, restarts); +#ifndef __WIN__ + snprintf(temp2,FN_REFLEN,"%s/var",mysql_test_dir); + mkdir(temp2,S_IRWXU); + snprintf(temp2,FN_REFLEN,"%s/var/log",mysql_test_dir); + mkdir(temp2,S_IRWXU); +#else + snprintf(temp2,FN_REFLEN,"%s/var",mysql_test_dir); + mkdir(temp2); + snprintf(temp2,FN_REFLEN,"%s/var/log",mysql_test_dir); + mkdir(temp2); +#endif + /* args */ + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=%s/var/log/master-bin",mysql_test_dir); + add_arg(&al, "--server-id=1"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--port=%u", master_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s",master_socket); +#endif + add_arg(&al, "--local-infile"); + add_arg(&al, "--core"); + add_arg(&al, "--datadir=%s", master_dir); +#ifndef __WIN__ + add_arg(&al, "--pid-file=%s", master_pid); +#endif + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); + + add_arg(&al, "--rpl-recovery-rank=1"); + add_arg(&al, "--init-rpl-role=master"); + add_arg(&al, "--default-character-set=latin1"); +// add_arg(&al, "--innodb_data_file_path=ibdata1:50M"); +#ifdef DEBUG /* only for debug builds */ + add_arg(&al, "--debug"); +#endif + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", server_cert); + add_arg(&al, "--ssl-key=%s", server_key); + } + + /* $MASTER_40_ARGS */ + add_arg(&al, "--rpl-recovery-rank=1"); + add_arg(&al, "--init-rpl-role=master"); + + /* $SMALL_SERVER */ + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); + + /* $EXTRA_MASTER_OPT */ + if (master_opt[0] != 0) + { + char *p; + + p= (char *)str_tok(argument, master_opt, " \t"); + if (!strstr(master_opt, "timezone")) + { + while (p) + { + add_arg(&al, "%s", p); + p= (char *)str_tok(argument, NULL, " \t"); + } + } + } + + /* remove the pid file if it exists */ +#ifndef __WIN__ + remove(master_pid); +#endif + + /* spawn */ +#ifdef __WIN__ + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + master_out, master_err, &master_pid)) == 0) +#else + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + master_out, master_err, master_pid)) == 0) +#endif + { + sleep_until_file_exists(master_pid); + + if ((err= wait_for_server_start(bin_dir, mysqladmin_file, user, password, + master_port, mysql_tmp_dir)) == 0) + { + master_running= TRUE; + } + else + { + log_error("The master server went down early."); + } + } + else + { + log_error("Unable to start master server."); + } + + /* free_args */ + free_args(&al); +} + +/****************************************************************************** + + start_slave() + + Start the slave server. + +******************************************************************************/ + +void start_slave() +{ + arg_list_t al; + int err; + char slave_out[FN_REFLEN]; + char slave_err[FN_REFLEN]; + + /* skip? */ + if (skip_slave) return; + + /* remove stale binary logs */ + removef("%s/*-bin.*", slave_dir); + + /* remove stale binary logs */ + removef("%s/*.index", slave_dir); + + /* remove master.info file */ + removef("%s/master.info", slave_dir); + + /* remove relay files */ + removef("%s/var/log/*relay*", mysql_test_dir); + + /* remove relay-log.info file */ + removef("%s/relay-log.info", slave_dir); + + /* init script */ + if (slave_init_script[0] != 0) + { +#ifdef __NETWARE__ + /* TODO: use the scripts */ + if (strinstr(slave_init_script, "rpl000016-slave.sh") != 0) + { + /* create empty master.info file */ + snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir); + close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); + } + else if (strinstr(slave_init_script, "rpl000017-slave.sh") != 0) + { + FILE *fp; + + /* create a master.info file */ + snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir); + fp= fopen(temp, "wb+"); + + fputs("master-bin.000001\n", fp); + fputs("4\n", fp); + fputs("127.0.0.1\n", fp); + fputs("replicate\n", fp); + fputs("aaaaaaaaaaaaaaab\n", fp); + fputs("9306\n", fp); + fputs("1\n", fp); + fputs("0\n", fp); + + fclose(fp); + } + else if (strinstr(slave_init_script, "rpl_rotate_logs-slave.sh") != 0) + { + /* create empty master.info file */ + snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir); + close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); + } +#elif !defined(__WIN__) + run_init_script(slave_init_script); +#endif + } + + /* redirection files */ + snprintf(slave_out, FN_REFLEN, "%s/var/run/slave%u.out", + mysql_test_dir, restarts); + snprintf(slave_err, FN_REFLEN, "%s/var/run/slave%u.err", + mysql_test_dir, restarts); + + /* args */ + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=slave-bin"); + add_arg(&al, "--relay_log=slave-relay-bin"); + add_arg(&al, "--basedir=%s", base_dir); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s",slave_socket); +#endif + add_arg(&al, "--port=%u", slave_port); + add_arg(&al, "--datadir=%s", slave_dir); +#ifndef __WIN__ + add_arg(&al, "--pid-file=%s", slave_pid); +#endif + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--core"); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); + + add_arg(&al, "--exit-info=256"); + add_arg(&al, "--log-slave-updates"); + add_arg(&al, "--init-rpl-role=slave"); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-slave-start"); + add_arg(&al, "--slave-load-tmpdir=../../var/tmp"); + + add_arg(&al, "--report-user=%s", user); + add_arg(&al, "--report-host=127.0.0.1"); + add_arg(&al, "--report-port=%u", slave_port); + + add_arg(&al, "--master-retry-count=10"); + add_arg(&al, "-O"); + add_arg(&al, "slave_net_timeout=10"); + add_arg(&al, "--log-slave-updates"); + add_arg(&al, "--log=%s/var/log/slave.log", mysql_test_dir); + add_arg(&al, "--default-character-set=latin1"); + add_arg(&al, "--skip-ndbcluster"); + +#ifdef DEBUG /* only for debug builds */ + add_arg(&al, "--debug"); +#endif + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", server_cert); + add_arg(&al, "--ssl-key=%s", server_key); + } + + /* slave master info */ + if (slave_master_info[0] != 0) + { + char *p; + + p= (char *)str_tok(argument, slave_master_info, " \t"); + + while (p) + { + add_arg(&al, "%s", p); + p= (char *)str_tok(argument, NULL, " \t"); + } + } + else + { + add_arg(&al, "--master-user=%s", user); + add_arg(&al, "--master-password=%s", password); + add_arg(&al, "--master-host=127.0.0.1"); + add_arg(&al, "--master-port=%u", master_port); + add_arg(&al, "--master-connect-retry=1"); + add_arg(&al, "--server-id=2"); + add_arg(&al, "--rpl-recovery-rank=2"); + } + + /* small server */ + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); + + + /* opt args */ + if (slave_opt[0] != 0) + { + char *p; + + p= (char *)str_tok(argument, slave_opt, " \t"); + + while (p) + { + add_arg(&al, "%s", p); + p= (char *)str_tok(argument, NULL, " \t"); + } + } + + /* remove the pid file if it exists */ +#ifndef __WIN__ + remove(slave_pid); +#endif + /* spawn */ +#ifdef __WIN__ + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + slave_out, slave_err, &slave_pid)) == 0) +#else + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + slave_out, slave_err, slave_pid)) == 0) +#endif + { + sleep_until_file_exists(slave_pid); + + if ((err= wait_for_server_start(bin_dir, mysqladmin_file, user, password, + slave_port, mysql_tmp_dir)) == 0) + { + slave_running= TRUE; + } + else + { + log_error("The slave server went down early."); + } + } + else + { + log_error("Unable to start slave server."); + } + + /* free args */ + free_args(&al); +} + +/****************************************************************************** + + mysql_start() + + Start the mysql servers. + +******************************************************************************/ + +void mysql_start() +{ + + + printf("loading master...\r"); + start_master(); + + printf("loading slave...\r"); + start_slave(); + + /* activate the test screen */ +#ifdef __NETWARE__ + ActivateScreen(getscreenhandle()); +#endif +} + +/****************************************************************************** + + stop_slave() + + Stop the slave server. + +******************************************************************************/ + +void stop_slave() +{ + int err; + + /* running? */ + if (!slave_running) return; + + /* stop */ + if ((err= stop_server(bin_dir, mysqladmin_file, user, password, + slave_port, slave_pid, mysql_tmp_dir)) == 0) + { + slave_running= FALSE; + } + else + { + log_error("Unable to stop slave server."); + } +} + +/****************************************************************************** + + stop_master() + + Stop the master server. + +******************************************************************************/ + +void stop_master() +{ + int err; + + /* running? */ + if (!master_running) return; + + if ((err= stop_server(bin_dir, mysqladmin_file, user, password, + master_port, master_pid, mysql_tmp_dir)) == 0) + { + master_running= FALSE; + } + else + { + log_error("Unable to stop master server."); + } +} + +/****************************************************************************** + + mysql_stop() + + Stop the mysql servers. + +******************************************************************************/ + +void mysql_stop() +{ + + stop_master(); + + stop_slave(); + + /* activate the test screen */ +#ifdef __NETWARE__ + ActivateScreen(getscreenhandle()); +#endif +} + +/****************************************************************************** + + mysql_restart() + + Restart the mysql servers. + +******************************************************************************/ + +void mysql_restart() +{ +/* log_info("Restarting the MySQL server(s): %u", ++restarts); */ + + mysql_stop(); + + mlog(DASH); + sleep(1); + + mysql_start(); +} + +/****************************************************************************** + + read_option() + + Read the option file. + +******************************************************************************/ + +int read_option(char *opt_file, char *opt) +{ + int fd, err; + char *p; + char buf[FN_REFLEN]; + + /* copy current option */ + strncpy(buf, opt, FN_REFLEN); + + /* open options file */ + fd= open(opt_file, O_RDONLY); + err= read(fd, opt, FN_REFLEN); + close(fd); + + if (err > 0) + { + /* terminate string */ + if ((p= strchr(opt, '\n')) != NULL) + { + *p= 0; + + /* check for a '\r' */ + if ((p= strchr(opt, '\r')) != NULL) + { + *p= 0; + } + } + else + { + opt[err]= 0; + } + + /* check for $MYSQL_TEST_DIR */ + if ((p= strstr(opt, "$MYSQL_TEST_DIR")) != NULL) + { + char temp[FN_REFLEN]; + + *p= 0; + + strcpy(temp, p + strlen("$MYSQL_TEST_DIR")); + strcat(opt, mysql_test_dir); + strcat(opt, temp); + } + /* Check for double backslash and replace it with single bakslash */ + if ((p= strstr(opt, "\\\\")) != NULL) + { + /* bmove is guranteed to work byte by byte */ + bmove(p, p+1, strlen(p)+1); + } + } + else + { + /* clear option */ + *opt= 0; + } + + /* compare current option with previous */ + return strcmp(opt, buf); +} + +/****************************************************************************** + + run_test() + + Run the given test case. + +******************************************************************************/ + +void run_test(char *test) +{ + char temp[FN_REFLEN]; + const char *rstr; + int skip= FALSE, ignore=FALSE; + int restart= FALSE; + int flag= FALSE; + struct stat info; + + /* skip tests in the skip list */ + snprintf(temp, FN_REFLEN, " %s ", test); + skip= (strinstr(skip_test, temp) != 0); + if (skip == FALSE) + ignore= (strinstr(ignore_test, temp) != 0); + + snprintf(master_init_script, FN_REFLEN, "%s/%s-master.sh", test_dir, test); + snprintf(slave_init_script, FN_REFLEN, "%s/%s-slave.sh", test_dir, test); +#ifdef __WIN__ + if (! stat(master_init_script, &info)) + skip= TRUE; + if (!stat(slave_init_script, &info)) + skip= TRUE; +#endif + if (ignore) + { + /* show test */ + mlog("%-46s ", test); + + /* ignore */ + rstr= TEST_IGNORE; + ++total_ignore; + } + else if (!skip) /* skip test? */ + { + char test_file[FN_REFLEN]; + char master_opt_file[FN_REFLEN]; + char slave_opt_file[FN_REFLEN]; + char slave_master_info_file[FN_REFLEN]; + char result_file[FN_REFLEN]; + char reject_file[FN_REFLEN]; + char out_file[FN_REFLEN]; + char err_file[FN_REFLEN]; + int err; + arg_list_t al; + /* skip slave? */ + flag= skip_slave; + skip_slave= (strncmp(test, "rpl", 3) != 0); + if (flag != skip_slave) restart= TRUE; + + /* create files */ + snprintf(master_opt_file, FN_REFLEN, "%s/%s-master.opt", test_dir, test); + snprintf(slave_opt_file, FN_REFLEN, "%s/%s-slave.opt", test_dir, test); + snprintf(slave_master_info_file, FN_REFLEN, "%s/%s.slave-mi", + test_dir, test); + snprintf(reject_file, FN_REFLEN, "%s/%s%s", + result_dir, test, REJECT_SUFFIX); + snprintf(out_file, FN_REFLEN, "%s/%s%s", result_dir, test, OUT_SUFFIX); + snprintf(err_file, FN_REFLEN, "%s/%s%s", result_dir, test, ERR_SUFFIX); + + /* netware specific files */ + snprintf(test_file, FN_REFLEN, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX); + if (stat(test_file, &info)) + { + snprintf(test_file, FN_REFLEN, "%s/%s%s", test_dir, test, TEST_SUFFIX); + if (access(test_file,0)) + { + printf("Invalid test name %s, %s file not found\n",test,test_file); + return; + } + } + + snprintf(result_file, FN_REFLEN, "%s/%s%s", + result_dir, test, NW_RESULT_SUFFIX); + if (stat(result_file, &info)) + { + snprintf(result_file, FN_REFLEN, "%s/%s%s", + result_dir, test, RESULT_SUFFIX); + } + + /* init scripts */ + if (stat(master_init_script, &info)) + master_init_script[0]= 0; + else + restart= TRUE; + + if (stat(slave_init_script, &info)) + slave_init_script[0]= 0; + else + restart= TRUE; + + /* read options */ + if (read_option(master_opt_file, master_opt)) restart= TRUE; + if (read_option(slave_opt_file, slave_opt)) restart= TRUE; + if (read_option(slave_master_info_file, slave_master_info)) restart= TRUE; + + /* cleanup previous run */ + remove(reject_file); + remove(out_file); + remove(err_file); + + /* start or restart? */ + if (!master_running) mysql_start(); + else if (restart) mysql_restart(); + + /* show test */ + mlog("%-46s ", test); + + /* args */ + init_args(&al); + add_arg(&al, "%s", mysqltest_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", master_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s", master_socket); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); +#endif + add_arg(&al, "--database=%s", db); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "--silent"); + add_arg(&al, "--basedir=%s/", mysql_test_dir); + add_arg(&al, "--host=127.0.0.1"); + add_arg(&al, "--skip-safemalloc"); + add_arg(&al, "-v"); + add_arg(&al, "-R"); + add_arg(&al, "%s", result_file); + + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", client_cert); + add_arg(&al, "--ssl-key=%s", client_key); + } + + /* spawn */ + err= spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); + /* free args */ + free_args(&al); + + remove_empty_file(out_file); + remove_empty_file(err_file); + + if (err == 0) + { + /* pass */ + rstr= TEST_PASS; + ++total_pass; + + /* increment total */ + ++total_test; + } + else if (err == 2) + { + /* skip */ + rstr= TEST_SKIP; + ++total_skip; + } + else if (err == 1) + { + /* fail */ + rstr= TEST_FAIL; + ++total_fail; + + /* increment total */ + ++total_test; + } + else + { + rstr= TEST_BAD; + } + } + else /* early skips */ + { + /* show test */ + mlog("%-46s ", test); + + /* skip */ + rstr= TEST_SKIP; + ++total_skip; + } + + /* result */ + mlog("%-14s\n", rstr); +} + +/****************************************************************************** + + vlog() + + Log the message. + +******************************************************************************/ + +void vlog(const char *format, va_list ap) +{ + vfprintf(stdout, format, ap); + fflush(stdout); + + if (log_fd) + { + vfprintf(log_fd, format, ap); + fflush(log_fd); + } +} + +/****************************************************************************** + + log() + + Log the message. + +******************************************************************************/ + +void mlog(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + vlog(format, ap); + + va_end(ap); +} + +/****************************************************************************** + + log_info() + + Log the given information. + +******************************************************************************/ + +void log_info(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- INFO : "); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + log_error() + + Log the given error. + +******************************************************************************/ + +void log_error(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- ERROR: "); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + log_errno() + + Log the given error and errno. + +******************************************************************************/ + +void log_errno(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- ERROR: (%003u) ", errno); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + die() + + Exit the application. + +******************************************************************************/ + +void die(const char *msg) +{ + log_error(msg); +#ifdef __NETWARE__ + pressanykey(); +#endif + exit(-1); +} + +/****************************************************************************** + + setup() + + Setup the mysql test enviornment. + +******************************************************************************/ + +void setup(char *file __attribute__((unused))) +{ + char temp[FN_REFLEN]; +#if defined(__WIN__) || defined(__NETWARE__) + char file_path[FN_REFLEN*2]; +#endif + char *p; + int position; + + /* set the timezone for the timestamp test */ +#ifdef __WIN__ + _putenv( "TZ=GMT-3" ); +#else + putenv((char *)"TZ=GMT-3"); +#endif + /* find base dir */ +#ifdef __NETWARE__ + strcpy(temp, strlwr(file)); + while ((p= strchr(temp, '\\')) != NULL) *p= '/'; +#else + getcwd(temp, FN_REFLEN); + position= strlen(temp); + temp[position]= '/'; + temp[position+1]= 0; +#ifdef __WIN__ + while ((p= strchr(temp, '\\')) != NULL) *p= '/'; +#endif +#endif + + if ((position= strinstr(temp, "/mysql-test/")) != 0) + { + p= temp + position - 1; + *p= 0; + strcpy(base_dir, temp); + } + + log_info("Currect directory: %s",base_dir); + +#ifdef __NETWARE__ + /* setup paths */ + snprintf(bin_dir, FN_REFLEN, "%s/bin", base_dir); + snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir); + snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); + snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, FN_REFLEN, "%s/share/english", base_dir); + snprintf(char_dir, FN_REFLEN, "%s/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl= TRUE; +#endif /* HAVE_OPENSSL */ + + /* OpenSSL paths */ + snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); + + /* setup files */ + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld", bin_dir); + snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin", bin_dir); + snprintf(master_pid, FN_REFLEN, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, FN_REFLEN, "%s/var/run/slave.pid", mysql_test_dir); +#elif __WIN__ + /* setup paths */ +#ifdef _DEBUG + snprintf(bin_dir, FN_REFLEN, "%s/client_debug", base_dir); +#else + snprintf(bin_dir, FN_REFLEN, "%s/client_release", base_dir); +#endif + snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir); + snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); + snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, FN_REFLEN, "%s/share/english", base_dir); + snprintf(char_dir, FN_REFLEN, "%s/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl= TRUE; +#endif /* HAVE_OPENSSL */ + + /* OpenSSL paths */ + snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); + + /* setup files */ +#ifdef _DEBUG + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld-debug.exe", bin_dir); +#else + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld.exe", bin_dir); +#endif + snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest.exe", bin_dir); + snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin.exe", bin_dir); +#else + /* setup paths */ + snprintf(bin_dir, FN_REFLEN, "%s/client", base_dir); + snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir); + snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); + snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(slave1_dir, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir); + snprintf(slave2_dir, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir); + snprintf(lang_dir, FN_REFLEN, "%s/sql/share/english", base_dir); + snprintf(char_dir, FN_REFLEN, "%s/sql/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl= TRUE; +#endif /* HAVE_OPENSSL */ + + /* OpenSSL paths */ + snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); + + /* setup files */ + snprintf(mysqld_file, FN_REFLEN, "%s/sql/mysqld", base_dir); + snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin", bin_dir); + snprintf(master_pid, FN_REFLEN, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, FN_REFLEN, "%s/var/run/slave.pid", mysql_test_dir); + + snprintf(master_socket,FN_REFLEN, "%s/var/tmp/master.sock", mysql_test_dir); + snprintf(slave_socket,FN_REFLEN, "%s/var/tmp/slave.sock", mysql_test_dir); + +#endif + /* create log file */ + snprintf(temp, FN_REFLEN, "%s/mysql-test-run.log", mysql_test_dir); + if ((log_fd= fopen(temp, "w+")) == NULL) + { + log_errno("Unable to create log file."); + } + + /* prepare skip test list */ + while ((p= strchr(skip_test, ',')) != NULL) *p= ' '; + strcpy(temp, strlwr(skip_test)); + snprintf(skip_test, FN_REFLEN, " %s ", temp); + + /* environment */ +#ifdef __NETWARE__ + setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); + snprintf(file_path, FN_REFLEN*2, + "%s/client/mysqldump --no-defaults -u root --port=%u", + bin_dir, master_port); + setenv("MYSQL_DUMP", file_path, 1); + snprintf(file_path, FN_REFLEN*2, + "%s/client/mysqlbinlog --no-defaults --local-load=%s", + bin_dir, mysql_tmp_dir); + setenv("MYSQL_BINLOG", file_path, 1); +#elif __WIN__ + snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir); + _putenv(file_path); + snprintf(file_path, FN_REFLEN*2, + "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -uroot --port=%u", + bin_dir, master_port); + _putenv(file_path); + snprintf(file_path, FN_REFLEN*2, + "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", + bin_dir, mysql_tmp_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "TESTS_BINDIR=%s/tests", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "CHARSETSDIR=%s/sql/share/charsets", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL=%s/mysql --port=%u ", + bin_dir, master_port); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults " + "--host=localhost --port=%u " + "--basedir=%s --bindir=%s --verbose", + base_dir,master_port, base_dir, bin_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "NDB_TOOLS_DIR=%s/ndb/tools", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "CLIENT_BINDIR=%s", bin_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --port=%u --silent", + base_dir, master_port); + _putenv(file_path); + +#else + { + static char env_MYSQL_TEST_DIR[FN_REFLEN*2]; + static char env_MYSQL_DUMP[FN_REFLEN*2]; + static char env_MYSQL_BINLOG[FN_REFLEN*2]; + static char env_MASTER_MYSOCK[FN_REFLEN*2]; + static char env_TESTS_BINDIR[FN_REFLEN*2]; + static char env_CHARSETSDIR[FN_REFLEN*2]; + static char env_MYSQL[FN_REFLEN*2]; + static char env_MYSQL_FIX_SYSTEM_TABLES[FN_REFLEN*2]; + static char env_NDB_TOOLS_DIR[FN_REFLEN*2]; + static char env_CLIENT_BINDIR[FN_REFLEN*2]; + static char env_MYSQL_CLIENT_TEST[FN_REFLEN*2]; + + snprintf(env_MYSQL_TEST_DIR,FN_REFLEN*2, + "MYSQL_TEST_DIR=%s",mysql_test_dir); + putenv(env_MYSQL_TEST_DIR); + + snprintf(env_MYSQL_DUMP, FN_REFLEN*2,"MYSQL_DUMP=%s/mysqldump --no-defaults " + "-uroot --port=%u --socket=%s ", + bin_dir, master_port, master_socket); + putenv(env_MYSQL_DUMP); + + snprintf(env_MYSQL_BINLOG, FN_REFLEN*2, + "MYSQL_BINLOG=%s/mysqlbinlog --no-defaults --local-load=%s -uroot ", + bin_dir, mysql_tmp_dir); + putenv(env_MYSQL_BINLOG); + + snprintf(env_MASTER_MYSOCK, FN_REFLEN*2, + "MASTER_MYSOCK=%s", master_socket); + putenv(env_MASTER_MYSOCK); + + snprintf(env_TESTS_BINDIR, FN_REFLEN*2, + "TESTS_BINDIR=%s/tests", base_dir); + putenv(env_TESTS_BINDIR); + + snprintf(env_CHARSETSDIR, FN_REFLEN*2, + "CHARSETSDIR=%s/sql/share/charsets", base_dir); + putenv(env_CHARSETSDIR); + + snprintf(env_MYSQL, FN_REFLEN*2, + "MYSQL=%s/mysql --port=%u --socket=%s -uroot ", + bin_dir, master_port, master_socket); + putenv(env_MYSQL); + + snprintf(env_MYSQL_FIX_SYSTEM_TABLES, FN_REFLEN*2, + "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults " + "--host=localhost --port=%u --socket=%s " + "--basedir=%s --bindir=%s --verbose -uroot ", + base_dir,master_port, master_socket, base_dir, bin_dir); + putenv(env_MYSQL_FIX_SYSTEM_TABLES); + + snprintf(env_NDB_TOOLS_DIR, FN_REFLEN*2, + "NDB_TOOLS_DIR=%s/ndb/tools", base_dir); + putenv(env_NDB_TOOLS_DIR); + + snprintf(env_CLIENT_BINDIR, FN_REFLEN*2, + "CLIENT_BINDIR=%s", bin_dir); + putenv(env_CLIENT_BINDIR); + + snprintf(env_MYSQL_CLIENT_TEST, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --socket=%s --port=%u --silent", + base_dir, master_socket, master_port); + putenv(env_MYSQL_CLIENT_TEST); + + } + +#endif + +#ifndef __WIN__ + putenv((char *)"MASTER_MYPORT=9306"); + putenv((char *)"SLAVE_MYPORT=9307"); + putenv((char *)"MYSQL_TCP_PORT=3306"); + +#else + _putenv("MASTER_MYPORT=9306"); + _putenv("SLAVE_MYPORT=9307"); + _putenv("MYSQL_TCP_PORT=3306"); +#endif + +} + +/* + Compare names of testes for right order +*/ +int compare( const void *arg1, const void *arg2 ) +{ + return sting_compare_func( * ( char** ) arg1, * ( char** ) arg2 ); +} + + + +/****************************************************************************** + + main() + +******************************************************************************/ + +int main(int argc, char **argv) +{ + int is_ignore_list= 0; + char **names= 0; + char **testes= 0; + int name_index; + int index; + char var_dir[FN_REFLEN]; + /* setup */ + setup(argv[0]); + + /* delete all file in var */ + snprintf(var_dir,FN_REFLEN,"%s/var",mysql_test_dir); + del_tree(var_dir); + + /* + The --ignore option is comma saperated list of test cases to skip and + should be very first command line option to the test suite. + + The usage is now: + mysql_test_run --ignore=test1,test2 test3 test4 + where test1 and test2 are test cases to ignore + and test3 and test4 are test cases to run. + */ + if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1)) + { + char *temp, *token; + temp= strdup(strchr(argv[1],'=') + 1); + for (token=str_tok(argument, temp, ","); token != NULL; + token=str_tok(argument, NULL, ",")) + { + if (strlen(ignore_test) + strlen(token) + 2 <= FN_REFLEN-1) + sprintf(ignore_test+strlen(ignore_test), " %s ", token); + else + { + free(temp); + die("ignore list too long."); + } + } + free(temp); + is_ignore_list= 1; + } + /* header */ +#ifndef __WIN__ + mlog("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); +#else + mlog("MySQL Server ---, for %s (%s)\n\n", SYSTEM_TYPE, MACHINE_TYPE); +#endif + + mlog("Initializing Tests...\n"); + + /* install test databases */ + mysql_install_db(); + + mlog("Starting Tests...\n"); + + mlog("\n"); + mlog(HEADER); + mlog(DASH); + + if ( argc > 1 + is_ignore_list ) + { + int i; + + /* single test */ + single_test= TRUE; + + for (i= 1 + is_ignore_list; i < argc; i++) + { + /* run given test */ + run_test(argv[i]); + } + } + else + { + /* run all tests */ + testes= malloc(MAX_COUNT_TESTES*sizeof(void*)); + if (!testes) + die("can not allcate memory for sorting"); + names= testes; + name_index= 0; +#ifndef __WIN__ + struct dirent *entry; + DIR *parent; + char test[FN_LEN]; + int position; + + /* FIXME are we sure the list is sorted if using readdir()? */ + if ((parent= opendir(test_dir)) == NULL) /* Not thread safe */ + die("Unable to open tests directory."); + else + { + while ((entry= readdir(parent)) != NULL) /* Not thread safe */ + { + strcpy(test, strlwr(entry->d_name)); + /* find the test suffix */ + if ((position= strinstr(test, TEST_SUFFIX)) != 0) + { + if (name_index < MAX_COUNT_TESTES) + { + /* null terminate at the suffix */ + *(test + position - 1)= '\0'; + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; + } + else + die("can not sort files, array is overloaded"); + } + } + closedir(parent); + } +#else + { + struct _finddata_t dir; + int* handle; + char test[FN_LEN]; + char mask[FN_REFLEN]; + char *p; + int position; + + /* single test */ + single_test= FALSE; + + snprintf(mask,FN_REFLEN,"%s/*.test",test_dir); + + if ((handle=_findfirst(mask,&dir)) == -1L) + { + die("Unable to open tests directory."); + } + + + do + { + if (!(dir.attrib & _A_SUBDIR)) + { + strcpy(test, strlwr(dir.name)); + + /* find the test suffix */ + if ((position= strinstr(test, TEST_SUFFIX)) != 0) + { + if (name_index < MAX_COUNT_TESTES) + { + /* null terminate at the suffix */ + *(test + position - 1)= '\0'; + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; + } + else + die("can not sort files, array is overloaded"); + } + } + }while (_findnext(handle,&dir) == 0); + + _findclose(handle); + } +#endif + qsort( (void *)testes, name_index, sizeof( char * ), compare ); + + for (index= 0; index < name_index; index++) + { + run_test(testes[index]); + free(testes[index]); + } + + free(testes); + } + + /* stop server */ + mysql_stop(); + + mlog(DASH); + mlog("\n"); + + mlog("Ending Tests...\n"); + + /* report stats */ + report_stats(); + + /* close log */ + if (log_fd) fclose(log_fd); + + /* keep results up */ +#ifdef __NETWARE__ + pressanykey(); +#endif + return 0; +} + + +/* + Synopsis: + This function breaks the string into a sequence of tokens. The difference + between this function and strtok is that it respects the quoted string i.e. + it skips any delimiter character within the quoted part of the string. + It return tokens by eliminating quote character. It modifies the input string + passed. It will work with whitespace delimeter but may not work properly with + other delimeter. If the delimeter will contain any quote character, then + function will not tokenize and will return null string. + e.g. if input string is + --init-slave="set global max_connections=500" --skip-external-locking + then the output will two string i.e. + --init-slave=set global max_connections=500 + --skip-external-locking + +Arguments: + string: input string + delim: set of delimiter character +Output: + return the null terminated token of NULL. +*/ +char *str_tok(char* dest, char *string, const char *delim) +{ + char *token; + char *ptr_end_token= NULL; + char *ptr_quote= NULL; + char *ptr_token= NULL; + int count_quotes= 0; + + *dest = '\0'; + if (strchr(delim,'\'') || strchr(delim,'\"')) + return NULL; + + token= (char*)strtok(string, delim); + if (token) + { + /* double quote is found */ + if (strchr(token,'\"')) + { + do + { + if (count_quotes & 1) + { + if (*dest == '\0') + sprintf(dest,"%s", ptr_token); + else + sprintf(dest,"%s %s", dest, ptr_token); + ptr_token= (char*)strtok(NULL, delim); + if (!ptr_token) + break; + } + else + { + ptr_token= token; + } + if (ptr_quote = strchr(ptr_token,'\"')) + { + ptr_end_token= ptr_token + strlen(ptr_token); + do + { +#ifndef __WIN__ + bmove(ptr_quote, ptr_quote+1, ptr_end_token - ptr_quote); +#endif + count_quotes++; + } while (ptr_quote != NULL && (ptr_quote = strchr(ptr_quote+1,'\"'))); + } + /* there are unpair quotes we have to search next quote*/ + } while (count_quotes & 1); + if (ptr_token != NULL) + { + if (*dest == '\0') + sprintf(dest,"%s", ptr_token); + else + sprintf(dest,"%s %s",dest,ptr_token); + } + } + else + { + sprintf(dest,"%s",token); + } + } + return token ? dest : NULL; +} + +#ifndef __WIN__ +/* + Synopsis: + This function run scripts files on Linux and Netware + +Arguments: + script_name: name of script file + +Output: + nothing +*/ + +void run_init_script(const char *script_name) +{ + arg_list_t al; + int err; + + /* args */ + init_args(&al); + add_arg(&al, sh_file); + add_arg(&al, script_name); + + /* spawn */ + if ((err= spawn(sh_file, &al, TRUE, NULL, NULL, NULL, NULL)) != 0) + { + die("Unable to run script."); + } + + /* free args */ + free_args(&al); +} +#endif diff --git a/mysql-test/ndb/Makefile.am b/mysql-test/ndb/Makefile.am index 3ed222344a6..502ccee099e 100644 --- a/mysql-test/ndb/Makefile.am +++ b/mysql-test/ndb/Makefile.am @@ -13,6 +13,8 @@ SUFFIXES = .sh .sh: @RM@ -f $@ $@-t @SED@ \ + -e 's!@''ndb_port''@!$(ndb_port)!g' \ + -e 's!@''ndb_port_base''@!$(ndb_port_base)!g' \ -e 's!@''ndbbindir''@!$(ndbbindir)!g' \ -e 's!@''ndbtoolsdir''@!$(ndbtoolsdir)!g' \ $< > $@-t diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result new file mode 100644 index 00000000000..5ebd20a7f83 --- /dev/null +++ b/mysql-test/ndb/basic.result @@ -0,0 +1,69 @@ +-- NDB Cluster -- Management Client -- +--------------------------------------------------------------------------- + NDB Cluster -- Management Client -- Help +--------------------------------------------------------------------------- +HELP Print help text +HELP SHOW Help for SHOW command +HELP DEBUG Help for debug compiled version +SHOW Print information about cluster +START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED] + Start backup (default WAIT COMPLETED) +ABORT BACKUP <backup id> Abort backup +SHUTDOWN Shutdown all processes in cluster +CLUSTERLOG ON [<severity>] ... Enable Cluster logging +CLUSTERLOG OFF [<severity>] ... Disable Cluster logging +CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off +CLUSTERLOG INFO Print cluster log information +<id> START Start DB node (started with -n) +<id> RESTART [-n] [-i] Restart DB node +<id> STOP Stop DB node +ENTER SINGLE USER MODE <api-node> Enter single user mode +EXIT SINGLE USER MODE Exit single user mode +<id> STATUS Print status +<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log +PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server +CONNECT [<connectstring>] Connect to management server (reconnect if already connected) +QUIT Quit management client + +<severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG +<category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | GREP | DEBUG | BACKUP +<level> = 0 - 15 +<id> = ALL | Any database node id + +Connected to Management Server at: localhost:1186 +Node 1: started (Version 4.1.9) +Node 2: started (Version 4.1.9) + +Node 1: started (Version 4.1.9) + +Node 2: started (Version 4.1.9) + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Cluster logging is disabled +Cluster logging is enabled. +Cluster logging is disabled +ALL disabled +ALL enabled diff --git a/mysql-test/ndb/basic.test b/mysql-test/ndb/basic.test new file mode 100644 index 00000000000..945bda94ff6 --- /dev/null +++ b/mysql-test/ndb/basic.test @@ -0,0 +1,17 @@ +help +all status +1 status +2 status +all clusterlog connection=8 +all clusterlog startup=7 +all clusterlog checkpoint=7 +all clusterlog noderestart=15 +all clusterlog statistics=7 +all clusterlog error=7 +all clusterlog info=7 +all clusterlog backup=15 +clusterlog off +clusterlog toggle +clusterlog off +clusterlog off all +clusterlog on all diff --git a/mysql-test/ndb/basic_log.result b/mysql-test/ndb/basic_log.result new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/mysql-test/ndb/basic_log.result diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index 8c89d2aa2cc..c831a5c7ffa 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -9,13 +9,13 @@ DataDir= CHOOSE_FILESYSTEM MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes [ndbd] -HostName= CHOOSE_HOSTNAME_1 +HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress [ndbd] -HostName= CHOOSE_HOSTNAME_2 +HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress [ndb_mgmd] -DataDir= CHOOSE_FILESYSTEM +DataDir= CHOOSE_FILESYSTEM # PortNumber= CHOOSE_PORT_MGM [mysqld] diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 294d32ac4be..16bb3a9b122 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -5,7 +5,8 @@ # This scripts starts the table handler ndbcluster # configurable parameters, make sure to change in mysqlcluterd as well -port_base="2200" +port=@ndb_port@ +port_base=@ndb_port_base@ fsdir=`pwd` # end configurable parameters @@ -22,6 +23,7 @@ if [ -d ../sql ] ; then exec_ndb=$ndbtop/src/kernel/ndbd exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd exec_waiter=$ndbtop/tools/ndb_waiter + exec_test=$ndbtop/tools/ndb_test_platform exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm else BINARY_DIST=1 @@ -34,11 +36,18 @@ else exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd fi exec_waiter=$BASEDIR/bin/ndb_waiter + exec_test=$BASEDIR/bin/ndb_test_platform exec_mgmtclient=$BASEDIR/bin/ndb_mgm fi +if $exec_test ; then :; else + echo "ndb not correctly compiled to support this platform" + exit 1 +fi + pidfile=ndbcluster.pid cfgfile=Ndb.cfg +test_ndb= stop_ndb= initial_ndb= status_ndb= @@ -49,8 +58,15 @@ ndb_con_op=105000 ndb_dmem=80M ndb_imem=24M +NDB_MGM_EXTRA_OPTS= +NDB_MGMD_EXTRA_OPTS= +NDBD_EXTRA_OPTS= + while test $# -gt 0; do case "$1" in + --test) + test_ndb=1 + ;; --stop) stop_ndb=1 ;; @@ -59,8 +75,7 @@ while test $# -gt 0; do initial_ndb=1 ;; --debug*) - f=`echo "$1" | sed -e "s;--debug=;;"` - flags_ndb="$flags_ndb $f" + flags_ndb="$flags_ndb $1" ;; --status) status_ndb=1 @@ -77,9 +92,21 @@ while test $# -gt 0; do --data-dir=*) fsdir=`echo "$1" | sed -e "s;--data-dir=;;"` ;; + --port=*) + port=`echo "$1" | sed -e "s;--port=;;"` + ;; --port-base=*) port_base=`echo "$1" | sed -e "s;--port-base=;;"` ;; + --ndb_mgm-extra-opts=*) + NDB_MGM_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgm-extra-opts=;;"` + ;; + --ndb_mgmd-extra-opts=*) + NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"` + ;; + --ndbd-extra-opts=*) + NDBD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndbd-extra-opts=;;"` + ;; -- ) shift; break ;; --* ) $ECHO "Unrecognized option: $1"; exit 1 ;; * ) break ;; @@ -87,7 +114,7 @@ while test $# -gt 0; do shift done -fs_ndb="$fsdir/ndbcluster-$port_base" +fs_ndb="$fsdir/ndbcluster-$port" NDB_HOME= if [ ! -x "$fsdir" ]; then @@ -102,12 +129,43 @@ if [ ! -x "$exec_mgmtsrvr" ]; then echo "$exec_mgmtsrvr missing" exit 1 fi +if [ ! -x "$exec_waiter" ]; then + echo "$exec_waiter missing" + exit 1 +fi + +exec_mgmtclient="$exec_mgmtclient --no-defaults $NDB_MGM_EXTRA_OPTS" +exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS" +exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS" +exec_waiter="$exec_waiter --no-defaults" ndb_host="localhost" -ndb_mgmd_port=$port_base +ndb_mgmd_port=$port NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port" export NDB_CONNECTSTRING +sleep_until_file_created () { + file=$1 + loop=$2 + org_time=$2 + message=$3 + while (test $loop -gt 0) + do + if [ -r $file ] + then + return 0 + fi + sleep 1 + loop=`expr $loop - 1` + done + if [ $message ] + then + echo $message + fi + echo "ERROR: $file was not created in $org_time seconds; Aborting" + return 1; +} + start_default_ndbcluster() { # do some checks @@ -120,16 +178,12 @@ if [ -d "$fs_ndb" ]; then :; else exit 1 fi -# set som help variables - -port_transporter=`expr $ndb_mgmd_port + 2` - # Start management server as deamon # Edit file system path and ports in config file - if [ $initial_ndb ] ; then -sed \ + rm -f $fs_ndb/ndb_* 2>&1 | cat > /dev/null + sed \ -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \ -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \ -e s,"CHOOSE_DataMemory","$ndb_dmem",g \ @@ -138,7 +192,7 @@ sed \ -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \ -e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \ -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \ - -e s,"CHOOSE_PORT_TRANSPORTER","$port_transporter",g \ + -e s,"CHOOSE_PORT_TRANSPORTER","$port_base",g \ < ndb/ndb_config_2_node.ini \ > "$fs_ndb/config.ini" fi @@ -146,25 +200,36 @@ fi rm -f "$cfgfile" 2>&1 | cat > /dev/null rm -f "$fs_ndb/$cfgfile" 2>&1 | cat > /dev/null -if ( cd "$fs_ndb" ; $exec_mgmtsrvr -c config.ini ) ; then :; else +if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi - +if sleep_until_file_created $fs_ndb/ndb_3.pid 120 +then :; else + exit 1 +fi cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # Start database node echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) - +if sleep_until_file_created $fs_ndb/ndb_1.pid 120 +then :; else + stop_default_ndbcluster + exit 1 +fi cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # Start database node echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) - +if sleep_until_file_created $fs_ndb/ndb_2.pid 120 +then :; else + stop_default_ndbcluster + exit 1 +fi cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # test if Ndb Cluster starts properly @@ -172,6 +237,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Waiting for started..." if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else echo "Ndbcluster startup failed" + stop_default_ndbcluster exit 1 fi @@ -182,7 +248,7 @@ status_ndbcluster status_ndbcluster() { # Start management client - echo "show" | $exec_mgmtclient + $exec_mgmtclient -e show } stop_default_ndbcluster() { @@ -191,17 +257,19 @@ stop_default_ndbcluster() { exec_mgmtclient="$exec_mgmtclient --try-reconnect=1" -echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null +$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null if [ -f "$fs_ndb/$pidfile" ] ; then kill_pids=`cat "$fs_ndb/$pidfile"` attempt=0 while [ $attempt -lt 10 ] ; do new_kill_pid="" + kill_pids2="" for p in $kill_pids ; do kill -0 $p 2> /dev/null if [ $? -eq 0 ] ; then new_kill_pid="$p $new_kill_pid" + kill_pids2="-$p $kill_pids2" fi done kill_pids=$new_kill_pid @@ -211,14 +279,57 @@ if [ -f "$fs_ndb/$pidfile" ] ; then sleep 1 attempt=`expr $attempt + 1` done - if [ "$kill_pids" != "" ] ; then - echo "Failed to shutdown ndbcluster, executing kill -9 "$kill_pids - kill -9 $kill_pids + if [ "$kill_pids2" != "" ] ; then + echo "Failed to shutdown ndbcluster, executing kill "$kill_pids2 + kill -9 -- $kill_pids2 2> /dev/null + /bin/kill -9 -- $kill_pids2 2> /dev/null + /usr/bin/kill -9 -- $kill_pids2 2> /dev/null + kill -9 $kill_pids2 2> /dev/null + /bin/kill -9 $kill_pids2 2> /dev/null + /usr/bin/kill -9 $kill_pids2 2> /dev/null fi rm "$fs_ndb/$pidfile" fi } +initialize_ndb_test () +{ + fs_result=$fs_ndb/r + rm -rf $fs_result + mkdir $fs_result + echo ------------------ + echo starting ndb tests + echo ------------------ +} + +do_ndb_test () +{ + test_name=$1 + + clusterlog=$fs_ndb/ndb_3_cluster.log + + test_log_result=$fs_result/${test_name}_log.result + test_log_reject=$fs_result/${test_name}_log.reject + test_result=$fs_result/${test_name}.result + test_reject=$fs_result/${test_name}.reject + + clean_log='s/.*\[MgmSrvr\]//' + + cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result + + cp ndb/${test_name}.result $test_result + + cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject + cat $clusterlog | sed -e $clean_log > $test_log_reject + + t="pass" + diff -C 5 $test_result $test_reject || t="fail" + printf "ndb_mgm output %20s [%s]\n" $test_name $t + t="pass" + diff -C 5 $test_log_result $test_log_reject || t="fail" + printf "clusterlog output %20s [%s]\n" $test_name $t +} + if [ $status_ndb ] ; then status_ndbcluster exit 0 @@ -230,4 +341,15 @@ else start_default_ndbcluster fi +if [ $test_ndb ] ; then + initialize_ndb_test + all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"` + for a in $all_tests ; do + do_ndb_test $a + done + echo ------------------ + echo shutting down cluster + stop_default_ndbcluster +fi + exit 0 diff --git a/mysql-test/ndb/restart.result b/mysql-test/ndb/restart.result new file mode 100644 index 00000000000..efa1399b5d9 --- /dev/null +++ b/mysql-test/ndb/restart.result @@ -0,0 +1,16 @@ +-- NDB Cluster -- Management Client -- +Connected to Management Server at: localhost:1186 +ALL disabled +Cluster logging is enabled. +ALERT enabled +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Node 1 is being restarted. + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Node 1 is being restarted. + +ALL enabled diff --git a/mysql-test/ndb/restart.test b/mysql-test/ndb/restart.test new file mode 100644 index 00000000000..6ea9e919368 --- /dev/null +++ b/mysql-test/ndb/restart.test @@ -0,0 +1,12 @@ +clusterlog off all +clusterlog on +clusterlog on alert +all clusterlog connection=0 +sleep 1 +1 restart +sleep 5 +all clusterlog connection=8 +sleep 1 +1 restart +sleep 5 +clusterlog on all diff --git a/mysql-test/ndb/restart_log.result b/mysql-test/ndb/restart_log.result new file mode 100644 index 00000000000..2b25fc7b5b6 --- /dev/null +++ b/mysql-test/ndb/restart_log.result @@ -0,0 +1,20 @@ + ALERT -- Node 2: Network partitioning - arbitration required + ALERT -- Node 2: Arbitration won - positive reply from node 3 + ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0 + ALERT -- Node 2: Node failure of 1 DBLQH completed + ALERT -- Node 2: Node failure of 1 DBDICT completed + ALERT -- Node 2: Node failure of 1 DBDIH completed + ALERT -- Node 2: Node failure of 1 DBTC completed + ALERT -- Node 2: Node 2 completed failure of Node 1 + ALERT -- Node 2: All nodes completed failure of Node 1 + ALERT -- Node 3: Node 1 Disconnected + ALERT -- Node 2: Node 1 Disconnected + ALERT -- Node 2: Network partitioning - arbitration required + ALERT -- Node 2: Arbitration won - positive reply from node 3 + ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0 + ALERT -- Node 2: Node failure of 1 DBLQH completed + ALERT -- Node 2: Node failure of 1 DBDICT completed + ALERT -- Node 2: Node failure of 1 DBDIH completed + ALERT -- Node 2: Node failure of 1 DBTC completed + ALERT -- Node 2: Node 2 completed failure of Node 1 + ALERT -- Node 2: All nodes completed failure of Node 1 diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index e85ad303564..7d2b3f01ae6 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -121,7 +121,7 @@ create database mysqltest; create table mysqltest.t1 (a int,b int,c int); grant all on mysqltest.t1 to mysqltest_1@localhost; alter table t1 rename t2; -ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2' +ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2' revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; @@ -349,6 +349,7 @@ alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; a hex(a) ÔÅÓÔ D4C5D3D4 +delete from t1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -482,3 +483,17 @@ ERROR 42000: Incorrect table name 't1\\' rename table t1 to `t1\\`; ERROR 42000: Incorrect table name 't1\\' drop table t1; +create table t1 (a text) character set koi8r; +insert into t1 values (_koi8r'ÔÅÓÔ'); +select hex(a) from t1; +hex(a) +D4C5D3D4 +alter table t1 convert to character set cp1251; +select hex(a) from t1; +hex(a) +F2E5F1F2 +drop table t1; +create table t1 ( a timestamp ); +alter table t1 add unique ( a(1) ); +ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys +drop table t1; diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index b51afab5b54..09c606b5a04 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -36,16 +36,16 @@ create table t2 select * from t1 where 0=1 procedure analyse(); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `Field_name` char(255) NOT NULL default '', - `Min_value` char(255) default NULL, - `Max_value` char(255) default NULL, + `Field_name` binary(255) NOT NULL default '', + `Min_value` binary(255) default NULL, + `Max_value` binary(255) default NULL, `Min_length` bigint(11) NOT NULL default '0', `Max_length` bigint(11) NOT NULL default '0', `Empties_or_zeros` bigint(11) NOT NULL default '0', `Nulls` bigint(11) NOT NULL default '0', - `Avg_value_or_avg_length` char(255) NOT NULL default '', - `Std` char(255) default NULL, - `Optimal_fieldtype` char(64) NOT NULL default '' + `Avg_value_or_avg_length` binary(255) NOT NULL default '', + `Std` binary(255) default NULL, + `Optimal_fieldtype` binary(64) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t1 where 0=1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype @@ -55,16 +55,16 @@ create table t2 select * from t1 where 0=1 procedure analyse(); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `Field_name` char(255) NOT NULL default '', - `Min_value` char(255) default NULL, - `Max_value` char(255) default NULL, + `Field_name` binary(255) NOT NULL default '', + `Min_value` binary(255) default NULL, + `Max_value` binary(255) default NULL, `Min_length` bigint(11) NOT NULL default '0', `Max_length` bigint(11) NOT NULL default '0', `Empties_or_zeros` bigint(11) NOT NULL default '0', `Nulls` bigint(11) NOT NULL default '0', - `Avg_value_or_avg_length` char(255) NOT NULL default '', - `Std` char(255) default NULL, - `Optimal_fieldtype` char(64) NOT NULL default '' + `Avg_value_or_avg_length` binary(255) NOT NULL default '', + `Std` binary(255) default NULL, + `Optimal_fieldtype` binary(64) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype @@ -78,16 +78,16 @@ create table t2 select * from t1 where 0=1 procedure analyse(); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `Field_name` char(255) NOT NULL default '', - `Min_value` char(255) default NULL, - `Max_value` char(255) default NULL, + `Field_name` binary(255) NOT NULL default '', + `Min_value` binary(255) default NULL, + `Max_value` binary(255) default NULL, `Min_length` bigint(11) NOT NULL default '0', `Max_length` bigint(11) NOT NULL default '0', `Empties_or_zeros` bigint(11) NOT NULL default '0', `Nulls` bigint(11) NOT NULL default '0', - `Avg_value_or_avg_length` char(255) NOT NULL default '', - `Std` char(255) default NULL, - `Optimal_fieldtype` char(64) NOT NULL default '' + `Avg_value_or_avg_length` binary(255) NOT NULL default '', + `Std` binary(255) default NULL, + `Optimal_fieldtype` binary(64) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype @@ -96,3 +96,9 @@ select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype test.t1.a 1 2 1 1 0 0 1.5000 0.5000 ENUM('1','2') NOT NULL drop table t1,t2; +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +select * from t1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.v " \\ 1 19 0 0 3.7619 NULL ENUM('"','""','"c','\'\0\\"','\'','\'\'','\'b','a\0\0\0b','a\0','a""""b','a\'\'\'\'b','abc','abc\'def\\hij"klm\0opq','a\\\\\\\\b','b\'','c"','d\\','The\ZEnd','\\','\\d','\\\\') NOT NULL +drop table t1; diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result index 405de1158d6..5b5f673b071 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -134,3 +134,10 @@ select * from t1 where firstname='john' and firstname like binary 'John'; firstname lastname John Doe drop table t1; +create table t1 (a binary); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` binary(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 1aa838140fd..541560afd36 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -98,10 +98,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '', `c2` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '', - `c3` char(1) NOT NULL default '', - `c4` char(1) NOT NULL default '', - `c5` char(3) NOT NULL default '', - `c6` char(3) NOT NULL default '', + `c3` binary(1) NOT NULL default '', + `c4` binary(1) NOT NULL default '', + `c5` binary(3) NOT NULL default '', + `c6` binary(3) NOT NULL default '', `c7` double(3,1) NOT NULL default '0.0', `c8` double(3,1) NOT NULL default '0.0', `c9` double(3,1) default NULL @@ -149,8 +149,8 @@ t1 CREATE TABLE `t1` ( `COALESCE(1.0)` double(3,1) NOT NULL default '0.0', `COALESCE('a')` char(1) NOT NULL default '', `COALESCE(1,1.0)` double(3,1) NOT NULL default '0.0', - `COALESCE(1,'1')` char(1) NOT NULL default '', - `COALESCE(1.1,'1')` char(3) NOT NULL default '', + `COALESCE(1,'1')` binary(1) NOT NULL default '', + `COALESCE(1.1,'1')` binary(3) NOT NULL default '', `COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index ccf75f68e88..636e2603f9b 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -178,3 +178,12 @@ aaa aa aab aa aac aa DROP TABLE t1; +select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour); +date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour) +2004-12-30 00:00:00 +select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00'); +timediff(cast('2004-12-30 12:00:00' as time), '12:00:00') +00:00:00 +select timediff(cast('1 12:00:00' as time), '12:00:00'); +timediff(cast('1 12:00:00' as time), '12:00:00') +24:00:00 diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index bf8a5106044..6f667aabac0 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -36,3 +36,9 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') 6109 -1 -1 61 0 0 DROP TABLE t1; +SELECT CHAR(31) = '', '' = CHAR(31); +CHAR(31) = '' '' = CHAR(31) +0 0 +SELECT CHAR(30) = '', '' = CHAR(30); +CHAR(30) = '' '' = CHAR(30) +0 0 diff --git a/mysql-test/r/consistent_snapshot.result b/mysql-test/r/consistent_snapshot.result new file mode 100644 index 00000000000..90606abbe4e --- /dev/null +++ b/mysql-test/r/consistent_snapshot.result @@ -0,0 +1,15 @@ +drop table if exists t1; +create table t1 (a int) engine=innodb; +start transaction with consistent snapshot; +insert into t1 values(1); +select * from t1; +a +commit; +delete from t1; +start transaction; +insert into t1 values(1); +select * from t1; +a +1 +commit; +drop table t1; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 44fad0cd96a..8f4ee3d0558 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -1,10 +1,79 @@ drop table if exists t1; -SET NAMES big5; -CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c)); +SET @test_character_set= 'big5'; +SET @test_collation= 'big5_chinese_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) big5_chinese_ci YES MUL NULL INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT * FROM t1 WHERE c LIKE 'aaa%'; -c +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results aaa aaaa aaaaa DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) big5_chinese_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET NAMES big5; +SET collation_connection='big5_chinese_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +big5_chinese_ci 6109 +big5_chinese_ci 61 +big5_chinese_ci 6120 +drop table t1; +SET collation_connection='big5_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +big5_bin 6109 +big5_bin 61 +big5_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 3793e962d40..647f8c6236c 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -54,3 +54,19 @@ select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; collation(a) collation(b) collation(binary 'ccc') cp1251_bin binary binary drop table t1; +create table t1 ( +a varchar(16) character set cp1251 collate cp1251_bin not null, +b int(10) default null, +primary key(a) +) charset=cp1251; +insert into t1 (a) values ('air'), +('we'),('g'),('we_toshko'), ('s0urce'),('we_ivo'),('we_iliyan'), +('we_martin'),('vw_grado'),('vw_vasko'),('tn_vili'),('tn_kalina'), +('tn_fakira'),('vw_silvia'),('vw_starshi'),('vw_geo'),('vw_b0x1'); +select * from t1 where a like 'we_%'; +a b +we_iliyan NULL +we_ivo NULL +we_martin NULL +we_toshko NULL +drop table t1; diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result index b35131f62a4..63bae33c6e1 100644 --- a/mysql-test/r/ctype_create.result +++ b/mysql-test/r/ctype_create.result @@ -63,3 +63,12 @@ ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET create database d1 default character set latin1 collate latin2_bin; ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1' DROP DATABASE mysqltest1; +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +use mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +drop database mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +ERROR 3D000: No database selected diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index a8182438ac4..21c40e24fe2 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -296,3 +296,37 @@ FD C3BD FD 1 FE C3BE FE 1 FF C3BF FF 1 DROP TABLE t1; +select 'a' regexp 'A' collate latin1_general_ci; +'a' regexp 'A' collate latin1_general_ci +1 +select 'a' regexp 'A' collate latin1_general_cs; +'a' regexp 'A' collate latin1_general_cs +0 +select 'a' regexp 'A' collate latin1_bin; +'a' regexp 'A' collate latin1_bin +0 +SET collation_connection='latin1_swedish_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +latin1_swedish_ci 6109 +latin1_swedish_ci 61 +latin1_swedish_ci 6120 +drop table t1; +SET collation_connection='latin1_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +latin1_bin 6109 +latin1_bin 61 +latin1_bin 6120 +drop table t1; +CREATE TABLE „a (a int); +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 '„a (a int)' at line 1 +SELECT '„a' as str; +str +„a diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 50af5464f54..f57d8c191bf 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -317,3 +317,24 @@ FIELD('ue',s1) FIELD('Ü',s1) s1='ue' s1='Ü' 1 1 1 1 1 1 1 1 DROP TABLE t1; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +latin1_german2_ci 6109 +latin1_german2_ci 61 +latin1_german2_ci 6120 +drop table t1; +SET NAMES latin1; +CREATE TABLE t1 ( +col1 varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 collate latin1_german2_ci; +INSERT INTO t1 VALUES ('ß'),('ss'),('ss'); +ALTER TABLE t1 ADD KEY ifword(col1); +SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1; +col1 +ss +ss +ß +DROP TABLE t1; diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result index 5e273b3c800..dbdb9c1343c 100644 --- a/mysql-test/r/ctype_mb.result +++ b/mysql-test/r/ctype_mb.result @@ -33,7 +33,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 key_a 1 a A NULL 9 NULL YES BTREE +t1 1 key_a 1 a A NULL 3 NULL YES BTREE ALTER TABLE t1 CHANGE a a CHAR(4); SHOW CREATE TABLE t1; Table Create Table @@ -53,5 +53,5 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 key_a 1 a A NULL 9 NULL YES BTREE +t1 1 key_a 1 a A NULL 3 NULL YES BTREE DROP TABLE t1; diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index be792c007fc..1c75988fd21 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -166,3 +166,77 @@ ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ' SET NAMES utf8; CREATE TABLE `goodÐÌÏÈÏ` (a int); ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)' +set names latin1; +create table t1 (a char(10) character set koi8r, b text character set koi8r); +insert into t1 values ('test','test'); +insert into t1 values ('ÊÃÕË','ÊÃÕË'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +drop table t1; +set names koi8r; +create table t1 (a char(10) character set cp1251); +insert into t1 values (_koi8r'×ÁÓÑ'); +select * from t1 where a=_koi8r'×ÁÓÑ'; +a +×ÁÓÑ +select * from t1 where a=concat(_koi8r'×ÁÓÑ'); +ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '=' +select * from t1 where a=_latin1'×ÁÓÑ'; +ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' +drop table t1; +set names latin1; +set names koi8r; +create table t1 (c1 char(10) character set cp1251); +insert into t1 values ('ß'); +select c1 from t1 where c1 between 'ß' and 'ß'; +c1 +ß +select ifnull(c1,'ß'), ifnull(null,c1) from t1; +ifnull(c1,'ß') ifnull(null,c1) +ß ß +select if(1,c1,'ö'), if(0,c1,'ö') from t1; +if(1,c1,'ö') if(0,c1,'ö') +ß ö +select coalesce('ö',c1), coalesce(null,c1) from t1; +coalesce('ö',c1) coalesce(null,c1) +ö ß +select least(c1,'ö'), greatest(c1,'ö') from t1; +least(c1,'ö') greatest(c1,'ö') +ö ß +select locate(c1,'ß'), locate('ß',c1) from t1; +locate(c1,'ß') locate('ß',c1) +1 1 +select field(c1,'ß'),field('ß',c1) from t1; +field(c1,'ß') field('ß',c1) +1 1 +select concat(c1,'ö'), concat('ö',c1) from t1; +concat(c1,'ö') concat('ö',c1) +ßö öß +select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1; +concat_ws(c1,'ö','ß') concat_ws('ö',c1,'ß') +ößß ßöß +select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1; +replace(c1,'ß','ö') replace('ß',c1,'ö') +ö ö +select substring_index(c1,'öößß',2) from t1; +substring_index(c1,'öößß',2) +ß +select elt(1,c1,'ö'),elt(1,'ö',c1) from t1; +elt(1,c1,'ö') elt(1,'ö',c1) +ß ö +select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1; +make_set(3,c1,'ö') make_set(3,'ö',c1) +ß,ö ö,ß +select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1; +insert(c1,1,2,'ö') insert('ö',1,2,c1) +ö ß +select trim(c1 from 'ß'),trim('ß' from c1) from t1; +trim(c1 from 'ß') trim('ß' from c1) + +select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1; +lpad(c1,3,'ö') lpad('ö',3,c1) +ööß ßßö +select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; +rpad(c1,3,'ö') rpad('ö',3,c1) +ßöö ößß diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index b0edbed1a41..98e5992f374 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -60,3 +60,38 @@ hex(c) 9353 9373 drop table t1; +SET NAMES sjis; +CREATE TABLE t1 ( +c char(16) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis; +insert into t1 values(0xb1),(0xb2),(0xb3); +select hex(c) from t1; +hex(c) +B1 +B2 +B3 +drop table t1; +SET collation_connection='sjis_japanese_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +sjis_japanese_ci 6109 +sjis_japanese_ci 61 +sjis_japanese_ci 6120 +drop table t1; +SET collation_connection='sjis_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +sjis_bin 6109 +sjis_bin 61 +sjis_bin 6120 +drop table t1; +SET NAMES sjis; +SELECT HEX('²“‘@\Œ\') FROM DUAL; +HEX('²“‘@_Œ\') +8DB2939181408C5C diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index 1fece515f9f..6d8bfe74c4b 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -2899,3 +2899,61 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') 6109 -1 -1 61 0 0 DROP TABLE t1; +CREATE TABLE t1 ( +`id` int(11) NOT NULL auto_increment, +`url` varchar(200) NOT NULL default '', +`name` varchar(250) NOT NULL default '', +`type` int(11) NOT NULL default '0', +`website` varchar(250) NOT NULL default '', +`adddate` date NOT NULL default '0000-00-00', +`size` varchar(20) NOT NULL default '', +`movieid` int(11) NOT NULL default '0', +`musicid` int(11) NOT NULL default '0', +`star` varchar(20) NOT NULL default '', +`download` int(11) NOT NULL default '0', +`lastweek` int(11) NOT NULL default '0', +`thisweek` int(11) NOT NULL default '0', +`page` varchar(250) NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `url` (`url`) +) CHARACTER SET tis620; +INSERT INTO t1 VALUES +(1,'http://www.siamzone.com/download/download/000001-frodo_1024.jpg','The Lord +of the Rings +Wallpapers',1,'http://www.lordoftherings.net','2002-01-22','',448,0,'',3805,0,0, +''); +INSERT INTO t1 VALUES (2,'http://www.othemovie.com/OScreenSaver1.EXE','O +Screensaver',2,'','2002-01-22','',491,0,'',519,0,0,''); +INSERT INTO t1 VALUES +(3,'http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg','Jaso +n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,''); +select * from t1 order by id; +id url name type website adddate size movieid musicid star download lastweek thisweek page +1 http://www.siamzone.com/download/download/000001-frodo_1024.jpg The Lord +of the Rings +Wallpapers 1 http://www.lordoftherings.net 2002-01-22 448 0 3805 0 0 +2 http://www.othemovie.com/OScreenSaver1.EXE O +Screensaver 2 2002-01-22 491 0 519 0 0 +3 http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg Jaso +n X Wallpapers 1 2002-05-31 579 0 1091 0 0 +DROP TABLE t1; +SET collation_connection='tis620_thai_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +tis620_thai_ci 6109 +tis620_thai_ci 61 +tis620_thai_ci 6120 +drop table t1; +SET collation_connection='tis620_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +tis620_bin 6109 +tis620_bin 61 +tis620_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 90681795513..dd5a7ebf6a4 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -19,6 +19,9 @@ select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; select 'a a' > 'a', 'a \t' < 'a'; 'a a' > 'a' 'a \t' < 'a' 1 1 +select 'c' like '\_' as want0; +want0 +0 CREATE TABLE t ( c char(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -2315,3 +2318,81 @@ HEX(CONVERT(col1 USING ucs2)) 064A06A9062F064A06AF0631 064A06A9064A DROP TABLE t1; +SET @test_character_set= 'utf8'; +SET @test_collation= 'utf8_swedish_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf8_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf8_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; +insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); +select a, a regexp '[a]' from t1 order by binary a; +a a regexp '[a]' +A 1 +B 0 +C 0 +a 1 +b 0 +c 0 +drop table t1; +SET collation_connection='utf8_unicode_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8_unicode_ci 6109 +utf8_unicode_ci 61 +utf8_unicode_ci 6120 +drop table t1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 1d3deb0b09a..0807cfabf2a 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -1,4 +1,27 @@ DROP TABLE IF EXISTS t1; +SET NAMES latin1; +SET character_set_connection=ucs2; +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +0 1 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +0 0 1 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +0 1 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +0 0 1 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 1 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 SET CHARACTER SET koi8r; CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2); INSERT INTO t1 VALUES (_koi8r'ò'), (X'2004'); @@ -480,3 +503,127 @@ a 0061 b 0062 c 0063 drop table t1; +set @ivar= 1234; +set @str1 = 'select ?'; +set @str2 = convert(@str1 using ucs2); +prepare stmt1 from @str2; +execute stmt1 using @ivar; +? +1234 +SET TIMESTAMP=10000; +create table t2 (c char(30)) charset=ucs2; +set @v=convert('abc' using ucs2); +reset master; +insert into t2 values (@v); +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 User var 1 79 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci +master-bin.000001 119 Query 1 119 use `test`; insert into t2 values (@v) +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`; +use test; +SET TIMESTAMP=10000; +insert into t2 values (@v); +drop table t2; +set names latin1; +create table t1 (a enum('x','y','z') character set ucs2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z','d','e','ä','ö','ü') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('Ä'); +insert into t1 values ('Ö'); +insert into t1 values ('Ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +d 0064 +e 0065 +ä 00E4 +ö 00F6 +ü 00FC +drop table t1; +create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` set('x','y','z','ä','ö','ü') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,Ä,Ö,Ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +x,y 0078002C0079 +z 007A +x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC +drop table t1; +create table t1(a enum('a','b','c')) default character set ucs2; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +Level Code Message +select * from t1 order by a; +a b +a NULL +b NULL +c NULL +drop table t1; +SET collation_connection='ucs2_general_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ucs2_general_ci 00610009 +ucs2_general_ci 0061 +ucs2_general_ci 00610020 +drop table t1; +SET NAMES latin1; +SET collation_connection='ucs2_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ucs2_bin 00610009 +ucs2_bin 0061 +ucs2_bin 00610020 +drop table t1; +SET NAMES latin1; +SET collation_connection='ucs2_swedish_ci'; +CREATE TABLE t1 (Field1 int(10) default '0'); +INSERT INTO t1 VALUES ('-1'); +SELECT * FROM t1; +Field1 +-1 +DROP TABLE t1; +CREATE TABLE t1 (Field1 int(10) unsigned default '0'); +INSERT INTO t1 VALUES ('-1'); +Warnings: +Warning 1265 Data truncated for column 'Field1' at row 1 +DROP TABLE t1; +SET NAMES latin1; diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 7c3ae52cbc9..fd6c501499b 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -126,3 +126,2104 @@ Field Type Null Key Default Extra a char(1) b enum('¤¢','¤¤') YES NULL DROP TABLE t1; +CREATE TABLE t1 +( +a INTEGER NOT NULL, +b VARCHAR(50) NOT NULL DEFAULT '', +PRIMARY KEY (a), +KEY b (b(10)) +) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +a b +0 aaabbbcccddd +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +a b +1 eeefffggghhh +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +a b +2 iiijjjkkkl +DROP TABLE t1; +CREATE TABLE t1 +( +a INTEGER NOT NULL, +b VARCHAR(50) NOT NULL DEFAULT '', +PRIMARY KEY (a), +KEY b (b(10)) +) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +a b +0 aaabbbcccddd +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +a b +1 eeefffggghhh +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +a b +2 iiijjjkkkl +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1(c char(1)) character set ujis; +INSERT INTO t1 VALUES(0xA2AF); +INSERT INTO t1 VALUES(0xA2B0); +INSERT INTO t1 VALUES(0xA2B1); +INSERT INTO t1 VALUES(0xA2B2); +INSERT INTO t1 VALUES(0xA2B3); +INSERT INTO t1 VALUES(0xA2B4); +INSERT INTO t1 VALUES(0xA2B5); +INSERT INTO t1 VALUES(0xA2B6); +INSERT INTO t1 VALUES(0xA2B7); +INSERT INTO t1 VALUES(0xA2B8); +INSERT INTO t1 VALUES(0xA2B9); +INSERT INTO t1 VALUES(0xA2C2); +INSERT INTO t1 VALUES(0xA2C3); +INSERT INTO t1 VALUES(0xA2C4); +INSERT INTO t1 VALUES(0xA2C5); +INSERT INTO t1 VALUES(0xA2C6); +INSERT INTO t1 VALUES(0xA2C7); +INSERT INTO t1 VALUES(0xA2C8); +INSERT INTO t1 VALUES(0xA2C9); +INSERT INTO t1 VALUES(0xA2D1); +INSERT INTO t1 VALUES(0xA2D2); +INSERT INTO t1 VALUES(0xA2D3); +INSERT INTO t1 VALUES(0xA2D4); +INSERT INTO t1 VALUES(0xA2D5); +INSERT INTO t1 VALUES(0xA2D6); +INSERT INTO t1 VALUES(0xA2D7); +INSERT INTO t1 VALUES(0xA2D8); +INSERT INTO t1 VALUES(0xA2D9); +INSERT INTO t1 VALUES(0xA2DA); +INSERT INTO t1 VALUES(0xA2DB); +INSERT INTO t1 VALUES(0xA2EB); +INSERT INTO t1 VALUES(0xA2EC); +INSERT INTO t1 VALUES(0xA2ED); +INSERT INTO t1 VALUES(0xA2EE); +INSERT INTO t1 VALUES(0xA2EF); +INSERT INTO t1 VALUES(0xA2F0); +INSERT INTO t1 VALUES(0xA2F1); +INSERT INTO t1 VALUES(0xA2FA); +INSERT INTO t1 VALUES(0xA2FB); +INSERT INTO t1 VALUES(0xA2FC); +INSERT INTO t1 VALUES(0xA2FD); +INSERT INTO t1 VALUES(0xA3A1); +INSERT INTO t1 VALUES(0xA3A2); +INSERT INTO t1 VALUES(0xA3A3); +INSERT INTO t1 VALUES(0xA3A4); +INSERT INTO t1 VALUES(0xA3A5); +INSERT INTO t1 VALUES(0xA3A6); +INSERT INTO t1 VALUES(0xA3A7); +INSERT INTO t1 VALUES(0xA3A8); +INSERT INTO t1 VALUES(0xA3A9); +INSERT INTO t1 VALUES(0xA3AA); +INSERT INTO t1 VALUES(0xA3AB); +INSERT INTO t1 VALUES(0xA3AC); +INSERT INTO t1 VALUES(0xA3AD); +INSERT INTO t1 VALUES(0xA3AE); +INSERT INTO t1 VALUES(0xA3AF); +INSERT INTO t1 VALUES(0xA3BA); +INSERT INTO t1 VALUES(0xA3BB); +INSERT INTO t1 VALUES(0xA3BC); +INSERT INTO t1 VALUES(0xA3BD); +INSERT INTO t1 VALUES(0xA3BE); +INSERT INTO t1 VALUES(0xA3BF); +INSERT INTO t1 VALUES(0xA3C0); +INSERT INTO t1 VALUES(0xA3DB); +INSERT INTO t1 VALUES(0xA3DC); +INSERT INTO t1 VALUES(0xA3DD); +INSERT INTO t1 VALUES(0xA3DE); +INSERT INTO t1 VALUES(0xA3DF); +INSERT INTO t1 VALUES(0xA3E0); +INSERT INTO t1 VALUES(0xA3FB); +INSERT INTO t1 VALUES(0xA3FC); +INSERT INTO t1 VALUES(0xA3FD); +INSERT INTO t1 VALUES(0xA3FE); +INSERT INTO t1 VALUES(0xA4F4); +INSERT INTO t1 VALUES(0xA4F5); +INSERT INTO t1 VALUES(0xA4F6); +INSERT INTO t1 VALUES(0xA4F7); +INSERT INTO t1 VALUES(0xA4F8); +INSERT INTO t1 VALUES(0xA4F9); +INSERT INTO t1 VALUES(0xA4FA); +INSERT INTO t1 VALUES(0xA4FB); +INSERT INTO t1 VALUES(0xA4FC); +INSERT INTO t1 VALUES(0xA4FD); +INSERT INTO t1 VALUES(0xA4FE); +INSERT INTO t1 VALUES(0xA5F7); +INSERT INTO t1 VALUES(0xA5F8); +INSERT INTO t1 VALUES(0xA5F9); +INSERT INTO t1 VALUES(0xA5FA); +INSERT INTO t1 VALUES(0xA5FB); +INSERT INTO t1 VALUES(0xA5FC); +INSERT INTO t1 VALUES(0xA5FD); +INSERT INTO t1 VALUES(0xA5FE); +INSERT INTO t1 VALUES(0xA6B9); +INSERT INTO t1 VALUES(0xA6BA); +INSERT INTO t1 VALUES(0xA6BB); +INSERT INTO t1 VALUES(0xA6BC); +INSERT INTO t1 VALUES(0xA6BD); +INSERT INTO t1 VALUES(0xA6BE); +INSERT INTO t1 VALUES(0xA6BF); +INSERT INTO t1 VALUES(0xA6C0); +INSERT INTO t1 VALUES(0xA6D9); +INSERT INTO t1 VALUES(0xA6DA); +INSERT INTO t1 VALUES(0xA6DB); +INSERT INTO t1 VALUES(0xA6DC); +INSERT INTO t1 VALUES(0xA6DD); +INSERT INTO t1 VALUES(0xA6DE); +INSERT INTO t1 VALUES(0xA6DF); +INSERT INTO t1 VALUES(0xA6E0); +INSERT INTO t1 VALUES(0xA6E1); +INSERT INTO t1 VALUES(0xA6E2); +INSERT INTO t1 VALUES(0xA6E3); +INSERT INTO t1 VALUES(0xA6E4); +INSERT INTO t1 VALUES(0xA6E5); +INSERT INTO t1 VALUES(0xA6E6); +INSERT INTO t1 VALUES(0xA6E7); +INSERT INTO t1 VALUES(0xA6E8); +INSERT INTO t1 VALUES(0xA6E9); +INSERT INTO t1 VALUES(0xA6EA); +INSERT INTO t1 VALUES(0xA6EB); +INSERT INTO t1 VALUES(0xA6EC); +INSERT INTO t1 VALUES(0xA6ED); +INSERT INTO t1 VALUES(0xA6EE); +INSERT INTO t1 VALUES(0xA6EF); +INSERT INTO t1 VALUES(0xA6F0); +INSERT INTO t1 VALUES(0xA6F1); +INSERT INTO t1 VALUES(0xA6F2); +INSERT INTO t1 VALUES(0xA6F3); +INSERT INTO t1 VALUES(0xA6F4); +INSERT INTO t1 VALUES(0xA6F5); +INSERT INTO t1 VALUES(0xA6F6); +INSERT INTO t1 VALUES(0xA6F7); +INSERT INTO t1 VALUES(0xA6F8); +INSERT INTO t1 VALUES(0xA6F9); +INSERT INTO t1 VALUES(0xA6FA); +INSERT INTO t1 VALUES(0xA6FB); +INSERT INTO t1 VALUES(0xA6FC); +INSERT INTO t1 VALUES(0xA6FD); +INSERT INTO t1 VALUES(0xA6FE); +INSERT INTO t1 VALUES(0xA7C2); +INSERT INTO t1 VALUES(0xA7C3); +INSERT INTO t1 VALUES(0xA7C4); +INSERT INTO t1 VALUES(0xA7C5); +INSERT INTO t1 VALUES(0xA7C6); +INSERT INTO t1 VALUES(0xA7C7); +INSERT INTO t1 VALUES(0xA7C8); +INSERT INTO t1 VALUES(0xA7C9); +INSERT INTO t1 VALUES(0xA7CA); +INSERT INTO t1 VALUES(0xA7CB); +INSERT INTO t1 VALUES(0xA7CC); +INSERT INTO t1 VALUES(0xA7CD); +INSERT INTO t1 VALUES(0xA7CE); +INSERT INTO t1 VALUES(0xA7CF); +INSERT INTO t1 VALUES(0xA7D0); +INSERT INTO t1 VALUES(0xA7F2); +INSERT INTO t1 VALUES(0xA7F3); +INSERT INTO t1 VALUES(0xA7F4); +INSERT INTO t1 VALUES(0xA7F5); +INSERT INTO t1 VALUES(0xA7F6); +INSERT INTO t1 VALUES(0xA7F7); +INSERT INTO t1 VALUES(0xA7F8); +INSERT INTO t1 VALUES(0xA7F9); +INSERT INTO t1 VALUES(0xA7FA); +INSERT INTO t1 VALUES(0xA7FB); +INSERT INTO t1 VALUES(0xA7FC); +INSERT INTO t1 VALUES(0xA7FD); +INSERT INTO t1 VALUES(0xA7FE); +INSERT INTO t1 VALUES(0xA8C1); +INSERT INTO t1 VALUES(0xA8C2); +INSERT INTO t1 VALUES(0xA8C3); +INSERT INTO t1 VALUES(0xA8C4); +INSERT INTO t1 VALUES(0xA8C5); +INSERT INTO t1 VALUES(0xA8C6); +INSERT INTO t1 VALUES(0xA8C7); +INSERT INTO t1 VALUES(0xA8C8); +INSERT INTO t1 VALUES(0xA8C9); +INSERT INTO t1 VALUES(0xA8CA); +INSERT INTO t1 VALUES(0xA8CB); +INSERT INTO t1 VALUES(0xA8CC); +INSERT INTO t1 VALUES(0xA8CD); +INSERT INTO t1 VALUES(0xA8CE); +INSERT INTO t1 VALUES(0xA8CF); +INSERT INTO t1 VALUES(0xA8D0); +INSERT INTO t1 VALUES(0xA8D1); +INSERT INTO t1 VALUES(0xA8D2); +INSERT INTO t1 VALUES(0xA8D3); +INSERT INTO t1 VALUES(0xA8D4); +INSERT INTO t1 VALUES(0xA8D5); +INSERT INTO t1 VALUES(0xA8D6); +INSERT INTO t1 VALUES(0xA8D7); +INSERT INTO t1 VALUES(0xA8D8); +INSERT INTO t1 VALUES(0xA8D9); +INSERT INTO t1 VALUES(0xA8DA); +INSERT INTO t1 VALUES(0xA8DB); +INSERT INTO t1 VALUES(0xA8DC); +INSERT INTO t1 VALUES(0xA8DD); +INSERT INTO t1 VALUES(0xA8DE); +INSERT INTO t1 VALUES(0xA8DF); +INSERT INTO t1 VALUES(0xA8E0); +INSERT INTO t1 VALUES(0xA8E1); +INSERT INTO t1 VALUES(0xA8E2); +INSERT INTO t1 VALUES(0xA8E3); +INSERT INTO t1 VALUES(0xA8E4); +INSERT INTO t1 VALUES(0xA8E5); +INSERT INTO t1 VALUES(0xA8E6); +INSERT INTO t1 VALUES(0xA8E7); +INSERT INTO t1 VALUES(0xA8E8); +INSERT INTO t1 VALUES(0xA8E9); +INSERT INTO t1 VALUES(0xA8EA); +INSERT INTO t1 VALUES(0xA8EB); +INSERT INTO t1 VALUES(0xA8EC); +INSERT INTO t1 VALUES(0xA8ED); +INSERT INTO t1 VALUES(0xA8EE); +INSERT INTO t1 VALUES(0xA8EF); +INSERT INTO t1 VALUES(0xA8F0); +INSERT INTO t1 VALUES(0xA8F1); +INSERT INTO t1 VALUES(0xA8F2); +INSERT INTO t1 VALUES(0xA8F3); +INSERT INTO t1 VALUES(0xA8F4); +INSERT INTO t1 VALUES(0xA8F5); +INSERT INTO t1 VALUES(0xA8F6); +INSERT INTO t1 VALUES(0xA8F7); +INSERT INTO t1 VALUES(0xA8F8); +INSERT INTO t1 VALUES(0xA8F9); +INSERT INTO t1 VALUES(0xA8FA); +INSERT INTO t1 VALUES(0xA8FB); +INSERT INTO t1 VALUES(0xA8FC); +INSERT INTO t1 VALUES(0xA8FD); +INSERT INTO t1 VALUES(0xA8FE); +INSERT INTO t1 VALUES(0xA9A1); +INSERT INTO t1 VALUES(0xA9A2); +INSERT INTO t1 VALUES(0xA9A3); +INSERT INTO t1 VALUES(0xA9A4); +INSERT INTO t1 VALUES(0xA9A5); +INSERT INTO t1 VALUES(0xA9A6); +INSERT INTO t1 VALUES(0xA9A7); +INSERT INTO t1 VALUES(0xA9A8); +INSERT INTO t1 VALUES(0xA9A9); +INSERT INTO t1 VALUES(0xA9AA); +INSERT INTO t1 VALUES(0xA9AB); +INSERT INTO t1 VALUES(0xA9AC); +INSERT INTO t1 VALUES(0xA9AD); +INSERT INTO t1 VALUES(0xA9AE); +INSERT INTO t1 VALUES(0xA9AF); +INSERT INTO t1 VALUES(0xA9B0); +INSERT INTO t1 VALUES(0xA9B1); +INSERT INTO t1 VALUES(0xA9B2); +INSERT INTO t1 VALUES(0xA9B3); +INSERT INTO t1 VALUES(0xA9B4); +INSERT INTO t1 VALUES(0xA9B5); +INSERT INTO t1 VALUES(0xA9B6); +INSERT INTO t1 VALUES(0xA9B7); +INSERT INTO t1 VALUES(0xA9B8); +INSERT INTO t1 VALUES(0xA9B9); +INSERT INTO t1 VALUES(0xA9BA); +INSERT INTO t1 VALUES(0xA9BB); +INSERT INTO t1 VALUES(0xA9BC); +INSERT INTO t1 VALUES(0xA9BD); +INSERT INTO t1 VALUES(0xA9BE); +INSERT INTO t1 VALUES(0xA9BF); +INSERT INTO t1 VALUES(0xA9C0); +INSERT INTO t1 VALUES(0xA9C1); +INSERT INTO t1 VALUES(0xA9C2); +INSERT INTO t1 VALUES(0xA9C3); +INSERT INTO t1 VALUES(0xA9C4); +INSERT INTO t1 VALUES(0xA9C5); +INSERT INTO t1 VALUES(0xA9C6); +INSERT INTO t1 VALUES(0xA9C7); +INSERT INTO t1 VALUES(0xA9C8); +INSERT INTO t1 VALUES(0xA9C9); +INSERT INTO t1 VALUES(0xA9CA); +INSERT INTO t1 VALUES(0xA9CB); +INSERT INTO t1 VALUES(0xA9CC); +INSERT INTO t1 VALUES(0xA9CD); +INSERT INTO t1 VALUES(0xA9CE); +INSERT INTO t1 VALUES(0xA9CF); +INSERT INTO t1 VALUES(0xA9D0); +INSERT INTO t1 VALUES(0xA9D1); +INSERT INTO t1 VALUES(0xA9D2); +INSERT INTO t1 VALUES(0xA9D3); +INSERT INTO t1 VALUES(0xA9D4); +INSERT INTO t1 VALUES(0xA9D5); +INSERT INTO t1 VALUES(0xA9D6); +INSERT INTO t1 VALUES(0xA9D7); +INSERT INTO t1 VALUES(0xA9D8); +INSERT INTO t1 VALUES(0xA9D9); +INSERT INTO t1 VALUES(0xA9DA); +INSERT INTO t1 VALUES(0xA9DB); +INSERT INTO t1 VALUES(0xA9DC); +INSERT INTO t1 VALUES(0xA9DD); +INSERT INTO t1 VALUES(0xA9DE); +INSERT INTO t1 VALUES(0xA9DF); +INSERT INTO t1 VALUES(0xA9E0); +INSERT INTO t1 VALUES(0xA9E1); +INSERT INTO t1 VALUES(0xA9E2); +INSERT INTO t1 VALUES(0xA9E3); +INSERT INTO t1 VALUES(0xA9E4); +INSERT INTO t1 VALUES(0xA9E5); +INSERT INTO t1 VALUES(0xA9E6); +INSERT INTO t1 VALUES(0xA9E7); +INSERT INTO t1 VALUES(0xA9E8); +INSERT INTO t1 VALUES(0xA9E9); +INSERT INTO t1 VALUES(0xA9EA); +INSERT INTO t1 VALUES(0xA9EB); +INSERT INTO t1 VALUES(0xA9EC); +INSERT INTO t1 VALUES(0xA9ED); +INSERT INTO t1 VALUES(0xA9EE); +INSERT INTO t1 VALUES(0xA9EF); +INSERT INTO t1 VALUES(0xA9F0); +INSERT INTO t1 VALUES(0xA9F1); +INSERT INTO t1 VALUES(0xA9F2); +INSERT INTO t1 VALUES(0xA9F3); +INSERT INTO t1 VALUES(0xA9F4); +INSERT INTO t1 VALUES(0xA9F5); +INSERT INTO t1 VALUES(0xA9F6); +INSERT INTO t1 VALUES(0xA9F7); +INSERT INTO t1 VALUES(0xA9F8); +INSERT INTO t1 VALUES(0xA9F9); +INSERT INTO t1 VALUES(0xA9FA); +INSERT INTO t1 VALUES(0xA9FB); +INSERT INTO t1 VALUES(0xA9FC); +INSERT INTO t1 VALUES(0xA9FD); +INSERT INTO t1 VALUES(0xA9FE); +INSERT INTO t1 VALUES(0xAAA1); +INSERT INTO t1 VALUES(0xAAA2); +INSERT INTO t1 VALUES(0xAAA3); +INSERT INTO t1 VALUES(0xAAA4); +INSERT INTO t1 VALUES(0xAAA5); +INSERT INTO t1 VALUES(0xAAA6); +INSERT INTO t1 VALUES(0xAAA7); +INSERT INTO t1 VALUES(0xAAA8); +INSERT INTO t1 VALUES(0xAAA9); +INSERT INTO t1 VALUES(0xAAAA); +INSERT INTO t1 VALUES(0xAAAB); +INSERT INTO t1 VALUES(0xAAAC); +INSERT INTO t1 VALUES(0xAAAD); +INSERT INTO t1 VALUES(0xAAAE); +INSERT INTO t1 VALUES(0xAAAF); +INSERT INTO t1 VALUES(0xAAB0); +INSERT INTO t1 VALUES(0xAAB1); +INSERT INTO t1 VALUES(0xAAB2); +INSERT INTO t1 VALUES(0xAAB3); +INSERT INTO t1 VALUES(0xAAB4); +INSERT INTO t1 VALUES(0xAAB5); +INSERT INTO t1 VALUES(0xAAB6); +INSERT INTO t1 VALUES(0xAAB7); +INSERT INTO t1 VALUES(0xAAB8); +INSERT INTO t1 VALUES(0xAAB9); +INSERT INTO t1 VALUES(0xAABA); +INSERT INTO t1 VALUES(0xAABB); +INSERT INTO t1 VALUES(0xAABC); +INSERT INTO t1 VALUES(0xAABD); +INSERT INTO t1 VALUES(0xAABE); +INSERT INTO t1 VALUES(0xAABF); +INSERT INTO t1 VALUES(0xAAC0); +INSERT INTO t1 VALUES(0xAAC1); +INSERT INTO t1 VALUES(0xAAC2); +INSERT INTO t1 VALUES(0xAAC3); +INSERT INTO t1 VALUES(0xAAC4); +INSERT INTO t1 VALUES(0xAAC5); +INSERT INTO t1 VALUES(0xAAC6); +INSERT INTO t1 VALUES(0xAAC7); +INSERT INTO t1 VALUES(0xAAC8); +INSERT INTO t1 VALUES(0xAAC9); +INSERT INTO t1 VALUES(0xAACA); +INSERT INTO t1 VALUES(0xAACB); +INSERT INTO t1 VALUES(0xAACC); +INSERT INTO t1 VALUES(0xAACD); +INSERT INTO t1 VALUES(0xAACE); +INSERT INTO t1 VALUES(0xAACF); +INSERT INTO t1 VALUES(0xAAD0); +INSERT INTO t1 VALUES(0xAAD1); +INSERT INTO t1 VALUES(0xAAD2); +INSERT INTO t1 VALUES(0xAAD3); +INSERT INTO t1 VALUES(0xAAD4); +INSERT INTO t1 VALUES(0xAAD5); +INSERT INTO t1 VALUES(0xAAD6); +INSERT INTO t1 VALUES(0xAAD7); +INSERT INTO t1 VALUES(0xAAD8); +INSERT INTO t1 VALUES(0xAAD9); +INSERT INTO t1 VALUES(0xAADA); +INSERT INTO t1 VALUES(0xAADB); +INSERT INTO t1 VALUES(0xAADC); +INSERT INTO t1 VALUES(0xAADD); +INSERT INTO t1 VALUES(0xAADE); +INSERT INTO t1 VALUES(0xAADF); +INSERT INTO t1 VALUES(0xAAE0); +INSERT INTO t1 VALUES(0xAAE1); +INSERT INTO t1 VALUES(0xAAE2); +INSERT INTO t1 VALUES(0xAAE3); +INSERT INTO t1 VALUES(0xAAE4); +INSERT INTO t1 VALUES(0xAAE5); +INSERT INTO t1 VALUES(0xAAE6); +INSERT INTO t1 VALUES(0xAAE7); +INSERT INTO t1 VALUES(0xAAE8); +INSERT INTO t1 VALUES(0xAAE9); +INSERT INTO t1 VALUES(0xAAEA); +INSERT INTO t1 VALUES(0xAAEB); +INSERT INTO t1 VALUES(0xAAEC); +INSERT INTO t1 VALUES(0xAAED); +INSERT INTO t1 VALUES(0xAAEE); +INSERT INTO t1 VALUES(0xAAEF); +INSERT INTO t1 VALUES(0xAAF0); +INSERT INTO t1 VALUES(0xAAF1); +INSERT INTO t1 VALUES(0xAAF2); +INSERT INTO t1 VALUES(0xAAF3); +INSERT INTO t1 VALUES(0xAAF4); +INSERT INTO t1 VALUES(0xAAF5); +INSERT INTO t1 VALUES(0xAAF6); +INSERT INTO t1 VALUES(0xAAF7); +INSERT INTO t1 VALUES(0xAAF8); +INSERT INTO t1 VALUES(0xAAF9); +INSERT INTO t1 VALUES(0xAAFA); +INSERT INTO t1 VALUES(0xAAFB); +INSERT INTO t1 VALUES(0xAAFC); +INSERT INTO t1 VALUES(0xAAFD); +INSERT INTO t1 VALUES(0xAAFE); +INSERT INTO t1 VALUES(0xABA1); +INSERT INTO t1 VALUES(0xABA2); +INSERT INTO t1 VALUES(0xABA3); +INSERT INTO t1 VALUES(0xABA4); +INSERT INTO t1 VALUES(0xABA5); +INSERT INTO t1 VALUES(0xABA6); +INSERT INTO t1 VALUES(0xABA7); +INSERT INTO t1 VALUES(0xABA8); +INSERT INTO t1 VALUES(0xABA9); +INSERT INTO t1 VALUES(0xABAA); +INSERT INTO t1 VALUES(0xABAB); +INSERT INTO t1 VALUES(0xABAC); +INSERT INTO t1 VALUES(0xABAD); +INSERT INTO t1 VALUES(0xABAE); +INSERT INTO t1 VALUES(0xABAF); +INSERT INTO t1 VALUES(0xABB0); +INSERT INTO t1 VALUES(0xABB1); +INSERT INTO t1 VALUES(0xABB2); +INSERT INTO t1 VALUES(0xABB3); +INSERT INTO t1 VALUES(0xABB4); +INSERT INTO t1 VALUES(0xABB5); +INSERT INTO t1 VALUES(0xABB6); +INSERT INTO t1 VALUES(0xABB7); +INSERT INTO t1 VALUES(0xABB8); +INSERT INTO t1 VALUES(0xABB9); +INSERT INTO t1 VALUES(0xABBA); +INSERT INTO t1 VALUES(0xABBB); +INSERT INTO t1 VALUES(0xABBC); +INSERT INTO t1 VALUES(0xABBD); +INSERT INTO t1 VALUES(0xABBE); +INSERT INTO t1 VALUES(0xABBF); +INSERT INTO t1 VALUES(0xABC0); +INSERT INTO t1 VALUES(0xABC1); +INSERT INTO t1 VALUES(0xABC2); +INSERT INTO t1 VALUES(0xABC3); +INSERT INTO t1 VALUES(0xABC4); +INSERT INTO t1 VALUES(0xABC5); +INSERT INTO t1 VALUES(0xABC6); +INSERT INTO t1 VALUES(0xABC7); +INSERT INTO t1 VALUES(0xABC8); +INSERT INTO t1 VALUES(0xABC9); +INSERT INTO t1 VALUES(0xABCA); +INSERT INTO t1 VALUES(0xABCB); +INSERT INTO t1 VALUES(0xABCC); +INSERT INTO t1 VALUES(0xABCD); +INSERT INTO t1 VALUES(0xABCE); +INSERT INTO t1 VALUES(0xABCF); +INSERT INTO t1 VALUES(0xABD0); +INSERT INTO t1 VALUES(0xABD1); +INSERT INTO t1 VALUES(0xABD2); +INSERT INTO t1 VALUES(0xABD3); +INSERT INTO t1 VALUES(0xABD4); +INSERT INTO t1 VALUES(0xABD5); +INSERT INTO t1 VALUES(0xABD6); +INSERT INTO t1 VALUES(0xABD7); +INSERT INTO t1 VALUES(0xABD8); +INSERT INTO t1 VALUES(0xABD9); +INSERT INTO t1 VALUES(0xABDA); +INSERT INTO t1 VALUES(0xABDB); +INSERT INTO t1 VALUES(0xABDC); +INSERT INTO t1 VALUES(0xABDD); +INSERT INTO t1 VALUES(0xABDE); +INSERT INTO t1 VALUES(0xABDF); +INSERT INTO t1 VALUES(0xABE0); +INSERT INTO t1 VALUES(0xABE1); +INSERT INTO t1 VALUES(0xABE2); +INSERT INTO t1 VALUES(0xABE3); +INSERT INTO t1 VALUES(0xABE4); +INSERT INTO t1 VALUES(0xABE5); +INSERT INTO t1 VALUES(0xABE6); +INSERT INTO t1 VALUES(0xABE7); +INSERT INTO t1 VALUES(0xABE8); +INSERT INTO t1 VALUES(0xABE9); +INSERT INTO t1 VALUES(0xABEA); +INSERT INTO t1 VALUES(0xABEB); +INSERT INTO t1 VALUES(0xABEC); +INSERT INTO t1 VALUES(0xABED); +INSERT INTO t1 VALUES(0xABEE); +INSERT INTO t1 VALUES(0xABEF); +INSERT INTO t1 VALUES(0xABF0); +INSERT INTO t1 VALUES(0xABF1); +INSERT INTO t1 VALUES(0xABF2); +INSERT INTO t1 VALUES(0xABF3); +INSERT INTO t1 VALUES(0xABF4); +INSERT INTO t1 VALUES(0xABF5); +INSERT INTO t1 VALUES(0xABF6); +INSERT INTO t1 VALUES(0xABF7); +INSERT INTO t1 VALUES(0xABF8); +INSERT INTO t1 VALUES(0xABF9); +INSERT INTO t1 VALUES(0xABFA); +INSERT INTO t1 VALUES(0xABFB); +INSERT INTO t1 VALUES(0xABFC); +INSERT INTO t1 VALUES(0xABFD); +INSERT INTO t1 VALUES(0xABFE); +INSERT INTO t1 VALUES(0xACA1); +INSERT INTO t1 VALUES(0xACA2); +INSERT INTO t1 VALUES(0xACA3); +INSERT INTO t1 VALUES(0xACA4); +INSERT INTO t1 VALUES(0xACA5); +INSERT INTO t1 VALUES(0xACA6); +INSERT INTO t1 VALUES(0xACA7); +INSERT INTO t1 VALUES(0xACA8); +INSERT INTO t1 VALUES(0xACA9); +INSERT INTO t1 VALUES(0xACAA); +INSERT INTO t1 VALUES(0xACAB); +INSERT INTO t1 VALUES(0xACAC); +INSERT INTO t1 VALUES(0xACAD); +INSERT INTO t1 VALUES(0xACAE); +INSERT INTO t1 VALUES(0xACAF); +INSERT INTO t1 VALUES(0xACB0); +INSERT INTO t1 VALUES(0xACB1); +INSERT INTO t1 VALUES(0xACB2); +INSERT INTO t1 VALUES(0xACB3); +INSERT INTO t1 VALUES(0xACB4); +INSERT INTO t1 VALUES(0xACB5); +INSERT INTO t1 VALUES(0xACB6); +INSERT INTO t1 VALUES(0xACB7); +INSERT INTO t1 VALUES(0xACB8); +INSERT INTO t1 VALUES(0xACB9); +INSERT INTO t1 VALUES(0xACBA); +INSERT INTO t1 VALUES(0xACBB); +INSERT INTO t1 VALUES(0xACBC); +INSERT INTO t1 VALUES(0xACBD); +INSERT INTO t1 VALUES(0xACBE); +INSERT INTO t1 VALUES(0xACBF); +INSERT INTO t1 VALUES(0xACC0); +INSERT INTO t1 VALUES(0xACC1); +INSERT INTO t1 VALUES(0xACC2); +INSERT INTO t1 VALUES(0xACC3); +INSERT INTO t1 VALUES(0xACC4); +INSERT INTO t1 VALUES(0xACC5); +INSERT INTO t1 VALUES(0xACC6); +INSERT INTO t1 VALUES(0xACC7); +INSERT INTO t1 VALUES(0xACC8); +INSERT INTO t1 VALUES(0xACC9); +INSERT INTO t1 VALUES(0xACCA); +INSERT INTO t1 VALUES(0xACCB); +INSERT INTO t1 VALUES(0xACCC); +INSERT INTO t1 VALUES(0xACCD); +INSERT INTO t1 VALUES(0xACCE); +INSERT INTO t1 VALUES(0xACCF); +INSERT INTO t1 VALUES(0xACD0); +INSERT INTO t1 VALUES(0xACD1); +INSERT INTO t1 VALUES(0xACD2); +INSERT INTO t1 VALUES(0xACD3); +INSERT INTO t1 VALUES(0xACD4); +INSERT INTO t1 VALUES(0xACD5); +INSERT INTO t1 VALUES(0xACD6); +INSERT INTO t1 VALUES(0xACD7); +INSERT INTO t1 VALUES(0xACD8); +INSERT INTO t1 VALUES(0xACD9); +INSERT INTO t1 VALUES(0xACDA); +INSERT INTO t1 VALUES(0xACDB); +INSERT INTO t1 VALUES(0xACDC); +INSERT INTO t1 VALUES(0xACDD); +INSERT INTO t1 VALUES(0xACDE); +INSERT INTO t1 VALUES(0xACDF); +INSERT INTO t1 VALUES(0xACE0); +INSERT INTO t1 VALUES(0xACE1); +INSERT INTO t1 VALUES(0xACE2); +INSERT INTO t1 VALUES(0xACE3); +INSERT INTO t1 VALUES(0xACE4); +INSERT INTO t1 VALUES(0xACE5); +INSERT INTO t1 VALUES(0xACE6); +INSERT INTO t1 VALUES(0xACE7); +INSERT INTO t1 VALUES(0xACE8); +INSERT INTO t1 VALUES(0xACE9); +INSERT INTO t1 VALUES(0xACEA); +INSERT INTO t1 VALUES(0xACEB); +INSERT INTO t1 VALUES(0xACEC); +INSERT INTO t1 VALUES(0xACED); +INSERT INTO t1 VALUES(0xACEE); +INSERT INTO t1 VALUES(0xACEF); +INSERT INTO t1 VALUES(0xACF0); +INSERT INTO t1 VALUES(0xACF1); +INSERT INTO t1 VALUES(0xACF2); +INSERT INTO t1 VALUES(0xACF3); +INSERT INTO t1 VALUES(0xACF4); +INSERT INTO t1 VALUES(0xACF5); +INSERT INTO t1 VALUES(0xACF6); +INSERT INTO t1 VALUES(0xACF7); +INSERT INTO t1 VALUES(0xACF8); +INSERT INTO t1 VALUES(0xACF9); +INSERT INTO t1 VALUES(0xACFA); +INSERT INTO t1 VALUES(0xACFB); +INSERT INTO t1 VALUES(0xACFC); +INSERT INTO t1 VALUES(0xACFD); +INSERT INTO t1 VALUES(0xACFE); +INSERT INTO t1 VALUES(0xADA1); +INSERT INTO t1 VALUES(0xADA2); +INSERT INTO t1 VALUES(0xADA3); +INSERT INTO t1 VALUES(0xADA4); +INSERT INTO t1 VALUES(0xADA5); +INSERT INTO t1 VALUES(0xADA6); +INSERT INTO t1 VALUES(0xADA7); +INSERT INTO t1 VALUES(0xADA8); +INSERT INTO t1 VALUES(0xADA9); +INSERT INTO t1 VALUES(0xADAA); +INSERT INTO t1 VALUES(0xADAB); +INSERT INTO t1 VALUES(0xADAC); +INSERT INTO t1 VALUES(0xADAD); +INSERT INTO t1 VALUES(0xADAE); +INSERT INTO t1 VALUES(0xADAF); +INSERT INTO t1 VALUES(0xADB0); +INSERT INTO t1 VALUES(0xADB1); +INSERT INTO t1 VALUES(0xADB2); +INSERT INTO t1 VALUES(0xADB3); +INSERT INTO t1 VALUES(0xADB4); +INSERT INTO t1 VALUES(0xADB5); +INSERT INTO t1 VALUES(0xADB6); +INSERT INTO t1 VALUES(0xADB7); +INSERT INTO t1 VALUES(0xADB8); +INSERT INTO t1 VALUES(0xADB9); +INSERT INTO t1 VALUES(0xADBA); +INSERT INTO t1 VALUES(0xADBB); +INSERT INTO t1 VALUES(0xADBC); +INSERT INTO t1 VALUES(0xADBD); +INSERT INTO t1 VALUES(0xADBE); +INSERT INTO t1 VALUES(0xADBF); +INSERT INTO t1 VALUES(0xADC0); +INSERT INTO t1 VALUES(0xADC1); +INSERT INTO t1 VALUES(0xADC2); +INSERT INTO t1 VALUES(0xADC3); +INSERT INTO t1 VALUES(0xADC4); +INSERT INTO t1 VALUES(0xADC5); +INSERT INTO t1 VALUES(0xADC6); +INSERT INTO t1 VALUES(0xADC7); +INSERT INTO t1 VALUES(0xADC8); +INSERT INTO t1 VALUES(0xADC9); +INSERT INTO t1 VALUES(0xADCA); +INSERT INTO t1 VALUES(0xADCB); +INSERT INTO t1 VALUES(0xADCC); +INSERT INTO t1 VALUES(0xADCD); +INSERT INTO t1 VALUES(0xADCE); +INSERT INTO t1 VALUES(0xADCF); +INSERT INTO t1 VALUES(0xADD0); +INSERT INTO t1 VALUES(0xADD1); +INSERT INTO t1 VALUES(0xADD2); +INSERT INTO t1 VALUES(0xADD3); +INSERT INTO t1 VALUES(0xADD4); +INSERT INTO t1 VALUES(0xADD5); +INSERT INTO t1 VALUES(0xADD6); +INSERT INTO t1 VALUES(0xADD7); +INSERT INTO t1 VALUES(0xADD8); +INSERT INTO t1 VALUES(0xADD9); +INSERT INTO t1 VALUES(0xADDA); +INSERT INTO t1 VALUES(0xADDB); +INSERT INTO t1 VALUES(0xADDC); +INSERT INTO t1 VALUES(0xADDD); +INSERT INTO t1 VALUES(0xADDE); +INSERT INTO t1 VALUES(0xADDF); +INSERT INTO t1 VALUES(0xADE0); +INSERT INTO t1 VALUES(0xADE1); +INSERT INTO t1 VALUES(0xADE2); +INSERT INTO t1 VALUES(0xADE3); +INSERT INTO t1 VALUES(0xADE4); +INSERT INTO t1 VALUES(0xADE5); +INSERT INTO t1 VALUES(0xADE6); +INSERT INTO t1 VALUES(0xADE7); +INSERT INTO t1 VALUES(0xADE8); +INSERT INTO t1 VALUES(0xADE9); +INSERT INTO t1 VALUES(0xADEA); +INSERT INTO t1 VALUES(0xADEB); +INSERT INTO t1 VALUES(0xADEC); +INSERT INTO t1 VALUES(0xADED); +INSERT INTO t1 VALUES(0xADEE); +INSERT INTO t1 VALUES(0xADEF); +INSERT INTO t1 VALUES(0xADF0); +INSERT INTO t1 VALUES(0xADF1); +INSERT INTO t1 VALUES(0xADF2); +INSERT INTO t1 VALUES(0xADF3); +INSERT INTO t1 VALUES(0xADF4); +INSERT INTO t1 VALUES(0xADF5); +INSERT INTO t1 VALUES(0xADF6); +INSERT INTO t1 VALUES(0xADF7); +INSERT INTO t1 VALUES(0xADF8); +INSERT INTO t1 VALUES(0xADF9); +INSERT INTO t1 VALUES(0xADFA); +INSERT INTO t1 VALUES(0xADFB); +INSERT INTO t1 VALUES(0xADFC); +INSERT INTO t1 VALUES(0xADFD); +INSERT INTO t1 VALUES(0xADFE); +INSERT INTO t1 VALUES(0xAEA1); +INSERT INTO t1 VALUES(0xAEA2); +INSERT INTO t1 VALUES(0xAEA3); +INSERT INTO t1 VALUES(0xAEA4); +INSERT INTO t1 VALUES(0xAEA5); +INSERT INTO t1 VALUES(0xAEA6); +INSERT INTO t1 VALUES(0xAEA7); +INSERT INTO t1 VALUES(0xAEA8); +INSERT INTO t1 VALUES(0xAEA9); +INSERT INTO t1 VALUES(0xAEAA); +INSERT INTO t1 VALUES(0xAEAB); +INSERT INTO t1 VALUES(0xAEAC); +INSERT INTO t1 VALUES(0xAEAD); +INSERT INTO t1 VALUES(0xAEAE); +INSERT INTO t1 VALUES(0xAEAF); +INSERT INTO t1 VALUES(0xAEB0); +INSERT INTO t1 VALUES(0xAEB1); +INSERT INTO t1 VALUES(0xAEB2); +INSERT INTO t1 VALUES(0xAEB3); +INSERT INTO t1 VALUES(0xAEB4); +INSERT INTO t1 VALUES(0xAEB5); +INSERT INTO t1 VALUES(0xAEB6); +INSERT INTO t1 VALUES(0xAEB7); +INSERT INTO t1 VALUES(0xAEB8); +INSERT INTO t1 VALUES(0xAEB9); +INSERT INTO t1 VALUES(0xAEBA); +INSERT INTO t1 VALUES(0xAEBB); +INSERT INTO t1 VALUES(0xAEBC); +INSERT INTO t1 VALUES(0xAEBD); +INSERT INTO t1 VALUES(0xAEBE); +INSERT INTO t1 VALUES(0xAEBF); +INSERT INTO t1 VALUES(0xAEC0); +INSERT INTO t1 VALUES(0xAEC1); +INSERT INTO t1 VALUES(0xAEC2); +INSERT INTO t1 VALUES(0xAEC3); +INSERT INTO t1 VALUES(0xAEC4); +INSERT INTO t1 VALUES(0xAEC5); +INSERT INTO t1 VALUES(0xAEC6); +INSERT INTO t1 VALUES(0xAEC7); +INSERT INTO t1 VALUES(0xAEC8); +INSERT INTO t1 VALUES(0xAEC9); +INSERT INTO t1 VALUES(0xAECA); +INSERT INTO t1 VALUES(0xAECB); +INSERT INTO t1 VALUES(0xAECC); +INSERT INTO t1 VALUES(0xAECD); +INSERT INTO t1 VALUES(0xAECE); +INSERT INTO t1 VALUES(0xAECF); +INSERT INTO t1 VALUES(0xAED0); +INSERT INTO t1 VALUES(0xAED1); +INSERT INTO t1 VALUES(0xAED2); +INSERT INTO t1 VALUES(0xAED3); +INSERT INTO t1 VALUES(0xAED4); +INSERT INTO t1 VALUES(0xAED5); +INSERT INTO t1 VALUES(0xAED6); +INSERT INTO t1 VALUES(0xAED7); +INSERT INTO t1 VALUES(0xAED8); +INSERT INTO t1 VALUES(0xAED9); +INSERT INTO t1 VALUES(0xAEDA); +INSERT INTO t1 VALUES(0xAEDB); +INSERT INTO t1 VALUES(0xAEDC); +INSERT INTO t1 VALUES(0xAEDD); +INSERT INTO t1 VALUES(0xAEDE); +INSERT INTO t1 VALUES(0xAEDF); +INSERT INTO t1 VALUES(0xAEE0); +INSERT INTO t1 VALUES(0xAEE1); +INSERT INTO t1 VALUES(0xAEE2); +INSERT INTO t1 VALUES(0xAEE3); +INSERT INTO t1 VALUES(0xAEE4); +INSERT INTO t1 VALUES(0xAEE5); +INSERT INTO t1 VALUES(0xAEE6); +INSERT INTO t1 VALUES(0xAEE7); +INSERT INTO t1 VALUES(0xAEE8); +INSERT INTO t1 VALUES(0xAEE9); +INSERT INTO t1 VALUES(0xAEEA); +INSERT INTO t1 VALUES(0xAEEB); +INSERT INTO t1 VALUES(0xAEEC); +INSERT INTO t1 VALUES(0xAEED); +INSERT INTO t1 VALUES(0xAEEE); +INSERT INTO t1 VALUES(0xAEEF); +INSERT INTO t1 VALUES(0xAEF0); +INSERT INTO t1 VALUES(0xAEF1); +INSERT INTO t1 VALUES(0xAEF2); +INSERT INTO t1 VALUES(0xAEF3); +INSERT INTO t1 VALUES(0xAEF4); +INSERT INTO t1 VALUES(0xAEF5); +INSERT INTO t1 VALUES(0xAEF6); +INSERT INTO t1 VALUES(0xAEF7); +INSERT INTO t1 VALUES(0xAEF8); +INSERT INTO t1 VALUES(0xAEF9); +INSERT INTO t1 VALUES(0xAEFA); +INSERT INTO t1 VALUES(0xAEFB); +INSERT INTO t1 VALUES(0xAEFC); +INSERT INTO t1 VALUES(0xAEFD); +INSERT INTO t1 VALUES(0xAEFE); +INSERT INTO t1 VALUES(0xAFA1); +INSERT INTO t1 VALUES(0xAFA2); +INSERT INTO t1 VALUES(0xAFA3); +INSERT INTO t1 VALUES(0xAFA4); +INSERT INTO t1 VALUES(0xAFA5); +INSERT INTO t1 VALUES(0xAFA6); +INSERT INTO t1 VALUES(0xAFA7); +INSERT INTO t1 VALUES(0xAFA8); +INSERT INTO t1 VALUES(0xAFA9); +INSERT INTO t1 VALUES(0xAFAA); +INSERT INTO t1 VALUES(0xAFAB); +INSERT INTO t1 VALUES(0xAFAC); +INSERT INTO t1 VALUES(0xAFAD); +INSERT INTO t1 VALUES(0xAFAE); +INSERT INTO t1 VALUES(0xAFAF); +INSERT INTO t1 VALUES(0xAFB0); +INSERT INTO t1 VALUES(0xAFB1); +INSERT INTO t1 VALUES(0xAFB2); +INSERT INTO t1 VALUES(0xAFB3); +INSERT INTO t1 VALUES(0xAFB4); +INSERT INTO t1 VALUES(0xAFB5); +INSERT INTO t1 VALUES(0xAFB6); +INSERT INTO t1 VALUES(0xAFB7); +INSERT INTO t1 VALUES(0xAFB8); +INSERT INTO t1 VALUES(0xAFB9); +INSERT INTO t1 VALUES(0xAFBA); +INSERT INTO t1 VALUES(0xAFBB); +INSERT INTO t1 VALUES(0xAFBC); +INSERT INTO t1 VALUES(0xAFBD); +INSERT INTO t1 VALUES(0xAFBE); +INSERT INTO t1 VALUES(0xAFBF); +INSERT INTO t1 VALUES(0xAFC0); +INSERT INTO t1 VALUES(0xAFC1); +INSERT INTO t1 VALUES(0xAFC2); +INSERT INTO t1 VALUES(0xAFC3); +INSERT INTO t1 VALUES(0xAFC4); +INSERT INTO t1 VALUES(0xAFC5); +INSERT INTO t1 VALUES(0xAFC6); +INSERT INTO t1 VALUES(0xAFC7); +INSERT INTO t1 VALUES(0xAFC8); +INSERT INTO t1 VALUES(0xAFC9); +INSERT INTO t1 VALUES(0xAFCA); +INSERT INTO t1 VALUES(0xAFCB); +INSERT INTO t1 VALUES(0xAFCC); +INSERT INTO t1 VALUES(0xAFCD); +INSERT INTO t1 VALUES(0xAFCE); +INSERT INTO t1 VALUES(0xAFCF); +INSERT INTO t1 VALUES(0xAFD0); +INSERT INTO t1 VALUES(0xAFD1); +INSERT INTO t1 VALUES(0xAFD2); +INSERT INTO t1 VALUES(0xAFD3); +INSERT INTO t1 VALUES(0xAFD4); +INSERT INTO t1 VALUES(0xAFD5); +INSERT INTO t1 VALUES(0xAFD6); +INSERT INTO t1 VALUES(0xAFD7); +INSERT INTO t1 VALUES(0xAFD8); +INSERT INTO t1 VALUES(0xAFD9); +INSERT INTO t1 VALUES(0xAFDA); +INSERT INTO t1 VALUES(0xAFDB); +INSERT INTO t1 VALUES(0xAFDC); +INSERT INTO t1 VALUES(0xAFDD); +INSERT INTO t1 VALUES(0xAFDE); +INSERT INTO t1 VALUES(0xAFDF); +INSERT INTO t1 VALUES(0xAFE0); +INSERT INTO t1 VALUES(0xAFE1); +INSERT INTO t1 VALUES(0xAFE2); +INSERT INTO t1 VALUES(0xAFE3); +INSERT INTO t1 VALUES(0xAFE4); +INSERT INTO t1 VALUES(0xAFE5); +INSERT INTO t1 VALUES(0xAFE6); +INSERT INTO t1 VALUES(0xAFE7); +INSERT INTO t1 VALUES(0xAFE8); +INSERT INTO t1 VALUES(0xAFE9); +INSERT INTO t1 VALUES(0xAFEA); +INSERT INTO t1 VALUES(0xAFEB); +INSERT INTO t1 VALUES(0xAFEC); +INSERT INTO t1 VALUES(0xAFED); +INSERT INTO t1 VALUES(0xAFEE); +INSERT INTO t1 VALUES(0xAFEF); +INSERT INTO t1 VALUES(0xAFF0); +INSERT INTO t1 VALUES(0xAFF1); +INSERT INTO t1 VALUES(0xAFF2); +INSERT INTO t1 VALUES(0xAFF3); +INSERT INTO t1 VALUES(0xAFF4); +INSERT INTO t1 VALUES(0xAFF5); +INSERT INTO t1 VALUES(0xAFF6); +INSERT INTO t1 VALUES(0xAFF7); +INSERT INTO t1 VALUES(0xAFF8); +INSERT INTO t1 VALUES(0xAFF9); +INSERT INTO t1 VALUES(0xAFFA); +INSERT INTO t1 VALUES(0xAFFB); +INSERT INTO t1 VALUES(0xAFFC); +INSERT INTO t1 VALUES(0xAFFD); +INSERT INTO t1 VALUES(0xAFFE); +INSERT INTO t1 VALUES(0xCFD4); +INSERT INTO t1 VALUES(0xCFD5); +INSERT INTO t1 VALUES(0xCFD6); +INSERT INTO t1 VALUES(0xCFD7); +INSERT INTO t1 VALUES(0xCFD8); +INSERT INTO t1 VALUES(0xCFD9); +INSERT INTO t1 VALUES(0xCFDA); +INSERT INTO t1 VALUES(0xCFDB); +INSERT INTO t1 VALUES(0xCFDC); +INSERT INTO t1 VALUES(0xCFDD); +INSERT INTO t1 VALUES(0xCFDE); +INSERT INTO t1 VALUES(0xCFDF); +INSERT INTO t1 VALUES(0xCFE0); +INSERT INTO t1 VALUES(0xCFE1); +INSERT INTO t1 VALUES(0xCFE2); +INSERT INTO t1 VALUES(0xCFE3); +INSERT INTO t1 VALUES(0xCFE4); +INSERT INTO t1 VALUES(0xCFE5); +INSERT INTO t1 VALUES(0xCFE6); +INSERT INTO t1 VALUES(0xCFE7); +INSERT INTO t1 VALUES(0xCFE8); +INSERT INTO t1 VALUES(0xCFE9); +INSERT INTO t1 VALUES(0xCFEA); +INSERT INTO t1 VALUES(0xCFEB); +INSERT INTO t1 VALUES(0xCFEC); +INSERT INTO t1 VALUES(0xCFED); +INSERT INTO t1 VALUES(0xCFEE); +INSERT INTO t1 VALUES(0xCFEF); +INSERT INTO t1 VALUES(0xCFF0); +INSERT INTO t1 VALUES(0xCFF1); +INSERT INTO t1 VALUES(0xCFF2); +INSERT INTO t1 VALUES(0xCFF3); +INSERT INTO t1 VALUES(0xCFF4); +INSERT INTO t1 VALUES(0xCFF5); +INSERT INTO t1 VALUES(0xCFF6); +INSERT INTO t1 VALUES(0xCFF7); +INSERT INTO t1 VALUES(0xCFF8); +INSERT INTO t1 VALUES(0xCFF9); +INSERT INTO t1 VALUES(0xCFFA); +INSERT INTO t1 VALUES(0xCFFB); +INSERT INTO t1 VALUES(0xCFFC); +INSERT INTO t1 VALUES(0xCFFD); +INSERT INTO t1 VALUES(0xCFFE); +INSERT INTO t1 VALUES(0xF4A7); +INSERT INTO t1 VALUES(0xF4A8); +INSERT INTO t1 VALUES(0xF4A9); +INSERT INTO t1 VALUES(0xF4AA); +INSERT INTO t1 VALUES(0xF4AB); +INSERT INTO t1 VALUES(0xF4AC); +INSERT INTO t1 VALUES(0xF4AD); +INSERT INTO t1 VALUES(0xF4AE); +INSERT INTO t1 VALUES(0xF4AF); +INSERT INTO t1 VALUES(0xF4B0); +INSERT INTO t1 VALUES(0xF4B1); +INSERT INTO t1 VALUES(0xF4B2); +INSERT INTO t1 VALUES(0xF4B3); +INSERT INTO t1 VALUES(0xF4B4); +INSERT INTO t1 VALUES(0xF4B5); +INSERT INTO t1 VALUES(0xF4B6); +INSERT INTO t1 VALUES(0xF4B7); +INSERT INTO t1 VALUES(0xF4B8); +INSERT INTO t1 VALUES(0xF4B9); +INSERT INTO t1 VALUES(0xF4BA); +INSERT INTO t1 VALUES(0xF4BB); +INSERT INTO t1 VALUES(0xF4BC); +INSERT INTO t1 VALUES(0xF4BD); +INSERT INTO t1 VALUES(0xF4BE); +INSERT INTO t1 VALUES(0xF4BF); +INSERT INTO t1 VALUES(0xF4C0); +INSERT INTO t1 VALUES(0xF4C1); +INSERT INTO t1 VALUES(0xF4C2); +INSERT INTO t1 VALUES(0xF4C3); +INSERT INTO t1 VALUES(0xF4C4); +INSERT INTO t1 VALUES(0xF4C5); +INSERT INTO t1 VALUES(0xF4C6); +INSERT INTO t1 VALUES(0xF4C7); +INSERT INTO t1 VALUES(0xF4C8); +INSERT INTO t1 VALUES(0xF4C9); +INSERT INTO t1 VALUES(0xF4CA); +INSERT INTO t1 VALUES(0xF4CB); +INSERT INTO t1 VALUES(0xF4CC); +INSERT INTO t1 VALUES(0xF4CD); +INSERT INTO t1 VALUES(0xF4CE); +INSERT INTO t1 VALUES(0xF4CF); +INSERT INTO t1 VALUES(0xF4D0); +INSERT INTO t1 VALUES(0xF4D1); +INSERT INTO t1 VALUES(0xF4D2); +INSERT INTO t1 VALUES(0xF4D3); +INSERT INTO t1 VALUES(0xF4D4); +INSERT INTO t1 VALUES(0xF4D5); +INSERT INTO t1 VALUES(0xF4D6); +INSERT INTO t1 VALUES(0xF4D7); +INSERT INTO t1 VALUES(0xF4D8); +INSERT INTO t1 VALUES(0xF4D9); +INSERT INTO t1 VALUES(0xF4DA); +INSERT INTO t1 VALUES(0xF4DB); +INSERT INTO t1 VALUES(0xF4DC); +INSERT INTO t1 VALUES(0xF4DD); +INSERT INTO t1 VALUES(0xF4DE); +INSERT INTO t1 VALUES(0xF4DF); +INSERT INTO t1 VALUES(0xF4E0); +INSERT INTO t1 VALUES(0xF4E1); +INSERT INTO t1 VALUES(0xF4E2); +INSERT INTO t1 VALUES(0xF4E3); +INSERT INTO t1 VALUES(0xF4E4); +INSERT INTO t1 VALUES(0xF4E5); +INSERT INTO t1 VALUES(0xF4E6); +INSERT INTO t1 VALUES(0xF4E7); +INSERT INTO t1 VALUES(0xF4E8); +INSERT INTO t1 VALUES(0xF4E9); +INSERT INTO t1 VALUES(0xF4EA); +INSERT INTO t1 VALUES(0xF4EB); +INSERT INTO t1 VALUES(0xF4EC); +INSERT INTO t1 VALUES(0xF4ED); +INSERT INTO t1 VALUES(0xF4EE); +INSERT INTO t1 VALUES(0xF4EF); +INSERT INTO t1 VALUES(0xF4F0); +INSERT INTO t1 VALUES(0xF4F1); +INSERT INTO t1 VALUES(0xF4F2); +INSERT INTO t1 VALUES(0xF4F3); +INSERT INTO t1 VALUES(0xF4F4); +INSERT INTO t1 VALUES(0xF4F5); +INSERT INTO t1 VALUES(0xF4F6); +INSERT INTO t1 VALUES(0xF4F7); +INSERT INTO t1 VALUES(0xF4F8); +INSERT INTO t1 VALUES(0xF4F9); +INSERT INTO t1 VALUES(0xF4FA); +INSERT INTO t1 VALUES(0xF4FB); +INSERT INTO t1 VALUES(0xF4FC); +INSERT INTO t1 VALUES(0xF4FD); +INSERT INTO t1 VALUES(0xF4FE); +SELECT HEX(c) FROM t1 ORDER BY BINARY c; +HEX(c) +A2AF +A2B0 +A2B1 +A2B2 +A2B3 +A2B4 +A2B5 +A2B6 +A2B7 +A2B8 +A2B9 +A2C2 +A2C3 +A2C4 +A2C5 +A2C6 +A2C7 +A2C8 +A2C9 +A2D1 +A2D2 +A2D3 +A2D4 +A2D5 +A2D6 +A2D7 +A2D8 +A2D9 +A2DA +A2DB +A2EB +A2EC +A2ED +A2EE +A2EF +A2F0 +A2F1 +A2FA +A2FB +A2FC +A2FD +A3A1 +A3A2 +A3A3 +A3A4 +A3A5 +A3A6 +A3A7 +A3A8 +A3A9 +A3AA +A3AB +A3AC +A3AD +A3AE +A3AF +A3BA +A3BB +A3BC +A3BD +A3BE +A3BF +A3C0 +A3DB +A3DC +A3DD +A3DE +A3DF +A3E0 +A3FB +A3FC +A3FD +A3FE +A4F4 +A4F5 +A4F6 +A4F7 +A4F8 +A4F9 +A4FA +A4FB +A4FC +A4FD +A4FE +A5F7 +A5F8 +A5F9 +A5FA +A5FB +A5FC +A5FD +A5FE +A6B9 +A6BA +A6BB +A6BC +A6BD +A6BE +A6BF +A6C0 +A6D9 +A6DA +A6DB +A6DC +A6DD +A6DE +A6DF +A6E0 +A6E1 +A6E2 +A6E3 +A6E4 +A6E5 +A6E6 +A6E7 +A6E8 +A6E9 +A6EA +A6EB +A6EC +A6ED +A6EE +A6EF +A6F0 +A6F1 +A6F2 +A6F3 +A6F4 +A6F5 +A6F6 +A6F7 +A6F8 +A6F9 +A6FA +A6FB +A6FC +A6FD +A6FE +A7C2 +A7C3 +A7C4 +A7C5 +A7C6 +A7C7 +A7C8 +A7C9 +A7CA +A7CB +A7CC +A7CD +A7CE +A7CF +A7D0 +A7F2 +A7F3 +A7F4 +A7F5 +A7F6 +A7F7 +A7F8 +A7F9 +A7FA +A7FB +A7FC +A7FD +A7FE +A8C1 +A8C2 +A8C3 +A8C4 +A8C5 +A8C6 +A8C7 +A8C8 +A8C9 +A8CA +A8CB +A8CC +A8CD +A8CE +A8CF +A8D0 +A8D1 +A8D2 +A8D3 +A8D4 +A8D5 +A8D6 +A8D7 +A8D8 +A8D9 +A8DA +A8DB +A8DC +A8DD +A8DE +A8DF +A8E0 +A8E1 +A8E2 +A8E3 +A8E4 +A8E5 +A8E6 +A8E7 +A8E8 +A8E9 +A8EA +A8EB +A8EC +A8ED +A8EE +A8EF +A8F0 +A8F1 +A8F2 +A8F3 +A8F4 +A8F5 +A8F6 +A8F7 +A8F8 +A8F9 +A8FA +A8FB +A8FC +A8FD +A8FE +A9A1 +A9A2 +A9A3 +A9A4 +A9A5 +A9A6 +A9A7 +A9A8 +A9A9 +A9AA +A9AB +A9AC +A9AD +A9AE +A9AF +A9B0 +A9B1 +A9B2 +A9B3 +A9B4 +A9B5 +A9B6 +A9B7 +A9B8 +A9B9 +A9BA +A9BB +A9BC +A9BD +A9BE +A9BF +A9C0 +A9C1 +A9C2 +A9C3 +A9C4 +A9C5 +A9C6 +A9C7 +A9C8 +A9C9 +A9CA +A9CB +A9CC +A9CD +A9CE +A9CF +A9D0 +A9D1 +A9D2 +A9D3 +A9D4 +A9D5 +A9D6 +A9D7 +A9D8 +A9D9 +A9DA +A9DB +A9DC +A9DD +A9DE +A9DF +A9E0 +A9E1 +A9E2 +A9E3 +A9E4 +A9E5 +A9E6 +A9E7 +A9E8 +A9E9 +A9EA +A9EB +A9EC +A9ED +A9EE +A9EF +A9F0 +A9F1 +A9F2 +A9F3 +A9F4 +A9F5 +A9F6 +A9F7 +A9F8 +A9F9 +A9FA +A9FB +A9FC +A9FD +A9FE +AAA1 +AAA2 +AAA3 +AAA4 +AAA5 +AAA6 +AAA7 +AAA8 +AAA9 +AAAA +AAAB +AAAC +AAAD +AAAE +AAAF +AAB0 +AAB1 +AAB2 +AAB3 +AAB4 +AAB5 +AAB6 +AAB7 +AAB8 +AAB9 +AABA +AABB +AABC +AABD +AABE +AABF +AAC0 +AAC1 +AAC2 +AAC3 +AAC4 +AAC5 +AAC6 +AAC7 +AAC8 +AAC9 +AACA +AACB +AACC +AACD +AACE +AACF +AAD0 +AAD1 +AAD2 +AAD3 +AAD4 +AAD5 +AAD6 +AAD7 +AAD8 +AAD9 +AADA +AADB +AADC +AADD +AADE +AADF +AAE0 +AAE1 +AAE2 +AAE3 +AAE4 +AAE5 +AAE6 +AAE7 +AAE8 +AAE9 +AAEA +AAEB +AAEC +AAED +AAEE +AAEF +AAF0 +AAF1 +AAF2 +AAF3 +AAF4 +AAF5 +AAF6 +AAF7 +AAF8 +AAF9 +AAFA +AAFB +AAFC +AAFD +AAFE +ABA1 +ABA2 +ABA3 +ABA4 +ABA5 +ABA6 +ABA7 +ABA8 +ABA9 +ABAA +ABAB +ABAC +ABAD +ABAE +ABAF +ABB0 +ABB1 +ABB2 +ABB3 +ABB4 +ABB5 +ABB6 +ABB7 +ABB8 +ABB9 +ABBA +ABBB +ABBC +ABBD +ABBE +ABBF +ABC0 +ABC1 +ABC2 +ABC3 +ABC4 +ABC5 +ABC6 +ABC7 +ABC8 +ABC9 +ABCA +ABCB +ABCC +ABCD +ABCE +ABCF +ABD0 +ABD1 +ABD2 +ABD3 +ABD4 +ABD5 +ABD6 +ABD7 +ABD8 +ABD9 +ABDA +ABDB +ABDC +ABDD +ABDE +ABDF +ABE0 +ABE1 +ABE2 +ABE3 +ABE4 +ABE5 +ABE6 +ABE7 +ABE8 +ABE9 +ABEA +ABEB +ABEC +ABED +ABEE +ABEF +ABF0 +ABF1 +ABF2 +ABF3 +ABF4 +ABF5 +ABF6 +ABF7 +ABF8 +ABF9 +ABFA +ABFB +ABFC +ABFD +ABFE +ACA1 +ACA2 +ACA3 +ACA4 +ACA5 +ACA6 +ACA7 +ACA8 +ACA9 +ACAA +ACAB +ACAC +ACAD +ACAE +ACAF +ACB0 +ACB1 +ACB2 +ACB3 +ACB4 +ACB5 +ACB6 +ACB7 +ACB8 +ACB9 +ACBA +ACBB +ACBC +ACBD +ACBE +ACBF +ACC0 +ACC1 +ACC2 +ACC3 +ACC4 +ACC5 +ACC6 +ACC7 +ACC8 +ACC9 +ACCA +ACCB +ACCC +ACCD +ACCE +ACCF +ACD0 +ACD1 +ACD2 +ACD3 +ACD4 +ACD5 +ACD6 +ACD7 +ACD8 +ACD9 +ACDA +ACDB +ACDC +ACDD +ACDE +ACDF +ACE0 +ACE1 +ACE2 +ACE3 +ACE4 +ACE5 +ACE6 +ACE7 +ACE8 +ACE9 +ACEA +ACEB +ACEC +ACED +ACEE +ACEF +ACF0 +ACF1 +ACF2 +ACF3 +ACF4 +ACF5 +ACF6 +ACF7 +ACF8 +ACF9 +ACFA +ACFB +ACFC +ACFD +ACFE +ADA1 +ADA2 +ADA3 +ADA4 +ADA5 +ADA6 +ADA7 +ADA8 +ADA9 +ADAA +ADAB +ADAC +ADAD +ADAE +ADAF +ADB0 +ADB1 +ADB2 +ADB3 +ADB4 +ADB5 +ADB6 +ADB7 +ADB8 +ADB9 +ADBA +ADBB +ADBC +ADBD +ADBE +ADBF +ADC0 +ADC1 +ADC2 +ADC3 +ADC4 +ADC5 +ADC6 +ADC7 +ADC8 +ADC9 +ADCA +ADCB +ADCC +ADCD +ADCE +ADCF +ADD0 +ADD1 +ADD2 +ADD3 +ADD4 +ADD5 +ADD6 +ADD7 +ADD8 +ADD9 +ADDA +ADDB +ADDC +ADDD +ADDE +ADDF +ADE0 +ADE1 +ADE2 +ADE3 +ADE4 +ADE5 +ADE6 +ADE7 +ADE8 +ADE9 +ADEA +ADEB +ADEC +ADED +ADEE +ADEF +ADF0 +ADF1 +ADF2 +ADF3 +ADF4 +ADF5 +ADF6 +ADF7 +ADF8 +ADF9 +ADFA +ADFB +ADFC +ADFD +ADFE +AEA1 +AEA2 +AEA3 +AEA4 +AEA5 +AEA6 +AEA7 +AEA8 +AEA9 +AEAA +AEAB +AEAC +AEAD +AEAE +AEAF +AEB0 +AEB1 +AEB2 +AEB3 +AEB4 +AEB5 +AEB6 +AEB7 +AEB8 +AEB9 +AEBA +AEBB +AEBC +AEBD +AEBE +AEBF +AEC0 +AEC1 +AEC2 +AEC3 +AEC4 +AEC5 +AEC6 +AEC7 +AEC8 +AEC9 +AECA +AECB +AECC +AECD +AECE +AECF +AED0 +AED1 +AED2 +AED3 +AED4 +AED5 +AED6 +AED7 +AED8 +AED9 +AEDA +AEDB +AEDC +AEDD +AEDE +AEDF +AEE0 +AEE1 +AEE2 +AEE3 +AEE4 +AEE5 +AEE6 +AEE7 +AEE8 +AEE9 +AEEA +AEEB +AEEC +AEED +AEEE +AEEF +AEF0 +AEF1 +AEF2 +AEF3 +AEF4 +AEF5 +AEF6 +AEF7 +AEF8 +AEF9 +AEFA +AEFB +AEFC +AEFD +AEFE +AFA1 +AFA2 +AFA3 +AFA4 +AFA5 +AFA6 +AFA7 +AFA8 +AFA9 +AFAA +AFAB +AFAC +AFAD +AFAE +AFAF +AFB0 +AFB1 +AFB2 +AFB3 +AFB4 +AFB5 +AFB6 +AFB7 +AFB8 +AFB9 +AFBA +AFBB +AFBC +AFBD +AFBE +AFBF +AFC0 +AFC1 +AFC2 +AFC3 +AFC4 +AFC5 +AFC6 +AFC7 +AFC8 +AFC9 +AFCA +AFCB +AFCC +AFCD +AFCE +AFCF +AFD0 +AFD1 +AFD2 +AFD3 +AFD4 +AFD5 +AFD6 +AFD7 +AFD8 +AFD9 +AFDA +AFDB +AFDC +AFDD +AFDE +AFDF +AFE0 +AFE1 +AFE2 +AFE3 +AFE4 +AFE5 +AFE6 +AFE7 +AFE8 +AFE9 +AFEA +AFEB +AFEC +AFED +AFEE +AFEF +AFF0 +AFF1 +AFF2 +AFF3 +AFF4 +AFF5 +AFF6 +AFF7 +AFF8 +AFF9 +AFFA +AFFB +AFFC +AFFD +AFFE +CFD4 +CFD5 +CFD6 +CFD7 +CFD8 +CFD9 +CFDA +CFDB +CFDC +CFDD +CFDE +CFDF +CFE0 +CFE1 +CFE2 +CFE3 +CFE4 +CFE5 +CFE6 +CFE7 +CFE8 +CFE9 +CFEA +CFEB +CFEC +CFED +CFEE +CFEF +CFF0 +CFF1 +CFF2 +CFF3 +CFF4 +CFF5 +CFF6 +CFF7 +CFF8 +CFF9 +CFFA +CFFB +CFFC +CFFD +CFFE +F4A7 +F4A8 +F4A9 +F4AA +F4AB +F4AC +F4AD +F4AE +F4AF +F4B0 +F4B1 +F4B2 +F4B3 +F4B4 +F4B5 +F4B6 +F4B7 +F4B8 +F4B9 +F4BA +F4BB +F4BC +F4BD +F4BE +F4BF +F4C0 +F4C1 +F4C2 +F4C3 +F4C4 +F4C5 +F4C6 +F4C7 +F4C8 +F4C9 +F4CA +F4CB +F4CC +F4CD +F4CE +F4CF +F4D0 +F4D1 +F4D2 +F4D3 +F4D4 +F4D5 +F4D6 +F4D7 +F4D8 +F4D9 +F4DA +F4DB +F4DC +F4DD +F4DE +F4DF +F4E0 +F4E1 +F4E2 +F4E3 +F4E4 +F4E5 +F4E6 +F4E7 +F4E8 +F4E9 +F4EA +F4EB +F4EC +F4ED +F4EE +F4EF +F4F0 +F4F1 +F4F2 +F4F3 +F4F4 +F4F5 +F4F6 +F4F7 +F4F8 +F4F9 +F4FA +F4FB +F4FC +F4FD +F4FE +DROP TABLE t1; +SET collation_connection='ujis_japanese_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ujis_japanese_ci 6109 +ujis_japanese_ci 61 +ujis_japanese_ci 6120 +drop table t1; +SET collation_connection='ujis_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ujis_bin 6109 +ujis_bin 61 +ujis_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 945ec8eae99..13105e2276c 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -412,7 +412,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` char(10) character set utf8 default NULL, - UNIQUE KEY `a` (`c`(1)) + UNIQUE KEY `a` TYPE HASH (`c`(1)) ) ENGINE=HEAP DEFAULT CHARSET=latin1 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('aa'); @@ -570,7 +570,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` char(10) character set utf8 collate utf8_bin default NULL, - UNIQUE KEY `a` (`c`(1)) + UNIQUE KEY `a` TYPE HASH (`c`(1)) ) ENGINE=HEAP DEFAULT CHARSET=latin1 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('aa'); @@ -814,3 +814,53 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2; drop table t1; +select 'c' like '\_' as want0; +want0 +0 +create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci); +insert into t1 values (1, 'Test'); +select * from t1 where soundex(a) = soundex('Test'); +id a +1 Test +select * from t1 where soundex(a) = soundex('TEST'); +id a +1 Test +select * from t1 where soundex(a) = soundex('test'); +id a +1 Test +drop table t1; +SET collation_connection='utf8_general_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8_general_ci 6109 +utf8_general_ci 61 +utf8_general_ci 6120 +drop table t1; +SET collation_connection='utf8_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8_bin 6109 +utf8_bin 61 +utf8_bin 6120 +drop table t1; +CREATE TABLE t1 ( +user varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('one'),('two'); +SELECT CHARSET('a'); +CHARSET('a') +utf8 +SELECT user, CONCAT('<', user, '>') AS c FROM t1; +user c +one <one> +two <two> +DROP TABLE t1; +select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8); +convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8) +1 diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 758a83defed..2db014c4a52 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -296,6 +296,9 @@ Tuesday 52 2001 %W %V %X 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 15-01-20 %d-%m-%y 00:00:00 15-2001-1 %d-%Y-%c 00:00:00 +select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); +concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) +2003-01-02 08:11:02.123456 truncate table t1; insert into t1 values ('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'), diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 5575ee1bf98..411cd52b4ca 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -16,12 +16,34 @@ SET AUTOCOMMIT=0; DELETE from t1; SET AUTOCOMMIT=1; drop table t1; -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); +create table t1 ( +a bigint not null, +b bigint not null default 0, +c bigint not null default 0, +d bigint not null default 0, +e bigint not null default 0, +f bigint not null default 0, +g bigint not null default 0, +h bigint not null default 0, +i bigint not null default 0, +j bigint not null default 0, +primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); delete from t1 where a=26; drop table t1; -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); +create table t1 ( +a bigint not null, +b bigint not null default 0, +c bigint not null default 0, +d bigint not null default 0, +e bigint not null default 0, +f bigint not null default 0, +g bigint not null default 0, +h bigint not null default 0, +i bigint not null default 0, +j bigint not null default 0, +primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; CREATE TABLE `t1` ( @@ -141,3 +163,12 @@ select * from t1; a b 7 7 drop table t1; +CREATE TABLE t1 ( a int PRIMARY KEY ); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; +INSERT INTO t1 VALUES (0),(1),(2); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1; +SELECT * FROM t1; +a +0 +2 +DROP TABLE t1; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 7e6b9b44566..b4d9a921178 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -330,3 +330,31 @@ SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MA min max avg 10.00 10.00 10 DROP TABLE t1; +create table t1 (a integer, b integer); +insert into t1 values (1,4), (2,2),(2,2), (4,1),(4,1),(4,1),(4,1); +select distinct sum(b) from t1 group by a; +sum(b) +4 +select distinct sum(b) from (select a,b from t1) y group by a; +sum(b) +4 +drop table t1; +create table t1(a int); +create table t2(a int); +create table t3(a int); +insert into t1 values(1),(1); +insert into t2 values(2),(2); +insert into t3 values(3),(3); +select * from t1 union distinct select * from t2 union all select * from t3; +a +1 +2 +3 +3 +select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; +a +1 +2 +3 +3 +drop table t1, t2, t3; diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 80af2dd0983..f4bc4263c4d 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -190,7 +190,7 @@ insert into t3 select * from t4; explain select distinct t1.a from t1,t3 where t1.a=t3.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary -1 SIMPLE t3 ref a a 5 test.t1.a 10 Using where; Using index; Distinct +1 SIMPLE t3 ref a a 5 test.t1.a 11 Using where; Using index; Distinct select distinct t1.a from t1,t3 where t1.a=t3.a; a 1 diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result index 8b919964163..223ceb003b3 100644 --- a/mysql-test/r/drop.result +++ b/mysql-test/r/drop.result @@ -1,5 +1,6 @@ drop table if exists t1; drop database if exists mysqltest; +drop database if exists client_test_db; drop table t1; ERROR 42S02: Unknown table 't1' create table t1(n int); diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result index 99ee0143c05..5f1f142cde5 100644 --- a/mysql-test/r/drop_temp_table.result +++ b/mysql-test/r/drop_temp_table.result @@ -1,7 +1,9 @@ reset master; create database `drop-temp+table-test`; use `drop-temp+table-test`; +create temporary table shortn1 (a int); create temporary table `table:name` (a int); +create temporary table shortn2 (a int); select get_lock("a",10); get_lock("a",10) 1 @@ -10,9 +12,11 @@ get_lock("a",10) 1 show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.000001 79 Query 1 79 use `test`; create database `drop-temp+table-test` -master-bin.000001 152 Query 1 152 use `drop-temp+table-test`; create temporary table `table:name` (a int) -master-bin.000001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` -master-bin.000001 375 Query 1 375 use `drop-temp+table-test`; DO RELEASE_LOCK("a") +master-bin.000001 # Start 1 # Server ver: VERSION, Binlog ver: 3 +master-bin.000001 # Query 1 # create database `drop-temp+table-test` +master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn1 (a int) +master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table `table:name` (a int) +master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn2 (a int) +master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1` +master-bin.000001 # Query 1 # use `drop-temp+table-test`; DO RELEASE_LOCK("a") drop database `drop-temp+table-test`; diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result index 17991f15382..2e9f1920937 100644 --- a/mysql-test/r/flush_block_commit.result +++ b/mysql-test/r/flush_block_commit.result @@ -20,4 +20,20 @@ commit; a 1 unlock tables; +commit; +begin; +insert into t1 values(10); +flush tables with read lock; +commit; +unlock tables; +flush tables with read lock; +unlock tables; +begin; +select * from t1; +a +1 +10 +show create database test; +Database Create Database +test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ drop table t1; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 30c4c75f3d1..dd5b0407eb3 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -148,6 +148,9 @@ select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN B a b select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); a b +select * from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE); +a b +Full-text indexes are called collections select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); a b select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE); @@ -190,6 +193,14 @@ a select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode); a aaa10 bbb20 +select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode); +a +aaa20 bbb15 +aaa30 bbb10 +select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode); +a +aaa20 bbb15 +aaa30 bbb10 drop table t1; CREATE TABLE t1 ( id int(11), @@ -330,6 +341,9 @@ t1_id name t2_id t1_id name select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode); t2_id t1_id name drop table t1,t2; +create table t1 (a text, fulltext key (a)); +insert into t1 select "xxxx yyyy zzzz"; +drop table t1; SET NAMES latin1; CREATE TABLE t1 (t text character set utf8 not null, fulltext(t)); INSERT t1 VALUES ('Mit freundlichem Grüß'), ('aus Osnabrück'); @@ -352,10 +366,15 @@ t collation(t) aus Osnabrück utf8_general_ci SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); t collation(t) -SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); -t collation(t) MATCH t AGAINST ('Osnabruck') -aus Osnabrück utf8_general_ci 1.591139793396 +SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); +t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6) +aus Osnabrück utf8_general_ci 1.591140 alter table t1 modify t varchar(200) collate latin1_german2_ci not null; +Warnings: +Warning 1265 Data truncated for column 't' at row 3 +Warning 1265 Data truncated for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 5 +Warning 1265 Data truncated for column 't' at row 6 SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); t collation(t) aus Osnabrück latin1_german2_ci @@ -374,3 +393,31 @@ s pära para para para para para DROP TABLE t1; +CREATE TABLE t1 (h text, FULLTEXT (h)); +INSERT INTO t1 VALUES ('Jesses Hasse Ling and his syncopators of Swing'); +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +select count(*) from t1; +count(*) +1 +drop table t1; +CREATE TABLE t1 ( a TEXT, FULLTEXT (a) ); +INSERT INTO t1 VALUES ('testing ft_nlq_find_relevance'); +SELECT MATCH(a) AGAINST ('nosuchword') FROM t1; +MATCH(a) AGAINST ('nosuchword') +0 +DROP TABLE t1; +create table t1 (a int primary key, b text, fulltext(b)); +create table t2 (a int, b text); +insert t1 values (1, "aaaa"), (2, "bbbb"); +insert t2 values (10, "aaaa"), (2, "cccc"); +replace t1 select * from t2; +drop table t1, t2; +CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t)); +SET NAMES latin1; +INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück'); +SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE); +COUNT(*) +1 +DROP TABLE t1; diff --git a/mysql-test/r/fulltext_cache.result b/mysql-test/r/fulltext_cache.result index 6a94189d8b4..80c101357c5 100644 --- a/mysql-test/r/fulltext_cache.result +++ b/mysql-test/r/fulltext_cache.result @@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka'); INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 -aaaaaaaaa dsaass de Feijoada 3 0.00000000 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 -ssde df s fsda sad er um copo de Vodka 5 0.00000000 -ssde df s fsda sad er um chocolate Snickers 6 0.00000000 -aaaaaaaaa dsaass de Bife 7 0.00000000 -aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 +aaaaaaaaa dsaass de sushi 1 1.923787 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000 +aaaaaaaaa dsaass de Feijoada 3 0.000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000 +ssde df s fsda sad er um copo de Vodka 5 0.000000 +ssde df s fsda sad er um chocolate Snickers 6 0.000000 +aaaaaaaaa dsaass de Bife 7 0.000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x @@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0 ssde df s fsda sad er um chocolate Snickers 6 0 aaaaaaaaa dsaass de Bife 7 0 aaaaaaaaa dsaass de Pizza de Salmao 8 0 -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 -aaaaaaaaa dsaass de Feijoada 3 0.00000000 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 -ssde df s fsda sad er um copo de Vodka 5 0.00000000 -ssde df s fsda sad er um chocolate Snickers 6 0.00000000 -aaaaaaaaa dsaass de Bife 7 0.00000000 -aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 +aaaaaaaaa dsaass de sushi 1 1.923787 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000 +aaaaaaaaa dsaass de Feijoada 3 0.000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000 +ssde df s fsda sad er um copo de Vodka 5 0.000000 +ssde df s fsda sad er um chocolate Snickers 6 0.000000 +aaaaaaaaa dsaass de Bife 7 0.000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x diff --git a/mysql-test/r/fulltext_order_by.result b/mysql-test/r/fulltext_order_by.result index bfee9eba280..c6c42fa2e8b 100644 --- a/mysql-test/r/fulltext_order_by.result +++ b/mysql-test/r/fulltext_order_by.result @@ -6,53 +6,53 @@ FULLTEXT(message) ) comment = 'original testcase by sroussey@network54.com'; INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"), ("steve"),("is"),("cool"),("steve is cool"); -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve'); -a MATCH (message) AGAINST ('steve') -4 0.90587323904037 -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve'); +a FORMAT(MATCH (message) AGAINST ('steve'),6) +4 0.905873 +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve'); a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 4 1 7 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); -a MATCH (message) AGAINST ('steve') -4 0.90587323904037 -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); +a FORMAT(MATCH (message) AGAINST ('steve'),6) +4 0.905873 +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 4 1 7 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; -a MATCH (message) AGAINST ('steve') -4 0.90587323904037 -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; +a FORMAT(MATCH (message) AGAINST ('steve'),6) +4 0.905873 +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a; a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 4 1 7 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; -a MATCH (message) AGAINST ('steve') -7 0.89568990468979 -4 0.90587323904037 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; +a FORMAT(MATCH (message) AGAINST ('steve'),6) +7 0.895690 +4 0.905873 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC; a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 7 1 4 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; -a MATCH (message) AGAINST ('steve') -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; +a FORMAT(MATCH (message) AGAINST ('steve'),6) +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1; a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 7 1 -SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; a rel -1 0 -2 0 -3 0 -5 0 -6 0 -7 0.89568990468979 -4 0.90587323904037 +1 0.000000 +2 0.000000 +3 0.000000 +5 0.000000 +6 0.000000 +7 0.895690 +4 0.905873 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; a rel 1 0 diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 11dbcca9431..9bc8e417e19 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -69,6 +69,6 @@ Error 1259 ZLIB: Input data corrupted Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) drop table t1; set @@max_allowed_packet=1048576*100; -select compress(repeat('aaaaaaaaaa', 10000000)) is null; -compress(repeat('aaaaaaaaaa', 10000000)) is null +select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null; +compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null 0 diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index ec53d6d87b0..cf6fbf2da4f 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -32,3 +32,35 @@ select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; a b c d AAAA 105 2003-03-01 1 drop table t1; +select 'a' union select concat('a', -4); +a +a +a-4 +select 'a' union select concat('a', -4.5); +a +a +a-4.5 +select 'a' union select concat('a', -(4 + 1)); +a +a +a-5 +select 'a' union select concat('a', 4 - 5); +a +a +a-1 +select 'a' union select concat('a', -'3'); +a +a +a-3 +select 'a' union select concat('a', -concat('3',4)); +a +a +a-34 +select 'a' union select concat('a', -0); +a +a +a0 +select 'a' union select concat('a', -0.0); +a +a +good diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index aa202823c77..390b33fdddc 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -457,3 +457,8 @@ group_concat(distinct b order by b) Warnings: Warning 1260 2 line(s) were cut by GROUP_CONCAT() drop table t1; +CREATE TABLE t1 (id int); +SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; +gc +NULL +DROP TABLE t1; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index c25f89d4df3..fa645700875 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -637,8 +637,22 @@ create table t1 (a char(10)); insert into t1 values ('a'),('b'),('c'); select coercibility(max(a)) from t1; coercibility(max(a)) -3 +2 drop table t1; +create table t1 (a char character set latin2); +insert into t1 values ('a'),('b'); +select charset(max(a)), coercibility(max(a)), +charset(min(a)), coercibility(min(a)) from t1; +charset(max(a)) coercibility(max(a)) charset(min(a)) coercibility(min(a)) +latin2 2 latin2 2 +create table t2 select max(a),min(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `max(a)` char(1) character set latin2 default NULL, + `min(a)` char(1) character set latin2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t2,t1; create table t1 (a int); insert into t1 values (1); select max(a) as b from t1 having b=1; @@ -719,3 +733,15 @@ one 2 two 2 three 1 drop table t1; +create table t1(f1 datetime); +insert into t1 values (now()); +create table t2 select f2 from (select max(now()) f2 from t1) a; +show columns from t2; +Field Type Null Key Default Extra +f2 datetime 0000-00-00 00:00:00 +drop table t2; +create table t2 select f2 from (select now() f2 from t1) a; +show columns from t2; +Field Type Null Key Default Extra +f2 datetime 0000-00-00 00:00:00 +drop table t2, t1; diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 374affce8c5..516d0a28a21 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -157,6 +157,14 @@ a bbbb цццц drop table t1; +create table t1 (a char(10) character set latin1 not null); +insert into t1 values ('a'),('b'),('c'); +select a from t1 where a IN ('a','b','c') order by a; +a +a +b +c +drop table t1; set names latin1; select '1.0' in (1,2); '1.0' in (1,2) @@ -179,3 +187,9 @@ select 1 in ('1.1',2); select 1 in ('1.1',2.0); 1 in ('1.1',2.0) 0 +create table t1 (a char(20) character set binary); +insert into t1 values ('aa'), ('bb'); +select * from t1 where a in (NULL, 'aa'); +a +aa +drop table t1; diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 90aa04515d7..3a28cccfac5 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -124,3 +124,5 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` +select rand(rand); +ERROR 42S22: Unknown column 'rand' in 'field list' diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 5a9f0f68228..2d464c891bf 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -28,3 +28,24 @@ length(format('nan', 2)) > 0 select concat("$",format(2500,2)); concat("$",format(2500,2)) $2,500.00 +create table t1 ( a timestamp ); +insert into t1 values ( '2004-01-06 12:34' ); +select a from t1 where left(a+0,6) in ( left(20040106,6) ); +a +2004-01-06 12:34:00 +select a from t1 where left(a+0,6) = ( left(20040106,6) ); +a +2004-01-06 12:34:00 +select a from t1 where right(a+0,6) in ( right(20040106123400,6) ); +a +2004-01-06 12:34:00 +select a from t1 where right(a+0,6) = ( right(20040106123400,6) ); +a +2004-01-06 12:34:00 +select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) ); +a +2004-01-06 12:34:00 +select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) ); +a +2004-01-06 12:34:00 +drop table t1; diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index cf2bd687115..c74d6fc5a4e 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -97,13 +97,16 @@ timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") 46:58:57.999999 select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") --23:59:59.999999 +-24:00:00.000001 select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); timediff("1997-12-31 23:59:59.000001","23:59:59.000001") NULL select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001") -00:00:00.000001 +select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50"); +timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50") +-00:00:00.000001 select maketime(10,11,12); maketime(10,11,12) 10:11:12 @@ -175,7 +178,7 @@ f8 date YES NULL f9 time YES NULL select * from t1; f1 f2 f3 f4 f5 f6 f7 f8 f9 -1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -23:59:59 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59 +1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -24:00:00 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59 create table test(t1 datetime, t2 time, t3 time, t4 datetime); insert into test values ('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'), diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 4a3a70274fd..f238915d3b9 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -201,6 +201,9 @@ hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex( select length(unhex(md5("abrakadabra"))); length(unhex(md5("abrakadabra"))) 16 +select concat('a', quote(NULL)); +concat('a', quote(NULL)) +aNULL select reverse(""); reverse("") @@ -312,7 +315,7 @@ insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n') one 'one' 0 0 'one' -NULL NULL 1 1 n +NULL NULL 0 0 NULL two 'two' 0 0 'two' four 'four' 0 0 'four' drop table t1; @@ -322,6 +325,19 @@ trim(trailing 'foo' from 'foo') select trim(leading 'foo' from 'foo'); trim(leading 'foo' from 'foo') +select quote(ltrim(concat(' ', 'a'))); +quote(ltrim(concat(' ', 'a'))) +'a' +select quote(trim(concat(' ', 'a'))); +quote(trim(concat(' ', 'a'))) +'a' +CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; +SELECT QUOTE('A') FROM t1; +QUOTE('A') +'A' +'A' +'A' +DROP TABLE t1; select 1=_latin1'1'; 1=_latin1'1' 1 @@ -460,7 +476,7 @@ collation(hex(130)) coercibility(hex(130)) latin1_swedish_ci 3 select collation(char(130)), coercibility(hex(130)); collation(char(130)) coercibility(hex(130)) -binary 3 +latin1_swedish_ci 3 select collation(format(130,10)), coercibility(format(130,10)); collation(format(130,10)) coercibility(format(130,10)) latin1_swedish_ci 3 @@ -682,3 +698,44 @@ drop table t1; select left(1234, 3) + 0; left(1234, 3) + 0 123 +create table t1 (a int not null primary key, b varchar(40), c datetime); +insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +total reg +10 2004-12-10 +drop table t1; +select trim(null from 'kate') as "must_be_null"; +must_be_null +NULL +select trim('xyz' from null) as "must_be_null"; +must_be_null +NULL +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +a bigint(20) unsigned default NULL, +PRIMARY KEY (id) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES +('0','16307858876001849059'); +SELECT CONV('e251273eb74a8ee3', 16, 10); +CONV('e251273eb74a8ee3', 16, 10) +16307858876001849059 +EXPLAIN +SELECT id +FROM t1 +WHERE a = 16307858876001849059; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +EXPLAIN +SELECT id +FROM t1 +WHERE a = CONV('e251273eb74a8ee3', 16, 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +DROP TABLE t1; +SELECT CHAR(NULL,121,83,81,'76') as my_column; +my_column +ySQL +SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column; +my_column +4 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 2dc6bffd071..4dd00ab74a1 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -474,6 +474,15 @@ unix_timestamp(@a) select unix_timestamp('1969-12-01 19:00:01'); unix_timestamp('1969-12-01 19:00:01') 0 +select from_unixtime(-1); +from_unixtime(-1) +NULL +select from_unixtime(2145916800); +from_unixtime(2145916800) +NULL +select from_unixtime(0); +from_unixtime(0) +1970-01-01 03:00:00 CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time); INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08"); SELECT * from t1; diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 3fb1a5dd31c..7b63654ffaf 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -757,3 +757,50 @@ SPATIAL KEY(g) ) ENGINE=MyISAM; INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); drop table t1; +CREATE TABLE t1 ( +geoobjid INT NOT NULL, +line LINESTRING NOT NULL, +kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', +name VARCHAR(32), +SPATIAL KEY (line) +) engine=myisam; +ALTER TABLE t1 DISABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES +("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), +("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), +("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), +("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), +("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), +("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), +("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), +("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), +("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), +("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), +("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), +("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), +("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), +("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), +("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), +("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), +("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), +("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), +("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), +("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), +("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), +("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), +("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), +("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), +("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), +("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), +("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), +("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), +("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); +ALTER TABLE t1 ENABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); +drop table t1; +CREATE TABLE t1 (st varchar(100)); +INSERT INTO t1 VALUES ("Fake string"); +CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); +INSERT INTO t2 SELECT GeomFromText(st) FROM t1; +ERROR HY000: Unknown error +drop table t1, t2; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 2226c6e33c9..c51b07f09d6 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -581,3 +581,77 @@ t1 CREATE TABLE `t1` ( `POINT(1,3)` longblob NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` +geometry NOT NULL default '') ENGINE=MyISAM ; +insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 +36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163 +36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363 +36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364 +36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882 +36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207 +36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017 +36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072 +36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755 +36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725 +36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556 +36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105 +36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344 +36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356 +36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499 +36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308 +36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527 +36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113 +36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354 +36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768 +36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662 +36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659 +36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764 +36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517 +36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403 +36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183 +36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729 +36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934 +36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731 +36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759 +36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835 +36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758 +36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843 +36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051 +36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913 +36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918 +36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314 +36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858 +36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335 +36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734 +36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491 +36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133 +36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233 +36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533 +36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331 +36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535 +36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135 +36.240569,-115.083135 36.240569,-115.079835 +36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107 +36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226 +36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733 +36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107 +36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438 +36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545 +36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757 +36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489 +36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519 +36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553 +36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347 +36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069 +36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039 +36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439 +36.252666,-115.261439 36.247366,-115.247239 36.247066)))')); +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85998; +object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) +85998 MULTIPOLYGON 0 POINT(115.31877315203 -36.237472821022) +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85984; +object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) +85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469) +drop table t1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 141e96c8424..22b34ebef62 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -37,6 +37,28 @@ Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA' delete from mysql.user where user='mysqltest_1'; flush privileges; +delete from mysql.user where user='mysqltest_1'; +flush privileges; +grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N 10 0 0 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 +grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N 10 20 30 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 +delete from mysql.user where user='mysqltest_1'; +flush privileges; grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost @@ -134,6 +156,31 @@ ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES select 1; 1 1 +insert into mysql.user (host, user) values ('localhost', 'test11'); +insert into mysql.db (host, db, user, select_priv) values +('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); +alter table mysql.db order by db asc; +flush privileges; +show grants for test11@localhost; +Grants for test11@localhost +GRANT USAGE ON *.* TO 'test11'@'localhost' +GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' +GRANT SELECT ON `a%`.* TO 'test11'@'localhost' +alter table mysql.db order by db desc; +flush privileges; +show grants for test11@localhost; +Grants for test11@localhost +GRANT USAGE ON *.* TO 'test11'@'localhost' +GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' +GRANT SELECT ON `a%`.* TO 'test11'@'localhost' +delete from mysql.user where user='test11'; +delete from mysql.db where user='test11'; +create database mysqltest1; +grant usage on mysqltest1.* to test6123 identified by 'magic123'; +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +host db user select_priv insert_priv +delete from mysql.user where user='test6123'; +drop database mysqltest1; create table t1 (a int); grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION; show grants for drop_user2@localhost; @@ -229,25 +276,6 @@ GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; DROP DATABASE ÂÄ; SET NAMES latin1; -insert into mysql.user (host, user) values ('localhost', 'test11'); -insert into mysql.db (host, db, user, select_priv) values -('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); -alter table mysql.db order by db asc; -flush privileges; -show grants for test11@localhost; -Grants for test11@localhost -GRANT USAGE ON *.* TO 'test11'@'localhost' -GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' -GRANT SELECT ON `a%`.* TO 'test11'@'localhost' -alter table mysql.db order by db desc; -flush privileges; -show grants for test11@localhost; -Grants for test11@localhost -GRANT USAGE ON *.* TO 'test11'@'localhost' -GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' -GRANT SELECT ON `a%`.* TO 'test11'@'localhost' -delete from mysql.user where user='test11'; -delete from mysql.db where user='test11'; USE test; CREATE TABLE t1 (a int ); CREATE TABLE t2 LIKE t1; @@ -315,3 +343,87 @@ DROP DATABASE testdb7; DROP DATABASE testdb8; DROP DATABASE testdb9; DROP DATABASE testdb10; +create table t1(a int, b int, c int, d int); +grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost; +show grants for grant_user@localhost; +Grants for grant_user@localhost +GRANT USAGE ON *.* TO 'grant_user'@'localhost' +GRANT INSERT (a, d, c, b) ON `test`.`t1` TO 'grant_user'@'localhost' +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +Host Db User Table_name Column_name Column_priv +localhost test grant_user t1 c Insert +localhost test grant_user t1 b Insert +localhost test grant_user t1 a Insert +localhost test grant_user t1 d Insert +revoke ALL PRIVILEGES on t1 from grant_user@localhost; +show grants for grant_user@localhost; +Grants for grant_user@localhost +GRANT USAGE ON *.* TO 'grant_user'@'localhost' +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +Host Db User Table_name Column_name Column_priv +drop user grant_user@localhost; +drop table t1; +create database mysqltest_1; +create database mysqltest_2; +create table mysqltest_1.t1 select 1 a, 2 q; +create table mysqltest_1.t2 select 1 b, 2 r; +create table mysqltest_2.t1 select 1 c, 2 s; +create table mysqltest_2.t2 select 1 d, 2 t; +grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; +grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; +grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; +grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +GRANT SELECT (b) ON `mysqltest_1`.`t2` TO 'mysqltest_3'@'localhost' +GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost' +GRANT UPDATE (a) ON `mysqltest_1`.`t1` TO 'mysqltest_3'@'localhost' +GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost' +update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1' +update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'd' in table 't2' +update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' +update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 's' in table 't1' +update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; +update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +a q b r +10 2 1 2 +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +c s d t +1 2 10 2 +revoke all on mysqltest_1.t1 from mysqltest_3@localhost; +revoke all on mysqltest_1.t2 from mysqltest_3@localhost; +revoke all on mysqltest_2.t1 from mysqltest_3@localhost; +revoke all on mysqltest_2.t2 from mysqltest_3@localhost; +grant all on mysqltest_2.* to mysqltest_3@localhost; +grant select on *.* to mysqltest_3@localhost; +flush privileges; +use mysqltest_1; +update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'a' in table 't1' +use mysqltest_2; +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' +update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' +update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +a q b r +10 2 1 2 +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +c s d t +500 2 600 2 +delete from mysql.user where user='mysqltest_3'; +delete from mysql.db where user="mysqltest_3"; +delete from mysql.tables_priv where user="mysqltest_3"; +delete from mysql.columns_priv where user="mysqltest_3"; +flush privileges; +drop database mysqltest_1; +drop database mysqltest_2; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index a31fa2ac3dc..6d8bdbaf8f9 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -37,7 +37,6 @@ show grants for current_user(); Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT, INSERT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' -use mysqltest; insert into t1 values (1, 'I can''t change it!'); update t1 set data='I can change it!' where id = 1; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest' @@ -47,8 +46,20 @@ select * from t1; id data 1 I can't change it! drop table t1; -drop database mysqltest; -use test; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; +create table t1 (a int, b int); +grant select (a) on t1 to mysqltest_1@localhost with grant option; +grant select (a,b) on t1 to mysqltest_2@localhost; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't1' +grant select on t1 to mysqltest_3@localhost; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1' +drop table t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; +drop database mysqltest; +use test; diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result index 892f1d940a6..d905e9319fd 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -134,7 +134,7 @@ a b c a 1 1 1 test.t1 2 2 2 test.t1 select * from t2; -ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2' +ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -148,7 +148,7 @@ select "user3"; user3 user3 select * from t1; -ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1' select a from t1; a 1 @@ -156,7 +156,7 @@ a select c from t1; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' select * from t2; -ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't2' select mysqltest.t1.c from test.t1,mysqltest.t1; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' show status like "Qcache_queries_in_cache"; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 022b8eff7e8..7f365eac58a 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -629,6 +629,18 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; +create table t1 (a int); +insert into t1 values(null); +select min(a) is null from t1; +min(a) is null +1 +select min(a) is null or null from t1; +min(a) is null or null +1 +select 1 and min(a) is null from t1; +1 and min(a) is null +1 +drop table t1; create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); select group_concat( distinct col1 ) as alias from t1 @@ -638,3 +650,30 @@ alias 1,2 1 drop table t1; +create table t1 (a integer, b integer, c integer); +insert into t1 (a,b) values (1,2),(1,3),(2,5); +select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +a r2 r1 +1 1.0 2 +select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2; +a r2 r1 +1 2 2 +select a,sum(b) from t1 where a=1 group by c; +a sum(b) +1 5 +select a*sum(b) from t1 where a=1 group by c; +a*sum(b) +5 +select sum(a)*sum(b) from t1 where a=1 group by c; +sum(a)*sum(b) +10 +select a,sum(b) from t1 where a=1 group by c having a=1; +a sum(b) +1 5 +select a as d,sum(b) from t1 where a=1 group by c having d=1; +d sum(b) +1 5 +select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0; +d +10 +drop table t1; diff --git a/mysql-test/r/have_exampledb.require b/mysql-test/r/have_exampledb.require index 4b0938660fe..29d0cf8b1a6 100644 --- a/mysql-test/r/have_exampledb.require +++ b/mysql-test/r/have_exampledb.require @@ -1,2 +1,2 @@ Variable_name Value -have_exampledb YES +have_example_engine YES diff --git a/mysql-test/r/have_moscow_leap_timezone.require b/mysql-test/r/have_moscow_leap_timezone.require new file mode 100644 index 00000000000..f27452d7770 --- /dev/null +++ b/mysql-test/r/have_moscow_leap_timezone.require @@ -0,0 +1,2 @@ +from_unixtime(1072904422) +2004-01-01 00:00:00 diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require index 032b60d544a..b33a1d2854f 100644 --- a/mysql-test/r/have_openssl_1.require +++ b/mysql-test/r/have_openssl_1.require @@ -1,2 +1,2 @@ Variable_name Value -Ssl_cipher EDH-RSA-DES-CBC3-SHA +Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 92b694b5117..b1cd17b444c 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -4,7 +4,7 @@ insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a=1 or a=0; show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 a NULL NULL NULL NULL HASH +t1 0 PRIMARY 1 a NULL 3 NULL NULL HASH select * from t1; a b 2 2 @@ -169,7 +169,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL btn NULL NULL NULL 11 Using where explain select * from t1 where btn="a" and new_col="a"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref btn btn 11 const,const 10 Using where +1 SIMPLE t1 ref btn btn 11 const,const 2 Using where drop table t1; CREATE TABLE t1 ( a int default NULL, @@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL; a b explain SELECT * FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 10 Using where +1 SIMPLE t1 ref a a 5 const 1 Using where SELECT * FROM t1 WHERE a<=>NULL; a b NULL 99 @@ -204,7 +204,7 @@ key a (a) INSERT INTO t1 VALUES (10), (10), (10); EXPLAIN SELECT * FROM t1 WHERE a=10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 10 Using where +1 SIMPLE t1 ref a a 5 const 3 Using where SELECT * FROM t1 WHERE a=10; a 10 @@ -233,3 +233,19 @@ SELECT * FROM t1 WHERE B is not null; a B 1 1 DROP TABLE t1; +CREATE TABLE t1 (pseudo char(35) PRIMARY KEY, date int(10) unsigned NOT NULL) ENGINE=HEAP; +INSERT INTO t1 VALUES ('massecot',1101106491),('altec',1101106492),('stitch+',1101106304),('Seb Corgan',1101106305),('beerfilou',1101106263),('flaker',1101106529),('joce8',5),('M4vrick',1101106418),('gabay008',1101106525),('Vamp irX',1101106291),('ZoomZip',1101106546),('rip666',1101106502),('CBP ',1101106397),('guezpard',1101106496); +DELETE FROM t1 WHERE date<1101106546; +SELECT * FROM t1; +pseudo date +ZoomZip 1101106546 +DROP TABLE t1; +create table t1(a char(2)) engine=memory; +insert into t1 values (NULL), (NULL); +delete from t1 where a is null; +insert into t1 values ('2'), ('3'); +select * from t1; +a +3 +2 +drop table t1; diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result index 7affbf788fb..d3673cd2a63 100644 --- a/mysql-test/r/heap_hash.result +++ b/mysql-test/r/heap_hash.result @@ -1,10 +1,10 @@ -drop table if exists t1; +drop table if exists t1,t2; create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a=1 or a=0; show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 a NULL NULL NULL NULL HASH +t1 0 PRIMARY 1 a NULL 3 NULL NULL HASH select * from t1; a b 2 2 @@ -169,7 +169,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL btn NULL NULL NULL 11 Using where explain select * from t1 where btn="a" and new_col="a"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref btn btn 11 const,const 10 Using where +1 SIMPLE t1 ref btn btn 11 const,const 2 Using where drop table t1; CREATE TABLE t1 ( a int default NULL, @@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL; a b explain SELECT * FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 10 Using where +1 SIMPLE t1 ref a a 5 const 1 Using where SELECT * FROM t1 WHERE a<=>NULL; a b NULL 99 @@ -203,3 +203,165 @@ DELETE from t1 where a < 100; SELECT * from t1; a DROP TABLE t1; +create table t1 +( +a char(8) not null, +b char(20) not null, +c int not null, +key (a) +) engine=heap; +insert into t1 values ('aaaa', 'prefill-hash=5',0); +insert into t1 values ('aaab', 'prefill-hash=0',0); +insert into t1 values ('aaac', 'prefill-hash=7',0); +insert into t1 values ('aaad', 'prefill-hash=2',0); +insert into t1 values ('aaae', 'prefill-hash=1',0); +insert into t1 values ('aaaf', 'prefill-hash=4',0); +insert into t1 values ('aaag', 'prefill-hash=3',0); +insert into t1 values ('aaah', 'prefill-hash=6',0); +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +insert into t1 select * from t1; +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +flush tables; +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +create table t2 as select * from t1; +delete from t1; +insert into t1 select * from t2; +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +drop table t1, t2; +create table t1 ( +id int unsigned not null primary key auto_increment, +name varchar(20) not null, +index heap_idx(name), +index btree_idx using btree(name) +) engine=heap; +create table t2 ( +id int unsigned not null primary key auto_increment, +name varchar(20) not null, +index btree_idx using btree(name), +index heap_idx(name) +) engine=heap; +insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'), +('Suzy'), ('Hoppy'), ('Burrito'), ('Mimi'), ('Sherry'), ('Ben'), ('Phil'), +('Emily'), ('Mike'); +insert into t2 select * from t1; +explain select * from t1 where name='matt'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='matt'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +explain select * from t1 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +explain select * from t1 where name='Phil'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='Phil'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +explain select * from t1 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +flush tables; +select count(*) from t1 where name='Matt'; +count(*) +7 +explain select * from t1 ignore index (btree_idx) where name='matt'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx heap_idx 20 const 7 Using where +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH +t1 1 heap_idx 1 name NULL 13 NULL NULL HASH +t1 1 btree_idx 1 name A NULL NULL NULL BTREE +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH +t1 1 heap_idx 1 name NULL 13 NULL NULL HASH +t1 1 btree_idx 1 name A NULL NULL NULL BTREE +create table t3 +( +a varchar(20) not null, +b varchar(20) not null, +key (a,b) +) engine=heap; +insert into t3 select name, name from t1; +show index from t3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t3 1 a 1 a NULL NULL NULL NULL HASH +t3 1 a 2 b NULL 15 NULL NULL HASH +show index from t3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t3 1 a 1 a NULL NULL NULL NULL HASH +t3 1 a 2 b NULL 15 NULL NULL HASH +explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx heap_idx 20 const 7 Using where +1 SIMPLE t3 ref a a 40 func,const 6 Using where +drop table t1, t2, t3; +create temporary table t1 ( a int, index (a) ) engine=memory; +insert into t1 values (1),(2),(3),(4),(5); +select a from t1 where a in (1,3); +a +1 +3 +explain select a from t1 where a in (1,3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 2 Using where +drop table t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 9d830367745..009432ec3ab 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1630,3 +1630,21 @@ show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 drop table t1; +create table t1 (c char(10), index (c,c)) engine=innodb; +ERROR 42S21: Duplicate column name 'c' +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +alter table t1 add key (c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c2,c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c2,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c1,c2); +ERROR 42S21: Duplicate column name 'c1' +drop table t1; diff --git a/mysql-test/r/innodb.result.es b/mysql-test/r/innodb.result.es new file mode 100644 index 00000000000..602a034bc16 --- /dev/null +++ b/mysql-test/r/innodb.result.es @@ -0,0 +1,1653 @@ +drop table if exists t1,t2,t3,t4; +drop database if exists mysqltest; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +update ignore t1 set id = 8, name = 'Sinisa' where id < 3; +select id, code, name from t1 order by id; +id code name +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +update ignore t1 set id = id + 10, name = 'Ralph' where id < 4; +select id, code, name from t1 order by id; +id code name +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +12 1 Ralph +drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +parent_id int(11) DEFAULT '0' NOT NULL, +level tinyint(4) DEFAULT '0' NOT NULL, +PRIMARY KEY (id), +KEY parent_id (parent_id), +KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +id parent_id level +8 102 2 +9 102 2 +15 102 2 +update t1 set id=id+1000; +update t1 set id=1024 where id=1009; +Got one of the listed errors +select * from t1; +id parent_id level +1001 100 0 +1002 101 1 +1003 101 1 +1004 101 1 +1005 101 1 +1006 101 1 +1007 101 1 +1008 102 2 +1009 102 2 +1015 102 2 +1016 103 2 +1017 103 2 +1018 103 2 +1019 103 2 +1020 103 2 +1021 104 2 +1022 104 2 +1024 104 2 +1025 105 2 +1026 105 2 +1027 105 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1034 106 2 +1035 106 2 +1036 107 2 +1037 107 2 +1038 107 2 +1040 107 2 +1157 100 0 +1179 105 2 +1183 104 2 +1193 105 2 +1202 107 2 +1203 107 2 +update ignore t1 set id=id+1; +select * from t1; +id parent_id level +1001 100 0 +1002 101 1 +1003 101 1 +1004 101 1 +1005 101 1 +1006 101 1 +1007 101 1 +1008 102 2 +1010 102 2 +1015 102 2 +1016 103 2 +1017 103 2 +1018 103 2 +1019 103 2 +1020 103 2 +1021 104 2 +1023 104 2 +1024 104 2 +1025 105 2 +1026 105 2 +1027 105 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1034 106 2 +1035 106 2 +1036 107 2 +1037 107 2 +1039 107 2 +1041 107 2 +1158 100 0 +1180 105 2 +1184 104 2 +1194 105 2 +1202 107 2 +1204 107 2 +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +id parent_id level +1008 102 2 +1010 102 2 +1015 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +explain select level,id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +explain select level,id,parent_id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where +select level,id from t1 where level=1; +level id +1 1002 +1 1003 +1 1004 +1 1005 +1 1006 +1 1007 +select level,id,parent_id from t1 where level=1; +level id parent_id +1 1002 101 +1 1003 101 +1 1004 101 +1 1005 101 +1 1006 101 +1 1007 101 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id A # NULL NULL BTREE +t1 1 parent_id 1 parent_id A # NULL NULL BTREE +t1 1 level 1 level A # NULL NULL BTREE +drop table t1; +CREATE TABLE t1 ( +gesuchnr int(11) DEFAULT '0' NOT NULL, +benutzer_id int(11) DEFAULT '0' NOT NULL, +PRIMARY KEY (gesuchnr,benutzer_id) +) engine=innodb; +replace into t1 (gesuchnr,benutzer_id) values (2,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +select * from t1; +gesuchnr benutzer_id +1 1 +2 1 +drop table t1; +create table t1 (a int) engine=innodb; +insert into t1 values (1), (2); +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +delete from t1 where a = 1; +select * from t1; +a +2 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a int,b varchar(20)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +delete from t1 where a = 1; +select * from t1; +a b +2 testing +create index skr on t1 (a); +insert into t1 values (3,""), (4,"testing"); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 skr 1 a A # NULL NULL YES BTREE +drop table t1; +create table t1 (a int,b varchar(20),key(a)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +select * from t1 where a = 1; +a b +1 +drop table t1; +create table t1 (n int not null primary key) engine=innodb; +set autocommit=0; +insert into t1 values (4); +rollback; +select n, "after rollback" from t1; +n after rollback +insert into t1 values (4); +commit; +select n, "after commit" from t1; +n after commit +4 after commit +commit; +insert into t1 values (5); +insert into t1 values (4); +ERROR 23000: Duplicate entry '4' for key 1 +commit; +select n, "after commit" from t1; +n after commit +4 after commit +5 after commit +set autocommit=1; +insert into t1 values (6); +insert into t1 values (4); +ERROR 23000: Duplicate entry '4' for key 1 +select n from t1; +n +4 +5 +6 +rollback; +drop table t1; +create table t1 (n int not null primary key) engine=innodb; +start transaction; +insert into t1 values (4); +flush tables with read lock; +commit; +unlock tables; +commit; +select * from t1; +n +4 +drop table t1; +create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb; +begin; +insert into t1 values(1,'hamdouni'); +select id as afterbegin_id,nom as afterbegin_nom from t1; +afterbegin_id afterbegin_nom +1 hamdouni +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +afterrollback_id afterrollback_nom +set autocommit=0; +insert into t1 values(2,'mysql'); +select id as afterautocommit0_id,nom as afterautocommit0_nom from t1; +afterautocommit0_id afterautocommit0_nom +2 mysql +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +afterrollback_id afterrollback_nom +set autocommit=1; +drop table t1; +CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb; +insert into t1 values ('pippo', 12); +insert into t1 values ('pippo', 12); +ERROR 23000: Duplicate entry 'pippo' for key 1 +delete from t1; +delete from t1 where id = 'pippo'; +select * from t1; +id val +insert into t1 values ('pippo', 12); +set autocommit=0; +delete from t1; +rollback; +select * from t1; +id val +pippo 12 +delete from t1; +commit; +select * from t1; +id val +drop table t1; +create table t1 (a integer) engine=innodb; +start transaction; +rename table t1 to t2; +create table t1 (b integer) engine=innodb; +insert into t1 values (1); +rollback; +drop table t1; +rename table t2 to t1; +drop table t1; +set autocommit=1; +CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 'Jochen'); +select * from t1; +ID NAME +1 Jochen +drop table t1; +CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb; +set autocommit=0; +INSERT INTO t1 SET _userid='marc@anyware.co.uk'; +COMMIT; +SELECT * FROM t1; +_userid +marc@anyware.co.uk +SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk'; +_userid +marc@anyware.co.uk +drop table t1; +set autocommit=1; +CREATE TABLE t1 ( +user_id int(10) DEFAULT '0' NOT NULL, +name varchar(100), +phone varchar(100), +ref_email varchar(100) DEFAULT '' NOT NULL, +detail varchar(200), +PRIMARY KEY (user_id,ref_email) +)engine=innodb; +INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar'); +select * from t1 where user_id=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds'); +select * from t1 where user_id=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +select * from t1 where user_id>=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +10293 shirish 2333604 shirish@yahoo.com ddsds +select * from t1 where user_id>10292; +user_id name phone ref_email detail +10293 shirish 2333604 shirish@yahoo.com ddsds +select * from t1 where user_id<10292; +user_id name phone ref_email detail +10291 sanjeev 29153373 sansh777@hotmail.com xxx +drop table t1; +CREATE TABLE t1 (a int not null, b int not null,c int not null, +key(a),primary key(a,b), unique(c),key(a),unique(b)); +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE +t1 0 PRIMARY 2 b A # NULL NULL BTREE +t1 0 c 1 c A # NULL NULL BTREE +t1 0 b 1 b A # NULL NULL BTREE +t1 1 a 1 a A # NULL NULL BTREE +t1 1 a_2 1 a A # NULL NULL BTREE +drop table t1; +create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); +alter table t1 engine=innodb; +insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4'); +select * from t1; +col1 col2 +1 1 +2 3 +3 4 +4 4 +5 2 +update t1 set col2='7' where col1='4'; +select * from t1; +col1 col2 +1 1 +2 3 +3 4 +4 7 +5 2 +alter table t1 add co3 int not null; +select * from t1; +col1 col2 co3 +1 1 0 +2 3 0 +3 4 0 +4 7 0 +5 2 0 +update t1 set col2='9' where col1='2'; +select * from t1; +col1 col2 co3 +1 1 0 +2 9 0 +3 4 0 +4 7 0 +5 2 0 +drop table t1; +create table t1 (a int not null , b int, primary key (a)) engine = innodb; +create table t2 (a int not null , b int, primary key (a)) engine = myisam; +insert into t1 VALUES (1,3) , (2,3), (3,3); +select * from t1; +a b +1 3 +2 3 +3 3 +insert into t2 select * from t1; +select * from t2; +a b +1 3 +2 3 +3 3 +delete from t1 where b = 3; +select * from t1; +a b +insert into t1 select * from t2; +select * from t1; +a b +1 3 +2 3 +3 3 +select * from t2; +a b +1 3 +2 3 +3 3 +drop table t1,t2; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +ggid varchar(32) binary DEFAULT '' NOT NULL, +email varchar(64) DEFAULT '' NOT NULL, +passwd varchar(32) binary DEFAULT '' NOT NULL, +PRIMARY KEY (id), +UNIQUE ggid (ggid) +) ENGINE=innodb; +insert into t1 (ggid,passwd) values ('test1','xxx'); +insert into t1 (ggid,passwd) values ('test2','yyy'); +insert into t1 (ggid,passwd) values ('test2','this will fail'); +ERROR 23000: Duplicate entry 'test2' for key 2 +insert into t1 (ggid,id) values ('this will fail',1); +ERROR 23000: Duplicate entry '1' for key 1 +select * from t1 where ggid='test1'; +id ggid email passwd +1 test1 xxx +select * from t1 where passwd='xxx'; +id ggid email passwd +1 test1 xxx +select * from t1 where id=2; +id ggid email passwd +2 test2 yyy +replace into t1 (ggid,id) values ('this will work',1); +replace into t1 (ggid,passwd) values ('test2','this will work'); +update t1 set id=100,ggid='test2' where id=1; +ERROR 23000: Duplicate entry 'test2' for key 2 +select * from t1; +id ggid email passwd +1 this will work +3 test2 this will work +select * from t1 where id=1; +id ggid email passwd +1 this will work +select * from t1 where id=999; +id ggid email passwd +drop table t1; +CREATE TABLE t1 ( +user_name varchar(12), +password text, +subscribed char(1), +user_id int(11) DEFAULT '0' NOT NULL, +quota bigint(20), +weight double, +access_date date, +access_time time, +approved datetime, +dummy_primary_key int(11) NOT NULL auto_increment, +PRIMARY KEY (dummy_primary_key) +) ENGINE=innodb; +INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1); +INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2); +INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3); +INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4); +INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5); +select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name; +user_name password subscribed user_id quota weight access_date access_time approved dummy_primary_key +user_0 somepassword N 0 0 0 2000-09-07 23:06:59 2000-09-07 23:06:59 1 +user_1 somepassword Y 1 1 1 2000-09-07 23:06:59 2000-09-07 23:06:59 2 +user_2 somepassword N 2 2 1.4142135623731 2000-09-07 23:06:59 2000-09-07 23:06:59 3 +user_3 somepassword Y 3 3 1.7320508075689 2000-09-07 23:06:59 2000-09-07 23:06:59 4 +user_4 somepassword N 4 4 2 2000-09-07 23:06:59 2000-09-07 23:06:59 5 +drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +parent_id int(11) DEFAULT '0' NOT NULL, +level tinyint(4) DEFAULT '0' NOT NULL, +KEY (id), +KEY parent_id (parent_id), +KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1); +INSERT INTO t1 values (179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +id parent_id level +8 102 2 +9 102 2 +15 102 2 +update t1 set id=id+1000; +update t1 set id=1024 where id=1009; +select * from t1; +id parent_id level +1001 100 0 +1003 101 1 +1004 101 1 +1008 102 2 +1024 102 2 +1017 103 2 +1022 104 2 +1024 104 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1203 107 2 +1202 107 2 +1020 103 2 +1157 100 0 +1193 105 2 +1040 107 2 +1002 101 1 +1015 102 2 +1006 101 1 +1034 106 2 +1035 106 2 +1016 103 2 +1007 101 1 +1036 107 2 +1018 103 2 +1026 105 2 +1027 105 2 +1183 104 2 +1038 107 2 +1025 105 2 +1037 107 2 +1021 104 2 +1019 103 2 +1005 101 1 +1179 105 2 +update ignore t1 set id=id+1; +select * from t1; +id parent_id level +1002 100 0 +1004 101 1 +1005 101 1 +1009 102 2 +1025 102 2 +1018 103 2 +1023 104 2 +1025 104 2 +1029 105 2 +1030 105 2 +1031 105 2 +1032 106 2 +1033 106 2 +1034 106 2 +1204 107 2 +1203 107 2 +1021 103 2 +1158 100 0 +1194 105 2 +1041 107 2 +1003 101 1 +1016 102 2 +1007 101 1 +1035 106 2 +1036 106 2 +1017 103 2 +1008 101 1 +1037 107 2 +1019 103 2 +1027 105 2 +1028 105 2 +1184 104 2 +1039 107 2 +1026 105 2 +1038 107 2 +1022 104 2 +1020 103 2 +1006 101 1 +1180 105 2 +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +id parent_id level +1009 102 2 +1025 102 2 +1016 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +select level,id from t1 where level=1; +level id +1 1004 +1 1005 +1 1003 +1 1007 +1 1008 +1 1006 +select level,id,parent_id from t1 where level=1; +level id parent_id +1 1004 101 +1 1005 101 +1 1003 101 +1 1007 101 +1 1008 101 +1 1006 101 +select level,id from t1 where level=1 order by id; +level id +1 1003 +1 1004 +1 1005 +1 1006 +1 1007 +1 1008 +delete from t1 where level=1; +select * from t1; +id parent_id level +1002 100 0 +1009 102 2 +1025 102 2 +1018 103 2 +1023 104 2 +1025 104 2 +1029 105 2 +1030 105 2 +1031 105 2 +1032 106 2 +1033 106 2 +1034 106 2 +1204 107 2 +1203 107 2 +1021 103 2 +1158 100 0 +1194 105 2 +1041 107 2 +1016 102 2 +1035 106 2 +1036 106 2 +1017 103 2 +1037 107 2 +1019 103 2 +1027 105 2 +1028 105 2 +1184 104 2 +1039 107 2 +1026 105 2 +1038 107 2 +1022 104 2 +1020 103 2 +1180 105 2 +drop table t1; +CREATE TABLE t1 ( +sca_code char(6) NOT NULL, +cat_code char(6) NOT NULL, +sca_desc varchar(50), +lan_code char(2) NOT NULL, +sca_pic varchar(100), +sca_sdesc varchar(50), +sca_sch_desc varchar(16), +PRIMARY KEY (sca_code, cat_code, lan_code), +INDEX sca_pic (sca_pic) +) engine = innodb ; +INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING'); +select count(*) from t1 where sca_code = 'PD'; +count(*) +1 +select count(*) from t1 where sca_code <= 'PD'; +count(*) +1 +select count(*) from t1 where sca_pic is null; +count(*) +2 +alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +count(*) +1 +select count(*) from t1 where cat_code='E'; +count(*) +0 +alter table t1 drop index sca_pic, add index (sca_pic, cat_code); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +count(*) +1 +select count(*) from t1 where sca_pic >= 'n'; +count(*) +1 +select sca_pic from t1 where sca_pic is null; +sca_pic +NULL +NULL +update t1 set sca_pic="test" where sca_pic is null; +delete from t1 where sca_code='pd'; +drop table t1; +set @a:=now(); +CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb; +insert into t1 (a) values(1),(2),(3); +select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a; +a +1 +2 +3 +update t1 set a=5 where a=1; +select a from t1; +a +2 +3 +5 +drop table t1; +create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb; +insert into t1 values("hello",1),("world",2); +select * from t1 order by b desc; +a b +world 2 +hello 1 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE +drop table t1; +create table t1 (i int, j int ) ENGINE=innodb; +insert into t1 values (1,2); +select * from t1 where i=1 and j=2; +i j +1 2 +create index ax1 on t1 (i,j); +select * from t1 where i=1 and j=2; +i j +1 2 +drop table t1; +CREATE TABLE t1 ( +a int3 unsigned NOT NULL, +b int1 unsigned NOT NULL, +UNIQUE (a, b) +) ENGINE = innodb; +INSERT INTO t1 VALUES (1, 1); +SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; +MIN(B) MAX(b) +1 1 +drop table t1; +CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb; +insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +explain select * from t1 where a > 0 and a < 50; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL # Using where +drop table t1; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +ERROR 23000: Duplicate entry '1-1' for key 1 +select id from t1; +id +0 +1 +2 +select id from t1; +id +0 +1 +2 +UNLOCK TABLES; +DROP TABLE t1; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +begin; +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +ERROR 23000: Duplicate entry '1-1' for key 1 +select id from t1; +id +0 +1 +2 +insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +commit; +select id,id3 from t1; +id id3 +0 0 +1 1 +2 2 +100 2 +UNLOCK TABLES; +DROP TABLE t1; +create table t1 (a char(20), unique (a(5))) engine=innodb; +drop table t1; +create table t1 (a char(20), index (a(5))) engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) default NULL, + KEY `a` (`a`(5)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb; +insert into t1 values (NULL),(NULL),(NULL); +delete from t1 where a=3; +insert into t1 values (NULL); +select * from t1; +a +1 +2 +4 +alter table t1 add b int; +select * from t1; +a b +1 NULL +2 NULL +4 NULL +drop table t1; +create table t1 +( +id int auto_increment primary key, +name varchar(32) not null, +value text not null, +uid int not null, +unique key(name,uid) +) engine=innodb; +insert into t1 values (1,'one','one value',101), +(2,'two','two value',102),(3,'three','three value',103); +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +delete from t1 where uid=102; +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +set insert_id=6; +replace into t1 (value,name,uid) values ('other value','two',102); +select * from t1; +id name value uid +1 one one value 101 +3 three three value 103 +6 two other value 102 +drop table t1; +create database mysqltest; +create table mysqltest.t1 (a int not null) engine= innodb; +insert into mysqltest.t1 values(1); +create table mysqltest.t2 (a int not null) engine= myisam; +insert into mysqltest.t2 values(1); +create table mysqltest.t3 (a int not null) engine= heap; +insert into mysqltest.t3 values(1); +commit; +drop database mysqltest; +show tables from mysqltest; +Got one of the listed errors +set autocommit=0; +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +commit; +truncate table t1; +select * from t1; +a +insert into t1 values(1),(2); +delete from t1; +select * from t1; +a +commit; +drop table t1; +set autocommit=1; +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +insert into t1 values(1),(2); +select * from t1; +a +1 +2 +truncate table t1; +insert into t1 values(1),(2); +delete from t1; +select * from t1; +a +drop table t1; +create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb; +insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4); +explain select * from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # +explain select * from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # +explain select * from t1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort +explain select a from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # Using index +explain select b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b,c from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # +drop table t1; +create table t1 (t int not null default 1, key (t)) engine=innodb; +desc t1; +Field Type Null Key Default Extra +t int(11) MUL 1 +drop table t1; +CREATE TABLE t1 ( +number bigint(20) NOT NULL default '0', +cname char(15) NOT NULL default '', +carrier_id smallint(6) NOT NULL default '0', +privacy tinyint(4) NOT NULL default '0', +last_mod_date timestamp(14) NOT NULL, +last_mod_id smallint(6) NOT NULL default '0', +last_app_date timestamp(14) NOT NULL, +last_app_id smallint(6) default '-1', +version smallint(6) NOT NULL default '0', +assigned_scps int(11) default '0', +status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1); +INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0); +INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1); +INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0); +INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0); +INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0); +CREATE TABLE t2 ( +number bigint(20) NOT NULL default '0', +cname char(15) NOT NULL default '', +carrier_id smallint(6) NOT NULL default '0', +privacy tinyint(4) NOT NULL default '0', +last_mod_date timestamp(14) NOT NULL, +last_mod_id smallint(6) NOT NULL default '0', +last_app_date timestamp(14) NOT NULL, +last_app_id smallint(6) default '-1', +version smallint(6) NOT NULL default '0', +assigned_scps int(11) default '0', +status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1); +INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0); +INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1); +INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0); +select * from t1; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +4077711111 SeanWheeler 90 2 2002-01-11 11:28:46 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:09 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 0 0 2001-12-27 11:13:36 342 0000-00-00 00:00:00 -1 1 24 1 +302467 Sue's Subshop 90 3 2002-01-09 11:32:41 500 2002-01-02 11:51:11 501 7 24 0 +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +4077711111 SeanWheeler 0 2 2002-01-11 11:28:53 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:18 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 90 0 2002-01-09 11:31:58 342 0000-00-00 00:00:00 -1 1 24 1 +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null); +select * from t1; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +drop table t1,t2; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +SELECT @@tx_isolation,@@global.tx_isolation; +@@tx_isolation @@global.tx_isolation +SERIALIZABLE REPEATABLE-READ +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +COMMIT; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +COMMIT; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +COMMIT; +DROP TABLE t1; +create table t1 (n int(10), d int(10)) engine=innodb; +create table t2 (n int(10), d int(10)) engine=innodb; +insert into t1 values(1,1),(1,2); +insert into t2 values(1,10),(2,20); +UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; +select * from t1; +n d +1 10 +1 10 +select * from t2; +n d +1 30 +2 20 +drop table t1,t2; +create table t1 (a int, b int) engine=innodb; +insert into t1 values(20,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a; +b ifnull(t2.b,"this is null") +NULL this is null +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +b ifnull(t2.b,"this is null") +NULL this is null +insert into t1 values(10,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +b ifnull(t2.b,"this is null") +NULL this is null +NULL this is null +drop table t1; +create table t1 (a varchar(10) not null) engine=myisam; +create table t2 (b varchar(10) not null unique) engine=innodb; +select t1.a from t1,t2 where t1.a=t2.b; +a +drop table t1,t2; +create table t1 (a int not null, b int, primary key (a)) engine = innodb; +create table t2 (a int not null, b int, primary key (a)) engine = innodb; +insert into t1 values (10, 20); +insert into t2 values (10, 20); +update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10; +drop table t1,t2; +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB; +insert into t1 set id=1; +insert into t2 set id=1, t1_id=1; +delete t1,t2 from t1,t2 where t1.id=t2.t1_id; +select * from t1; +id +select * from t2; +id t1_id +drop table t2,t1; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +id +1 +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +id +2 +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +id +3 +DROP TABLE t1,t2; +set autocommit=0; +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB; +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; +SELECT * FROM t1; +id value +this-key will disappear +SELECT * FROM t2; +id value +this-key will also disappear +SELECT * FROM t3; +id1 id2 +ROLLBACK; +SELECT * FROM t1; +id value +SELECT * FROM t2; +id value +SELECT * FROM t3; +id1 id2 +my-test-1 my-test-2 +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +id1 id2 +my-test-1 my-test-2 +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +a b +1 1 +102 2 +103 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +drop table t1; +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update t1,t2 set t1.a=t1.a+100; +select * from t1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; +a b +201 1 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; +select * from t1; +a b +201 1 +103 5 +104 6 +106 6 +105 7 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +select * from t2; +a b +1 1 +2 2 +6 6 +7 7 +8 8 +9 9 +3 13 +4 14 +5 15 +drop table t1,t2; +CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t1 ( B_ID ) VALUES ( 1 ); +INSERT INTO t2 ( NEXT_T ) VALUES ( 1 ); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SELECT * FROM t1; +B_ID +drop table t1,t2; +create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb; +insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2); +select distinct parent,child from t1 order by parent; +parent child +0 4 +1 2 +1 3 +2 1 +drop table t1; +create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb; +create table t2 (a int not null auto_increment primary key, b int); +insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null); +insert into t2 (a) select b from t1; +insert into t1 (b) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +select count(*) from t1; +count(*) +29267 +explain select * from t1 where c between 1 and 10000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 5 NULL # Using where +update t1 set c=a; +explain select * from t1 where c between 1 and 10000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL c NULL NULL NULL # Using where +drop table t1,t2; +create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb; +insert into t1 (id) values (null),(null),(null),(null),(null); +update t1 set fk=69 where fk is null order by id limit 1; +SELECT * from t1; +id fk +2 NULL +3 NULL +4 NULL +5 NULL +1 69 +drop table t1; +create table t1 (a int not null, b int not null, key (a)); +insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3); +SET @tmp=0; +update t1 set b=(@tmp:=@tmp+1) order by a; +update t1 set b=99 where a=1 order by b asc limit 1; +update t1 set b=100 where a=1 order by b desc limit 2; +update t1 set a=a+10+b where a=1 order by b; +select * from t1 order by a,b; +a b +2 4 +2 5 +2 6 +3 7 +3 8 +3 9 +3 10 +3 11 +3 12 +13 2 +111 100 +111 100 +drop table t1; +create table t1 ( c char(8) not null ) engine=innodb; +insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'); +insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F'); +alter table t1 add b char(8) not null; +alter table t1 add a char(8) not null; +alter table t1 add primary key (a,b,c); +update t1 set a=c, b=c; +create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb; +insert into t2 select * from t1; +delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; +drop table t1,t2; +SET AUTOCOMMIT=1; +create table t1 (a integer auto_increment primary key) engine=innodb; +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +a +3 +4 +drop table t1; +CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB; +drop table t2,t1; +create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb; +insert into `t1`values ( 1 ) ; +create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb; +insert into `t2`values ( 1 ) ; +create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb; +insert into `t3`values ( 1 ) ; +delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 42S02: Unknown table 't1' in where clause +drop table t3,t2,t1; +create table t1( +id int primary key, +pid int, +index(pid), +foreign key(pid) references t1(id) on delete cascade) engine=innodb; +insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6), +(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14); +delete from t1 where id=0; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +delete from t1 where id=15; +delete from t1 where id=0; +drop table t1; +CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB; +CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx +(stamp))ENGINE=InnoDB; +insert into t1 values (1),(2),(3); +insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000); +Warnings: +Warning 1265 Data truncated for column 'stamp' at row 3 +SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp < +'20020204120000' GROUP BY col1; +col1 +1 +2 +3 +4 +drop table t1,t2; +CREATE TABLE t1 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_object` int(10) unsigned default '0', +`id_version` int(10) unsigned NOT NULL default '1', +label varchar(100) NOT NULL default '', +`description` text, +PRIMARY KEY (`id`), +KEY `id_object` (`id_object`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL); +CREATE TABLE t2 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_version` int(10) unsigned NOT NULL default '1', +PRIMARY KEY (`id`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); +SELECT t2.id, t1.label FROM t2 INNER JOIN +(SELECT t1.id_object as id_object FROM t1 WHERE t1.label LIKE '%test%') AS lbl +ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); +id label +3382 Test +102 Le Pekin (Test) +1794 Test de resto +1822 Test 3 +3524 Societe Test +3525 Fournisseur Test +drop table t1,t2; +create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb; +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12"); +select * from t1; +c1 c2 stamp +text1 11 2004-12-01 13:23:14 +text2 12 2004-12-01 13:23:14 +replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" ); +ERROR 21S01: Column count doesn't match value count at row 3 +select * from t1; +c1 c2 stamp +text1 11 2004-12-01 13:23:14 +text2 12 2004-12-01 13:23:14 +drop table t1; +create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam; +create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb; +create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +insert t3 select * from t1; +checksum table t1, t2, t3, t4 quick; +Table Checksum +test.t1 968604391 +test.t2 NULL +test.t3 NULL +test.t4 NULL +checksum table t1, t2, t3, t4; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +checksum table t1, t2, t3, t4 extended; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +drop table t1,t2,t3; +create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; +insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt'); +select name2 from t1 union all select name from t1 union all select id from t1; +name2 +fff +sss +ttt +first +second +third +1 +2 +3 +drop table t1; +create table t1 (a int) engine=innodb; +create table t2 like t1; +drop table t1,t2; +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id2 on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + KEY `id2` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop index id2 on t2; +drop index id on t2; +Got one of the listed errors +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create unique index id on t2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `id_test` (`id`), + KEY `id_test2` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; +ERROR HY000: Can't create table '/home/hf/work/mysql-4.1.clean/mysql-test/var/master-data/test/t2.frm' (errno: 150) +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b_2` (`b`), + KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`), + CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t1; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 24 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 0 +create table t1 (a int) engine=innodb; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 25 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 26 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +drop table t1; +create table t1 (c char(10), index (c,c)) engine=innodb; +ERROR 42S21: Duplicate column name 'c' +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +alter table t1 add key (c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c2,c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c2,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c1,c2); +ERROR 42S21: Duplicate column name 'c1' +drop table t1; diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index 7c7ac152aa5..f5ad0c87881 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -81,6 +81,15 @@ a 1 2 drop table t1, t2; +create table t1(a int); +insert into t1 values(1),(1); +reset master; +create table t2(unique(a)) select a from t1; +ERROR 23000: Duplicate entry '1' for key 1 +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +drop table t1; create table t1 (a int not null); create table t2 (a int not null); insert into t1 values (1); @@ -629,3 +638,15 @@ No Field Count 0 1 100 0 2 100 drop table t1, t2; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +NO int(11) NOT NULL default '0', +SEQ int(11) NOT NULL default '0', +PRIMARY KEY (ID), +KEY t1$NO (SEQ,NO) +) ENGINE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +ID NO SEQ +1 1 1 +drop table t1; diff --git a/mysql-test/r/insert_select.result.es b/mysql-test/r/insert_select.result.es index 3955c0534f2..9cac6d31b8f 100644 --- a/mysql-test/r/insert_select.result.es +++ b/mysql-test/r/insert_select.result.es @@ -78,6 +78,13 @@ a 1 2 drop table t1, t2; +create table t1(a int); +insert into t1 values(1),(1); +reset master; +create table t2(unique(a)) select a from t1; +ERROR 23000: Duplicate entry '1' for key 1 +show binlog events; +drop table t1; create table t1 (a int not null); create table t2 (a int not null); insert into t1 values (1); @@ -626,3 +633,15 @@ No Field Count 0 1 100 0 2 100 drop table t1, t2; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +NO int(11) NOT NULL default '0', +SEQ int(11) NOT NULL default '0', +PRIMARY KEY (ID), +KEY t1$NO (SEQ,NO) +) ENGINE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +ID NO SEQ +1 1 1 +drop table t1; diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 303d7186015..ff7ec1ba73f 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -105,3 +105,65 @@ a b 8 28 9 29 drop table t1; +CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B)); +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 30 +INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 130 +INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; +SELECT * FROM t1; +a b c +1 2 10 +3 4 1020 +5 6 130 +INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; +ERROR 23000: Duplicate entry '4' for key 2 +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +TRUNCATE TABLE t1; +INSERT t1 VALUES (1,2,10), (3,4,20); +CREATE TABLE t2 (a INT, b INT, c INT, d INT); +INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); +INSERT t2 VALUES (2,1,11,2), (7,4,40,2); +INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 6 30 +8 9 60 +INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 0 30 +8 9 60 +INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +SELECT *, VALUES(a) FROM t1; +a b c VALUES(a) +1 2 10 NULL +3 4 127 NULL +5 0 30 NULL +8 9 60 NULL +2 1 11 NULL +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 75bf96cb401..c045aa0d00a 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -751,3 +751,68 @@ player_id match_1_h * match_id home UUX 7 4 * 1 2 2 3 3 * 1 2 1 drop table t1, t2; +create table t1 (a int, b int, unique index idx (a, b)); +create table t2 (a int, b int, c int, unique index idx (a, b)); +insert into t1 values (1, 10), (1,11), (2,10), (2,11); +insert into t2 values (1,10,3); +select t1.a, t1.b, t2.c from t1 left join t2 +on t1.a=t2.a and t1.b=t2.b and t2.c=3 +where t1.a=1 and t2.c is null; +a b c +1 11 NULL +drop table t1, t2; +CREATE TABLE t1 ( +ts_id bigint(20) default NULL, +inst_id tinyint(4) default NULL, +flag_name varchar(64) default NULL, +flag_value text, +UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE t2 ( +ts_id bigint(20) default NULL, +inst_id tinyint(4) default NULL, +flag_name varchar(64) default NULL, +flag_value text, +UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES +(111056548820001, 0, 'flag1', NULL), +(111056548820001, 0, 'flag2', NULL), +(2, 0, 'other_flag', NULL); +INSERT INTO t2 VALUES +(111056548820001, 3, 'flag1', 'sss'); +SELECT t1.flag_name,t2.flag_value +FROM t1 LEFT JOIN t2 +ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND +t2.inst_id = 3) +WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND +t2.flag_value IS NULL; +flag_name flag_value +flag2 NULL +DROP TABLE t1,t2; +CREATE TABLE invoice ( +id int(11) unsigned NOT NULL auto_increment, +text_id int(10) unsigned default NULL, +PRIMARY KEY (id) +); +INSERT INTO invoice VALUES("1", "0"); +INSERT INTO invoice VALUES("2", "10"); +CREATE TABLE text_table ( +text_id char(3) NOT NULL default '', +language_id char(3) NOT NULL default '', +text_data text, +PRIMARY KEY (text_id,language_id) +); +INSERT INTO text_table VALUES("0", "EN", "0-EN"); +INSERT INTO text_table VALUES("0", "SV", "0-SV"); +INSERT INTO text_table VALUES("10", "EN", "10-EN"); +INSERT INTO text_table VALUES("10", "SV", "10-SV"); +SELECT invoice.id, invoice.text_id, text_table.text_data +FROM invoice LEFT JOIN text_table +ON invoice.text_id = text_table.text_id +AND text_table.language_id = 'SV' + WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%'); +id text_id text_data +1 0 0-SV +2 10 10-SV +DROP TABLE invoice, text_table; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index e74bda23da9..cceaf393a60 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -307,3 +307,21 @@ test.t1 check status OK drop table t1; create table t1 (c char(10), index (c(0))); ERROR HY000: Key part 'c' length cannot be 0 +create table t1 (c char(10), index (c,c)); +ERROR 42S21: Duplicate column name 'c' +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)); +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)); +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)); +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10)); +alter table t1 add key (c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c2,c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c2,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c1,c2); +ERROR 42S21: Duplicate column name 'c1' +drop table t1; diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index fe8708f882d..79b5a6e84b2 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -277,3 +277,13 @@ Key_blocks_unused KEY_BLOCKS_UNUSED set global keycache2.key_buffer_size=0; set global keycache3.key_buffer_size=100; set global keycache3.key_buffer_size=0; +create table t1 (mytext text, FULLTEXT (mytext)); +insert t1 values ('aaabbb'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +set GLOBAL key_cache_block_size=2048; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result index c82105e6a49..6a3d2bffab0 100644 --- a/mysql-test/r/limit.result +++ b/mysql-test/r/limit.result @@ -67,3 +67,12 @@ SELECT * FROM t1; id id2 3 0 DROP TABLE t1; +create table t1 (a integer); +insert into t1 values (1); +select 1 as a from t1 union all select 1 from dual limit 1; +a +1 +(select 1 as a from t1) union all (select 1 from dual) limit 1; +a +1 +drop table t1; diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index 3be73f6cc6a..8361b66817a 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -131,3 +131,31 @@ show tables like 't1%'; Tables_in_test (t1%) t1 drop table t1; +create temporary table T1(a int(11), b varchar(8)); +insert into T1 values (1, 'abc'); +select * from T1; +a b +1 abc +alter table T1 add index (a); +select * from T1; +a b +1 abc +drop table T1; +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +insert into myUC values (1),(2),(3); +select * from myUC; +i +1 +2 +3 +use test; +drop database mysqltest_LC2; +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +select * from myUC; +i +use test; +drop database mysqltest_LC2; diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result index a645e46be9e..8182d07c26b 100644 --- a/mysql-test/r/lowercase_table3.result +++ b/mysql-test/r/lowercase_table3.result @@ -6,5 +6,5 @@ drop table t1; flush tables; CREATE TABLE t1 (a int) ENGINE=INNODB; SELECT * from T1; -ERROR HY000: Can't open file: 'T1.InnoDB' (errno: 1) +ERROR HY000: Can't open file: 'T1.ibd' (errno: 1) drop table t1; diff --git a/mysql-test/r/lowercase_table_grant.result b/mysql-test/r/lowercase_table_grant.result new file mode 100644 index 00000000000..3889bd418db --- /dev/null +++ b/mysql-test/r/lowercase_table_grant.result @@ -0,0 +1,23 @@ +use mysql; +create database MYSQLtest; +grant all on MySQLtest.* to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +select * from db where user = 'mysqltest_1'; +Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv +localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y +update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +select * from db where user = 'mysqltest_1'; +Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv +localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y +delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +drop user mysqltest_1@localhost; +drop database MYSQLtest; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 5755033190b..79d8f019ce3 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -651,3 +651,33 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause create table t3 engine=merge union=(t1, t2) select * from t2; ERROR HY000: You can't specify target table 't2' for update in FROM clause drop table t1, t2; +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) +engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a,b,c; +a b c +1 1 0 +1 1 1 +1 2 0 +1 2 1 +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +a b c +1 2 1 +1 2 0 +1 1 1 +1 1 0 +show index from t3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t3 1 a 1 a A NULL NULL NULL YES BTREE +t3 1 a 2 b A NULL NULL NULL YES BTREE +t3 1 a 3 c A NULL NULL NULL YES BTREE +drop table t1, t2, t3; diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index ced3ca61f80..54b3f1e0466 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -1,11 +1,11 @@ drop table if exists t1,t2; select 1, 1.0, -1, "hello", NULL; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def 1 8 1 1 N 32769 0 8 -def 1.0 5 3 3 N 32769 1 8 -def -1 8 1 2 N 32769 0 8 +def 1 8 1 1 N 32897 0 63 +def 1.0 5 3 3 N 32897 1 63 +def -1 8 2 2 N 32897 0 63 def hello 254 5 5 N 1 31 8 -def NULL 6 0 0 Y 32768 0 8 +def NULL 6 0 0 Y 32896 0 63 1 1.0 -1 hello NULL 1 1.0 -1 hello NULL create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10)); diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result index 54d99d5609e..72288d1027b 100644 --- a/mysql-test/r/mix_innodb_myisam_binlog.result +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -180,4 +180,25 @@ master-bin.000001 79 Query 1 79 use `test`; BEGIN master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(16) master-bin.000001 179 Query 1 79 use `test`; insert into t1 values(18) master-bin.000001 239 Query 1 239 use `test`; COMMIT +delete from t1; +delete from t2; +alter table t2 type=MyISAM; +insert into t1 values (1); +begin; +select * from t1 for update; +a +1 +select (@before:=unix_timestamp())*0; +(@before:=unix_timestamp())*0 +0 +begin; + select * from t1 for update; +insert into t2 values (20); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +select (@after:=unix_timestamp())*0; +(@after:=unix_timestamp())*0 +0 +select (@after-@before) >= 2; +(@after-@before) >= 2 +1 drop table t1,t2; diff --git a/mysql-test/r/multi_statement.result b/mysql-test/r/multi_statement.result index 4451b0a355e..3a8d86bf349 100644 --- a/mysql-test/r/multi_statement.result +++ b/mysql-test/r/multi_statement.result @@ -31,3 +31,20 @@ select 5'abcd' select 'finish'; finish finish +flush status; +create table t1 (i int); +insert into t1 values (1); +select * from t1 where i = 1; +insert into t1 values (2),(3),(4); +select * from t1 where i = 2; +select * from t1 where i = 3|||| +i +1 +i +2 +i +3 +show status like 'Slow_queries'|||| +Variable_name Value +Slow_queries 2 +drop table t1|||| diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 045a1b05e47..dba10296063 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -464,3 +464,14 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; ERROR HY000: You can't specify target table 't1' for update in FROM clause drop table t1,t2; +create table t1 ( +aclid bigint not null primary key, +status tinyint(1) not null +) engine = innodb; +create table t2 ( +refid bigint not null primary key, +aclid bigint, index idx_acl(aclid) +) engine = innodb; +insert into t2 values(1,null); +delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; +drop table t1, t2; diff --git a/mysql-test/r/myisam-blob.result.es b/mysql-test/r/myisam-blob.result.es new file mode 100644 index 00000000000..4031b9cfd1c --- /dev/null +++ b/mysql-test/r/myisam-blob.result.es @@ -0,0 +1,59 @@ +drop table if exists t1; +CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam; +INSERT INTO t1 (data) VALUES (NULL); +UPDATE t1 set data=repeat('a',18*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +select length(data) from t1; +length(data) +NULL +delete from t1 where left(data,1)='a'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +truncate table t1; +INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024)); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024)); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +delete from t1 where left(data,1)='b'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +UPDATE t1 set data=repeat('c',17*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +delete from t1 where left(data,1)='c'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 set data=repeat('a',18*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +select length(data) from t1; +length(data) +NULL +NULL +NULL +alter table t1 modify data blob; +select length(data) from t1; +length(data) +NULL +NULL +NULL +drop table t1; +CREATE TABLE t1 (data BLOB) ENGINE=myisam; +INSERT INTO t1 (data) VALUES (NULL); +UPDATE t1 set data=repeat('a',18*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +select length(data) from t1; +length(data) +NULL +drop table t1; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 26dcce43d08..d155a14bb60 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -529,6 +529,7 @@ show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 a 1 a A NULL NULL NULL YES BTREE disabled create table t2 (a int); +set @@rand_seed1=31415926,@@rand_seed2=2718281828; insert t1 select * from t2; show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -543,7 +544,7 @@ Warnings: Note 1031 Table storage engine for 't1' doesn't have this option show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 a 1 a NULL NULL NULL NULL YES HASH +t1 1 a 1 a NULL 1000 NULL NULL YES HASH drop table t1,t2; create table t1 ( a tinytext, b char(1), index idx (a(1),b) ); insert into t1 values (null,''), (null,''); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 7e69620394b..f763a16836f 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -60,7 +60,8 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, @@ -80,10 +81,12 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, `b` float default NULL @@ -94,6 +97,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1(a int, b text, c varchar(3)); @@ -149,7 +153,8 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` varchar(255) default NULL @@ -169,13 +174,15 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1 (a int) ENGINE=MYISAM; INSERT INTO t1 VALUES (1), (2); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL40" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -191,10 +198,12 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -210,6 +219,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; create table ```a` (i int); @@ -225,7 +235,8 @@ create table t1(a int); /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -243,10 +254,12 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -261,6 +274,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; set global sql_mode='ANSI_QUOTES'; @@ -270,7 +284,8 @@ set global sql_mode='ANSI_QUOTES'; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -288,10 +303,12 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -306,6 +323,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; set global sql_mode=''; drop table t1; @@ -316,7 +334,8 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -327,8 +346,206 @@ CREATE TABLE `t1` ( /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 1 2 3 drop table t1; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +create database mysqldump_test_db character set latin2 collate latin2_bin; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; + +USE `mysqldump_test_db`; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +drop database mysqldump_test_db; +CREATE TABLE t1 (a CHAR(10)); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('Ž™šá'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('Ž™šá'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (4),(5),(6); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +LOCK TABLES `t2` WRITE; +INSERT INTO `t2` VALUES (4),(5),(6); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 4e30d5bc110..d75dbd5d00c 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -1,14 +1,12 @@ +select -1 as "before_use_test" ; +before_use_test +-1 select otto from (select 1 as otto) as t1; otto 1 select otto from (select 1 as otto) as t1; otto 1 -select otto from (select 1 as otto) as t1; -otto -1 -select friedrich from (select 1 as otto) as t1; -ERROR 42S22: Unknown column 'friedrich' in 'field list' select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' select otto from (select 1 as otto) as t1; @@ -21,3 +19,126 @@ select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' +select otto from (select 1 as otto) as t1; +otto +1 +select 0 as "after_successful_stmt_errno" ; +after_successful_stmt_errno +0 +garbage ; +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 'garbage' at line 1 +select 1064 as "after_wrong_syntax_errno" ; +after_wrong_syntax_errno +1064 +garbage ; +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 'garbage' at line 1 +select 1064 as "after_let_var_equal_value" ; +after_let_var_equal_value +1064 +garbage ; +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 'garbage' at line 1 +set @my_var= 'abc' ; +select 0 as "after_set_var_equal_value" ; +after_set_var_equal_value +0 +garbage ; +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 'garbage' at line 1 +select 1064 as "after_disable_warnings_command" ; +after_disable_warnings_command +1064 +drop table if exists t1 ; +garbage ; +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 'garbage' at line 1 +drop table if exists t1 ; +select 0 as "after_disable_warnings" ; +after_disable_warnings +0 +garbage ; +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 'garbage' at line 1 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_minus_masked" ; +after_minus_masked +1146 +garbage ; +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 'garbage' at line 1 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_!_masked" ; +after_!_masked +1146 +garbage ; +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 'garbage' at line 1 +select -1 as "after_let_errno_equal_value" ; +after_let_errno_equal_value +-1 +garbage ; +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 'garbage' at line 1 +prepare stmt from "select 3 from t1" ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_failing_prepare" ; +after_failing_prepare +1146 +create table t1 ( f1 char(10)); +garbage ; +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 'garbage' at line 1 +prepare stmt from "select 3 from t1" ; +select 0 as "after_successful_prepare" ; +after_successful_prepare +0 +garbage ; +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 'garbage' at line 1 +execute stmt; +3 +select 0 as "after_successful_execute" ; +after_successful_execute +0 +drop table t1; +garbage ; +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 'garbage' at line 1 +execute stmt; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_failing_execute" ; +after_failing_execute +1146 +garbage ; +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 'garbage' at line 1 +execute __stmt_; +ERROR HY000: Unknown prepared statement handler (__stmt_) given to EXECUTE +select 1243 as "after_failing_execute" ; +after_failing_execute +1243 +garbage ; +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 'garbage' at line 1 +deallocate prepare stmt; +select 0 as "after_successful_deallocate" ; +after_successful_deallocate +0 +garbage ; +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 'garbage' at line 1 +deallocate prepare __stmt_; +ERROR HY000: Unknown prepared statement handler (__stmt_) given to DEALLOCATE PREPARE +select 1243 as "after_failing_deallocate" ; +after_failing_deallocate +1243 +garbage ; +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 'garbage' at line 1 +select 1064 as "after_--disable_abort_on_error" ; +after_--disable_abort_on_error +1064 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_!errno_masked_error" ; +after_!errno_masked_error +1146 +garbage ; +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 'garbage' at line 1 +select 1064 as "after_--enable_abort_on_error" ; +after_--enable_abort_on_error +1064 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index ee7c3b28fe2..f899d254243 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1; +drop database if exists mysqltest; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL @@ -9,6 +10,21 @@ SELECT * FROM t1; a b c 9410 9412 0 DROP TABLE t1; +CREATE DATABASE mysqltest; +USE mysqltest; +CREATE TABLE t1 ( +a INT NOT NULL, +b INT NOT NULL +) ENGINE=ndbcluster; +RENAME TABLE t1 TO test.t1; +SHOW TABLES; +Tables_in_mysqltest +DROP DATABASE mysqltest; +USE test; +SHOW TABLES; +Tables_in_test +t1 +DROP TABLE t1; create table t1 ( col1 int not null auto_increment primary key, col2 varchar(30) not null, diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 23f089b9bc0..b7afb5918a4 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; flush status; create table t1( id int not null primary key, @@ -363,3 +363,8 @@ a int NOT NULL PRIMARY KEY, b int ) engine=ndb; insert t9 values(1, 2), (2,3), (3, 4), (4, 5); +create table t10 ( +a int not null primary key, +b blob +) engine=ndb; +insert into t10 values (1, 'kalle'); diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/r/ndb_autodiscover2.result index 08803d997a5..91f018b5d02 100644 --- a/mysql-test/r/ndb_autodiscover2.result +++ b/mysql-test/r/ndb_autodiscover2.result @@ -8,3 +8,6 @@ show status like 'handler_discover%'; Variable_name Value Handler_discover 1 drop table t9; +select * from t10; +ERROR HY000: Got error 4263 'Invalid blob attributes or invalid blob parts table' from ndbcluster +drop table t10; diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index abe1b98b536..a6396080ef0 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -40,6 +40,11 @@ SELECT * FROM t1 ORDER BY pk1; pk1 attr1 attr2 attr3 3 1 NULL 9412 9412 9413 17 9413 +UPDATE t1 SET pk1=4 WHERE pk1 = 3; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +4 1 NULL 9412 +9412 9413 17 9413 DELETE FROM t1; SELECT * FROM t1; pk1 attr1 attr2 attr3 @@ -395,6 +400,13 @@ b attr1 9413 9412 drop table test.t1, t2; drop database mysqltest; +drop database if exists ndbtest1; +create database ndbtest1; +use ndbtest1; +create table t1(id int) engine=ndbcluster; +drop database ndbtest1; +drop database ndbtest1; +ERROR HY000: Can't drop database 'ndbtest1'; database doesn't exist use test; create table t1 (a int primary key, b char(0)); insert into t1 values (1,""); @@ -414,3 +426,184 @@ select * from t1 where b IS NOT NULL; a b 1 drop table t1; +create table t1 ( +c1 int, +c2 int, +c3 int, +c4 int, +c5 int, +c6 int, +c7 int, +c8 int, +c9 int, +c10 int, +c11 int, +c12 int, +c13 int, +c14 int, +c15 int, +c16 int, +c17 int, +c18 int, +c19 int, +c20 int, +c21 int, +c22 int, +c23 int, +c24 int, +c25 int, +c26 int, +c27 int, +c28 int, +c29 int, +c30 int, +c31 int, +c32 int, +c33 int, +c34 int, +c35 int, +c36 int, +c37 int, +c38 int, +c39 int, +c40 int, +c41 int, +c42 int, +c43 int, +c44 int, +c45 int, +c46 int, +c47 int, +c48 int, +c49 int, +c50 int, +c51 int, +c52 int, +c53 int, +c54 int, +c55 int, +c56 int, +c57 int, +c58 int, +c59 int, +c60 int, +c61 int, +c62 int, +c63 int, +c64 int, +c65 int, +c66 int, +c67 int, +c68 int, +c69 int, +c70 int, +c71 int, +c72 int, +c73 int, +c74 int, +c75 int, +c76 int, +c77 int, +c78 int, +c79 int, +c80 int, +c81 int, +c82 int, +c83 int, +c84 int, +c85 int, +c86 int, +c87 int, +c88 int, +c89 int, +c90 int, +c91 int, +c92 int, +c93 int, +c94 int, +c95 int, +c96 int, +c97 int, +c98 int, +c99 int, +c100 int, +c101 int, +c102 int, +c103 int, +c104 int, +c105 int, +c106 int, +c107 int, +c108 int, +c109 int, +c110 int, +c111 int, +c112 int, +c113 int, +c114 int, +c115 int, +c116 int, +c117 int, +c118 int, +c119 int, +c120 int, +c121 int, +c122 int, +c123 int, +c124 int, +c125 int, +c126 int, +c127 int, +c128 int, +primary key(c1)) engine=ndb; +drop table t1; +create table t1 ( +a1234567890123456789012345678901234567890 int primary key, +a12345678901234567890123456789a1234567890 int, +index(a12345678901234567890123456789a1234567890) +) engine=ndb; +show tables; +Tables_in_test +t1 +insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1); +explain select * from t1 where a12345678901234567890123456789a1234567890=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const 10 Using where +select * from t1 where a12345678901234567890123456789a1234567890=2; +a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890 +5 2 +drop table t1; +create table t1 +(a bigint, b bigint, c bigint, d bigint, +primary key (a,b,c,d)) +engine=ndb +max_rows=200000000; +Warnings: +Warning 1105 Ndb might have problems storing the max amount of rows specified +insert into t1 values +(1,2,3,4),(2,3,4,5),(3,4,5,6), +(3,2,3,4),(1,3,4,5),(2,4,5,6), +(1,2,3,5),(2,3,4,8),(3,4,5,9), +(3,2,3,5),(1,3,4,8),(2,4,5,9), +(1,2,3,6),(2,3,4,6),(3,4,5,7), +(3,2,3,6),(1,3,4,6),(2,4,5,7), +(1,2,3,7),(2,3,4,7),(3,4,5,8), +(3,2,3,7),(1,3,4,7),(2,4,5,8), +(1,3,3,4),(2,4,4,5),(3,5,5,6), +(3,3,3,4),(1,4,4,5),(2,5,5,6), +(1,3,3,5),(2,4,4,8),(3,5,5,9), +(3,3,3,5),(1,4,4,8),(2,5,5,9), +(1,3,3,6),(2,4,4,6),(3,5,5,7), +(3,3,3,6),(1,4,4,6),(2,5,5,7), +(1,3,3,7),(2,4,4,7),(3,5,5,8), +(3,3,3,7),(1,4,4,7),(2,5,5,8); +select count(*) from t1; +count(*) +48 +drop table t1; +create table t1 +(a bigint, b bigint, c bigint, d bigint, +primary key (a)) +engine=ndb +max_rows=1; +drop table t1; diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index cf64ec41ae3..6f25ec95c80 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -1,25 +1,5 @@ drop table if exists t1; -drop database if exists mysqltest; -create table t1 ( -a int not null primary key, -b tinytext -) engine=ndbcluster; -insert into t1 values(1, 'x'); -update t1 set b = 'y'; -select * from t1; -a b -1 y -delete from t1; -drop table t1; -create table t1 ( -a int not null primary key, -b text not null -) engine=ndbcluster; -insert into t1 values(1, ''); -select * from t1; -a b -1 -drop table t1; +drop database if exists test2; set autocommit=0; create table t1 ( a int not null primary key, @@ -102,6 +82,53 @@ commit; select count(*) from t1; count(*) 0 +replace t1 set a=1,b=@b1,c=111,d=@d1; +replace t1 set a=2,b=@b2,c=222,d=@d2; +commit; +explain select * from t1 where a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=1; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=2; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +2 20000 b2 30000 dd2 +replace t1 set a=1,b=@b2,c=111,d=@d2; +replace t1 set a=2,b=@b1,c=222,d=@d1; +commit; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=1; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +1 20000 b2 30000 dd2 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=2; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +2 2256 b1 3000 dd1 +replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2); +replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1); +commit; +select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3) +from t1 where a=1; +a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3) +1 40000 b2 60000 dd2 +select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3) +from t1 where a=2; +a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3) +2 4512 b1 6000 dd1 +replace t1 set a=1,b='xyz',c=111,d=null; +commit; +select a,b from t1 where d is null; +a b +1 xyz +delete from t1 where a=1; +delete from t1 where a=2; +commit; +select count(*) from t1; +count(*) +0 insert into t1 values(1,@b1,111,@d1); insert into t1 values(2,@b2,222,@d2); commit; @@ -241,90 +268,6 @@ a b c d 7 7xb7 777 7xdd7 8 8xb8 888 8xdd8 9 9xb9 999 9xdd9 -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 -alter table t1 add x int; -select * from t1 order by a; -a b c d x -1 1xb1 111 1xdd1 NULL -2 2xb2 222 2xdd2 NULL -3 3xb3 333 3xdd3 NULL -4 4xb4 444 4xdd4 NULL -5 5xb5 555 5xdd5 NULL -6 6xb6 666 6xdd6 NULL -7 7xb7 777 7xdd7 NULL -8 8xb8 888 8xdd8 NULL -9 9xb9 999 9xdd9 NULL -alter table t1 drop x; -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 -create database mysqltest; -use mysqltest; -CREATE TABLE t2 ( -a bigint unsigned NOT NULL PRIMARY KEY, -b int unsigned not null, -c int unsigned -) engine=ndbcluster; -insert into t2 values (1,1,1),(2,2,2); -select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; -a b c d a b c -1 1xb1 111 1xdd1 1 1 1 -2 2xb2 222 2xdd2 2 2 2 -drop table t2; -use test; -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 -alter table t1 add x int; -select * from t1 order by a; -a b c d x -1 1xb1 111 1xdd1 NULL -2 2xb2 222 2xdd2 NULL -3 3xb3 333 3xdd3 NULL -4 4xb4 444 4xdd4 NULL -5 5xb5 555 5xdd5 NULL -6 6xb6 666 6xdd6 NULL -7 7xb7 777 7xdd7 NULL -8 8xb8 888 8xdd8 NULL -9 9xb9 999 9xdd9 NULL -alter table t1 drop x; -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 delete from t1 where c >= 100; commit; select count(*) from t1; @@ -375,8 +318,128 @@ rollback; select count(*) from t1; count(*) 0 +insert into t1 values(1,'b1',111,'dd1'); +insert into t1 values(2,'b2',222,'dd2'); +insert into t1 values(3,'b3',333,'dd3'); +insert into t1 values(4,'b4',444,'dd4'); +insert into t1 values(5,'b5',555,'dd5'); +insert into t1 values(6,'b6',666,'dd6'); +insert into t1 values(7,'b7',777,'dd7'); +insert into t1 values(8,'b8',888,'dd8'); +insert into t1 values(9,'b9',999,'dd9'); +commit; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +alter table t1 add x int; +select * from t1 order by a; +a b c d x +1 b1 111 dd1 NULL +2 b2 222 dd2 NULL +3 b3 333 dd3 NULL +4 b4 444 dd4 NULL +5 b5 555 dd5 NULL +6 b6 666 dd6 NULL +7 b7 777 dd7 NULL +8 b8 888 dd8 NULL +9 b9 999 dd9 NULL +alter table t1 drop x; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +create database test2; +use test2; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +insert into t2 values (1,1,1),(2,2,2); +select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; +a b c d a b c +1 b1 111 dd1 1 1 1 +2 b2 222 dd2 2 2 2 +drop table t2; +use test; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +alter table t1 add x int; +select * from t1 order by a; +a b c d x +1 b1 111 dd1 NULL +2 b2 222 dd2 NULL +3 b3 333 dd3 NULL +4 b4 444 dd4 NULL +5 b5 555 dd5 NULL +6 b6 666 dd6 NULL +7 b7 777 dd7 NULL +8 b8 888 dd8 NULL +9 b9 999 dd9 NULL +alter table t1 drop x; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +drop table t1; +drop database test2; +set autocommit=0; +create table t1 ( +a int not null primary key, +b tinytext +) engine=ndbcluster; +insert into t1 values(1, 'x'); +update t1 set b = 'y'; +select * from t1; +a b +1 y +delete from t1; +select * from t1; +a b +commit; +drop table t1; +set autocommit=0; +create table t1 ( +a int not null primary key, +b text not null +) engine=ndbcluster; +insert into t1 values(1, ''); +select * from t1; +a b +1 +commit; drop table t1; -drop database mysqltest; set autocommit=1; use test; CREATE TABLE t1 ( @@ -397,9 +460,28 @@ select * from t1 order by a; a b 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +set autocommit=1; alter table t1 engine=myisam; select * from t1 order by a; a b 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB drop table t1; +create table t1 ( +id int(11) unsigned primary key NOT NULL auto_increment, +msg text NOT NULL +) engine=ndbcluster default charset=utf8; +insert into t1 (msg) values( +'Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length).'); +select * from t1; +id msg +1 Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length). +drop table t1; diff --git a/mysql-test/r/ndb_charset.result b/mysql-test/r/ndb_charset.result index 93429a1fcb0..00bc36a7c0d 100644 --- a/mysql-test/r/ndb_charset.result +++ b/mysql-test/r/ndb_charset.result @@ -78,9 +78,9 @@ unique key(a) ) engine=ndb; insert into t1 values(1, 'aAa'); insert into t1 values(2, 'aaa'); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '2' for key 1 insert into t1 values(3, 'AAA'); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '3' for key 1 select * from t1 order by p; p a 1 aAa @@ -189,3 +189,13 @@ p a 5 aaa 6 AAA drop table t1; +create table t1 ( +a varchar(10) primary key +) engine=ndb; +insert into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +select * from t1; +a +jonas % +drop table t1; diff --git a/mysql-test/r/ndb_grant.result b/mysql-test/r/ndb_grant.result new file mode 100644 index 00000000000..6583065a0c4 --- /dev/null +++ b/mysql-test/r/ndb_grant.result @@ -0,0 +1,416 @@ +drop table if exists t1; +SET NAMES binary; +use mysql; +alter table columns_priv engine=ndb; +alter table db engine=ndb; +alter table func engine=ndb; +alter table help_category engine=ndb; +alter table help_keyword engine=ndb; +alter table help_relation engine=ndb; +alter table help_topic engine=ndb; +alter table host engine=ndb; +alter table tables_priv engine=ndb; +alter table time_zone engine=ndb; +alter table time_zone_leap_second engine=ndb; +alter table time_zone_name engine=ndb; +alter table time_zone_transition engine=ndb; +alter table time_zone_transition_type engine=ndb; +alter table user engine=ndb; +use test; +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +flush privileges; +begin; +grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant delete on mysqltest.* to mysqltest_1@localhost; +commit; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT, DELETE ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +revoke delete on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant select on mysqltest.* to mysqltest_1@localhost require NONE; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB"; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA' +delete from mysql.user where user='mysqltest_1'; +flush privileges; +begin; +grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION; +commit; +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +begin; +revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +delete from mysql.user where user='mysqltest_1'; +flush privileges; +begin; +grant usage on test.* to mysqltest_1@localhost with grant option; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT USAGE ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +GRANT USAGE ON `test`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +delete from mysql.tables_priv where user='mysqltest_1'; +delete from mysql.columns_priv where user='mysqltest_1'; +flush privileges; +show grants for mysqltest_1@localhost; +ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host 'localhost' +create table t1 (a int); +begin; +GRANT select,update,insert on t1 to mysqltest_1@localhost; +GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT, SELECT (a), INSERT, INSERT (a), UPDATE, UPDATE (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +table_priv column_priv +Select,Insert,Update Select,Insert,Update,References +begin; +REVOKE select (a), update on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +begin; +REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +begin; +GRANT select,references on t1 to mysqltest_1@localhost; +commit; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +table_priv column_priv +Select,References References +begin; +grant all on test.* to mysqltest_3@localhost with grant option; +revoke all on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +GRANT USAGE ON `test`.* TO 'mysqltest_3'@'localhost' WITH GRANT OPTION +begin; +revoke grant option on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +begin; +grant all on test.t1 to mysqltest_2@localhost with grant option; +revoke all on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +GRANT USAGE ON `test`.`t1` TO 'mysqltest_2'@'localhost' WITH GRANT OPTION +begin; +revoke grant option on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +flush privileges; +drop table t1; +begin; +GRANT FILE on mysqltest.* to mysqltest_1@localhost; +ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES +commit; +select 1; +1 +1 +create database mysqltest1; +begin; +grant usage on mysqltest1.* to test6123 identified by 'magic123'; +commit; +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +host db user select_priv insert_priv +delete from mysql.user where user='test6123'; +drop database mysqltest1; +create table t1 (a int); +begin; +grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION; +commit; +show grants for drop_user2@localhost; +Grants for drop_user2@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user2'@'localhost' WITH GRANT OPTION +begin; +revoke all privileges, grant option from drop_user2@localhost; +commit; +drop user drop_user2@localhost; +begin; +grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION; +grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION; +grant select(a) on test.t1 to drop_user@localhost; +commit; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost' +set sql_mode=ansi_quotes; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost' +set sql_mode=default; +set sql_quote_show_create=0; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost' +set sql_mode="ansi_quotes"; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost' +set sql_quote_show_create=1; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost' +set sql_mode=""; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost' +revoke all privileges, grant option from drop_user@localhost; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT USAGE ON *.* TO 'drop_user'@'localhost' +drop user drop_user@localhost; +begin; +revoke all privileges, grant option from drop_user@localhost; +ERROR HY000: Can't revoke all privileges, grant for one or more of the requested users +commit; +begin; +grant select(a) on test.t1 to drop_user1@localhost; +commit; +flush privileges; +begin; +grant select on test.t1 to drop_user2@localhost; +grant select on test.* to drop_user3@localhost; +grant select on *.* to drop_user4@localhost; +commit; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +ERROR HY000: Can't drop one or more of the requested users +begin; +revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost, +drop_user3@localhost, drop_user4@localhost; +commit; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +drop table t1; +begin; +grant usage on *.* to mysqltest_1@localhost identified by "password"; +grant select, update, insert on test.* to mysqltest@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' +drop user mysqltest_1@localhost; +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁ (ËÏÌ int); +begin; +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost' +begin; +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +commit; +begin; +GRANT SELECT ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +begin; +REVOKE SELECT ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +commit; +begin; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +begin; +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +commit; +DROP DATABASE ÂÄ; +SET NAMES latin1; +USE test; +CREATE TABLE t1 (a int ); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +CREATE TABLE t4 LIKE t1; +CREATE TABLE t5 LIKE t1; +CREATE TABLE t6 LIKE t1; +CREATE TABLE t7 LIKE t1; +CREATE TABLE t8 LIKE t1; +CREATE TABLE t9 LIKE t1; +CREATE TABLE t10 LIKE t1; +CREATE DATABASE testdb1; +CREATE DATABASE testdb2; +CREATE DATABASE testdb3; +CREATE DATABASE testdb4; +CREATE DATABASE testdb5; +CREATE DATABASE testdb6; +CREATE DATABASE testdb7; +CREATE DATABASE testdb8; +CREATE DATABASE testdb9; +CREATE DATABASE testdb10; +begin; +GRANT ALL ON testdb1.* TO testuser@localhost; +GRANT ALL ON testdb2.* TO testuser@localhost; +GRANT ALL ON testdb3.* TO testuser@localhost; +GRANT ALL ON testdb4.* TO testuser@localhost; +GRANT ALL ON testdb5.* TO testuser@localhost; +GRANT ALL ON testdb6.* TO testuser@localhost; +GRANT ALL ON testdb7.* TO testuser@localhost; +GRANT ALL ON testdb8.* TO testuser@localhost; +GRANT ALL ON testdb9.* TO testuser@localhost; +GRANT ALL ON testdb10.* TO testuser@localhost; +GRANT SELECT ON test.t1 TO testuser@localhost; +GRANT SELECT ON test.t2 TO testuser@localhost; +GRANT SELECT ON test.t3 TO testuser@localhost; +GRANT SELECT ON test.t4 TO testuser@localhost; +GRANT SELECT ON test.t5 TO testuser@localhost; +GRANT SELECT ON test.t6 TO testuser@localhost; +GRANT SELECT ON test.t7 TO testuser@localhost; +GRANT SELECT ON test.t8 TO testuser@localhost; +GRANT SELECT ON test.t9 TO testuser@localhost; +GRANT SELECT ON test.t10 TO testuser@localhost; +GRANT SELECT (a) ON test.t1 TO testuser@localhost; +GRANT SELECT (a) ON test.t2 TO testuser@localhost; +GRANT SELECT (a) ON test.t3 TO testuser@localhost; +GRANT SELECT (a) ON test.t4 TO testuser@localhost; +GRANT SELECT (a) ON test.t5 TO testuser@localhost; +GRANT SELECT (a) ON test.t6 TO testuser@localhost; +GRANT SELECT (a) ON test.t7 TO testuser@localhost; +GRANT SELECT (a) ON test.t8 TO testuser@localhost; +GRANT SELECT (a) ON test.t9 TO testuser@localhost; +GRANT SELECT (a) ON test.t10 TO testuser@localhost; +commit; +begin; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; +commit; +SHOW GRANTS FOR testuser@localhost; +Grants for testuser@localhost +GRANT USAGE ON *.* TO 'testuser'@'localhost' +DROP USER testuser@localhost; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +DROP DATABASE testdb1; +DROP DATABASE testdb2; +DROP DATABASE testdb3; +DROP DATABASE testdb4; +DROP DATABASE testdb5; +DROP DATABASE testdb6; +DROP DATABASE testdb7; +DROP DATABASE testdb8; +DROP DATABASE testdb9; +DROP DATABASE testdb10; +use mysql; +alter table columns_priv engine=myisam; +alter table db engine=myisam; +alter table func engine=myisam; +alter table help_category engine=myisam; +alter table help_keyword engine=myisam; +alter table help_relation engine=myisam; +alter table help_topic engine=myisam; +alter table host engine=myisam; +alter table tables_priv engine=myisam; +alter table time_zone engine=myisam; +alter table time_zone_leap_second engine=myisam; +alter table time_zone_name engine=myisam; +alter table time_zone_transition engine=myisam; +alter table time_zone_transition_type engine=myisam; +alter table user engine=myisam; +use test; +flush privileges; diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 2dc260ec43d..f5794d477f3 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, test1, test2; CREATE TABLE t1 ( a int unsigned NOT NULL PRIMARY KEY, b int unsigned not null, @@ -275,3 +275,271 @@ a b c 1 1 1 4 4 NULL drop table t1; +CREATE TABLE test1 ( +SubscrID int(11) NOT NULL auto_increment, +UsrID int(11) NOT NULL default '0', +PRIMARY KEY (SubscrID), +KEY idx_usrid (UsrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO test1 VALUES (2,224),(3,224),(1,224); +CREATE TABLE test2 ( +SbclID int(11) NOT NULL auto_increment, +SbcrID int(11) NOT NULL default '0', +PRIMARY KEY (SbclID), +KEY idx_sbcrid (SbcrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2); +select * from test1 order by 1; +SubscrID UsrID +1 224 +2 224 +3 224 +select * from test2 order by 1; +SbclID SbcrID +1 1 +2 1 +3 2 +4 2 +SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON +l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2; +SubscrID SbclID +1 1 +1 2 +2 3 +2 4 +3 NULL +drop table test1; +drop table test2; +create table t1 ( +pk int primary key, +dt datetime not null, +da date not null, +ye year not null, +ti time not null, +ts timestamp not null, +index(dt), +index(da), +index(ye), +index(ti), +index(ts) +) engine=ndb; +insert into t1 (pk,dt,da,ye,ti,ts) values +(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'), +(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'), +(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'), +(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'), +(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'), +(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'), +(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'), +(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'), +(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59'); +select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +count(*)-9 +0 +select count(*)-6 from t1 use index (dt) where dt >= '1955-12-31 00:00:00'; +count(*)-6 +0 +select count(*)-5 from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +count(*)-5 +0 +select count(*)-5 from t1 use index (dt) where dt < '1970-03-03 22:22:22'; +count(*)-5 +0 +select count(*)-7 from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +count(*)-7 +0 +select count(*)-8 from t1 use index (dt) where dt <= '2001-01-01 10:11:11'; +count(*)-8 +0 +select count(*)-9 from t1 use index (dt) where dt <= '2055-01-01 00:00:00'; +count(*)-9 +0 +select count(*)-9 from t1 use index (da) where da > '1900-01-01'; +count(*)-9 +0 +select count(*)-6 from t1 use index (da) where da >= '1955-12-31'; +count(*)-6 +0 +select count(*)-5 from t1 use index (da) where da > '1955-12-31'; +count(*)-5 +0 +select count(*)-5 from t1 use index (da) where da < '1970-03-03'; +count(*)-5 +0 +select count(*)-6 from t1 use index (da) where da < '2001-01-01'; +count(*)-6 +0 +select count(*)-8 from t1 use index (da) where da <= '2001-01-02'; +count(*)-8 +0 +select count(*)-9 from t1 use index (da) where da <= '2055-01-01'; +count(*)-9 +0 +select count(*)-9 from t1 use index (ye) where ye > '1900'; +count(*)-9 +0 +select count(*)-6 from t1 use index (ye) where ye >= '1955'; +count(*)-6 +0 +select count(*)-5 from t1 use index (ye) where ye > '1955'; +count(*)-5 +0 +select count(*)-5 from t1 use index (ye) where ye < '1970'; +count(*)-5 +0 +select count(*)-6 from t1 use index (ye) where ye < '2001'; +count(*)-6 +0 +select count(*)-8 from t1 use index (ye) where ye <= '2001'; +count(*)-8 +0 +select count(*)-9 from t1 use index (ye) where ye <= '2055'; +count(*)-9 +0 +select count(*)-9 from t1 use index (ti) where ti >= '00:00:00'; +count(*)-9 +0 +select count(*)-7 from t1 use index (ti) where ti > '00:00:00'; +count(*)-7 +0 +select count(*)-7 from t1 use index (ti) where ti > '05:05:05'; +count(*)-7 +0 +select count(*)-5 from t1 use index (ti) where ti > '06:06:06'; +count(*)-5 +0 +select count(*)-5 from t1 use index (ti) where ti < '10:11:11'; +count(*)-5 +0 +select count(*)-6 from t1 use index (ti) where ti <= '10:11:11'; +count(*)-6 +0 +select count(*)-8 from t1 use index (ti) where ti < '23:59:59'; +count(*)-8 +0 +select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; +count(*)-9 +0 +select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00'; +count(*)-9 +0 +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00'; +count(*)-7 +0 +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05'; +count(*)-7 +0 +select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06'; +count(*)-5 +0 +select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11'; +count(*)-5 +0 +select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11'; +count(*)-6 +0 +select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59'; +count(*)-8 +0 +select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; +count(*)-9 +0 +drop table t1; +create table t1 ( +a int primary key, +s decimal(12), +t decimal(12, 5), +u decimal(12) unsigned, +v decimal(12, 5) unsigned, +key (s), +key (t), +key (u), +key (v) +) engine=ndb; +insert into t1 values +( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042), +( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003), +( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488), +( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013), +( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002), +( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018), +( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001), +( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374), +( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000), +( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008); +select count(*)- 5 from t1 use index (s) where s < -000000000007; +count(*)- 5 +0 +select count(*)- 7 from t1 use index (s) where s <= -000000000007; +count(*)- 7 +0 +select count(*)- 2 from t1 use index (s) where s = -000000000007; +count(*)- 2 +0 +select count(*)- 5 from t1 use index (s) where s >= -000000000007; +count(*)- 5 +0 +select count(*)- 3 from t1 use index (s) where s > -000000000007; +count(*)- 3 +0 +select count(*)- 4 from t1 use index (t) where t < -0000061.00003; +count(*)- 4 +0 +select count(*)- 5 from t1 use index (t) where t <= -0000061.00003; +count(*)- 5 +0 +select count(*)- 1 from t1 use index (t) where t = -0000061.00003; +count(*)- 1 +0 +select count(*)- 6 from t1 use index (t) where t >= -0000061.00003; +count(*)- 6 +0 +select count(*)- 5 from t1 use index (t) where t > -0000061.00003; +count(*)- 5 +0 +select count(*)- 2 from t1 use index (u) where u < 000000000061; +count(*)- 2 +0 +select count(*)- 4 from t1 use index (u) where u <= 000000000061; +count(*)- 4 +0 +select count(*)- 2 from t1 use index (u) where u = 000000000061; +count(*)- 2 +0 +select count(*)- 8 from t1 use index (u) where u >= 000000000061; +count(*)- 8 +0 +select count(*)- 6 from t1 use index (u) where u > 000000000061; +count(*)- 6 +0 +select count(*)- 5 from t1 use index (v) where v < 0000965.00042; +count(*)- 5 +0 +select count(*)- 6 from t1 use index (v) where v <= 0000965.00042; +count(*)- 6 +0 +select count(*)- 1 from t1 use index (v) where v = 0000965.00042; +count(*)- 1 +0 +select count(*)- 5 from t1 use index (v) where v >= 0000965.00042; +count(*)- 5 +0 +select count(*)- 4 from t1 use index (v) where v > 0000965.00042; +count(*)- 4 +0 +drop table t1; +create table t1(a int primary key, b int not null, index(b)); +insert into t1 values (1,1), (2,2); +set autocommit=0; +begin; +select count(*) from t1; +count(*) +2 +ALTER TABLE t1 ADD COLUMN c int; +select a from t1 where b = 2; +a +2 +show tables; +Tables_in_test +t1 +drop table t1; diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index f1407dfe78d..598b9dcccf7 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by a; a b c 3 4 6 insert into t1 values(8, 2, 3); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '8' for key 1 select * from t1 order by a; a b c 1 2 3 @@ -44,6 +44,53 @@ a b c 7 8 3 8 2 3 drop table t1; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned, +c int unsigned, +UNIQUE bc(b,c) +) engine = ndb; +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 use index (bc) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc)order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 use index (bc) order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 use index (PRIMARY) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; +a b c +3 NULL NULL +select * from t1 use index (bc) where b IS NULL and c = 2 order by a; +a b c +2 NULL 2 +select * from t1 use index (bc) where b < 4 order by a; +a b c +1 1 1 +select * from t1 use index (bc) where b IS NOT NULL order by a; +a b c +1 1 1 +4 4 NULL +insert into t1 values(5,1,1); +ERROR 23000: Duplicate entry '5' for key 1 +drop table t1; CREATE TABLE t2 ( a int unsigned NOT NULL PRIMARY KEY, b int unsigned not null, @@ -65,7 +112,7 @@ select * from t2 where b = 4 order by a; a b c 3 4 6 insert into t2 values(8, 2, 3); -ERROR 23000: Can't write, because of unique constraint, to table 't2' +ERROR 23000: Duplicate entry '8' for key 1 select * from t2 order by a; a b c 1 2 3 @@ -87,6 +134,13 @@ a b c 7 8 3 8 2 3 drop table t2; +CREATE TABLE t2 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned, +UNIQUE USING HASH (b, c) +) engine=ndbcluster; +ERROR 42000: Column 'c' is used with UNIQUE or INDEX but is not defined as NOT NULL CREATE TABLE t3 ( a int unsigned NOT NULL, b int unsigned not null, @@ -123,7 +177,7 @@ pk a 3 NULL 4 4 insert into t1 values (5,0); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '5' for key 1 select * from t1 order by pk; pk a -1 NULL @@ -156,7 +210,7 @@ pk a b c 0 NULL 18 NULL 1 3 19 abc insert into t2 values(2,3,19,'abc'); -ERROR 23000: Can't write, because of unique constraint, to table 't2' +ERROR 23000: Duplicate entry '2' for key 1 select * from t2 order by pk; pk a b c -1 1 17 NULL @@ -522,3 +576,53 @@ uid gid rid cid 1 1 2 3 1 1 2 4 drop table t1,t2,t3,t4,t5,t6,t7; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned, +c int unsigned, +UNIQUE bc(b,c) ) engine = ndb; +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 where b=1 and c=1; +a b c +1 1 1 +select * from t1 where b is null and c is null; +a b c +3 NULL NULL +select * from t1 where b is null and c = 2; +a b c +2 NULL 2 +select * from t1 where b = 4 and c is null; +a b c +4 4 NULL +create table t8 as +select * from t1 where (b = 1 and c = 1) +or (b is null and c is null) +or (b is null and c = 2) +or (b = 4 and c is null); +select * from t8 order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +drop table t1, t8; +create table t1( +id integer not null auto_increment, +month integer not null, +year integer not null, +code varchar( 2) not null, +primary key ( id), +unique idx_t1( month, code, year) +) engine=ndb; +INSERT INTO t1 (month, year, code) VALUES (4,2004,'12'); +INSERT INTO t1 (month, year, code) VALUES (5,2004,'12'); +select * from t1 where code = '12' and month = 4 and year = 2004 ; +id month year code +1 4 2004 12 +drop table t1; diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index cdc445558b9..7503010a66b 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -535,25 +535,73 @@ count(*) 2000 insert into t1 select * from t1 where b < 10 order by pk1; ERROR 23000: Duplicate entry '9' for key 1 +DELETE FROM t1 WHERE pk1=2; begin; -INSERT IGNORE INTO t1 VALUES(1,2,3); -ERROR HY000: Table storage engine for 't1' doesn't have this option -commit; -select * from t1 where pk1=1; +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; pk1 b c +0 0 0 1 1 1 -INSERT IGNORE INTO t1 VALUES(1,2,3); -ERROR HY000: Table storage engine for 't1' doesn't have this option -select * from t1 where pk1=1; +2 3 4 +rollback; +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; pk1 b c +0 0 0 1 1 1 -REPLACE INTO t1 values(1, 2, 3); +2 3 4 +REPLACE INTO t1 values(1, 78, 3); select * from t1 where pk1=1; pk1 b c -1 2 3 -INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; -ERROR HY000: Table storage engine for 't1' doesn't have this option -select * from t1 where pk1=1; +1 78 3 +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79; +select * from t1 where pk1 < 4 order by pk1; pk1 b c -1 2 3 +0 0 0 +1 79 3 +2 3 4 +3 79 3 +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c; +select * from t1 where pk1 < 4 order by pk1; +pk1 b c +0 0 0 +1 4 3 +2 3 4 +3 6 3 +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; +pk1 b c +2 2 17 +4 4 3 +6 6 3 +DROP TABLE t1; +CREATE TABLE t1(a INT) ENGINE=ndb; +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 SELECT a FROM t1; +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; +a +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 DROP TABLE t1; diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/r/ndb_restore.result new file mode 100644 index 00000000000..8e4449b1996 --- /dev/null +++ b/mysql-test/r/ndb_restore.result @@ -0,0 +1,249 @@ +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +CREATE TABLE `t1` ( +`capgoaledatta` smallint(5) unsigned NOT NULL auto_increment, +`goaledatta` char(2) NOT NULL default '', +`maturegarbagefa` varchar(32) NOT NULL default '', +PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt'); +CREATE TABLE `t2` ( +`capgotod` smallint(5) unsigned NOT NULL auto_increment, +`gotod` smallint(5) unsigned NOT NULL default '0', +`goaledatta` char(2) default NULL, +`maturegarbagefa` varchar(32) default NULL, +`descrpooppo` varchar(64) default NULL, +`svcutonsa` varchar(64) NOT NULL default '', +PRIMARY KEY (`capgotod`), +KEY `i_quadaddsvr` (`gotod`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); +CREATE TABLE `t3` ( +`CapGoaledatta` smallint(5) unsigned NOT NULL default '0', +`capgotod` smallint(5) unsigned NOT NULL default '0', +PRIMARY KEY (`capgotod`,`CapGoaledatta`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3); +CREATE TABLE `t4` ( +`capfa` bigint(20) unsigned NOT NULL auto_increment, +`realm` varchar(32) NOT NULL default '', +`authpwchap` varchar(32) default NULL, +`fa` varchar(32) NOT NULL default '', +`payyingatta` tinyint(4) NOT NULL default '0', +`status` char(1) default NULL, +PRIMARY KEY (`fa`,`realm`), +KEY `capfa` (`capfa`), +KEY `i_quadentity` (`fa`,`realm`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL); +CREATE TABLE `t5` ( +`capfa` bigint(20) unsigned NOT NULL default '0', +`gotod` smallint(5) unsigned NOT NULL default '0', +`orderutonsa` varchar(64) NOT NULL default '', +PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,''); +CREATE TABLE `t6` ( +`capfa_parent` bigint(20) unsigned NOT NULL default '0', +`capfa_child` bigint(20) unsigned NOT NULL default '0', +`relatta` smallint(5) unsigned NOT NULL default '0', +PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0); +CREATE TABLE `t7` ( +`dardpo` char(15) NOT NULL default '', +`dardtestard` tinyint(3) unsigned NOT NULL default '0', +`FastFA` char(5) NOT NULL default '', +`FastCode` char(6) NOT NULL default '', +`Fastca` char(1) NOT NULL default '', +`Fastmag` char(1) NOT NULL default '', +`Beareratta` char(2) NOT NULL default '', +PRIMARY KEY (`dardpo`,`dardtestard`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3'); +CREATE TABLE `t8` ( +`kattjame` varchar(32) NOT NULL default '', +`realm` varchar(32) NOT NULL default '', +`realm_entered` varchar(32) NOT NULL default '', +`maturegarbagefa` varchar(32) NOT NULL default '', +`hunderaaarbagefa_parent` varchar(32) NOT NULL default '', +`kattjame_entered` varchar(32) NOT NULL default '', +`hunderaaarbagefa` varchar(32) NOT NULL default '', +`gest` varchar(16) default NULL, +`hassetino` varchar(16) NOT NULL default '', +`aaaproxysessfa` varchar(255) default NULL, +`autologonallowed` char(1) default NULL, +`squardporoot` varchar(15) NOT NULL default '', +`naspo` varchar(15) default NULL, +`beareratta` char(2) default NULL, +`fastCode` varchar(6) default NULL, +`fastFA` varchar(5) default NULL, +`fastca` char(1) default NULL, +`fastmag` char(1) default NULL, +`lastupdate` datetime default NULL, +`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', +`accthassetitime` int(10) unsigned default NULL, +`acctoutputoctets` bigint(20) unsigned default NULL, +`acctinputoctets` bigint(20) unsigned default NULL, +PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`), +KEY `squardporoot` (`squardporoot`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565); +CREATE TABLE `t9` ( +`kattjame` varchar(32) NOT NULL default '', +`kattjame_entered` varchar(32) NOT NULL default '', +`realm` varchar(32) NOT NULL default '', +`realm_entered` varchar(32) NOT NULL default '', +`maturegarbagefa` varchar(32) NOT NULL default '', +`hunderaaarbagefa` varchar(32) NOT NULL default '', +`hunderaaarbagefa_parent` varchar(32) NOT NULL default '', +`gest` varchar(16) default NULL, +`hassetino` varchar(16) NOT NULL default '', +`squardporoot` varchar(15) NOT NULL default '', +`naspo` varchar(15) default NULL, +`beareratta` char(2) default NULL, +`fastCode` varchar(6) default NULL, +`fastFA` varchar(5) default NULL, +`fastca` char(1) default NULL, +`fastmag` char(1) default NULL, +`lastupdate` datetime default NULL, +`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', +`accthassetitime` int(10) unsigned default NULL, +`actcoutpuocttets` bigint(20) unsigned default NULL, +`actinputocctets` bigint(20) unsigned default NULL, +`terminateraste` tinyint(3) unsigned default NULL, +PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3); +create table t1_c engine=ndbcluster as select * from t1; +create table t2_c engine=ndbcluster as select * from t2; +create table t3_c engine=ndbcluster as select * from t3; +create table t4_c engine=ndbcluster as select * from t4; +create table t5_c engine=ndbcluster as select * from t5; +create table t6_c engine=ndbcluster as select * from t6; +create table t7_c engine=ndbcluster as select * from t7; +create table t8_c engine=ndbcluster as select * from t8; +create table t9_c engine=ndbcluster as select * from t9; +drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +t5 +t6 +t7 +t8 +t9 +t8_c +t9_c +t1_c +t7_c +t6_c +t5_c +t4_c +t3_c +t2_c +select count(*) from t1; +count(*) +5 +select count(*) from t1_c; +count(*) +5 +select count(*) +from (select * from t1 union +select * from t1_c) a; +count(*) +5 +select count(*) from t2; +count(*) +6 +select count(*) from t2_c; +count(*) +6 +select count(*) +from (select * from t2 union +select * from t2_c) a; +count(*) +6 +select count(*) from t3; +count(*) +4 +select count(*) from t3_c; +count(*) +4 +select count(*) +from (select * from t3 union +select * from t3_c) a; +count(*) +4 +select count(*) from t4; +count(*) +22 +select count(*) from t4_c; +count(*) +22 +select count(*) +from (select * from t4 union +select * from t4_c) a; +count(*) +22 +select count(*) from t5; +count(*) +3 +select count(*) from t5_c; +count(*) +3 +select count(*) +from (select * from t5 union +select * from t5_c) a; +count(*) +3 +select count(*) from t6; +count(*) +8 +select count(*) from t6_c; +count(*) +8 +select count(*) +from (select * from t6 union +select * from t6_c) a; +count(*) +8 +select count(*) from t7; +count(*) +5 +select count(*) from t7_c; +count(*) +5 +select count(*) +from (select * from t7 union +select * from t7_c) a; +count(*) +5 +select count(*) from t8; +count(*) +3 +select count(*) from t8_c; +count(*) +3 +select count(*) +from (select * from t8 union +select * from t8_c) a; +count(*) +3 +select count(*) from t9; +count(*) +3 +select count(*) from t9_c; +count(*) +3 +select count(*) +from (select * from t9 union +select * from t9_c) a; +count(*) +3 +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result new file mode 100644 index 00000000000..5df5c861cfb --- /dev/null +++ b/mysql-test/r/ndb_update.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +b INT NOT NULL, +c INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3); +UPDATE t1 set b = c; +select * from t1 order by pk1; +pk1 b c +0 1 1 +1 2 2 +2 3 3 diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index bd90b3fe3f3..3e233eb512a 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -175,3 +175,97 @@ explain select * from t1 where i=2 or i is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i i 4 const 7 Using where; Using index drop table t1; +set names latin2; +create table t1 select +null as c00, +if(1, null, 'string') as c01, +if(0, null, 'string') as c02, +ifnull(null, 'string') as c03, +ifnull('string', null) as c04, +case when 0 then null else 'string' end as c05, +case when 1 then null else 'string' end as c06, +coalesce(null, 'string') as c07, +coalesce('string', null) as c08, +least('string',null) as c09, +least(null, 'string') as c10, +greatest('string',null) as c11, +greatest(null, 'string') as c12, +nullif('string', null) as c13, +nullif(null, 'string') as c14, +trim('string' from null) as c15, +trim(null from 'string') as c16, +substring_index('string', null, 1) as c17, +substring_index(null, 'string', 1) as c18, +elt(1, null, 'string') as c19, +elt(1, 'string', null) as c20, +concat('string', null) as c21, +concat(null, 'string') as c22, +concat_ws('sep', 'string', null) as c23, +concat_ws('sep', null, 'string') as c24, +concat_ws(null, 'string', 'string') as c25, +make_set(3, 'string', null) as c26, +make_set(3, null, 'string') as c27, +export_set(3, null, 'off', 'sep') as c29, +export_set(3, 'on', null, 'sep') as c30, +export_set(3, 'on', 'off', null) as c31, +replace(null, 'from', 'to') as c32, +replace('str', null, 'to') as c33, +replace('str', 'from', null) as c34, +insert('str', 1, 2, null) as c35, +insert(null, 1, 2, 'str') as c36, +lpad('str', 10, null) as c37, +rpad(null, 10, 'str') as c38; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c00` binary(0) default NULL, + `c01` varchar(6) character set latin2 default NULL, + `c02` varchar(6) character set latin2 default NULL, + `c03` varchar(6) character set latin2 NOT NULL default '', + `c04` varchar(6) character set latin2 default NULL, + `c05` varchar(6) character set latin2 default NULL, + `c06` varchar(6) character set latin2 default NULL, + `c07` varchar(6) character set latin2 default NULL, + `c08` varchar(6) character set latin2 default NULL, + `c09` varchar(6) character set latin2 NOT NULL default '', + `c10` varchar(6) character set latin2 NOT NULL default '', + `c11` varchar(6) character set latin2 NOT NULL default '', + `c12` varchar(6) character set latin2 NOT NULL default '', + `c13` varchar(6) character set latin2 default NULL, + `c14` char(0) character set latin2 default NULL, + `c15` char(0) character set latin2 default NULL, + `c16` varchar(6) character set latin2 default NULL, + `c17` varchar(6) character set latin2 default NULL, + `c18` char(0) character set latin2 default NULL, + `c19` varchar(6) character set latin2 default NULL, + `c20` varchar(6) character set latin2 default NULL, + `c21` varchar(6) character set latin2 default NULL, + `c22` varchar(6) character set latin2 default NULL, + `c23` varchar(9) character set latin2 default NULL, + `c24` varchar(9) character set latin2 default NULL, + `c25` varchar(12) character set latin2 default NULL, + `c26` varchar(7) character set latin2 default NULL, + `c27` varchar(7) character set latin2 default NULL, + `c29` longtext character set latin2, + `c30` longtext character set latin2, + `c31` varchar(192) character set latin2 default NULL, + `c32` char(0) character set latin2 default NULL, + `c33` char(3) character set latin2 default NULL, + `c34` char(3) character set latin2 default NULL, + `c35` char(3) character set latin2 default NULL, + `c36` char(3) character set latin2 default NULL, + `c37` varchar(10) character set latin2 default NULL, + `c38` varchar(10) character set latin2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select +case 'str' when 'STR' then 'str' when null then 'null' end as c01, +case 'str' when null then 'null' when 'STR' then 'str' end as c02, +field(null, 'str1', 'str2') as c03, +field('str1','STR1', null) as c04, +field('str1', null, 'STR1') as c05, +'string' in ('STRING', null) as c08, +'string' in (null, 'STRING') as c09; +c01 c02 c03 c04 c05 c08 c09 +str str 0 1 2 1 1 +set names latin1; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index a87d0c33559..f7cb17a1a74 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -2,9 +2,9 @@ drop table if exists t1; create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; -grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; select * from t1; f1 diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 94d56bbc2fa..ee8ca5f0328 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -733,3 +733,58 @@ xxxxxxxxxxxxxxxxxxxaa xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxz drop table t1; +create table t1 ( +`sid` decimal(8,0) default null, +`wnid` varchar(11) not null default '', +key `wnid14` (`wnid`(4)), +key `wnid` (`wnid`) +) engine=myisam default charset=latin1; +insert into t1 (`sid`, `wnid`) values +('10100','01019000000'),('37986','01019000000'),('37987','01019010000'), +('39560','01019090000'),('37989','01019000000'),('37990','01019011000'), +('37991','01019011000'),('37992','01019019000'),('37993','01019030000'), +('37994','01019090000'),('475','02070000000'),('25253','02071100000'), +('25255','02071100000'),('25256','02071110000'),('25258','02071130000'), +('25259','02071190000'),('25260','02071200000'),('25261','02071210000'), +('25262','02071290000'),('25263','02071300000'),('25264','02071310000'), +('25265','02071310000'),('25266','02071320000'),('25267','02071320000'), +('25269','02071330000'),('25270','02071340000'),('25271','02071350000'), +('25272','02071360000'),('25273','02071370000'),('25281','02071391000'), +('25282','02071391000'),('25283','02071399000'),('25284','02071400000'), +('25285','02071410000'),('25286','02071410000'),('25287','02071420000'), +('25288','02071420000'),('25291','02071430000'),('25290','02071440000'), +('25292','02071450000'),('25293','02071460000'),('25294','02071470000'), +('25295','02071491000'),('25296','02071491000'),('25297','02071499000'); +explain select * from t1 where wnid like '0101%' order by wnid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range wnid14,wnid wnid 11 NULL 10 Using where +select * from t1 where wnid like '0101%' order by wnid; +sid wnid +10100 01019000000 +37986 01019000000 +37989 01019000000 +37987 01019010000 +37990 01019011000 +37991 01019011000 +37992 01019019000 +37993 01019030000 +39560 01019090000 +37994 01019090000 +drop table t1; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (2), (1), (1), (2), (1); +SELECT a FROM t1 ORDER BY a; +a +1 +1 +1 +2 +2 +(SELECT a FROM t1) ORDER BY a; +a +1 +1 +1 +2 +2 +DROP TABLE t1; diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result index f0b99a8d6f1..7237a0da7e0 100644 --- a/mysql-test/r/preload.result +++ b/mysql-test/r/preload.result @@ -74,15 +74,15 @@ Table Op Msg_type Msg_text test.t1 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 581 +Key_reads 581 select count(*) from t1 where b = 'test1'; count(*) 4181 show status like "key_read%"; Variable_name Value -Key_read_requests 217 -Key_reads 45 +Key_read_requests 798 +Key_reads 581 flush tables; flush status; show status like "key_read%"; @@ -98,15 +98,15 @@ Table Op Msg_type Msg_text test.t1 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 10 +Key_reads 10 select count(*) from t1 where b = 'test1'; count(*) 4181 show status like "key_read%"; Variable_name Value -Key_read_requests 217 -Key_reads 45 +Key_read_requests 227 +Key_reads 52 flush tables; flush status; show status like "key_read%"; @@ -123,8 +123,8 @@ test.t1 preload_keys status OK test.t2 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 587 +Key_reads 587 select count(*) from t1 where b = 'test1'; count(*) 4181 @@ -133,8 +133,8 @@ count(*) 2584 show status like "key_read%"; Variable_name Value -Key_read_requests 351 -Key_reads 73 +Key_read_requests 938 +Key_reads 613 flush tables; flush status; show status like "key_read%"; @@ -147,8 +147,8 @@ test.t3 preload_keys error Table 'test.t3' doesn't exist test.t2 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 355 +Key_reads 355 flush tables; flush status; show status like "key_read%"; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 8c55bb08249..4e1e75f1b33 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -106,12 +106,6 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp set @fvar= 123.4567; prepare stmt1 from @fvar; 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 '123.4567' at line 1 -set @str1 = 'select ?'; -set @str2 = convert(@str1 using ucs2); -prepare stmt1 from @str2; -execute stmt1 using @ivar; -? -1234 drop table t1,t2; PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?"; set @var='A'; @@ -456,3 +450,35 @@ PREPARE stmt FROM 'UPDATE t1 AS P1 INNER JOIN (SELECT N FROM t1 GROUP BY N HAVIN EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +prepare stmt from "select ? is null, ? is not null, ?"; +select @no_such_var is null, @no_such_var is not null, @no_such_var; +@no_such_var is null @no_such_var is not null @no_such_var +1 0 NULL +execute stmt using @no_such_var, @no_such_var, @no_such_var; +? is null ? is not null ? +1 0 NULL +set @var='abc'; +select @var is null, @var is not null, @var; +@var is null @var is not null @var +0 1 abc +execute stmt using @var, @var, @var; +? is null ? is not null ? +0 1 abc +set @var=null; +select @var is null, @var is not null, @var; +@var is null @var is not null @var +1 0 NULL +execute stmt using @var, @var, @var; +? is null ? is not null ? +1 0 NULL +create table t1 (pnum char(3)); +create table t2 (pnum char(3)); +prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)"; +execute stmt; +pnum +execute stmt; +pnum +execute stmt; +pnum +deallocate prepare stmt; +drop table t1, t2; diff --git a/mysql-test/r/ps_10nestset.result b/mysql-test/r/ps_10nestset.result index 68f58a03674..ff63485a5f9 100644 --- a/mysql-test/r/ps_10nestset.result +++ b/mysql-test/r/ps_10nestset.result @@ -62,4 +62,15 @@ id emp salary l r 4 Donna 1064.80 5 6 5 Eddie 931.70 7 8 6 Fred 798.60 9 10 +prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; +set @arg_round= 50; +execute st_round using @arg_round, @arg_round; +select * from t1; +id emp salary l r +1 Jerry 1350.00 1 12 +2 Bert 1200.00 2 3 +3 Chuck 1250.00 4 11 +4 Donna 1100.00 5 6 +5 Eddie 950.00 7 8 +6 Fred 800.00 9 10 drop table t1; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index ccf2945d488..ec4aa528a7f 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -1,4 +1,6 @@ -use test; +drop table if exists t5, t6, t7, t8; +drop database if exists mysqltest ; +drop database if exists client_test_db; test_sequence ------ basic tests ------ drop table if exists t1, t9 ; @@ -290,7 +292,7 @@ execute stmt4; prepare stmt4 from ' show full processlist '; execute stmt4; Id User Host db Command Time State Info -number root localhost test Query 0 NULL show full processlist +number root localhost test Query time NULL show full processlist prepare stmt4 from ' show grants for user '; prepare stmt4 from ' show create table t2 '; ERROR HY000: This command is not supported in the prepared statement protocol yet @@ -467,15 +469,15 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye prepare stmt1 from ' explain select a from t1 order by b '; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 14 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort @@ -483,15 +485,15 @@ SET @arg00=1 ; prepare stmt1 from ' explain select a from t1 where a > ? order by b '; execute stmt1 using @arg00; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 5 N 1 31 8 def possible_keys 253 4096 7 Y 0 31 8 def key 253 64 7 Y 0 31 8 -def key_len 8 3 1 Y 32800 0 8 +def key_len 8 3 1 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 27 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort @@ -558,7 +560,6 @@ execute stmt3; ERROR 42S01: Table 'new_t2' already exists rename table new_t2 to t2; drop table t2; -drop table if exists t5, t6, t7, t8 ; prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; execute stmt1 ; @@ -810,46 +811,49 @@ test_sequence ------ grant/revoke/drop affects a parallel session test ------ show grants for second_user@localhost ; ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost' -grant usage on test.* to second_user@localhost +create database mysqltest; +use mysqltest; +use test; +grant usage on mysqltest.* to second_user@localhost identified by 'looser' ; -grant select on test.t9 to second_user@localhost +grant select on mysqltest.t9 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' select current_user(); current_user() second_user@localhost show grants for current_user(); Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' prepare s_t9 from 'select c1 as my_col from t9 where c1= 1' ; execute s_t9 ; my_col 1 select a as my_col from t1; -ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' -grant select on test.t1 to second_user@localhost +ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' +grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' -drop table t9 ; +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' +drop table mysqltest.t9 ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' prepare s_t1 from 'select a as my_col from t1' ; execute s_t1 ; my_col @@ -858,19 +862,19 @@ my_col 3 4 execute s_t9 ; -ERROR 42S02: Table 'test.t9' doesn't exist -revoke all privileges on test.t1 from second_user@localhost +ERROR 42S02: Table 'mysqltest.t9' doesn't exist +revoke all privileges on mysqltest.t1 from second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' execute s_t1 ; -ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' +ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' revoke all privileges, grant option from second_user@localhost ; show grants for second_user@localhost ; Grants for second_user@localhost @@ -879,4 +883,5 @@ drop user second_user@localhost ; commit ; show grants for second_user@localhost ; ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost' -drop table t1 ; +drop table t1,t9 ; +drop database mysqltest; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 40b2516f0b9..a27b8b996cd 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1145,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 @@ -1581,7 +1581,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -1686,6 +1688,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; @@ -1788,10 +1793,10 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1818,10 +1823,10 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1939,7 +1944,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1974,19 +1979,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2036,7 +2041,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2064,19 +2069,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2124,7 +2129,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2156,19 +2161,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2214,7 +2219,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2240,19 +2245,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -3022,7 +3027,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 11669b131a7..eb17d25e80c 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1145,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 @@ -1564,7 +1564,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -1669,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; @@ -1771,10 +1776,10 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1801,10 +1806,10 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1922,7 +1927,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1957,19 +1962,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2019,7 +2024,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2047,19 +2052,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2107,7 +2112,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2139,19 +2144,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2197,7 +2202,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2223,19 +2228,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -3005,7 +3010,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index a3837650e0e..b53ad7e2409 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1146,15 +1146,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 @@ -1565,7 +1565,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -1670,6 +1672,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; @@ -1772,10 +1777,10 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1802,10 +1807,10 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1923,7 +1928,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1958,19 +1963,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2020,7 +2025,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2048,19 +2053,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2108,7 +2113,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2140,19 +2145,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2198,7 +2203,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2224,19 +2229,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -3006,7 +3011,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 619b59e4e3d..13227eb533b 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1188,15 +1188,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 @@ -1607,7 +1607,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -1711,10 +1713,10 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1741,10 +1743,10 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1862,7 +1864,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1897,19 +1899,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -1959,7 +1961,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -1987,19 +1989,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2047,7 +2049,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2079,19 +2081,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2137,7 +2139,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2163,19 +2165,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -2945,7 +2947,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL @@ -4196,15 +4198,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 @@ -4615,7 +4617,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -4719,10 +4723,10 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -4749,10 +4753,10 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -4870,7 +4874,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -4905,19 +4909,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -4967,7 +4971,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -4995,19 +4999,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -5055,7 +5059,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5087,19 +5091,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5145,7 +5149,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -5171,19 +5175,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -5953,7 +5957,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 5c23a574f51..8630ba2db9b 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1145,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 @@ -1564,7 +1564,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -1669,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; @@ -1771,10 +1776,10 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1801,10 +1806,10 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1922,7 +1927,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1957,19 +1962,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2019,7 +2024,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2047,19 +2052,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2107,7 +2112,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2139,19 +2144,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2197,7 +2202,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2223,19 +2228,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -3005,7 +3010,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index cf567750b85..43ff9607c55 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -2,20 +2,19 @@ use test; drop table if exists t1, t9 ; create table t1 ( -a int not null, b varchar(30), +a int, b varchar(30), primary key(a) ) engine = 'NDB' ; -drop table if exists t9; create table t9 ( -c1 tinyint not null, c2 smallint, c3 mediumint, c4 int, +c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), c13 date, c14 datetime, c15 timestamp(14), c16 time, c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), -c25 char(100), c26 char(100), c27 char(100), c28 char(100), -c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) ) engine = 'NDB' ; @@ -72,14 +71,14 @@ def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 def test t9 t9 c20 c20 254 1 1 Y 0 0 8 def test t9 t9 c21 c21 253 10 10 Y 0 0 8 def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 253 100 8 Y 0 0 8 -def test t9 t9 c24 c24 253 100 8 Y 0 0 8 -def test t9 t9 c25 c25 253 100 4 Y 0 0 8 -def test t9 t9 c26 c26 253 100 4 Y 0 0 8 -def test t9 t9 c27 c27 253 100 10 Y 0 0 8 -def test t9 t9 c28 c28 253 100 10 Y 0 0 8 -def test t9 t9 c29 c29 253 100 8 Y 0 0 8 -def test t9 t9 c30 c30 253 100 8 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 def test t9 t9 c31 c31 254 5 3 Y 256 0 8 def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 @@ -1146,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 @@ -1188,7 +1187,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; -select a,b from t1 where a=2 order by b; +select a,b from t1 where a=2; a b execute stmt1; insert into t1 values(0,NULL); @@ -1270,18 +1269,23 @@ execute stmt1 using @arg00, @arg00; select a,b from t1 where a=@arg00; a b 2 two +execute stmt1 using @arg01, @arg00; select a,b from t1 where a=@arg01; a b +22 two execute stmt1 using @arg00, @arg01; select a,b from t1 where a=@arg00; a b 2 two set @arg00=NULL; set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1 order by a; a b +0 two 1 one -2 two 3 three 4 four set @arg00=0; @@ -1302,15 +1306,19 @@ create table t2 as select a,b from t1 ; prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b +23 two prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 0 -info: Rows matched: 0 Changed: 0 Warnings: 0 -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -1319,21 +1327,25 @@ a b drop table t2 ; create table t2 ( -a int not null, b varchar(30), +a int, b varchar(30), primary key(a) ) engine = 'NDB' ; insert into t2(a,b) select a, b from t1 ; prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b +23 two prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 0 -info: Rows matched: 0 Changed: 0 Warnings: 0 +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 order by a ; a b 1 one @@ -1474,7 +1486,7 @@ set @arg02=82 ; set @arg03='8-2' ; prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) order by a ; +select a,b from t1 where a in (@arg00,@arg02) ; a b 81 8-1 82 8-2 @@ -1489,6 +1501,7 @@ set @arg00=6 ; set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; select * from t1 order by a; a b 0 NULL @@ -1497,13 +1510,15 @@ a b 3 three 4 four 5 five -6 six +7 sixmodified 8 eight 9 nine 81 8-1 82 8-2 set @arg00=81 ; set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 drop table if exists t2 ; create table t2 (id int auto_increment primary key) ENGINE= 'NDB' ; @@ -1526,24 +1541,32 @@ set @x1100="x1100" ; set @100=100 ; set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; select a,b from t1 where a >= 1000 order by a ; a b -1000 x1000_1 +1000 x1000_3 +1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; select a,b from t1 where a >= 1000 order by a ; a b -1000 x1000_1 +1000 x1000_3 +1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; select a,b from t1 where a >= 1000 order by a ; a b -1000 x1000_1 +1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -1648,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; @@ -1750,10 +1776,10 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1780,10 +1806,10 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1892,16 +1918,16 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1936,19 +1962,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -1989,16 +2015,16 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2026,19 +2052,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2077,16 +2103,16 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2118,19 +2144,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2167,16 +2193,16 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2202,19 +2228,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -2771,14 +2797,14 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50 50 50 50 50 50 50 50 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52 52 52 52 52 52 52 52 -53 5 53 53 53 53 53 53 53 53 53 53 -54 5 54 54 54 54 54 54 54 54 54 54 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56 56 56 56 56 56 56 56 -57 6 57 57 57 57 57 57 57 57 57 57 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL @@ -2984,7 +3010,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index d68da39b19f..9f61b029391 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -791,6 +791,19 @@ Qcache_queries_in_cache 1 unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +id +1 +2 +3 +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +a +drop table t1; +drop table t1; SET NAMES koi8r; CREATE TABLE t1 (a char(1) character set koi8r); INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á'); diff --git a/mysql-test/r/query_cache.result.es b/mysql-test/r/query_cache.result.es index 218e4e1ae2a..7e75a3cee4c 100644 --- a/mysql-test/r/query_cache.result.es +++ b/mysql-test/r/query_cache.result.es @@ -791,11 +791,24 @@ Qcache_queries_in_cache 1 unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +id +1 +2 +3 +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +a +drop table t1; +drop table t1; SET NAMES koi8r; CREATE TABLE t1 (a char(1) character set koi8r); INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á'); SELECT a,'Â','â'='Â' FROM t1; -a б 'Б'='б' +a  'â'='Â' á  1 Á  1 show status like "Qcache_hits"; @@ -806,7 +819,7 @@ Variable_name Value Qcache_queries_in_cache 1 set collation_connection=koi8r_bin; SELECT a,'Â','â'='Â' FROM t1; -a б 'Б'='б' +a  'â'='Â' á  0 Á  0 show status like "Qcache_hits"; @@ -817,7 +830,7 @@ Variable_name Value Qcache_queries_in_cache 2 set character_set_client=cp1251; SELECT a,'Â','â'='Â' FROM t1; -a Ð’ 'в'='Ð’' +a ÷ '×'='÷' á ÷ 0 Á ÷ 0 show status like "Qcache_hits"; @@ -828,7 +841,7 @@ Variable_name Value Qcache_queries_in_cache 3 set character_set_results=cp1251; SELECT a,'Â','â'='Â' FROM t1; -a Ð’ 'в'='Ð’' +a  'â'='Â' À  0 à  0 show status like "Qcache_hits"; @@ -901,6 +914,8 @@ set group_concat_max_len=10; select group_concat(a) FROM t1 group by b; group_concat(a) 1234567890 +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() set group_concat_max_len=1024; select group_concat(a) FROM t1 group by b; group_concat(a) diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 4ca96316800..fc2b4a78469 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -221,7 +221,7 @@ update t1 set y=x; explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where -1 SIMPLE t2 range x x 5 NULL 4 Using where +1 SIMPLE t2 range x x 5 NULL 4 Range checked for each record (index map: 0x1) explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where @@ -237,7 +237,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where -1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 0x1) explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where @@ -561,3 +561,19 @@ select count(*) from t1 where x = 18446744073709551601; count(*) 1 drop table t1; +set names latin1; +create table t1 (a char(10), b text, key (a)) character set latin1; +INSERT INTO t1 (a) VALUES +('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb'); +explain select * from t1 where a='aaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 11 const 2 Using where +explain select * from t1 where a=binary 'aaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 2 Using where +explain select * from t1 where a='aaa' collate latin1_bin; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 2 Using where +explain select * from t1 where a='aaa' collate latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index 54cce23b301..292cfb19175 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -105,62 +105,62 @@ drop database mysqltest2; drop database mysqltest3; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 79 Query 1 79 use `test`; drop database if exists mysqltest2 -master-bin.000001 148 Query 1 148 use `test`; drop database if exists mysqltest3 -master-bin.000001 217 Query 1 217 use `test`; create database mysqltest2 character set latin2 -master-bin.000001 299 Query 1 299 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30 -master-bin.000001 433 Query 1 433 use `test`; create database mysqltest3 -master-bin.000001 494 Query 1 494 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 -master-bin.000001 628 Query 1 628 use `test`; drop database mysqltest3 -master-bin.000001 687 Query 1 687 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 -master-bin.000001 821 Query 1 821 use `test`; create database mysqltest3 -master-bin.000001 882 Query 1 882 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1022 Query 1 1022 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 1129 Query 1 1129 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1270 Intvar 1 1270 INSERT_ID=1 -master-bin.000001 1298 Query 1 1298 use `mysqltest2`; insert into t1 (b) values(@@character_set_server) -master-bin.000001 1388 Query 1 1388 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1529 Intvar 1 1529 INSERT_ID=2 -master-bin.000001 1557 Query 1 1557 use `mysqltest2`; insert into t1 (b) values(@@collation_server) -master-bin.000001 1643 Query 1 1643 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1784 Intvar 1 1784 INSERT_ID=3 -master-bin.000001 1812 Query 1 1812 use `mysqltest2`; insert into t1 (b) values(@@character_set_client) -master-bin.000001 1902 Query 1 1902 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2043 Intvar 1 2043 INSERT_ID=4 -master-bin.000001 2071 Query 1 2071 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection) -master-bin.000001 2165 Query 1 2165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2306 Intvar 1 2306 INSERT_ID=5 -master-bin.000001 2334 Query 1 2334 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 2424 Query 1 2424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2564 Query 1 2564 use `mysqltest2`; truncate table t1 -master-bin.000001 2622 Query 1 2622 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2762 Intvar 1 2762 INSERT_ID=1 -master-bin.000001 2790 Query 1 2790 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 2880 Query 1 2880 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3020 Intvar 1 3020 INSERT_ID=2 -master-bin.000001 3048 Query 1 3048 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 3141 Query 1 3141 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3282 Intvar 1 3282 INSERT_ID=3 -master-bin.000001 3310 Query 1 3310 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 3400 Query 1 3400 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3541 Intvar 1 3541 INSERT_ID=4 -master-bin.000001 3569 Query 1 3569 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 3662 Query 1 3662 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3803 Intvar 1 3803 INSERT_ID=74 -master-bin.000001 3831 Create_file 1 3831 db=mysqltest2;table=t1;file_id=1;block_len=581 -master-bin.000001 4504 Query 1 4504 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 4645 Intvar 1 4645 INSERT_ID=5 -master-bin.000001 4673 Exec_load 1 4673 ;file_id=1 -master-bin.000001 4696 Query 1 4696 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 4837 Query 1 4837 use `mysqltest2`; truncate table t1 -master-bin.000001 4895 Query 1 4895 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5036 Intvar 1 5036 INSERT_ID=1 -master-bin.000001 5064 User var 1 5064 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci -master-bin.000001 5104 Query 1 5104 use `mysqltest2`; insert into t1 (b) values(collation(@a)) -master-bin.000001 5185 Query 1 5185 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5326 Query 1 5326 use `mysqltest2`; drop database mysqltest2 -master-bin.000001 5391 Query 1 5391 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5522 Query 1 5522 drop database mysqltest3 +master-bin.000001 79 Query 1 79 drop database if exists mysqltest2 +master-bin.000001 154 Query 1 154 drop database if exists mysqltest3 +master-bin.000001 229 Query 1 229 create database mysqltest2 character set latin2 +master-bin.000001 317 Query 1 317 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30 +master-bin.000001 451 Query 1 451 create database mysqltest3 +master-bin.000001 518 Query 1 518 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 652 Query 1 652 drop database mysqltest3 +master-bin.000001 717 Query 1 717 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 851 Query 1 851 create database mysqltest3 +master-bin.000001 918 Query 1 918 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1058 Query 1 1058 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 1165 Query 1 1165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1306 Intvar 1 1306 INSERT_ID=1 +master-bin.000001 1334 Query 1 1334 use `mysqltest2`; insert into t1 (b) values(@@character_set_server) +master-bin.000001 1424 Query 1 1424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1565 Intvar 1 1565 INSERT_ID=2 +master-bin.000001 1593 Query 1 1593 use `mysqltest2`; insert into t1 (b) values(@@collation_server) +master-bin.000001 1679 Query 1 1679 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1820 Intvar 1 1820 INSERT_ID=3 +master-bin.000001 1848 Query 1 1848 use `mysqltest2`; insert into t1 (b) values(@@character_set_client) +master-bin.000001 1938 Query 1 1938 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2079 Intvar 1 2079 INSERT_ID=4 +master-bin.000001 2107 Query 1 2107 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection) +master-bin.000001 2201 Query 1 2201 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2342 Intvar 1 2342 INSERT_ID=5 +master-bin.000001 2370 Query 1 2370 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2460 Query 1 2460 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2600 Query 1 2600 use `mysqltest2`; truncate table t1 +master-bin.000001 2658 Query 1 2658 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2798 Intvar 1 2798 INSERT_ID=1 +master-bin.000001 2826 Query 1 2826 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2916 Query 1 2916 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3056 Intvar 1 3056 INSERT_ID=2 +master-bin.000001 3084 Query 1 3084 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3177 Query 1 3177 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3318 Intvar 1 3318 INSERT_ID=3 +master-bin.000001 3346 Query 1 3346 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 3436 Query 1 3436 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3577 Intvar 1 3577 INSERT_ID=4 +master-bin.000001 3605 Query 1 3605 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3698 Query 1 3698 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3839 Intvar 1 3839 INSERT_ID=74 +master-bin.000001 3867 Create_file 1 3867 db=mysqltest2;table=t1;file_id=1;block_len=581 +master-bin.000001 4540 Query 1 4540 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4681 Intvar 1 4681 INSERT_ID=5 +master-bin.000001 4709 Exec_load 1 4709 ;file_id=1 +master-bin.000001 4732 Query 1 4732 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4873 Query 1 4873 use `mysqltest2`; truncate table t1 +master-bin.000001 4931 Query 1 4931 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5072 Intvar 1 5072 INSERT_ID=1 +master-bin.000001 5100 User var 1 5100 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci +master-bin.000001 5140 Query 1 5140 use `mysqltest2`; insert into t1 (b) values(collation(@a)) +master-bin.000001 5221 Query 1 5221 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5362 Query 1 5362 drop database mysqltest2 +master-bin.000001 5427 Query 1 5427 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5558 Query 1 5558 drop database mysqltest3 set global character_set_server=latin2; ERROR HY000: Binary logging and replication forbid changing the global server character set or collation set global character_set_server=latin2; @@ -200,10 +200,17 @@ hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 stop slave; delete from t1; -change master to master_log_pos=5801; -start slave until master_log_file='master-bin.000001', master_log_pos=5937; +change master to master_log_pos=5847; +start slave until master_log_file='master-bin.000001', master_log_pos=5983; start slave; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 drop table t1; +create table `t1` ( +`pk` varchar(10) not null default '', +primary key (`pk`) +) engine=myisam default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/r/rpl_create_database.result new file mode 100644 index 00000000000..2375e13bb5c --- /dev/null +++ b/mysql-test/r/rpl_create_database.result @@ -0,0 +1,83 @@ +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 DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; +DROP DATABASE IF EXISTS mysqltest_bob; +CREATE DATABASE mysqltest_prometheus; +CREATE DATABASE mysqltest_sisyfos; +CREATE DATABASE mysqltest_bob; +USE mysqltest_sisyfos; +CREATE TABLE t1 (b int); +INSERT INTO t1 VALUES(1); +USE mysqltest_bob; +CREATE TABLE t2 (b int); +INSERT INTO t2 VALUES(2); +ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; +USE mysqltest_sisyfos; +ALTER DATABASE mysqltest_bob CHARACTER SET latin1; +SHOW DATABASES; +Database +mysql +mysqltest_bob +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW DATABASES; +Database +mysql +mysqltest_prometheus +mysqltest_sisyfos +test +DROP DATABASE IF EXISTS mysqltest_sisyfos; +USE mysqltest_prometheus; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +CREATE DATABASE mysqltest_sisyfos; +USE mysqltest_sisyfos; +CREATE TABLE t2 (a INT); +SHOW BINLOG EVENTS; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 DROP DATABASE IF EXISTS mysqltest_prometheus +master-bin.000001 174 Query 1 174 DROP DATABASE IF EXISTS mysqltest_sisyfos +master-bin.000001 263 Query 1 263 CREATE DATABASE mysqltest_prometheus +master-bin.000001 350 Query 1 350 CREATE DATABASE mysqltest_sisyfos +master-bin.000001 431 Query 1 431 use `mysqltest_sisyfos`; CREATE TABLE t1 (b int) +master-bin.000001 502 Query 1 502 use `mysqltest_sisyfos`; INSERT INTO t1 VALUES(1) +master-bin.000001 574 Query 1 574 ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1 +master-bin.000001 675 Query 1 675 DROP DATABASE IF EXISTS mysqltest_sisyfos +master-bin.000001 764 Query 1 764 use `mysqltest_prometheus`; CREATE TABLE t1 (a INT) +master-bin.000001 838 Query 1 838 use `mysqltest_prometheus`; INSERT INTO t1 VALUES (1) +master-bin.000001 914 Query 1 914 CREATE DATABASE mysqltest_sisyfos +master-bin.000001 995 Query 1 995 use `mysqltest_sisyfos`; CREATE TABLE t2 (a INT) +SHOW DATABASES; +Database +mysql +mysqltest_bob +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW DATABASES; +Database +mysql +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW CREATE TABLE mysqltest_prometheus.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE mysqltest_sisyfos.t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; diff --git a/mysql-test/r/rpl_drop_temp.result b/mysql-test/r/rpl_drop_temp.result new file mode 100644 index 00000000000..e00309cac8f --- /dev/null +++ b/mysql-test/r/rpl_drop_temp.result @@ -0,0 +1,12 @@ +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; +create database if not exists mysqltest; +create temporary table mysqltest.t1 (n int); +create temporary table mysqltest.t2 (n int); +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 diff --git a/mysql-test/r/rpl_failed_optimize.result b/mysql-test/r/rpl_failed_optimize.result new file mode 100644 index 00000000000..1576ec60500 --- /dev/null +++ b/mysql-test/r/rpl_failed_optimize.result @@ -0,0 +1,15 @@ +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; +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES (1); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status Operation failed +OPTIMIZE TABLE non_existing; +Table Op Msg_type Msg_text +test.non_existing optimize error Table 'test.non_existing' doesn't exist diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result index 8001cb59a35..8482f631553 100644 --- a/mysql-test/r/rpl_insert_id.result +++ b/mysql-test/r/rpl_insert_id.result @@ -68,3 +68,8 @@ b c 9 13 drop table t1; drop table t2; +SET TIMESTAMP=1000000000; +CREATE TABLE t1 ( a INT UNIQUE ); +SET FOREIGN_KEY_CHECKS=0; +INSERT INTO t1 VALUES (1),(1); +ERROR 23000: Duplicate entry '1' for key 1 diff --git a/mysql-test/r/rpl_insert_ignore.result b/mysql-test/r/rpl_insert_ignore.result new file mode 100644 index 00000000000..da24c86627c --- /dev/null +++ b/mysql-test/r/rpl_insert_ignore.result @@ -0,0 +1,70 @@ +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; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned, +unique (b) +) ENGINE=innodb; +CREATE TABLE t2 ( +a int unsigned, # to force INSERT SELECT to have a certain order +b int unsigned +) ENGINE=innodb; +INSERT INTO t1 VALUES (NULL, 1); +INSERT INTO t1 VALUES (NULL, 2); +INSERT INTO t1 VALUES (NULL, 3); +INSERT INTO t1 VALUES (NULL, 4); +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 5); +INSERT INTO t2 VALUES (4, 3); +INSERT INTO t2 VALUES (5, 4); +INSERT INTO t2 VALUES (6, 6); +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +drop table t1; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned, +unique (b) +) ENGINE=myisam; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +drop table t1, t2; diff --git a/mysql-test/r/rpl_loaddata_rule_m.result b/mysql-test/r/rpl_loaddata_rule_m.result index a34453b0a2b..08f2c2ec071 100644 --- a/mysql-test/r/rpl_loaddata_rule_m.result +++ b/mysql-test/r/rpl_loaddata_rule_m.result @@ -12,4 +12,6 @@ use mysqltest; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 drop database if exists mysqltest +master-bin.000001 152 Query 1 152 create database mysqltest drop database mysqltest; diff --git a/mysql-test/r/rpl_many_optimize.result b/mysql-test/r/rpl_many_optimize.result new file mode 100644 index 00000000000..b2148892591 --- /dev/null +++ b/mysql-test/r/rpl_many_optimize.result @@ -0,0 +1,9 @@ +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; +create table t1 (a int not null auto_increment primary key, b int, key(b)); +INSERT INTO t1 (a) VALUES (1),(2); +drop table t1; diff --git a/mysql-test/r/rpl_multi_query.result b/mysql-test/r/rpl_multi_query.result new file mode 100644 index 00000000000..2521dbe1ed9 --- /dev/null +++ b/mysql-test/r/rpl_multi_query.result @@ -0,0 +1,32 @@ +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 database if exists mysqltest; +create database mysqltest; +create table mysqltest.t1 ( n int); +insert into mysqltest.t1 values(1)/ +insert into mysqltest.t1 values(2); +insert into mysqltest.t1 values(3); +insert into mysqltest.t1 values(4); +insert into mysqltest.t1 values(5)/ +select * from mysqltest.t1; +n +1 +2 +3 +4 +5 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 # Query 1 # drop database if exists mysqltest +master-bin.000001 # Query 1 # create database mysqltest +master-bin.000001 # Query 1 # use `test`; create table mysqltest.t1 ( n int) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(1) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(2) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(3) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(4) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(5) +drop database mysqltest; diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result new file mode 100644 index 00000000000..99356ebf970 --- /dev/null +++ b/mysql-test/r/rpl_multi_update2.result @@ -0,0 +1,42 @@ +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; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=MyISAM; +CREATE TABLE t2 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 diff --git a/mysql-test/r/rpl_rewrite_db.result b/mysql-test/r/rpl_rewrite_db.result new file mode 100644 index 00000000000..a2c8706e3e1 --- /dev/null +++ b/mysql-test/r/rpl_rewrite_db.result @@ -0,0 +1,92 @@ +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 database if exists mysqltest1; +create database mysqltest1; +use mysqltest1; +create table t1 (a int); +insert into t1 values(9); +select * from mysqltest1.t1; +a +9 +show databases like 'mysqltest1'; +Database (mysqltest1) +mysqltest1 +select * from test.t1; +a +9 +drop table t1; +drop database mysqltest1; +drop database if exists rewrite; +create database rewrite; +use test; +create table t1 (a date, b date, c date not null, d date); +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +select * from rewrite.t1; +a b c d +0000-00-00 NULL 0000-00-00 0000-00-00 +0000-00-00 0000-00-00 0000-00-00 0000-00-00 +2003-03-03 2003-03-03 2003-03-03 NULL +2003-03-03 2003-03-03 2003-03-03 NULL +truncate table t1; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 +select * from rewrite.t1; +a b c d +NULL NULL 0000-00-00 0000-00-00 +NULL 0000-00-00 0000-00-00 0000-00-00 +NULL 2003-03-03 2003-03-03 NULL +drop table t1; +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +Warnings: +Warning 1261 Row 3 doesn't contain data for all columns +select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; +concat('|',a,'|') concat('|',b,'|') +|Field A| |Field B| +|Field 1| |Field 2' +Field 3,'Field 4| +|Field 5' ,'Field 6| NULL +|Field 6| | 'Field 7'| +drop table t1; +create table t1 (a int, b char(10)); +load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +Warnings: +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1262 Row 3 was truncated; it contained more data than there were input columns +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1262 Row 5 was truncated; it contained more data than there were input columns +select * from rewrite.t1; +a b +1 row 1 +2 row 2 +0 1234567890 +3 row 3 +0 1234567890 +truncate table t1; +load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +Warnings: +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1261 Row 4 doesn't contain data for all columns +select * from rewrite.t1; +a b +1 row 1 +2 row 2 +3 row 3 +0 +drop table t1; diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/r/rpl_start_stop_slave.result new file mode 100644 index 00000000000..1fcb586d1fb --- /dev/null +++ b/mysql-test/r/rpl_start_stop_slave.result @@ -0,0 +1,12 @@ +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; +stop slave; +create table t1(n int); +start slave; +stop slave io_thread; +start slave io_thread; +drop table t1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index ba0a80331b1..1a3b2ab22e6 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2057,6 +2057,10 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; DO 1; DO benchmark(100,1+1),1,1; +do default; +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 '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( id mediumint(8) unsigned NOT NULL auto_increment, pseudo varchar(35) NOT NULL default '', @@ -2349,6 +2353,27 @@ select * from t2,t3 where t2.s = t3.s; s s two two drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c char(10) NOT NULL default '', @@ -2361,7 +2386,39 @@ INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -EXPLAIN SELECT i FROM t1 WHERE i=1; +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London DROP TABLE t1; diff --git a/mysql-test/r/select.result.es b/mysql-test/r/select.result.es index 2ff58372d6d..da761ebb822 100644 --- a/mysql-test/r/select.result.es +++ b/mysql-test/r/select.result.es @@ -1,4 +1,5 @@ drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2056,6 +2057,10 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; DO 1; DO benchmark(100,1+1),1,1; +do default; +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 '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( id mediumint(8) unsigned NOT NULL auto_increment, pseudo varchar(35) NOT NULL default '', @@ -2348,6 +2353,27 @@ select * from t2,t3 where t2.s = t3.s; s s two two drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c char(10) NOT NULL default '', @@ -2360,7 +2386,4 @@ INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index DROP TABLE t1; diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 1eaa7033c99..b8178bbeb52 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -271,3 +271,12 @@ foo SELECT FOUND_ROWS(); FOUND_ROWS() 2 +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5); +SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2; +a +a +SELECT FOUND_ROWS(); +FOUND_ROWS() +1 +DROP TABLE t1; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 8256c8d692a..37531f05f43 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -314,57 +314,57 @@ insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); 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 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); 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 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); 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 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; 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 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1; delete from t2; delete from t3; 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 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); 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 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; 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 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL drop table t1, t2, t3; create database mysqltest; show create database mysqltest; @@ -405,3 +405,73 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; flush privileges; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE HASH (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result new file mode 100644 index 00000000000..d8d873699a5 --- /dev/null +++ b/mysql-test/r/skip_name_resolve.result @@ -0,0 +1,7 @@ +GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255'; +SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255'; +Grants for mysqltest_1@127.0.0.1/255.255.255.255 +GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' +GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' +REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; +DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index e54dd217f8c..c18be2df403 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -85,6 +85,36 @@ t1 CREATE TABLE "t1" ( UNIQUE KEY "email" ("email") ) drop table t1; +CREATE TABLE t1 ( +a char(10), +b char(10) collate latin1_bin, +c binary(10) +) character set latin1; +set @@sql_mode=""; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL, + `b` char(10) character set latin1 collate latin1_bin default NULL, + `c` binary(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +set @@sql_mode="mysql323"; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL, + `b` char(10) binary default NULL, + `c` binary(10) default NULL +) TYPE=MyISAM +set @@sql_mode="mysql40"; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL, + `b` char(10) binary default NULL, + `c` binary(10) default NULL +) TYPE=MyISAM +drop table t1; set session sql_mode = ''; create table t1 ( min_num dec(6,6) default .000001); show create table t1; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 04c5f685f58..fb42f68398f 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -55,7 +55,7 @@ SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 SELECT (SELECT 1), a; -ERROR 42S22: Unknown column 'a' in 'checking transformed subquery' +ERROR 42S22: Unknown column 'a' in 'field list' SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1; a 1 @@ -269,7 +269,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) +Note 1003 select test.t3.a AS `a` from test.t3 where <nop>((test.t3.a >= (select min(test.t2.b) from test.t2))) select * from t3 where a >= all (select b from t2); a 7 @@ -999,7 +999,9 @@ drop table t1, t2; CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function +select * from t1; +i +1 drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; @@ -1084,7 +1086,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) NOT NULL default '0', - `(SELECT a)` bigint(20) default NULL + `(SELECT a)` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; @@ -1102,7 +1104,7 @@ a SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(20) default NULL + `a` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int); @@ -1186,11 +1188,12 @@ PRIMARY KEY (`i`) ) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); ERROR 42S02: Unknown table 't' in field list +select * from t1; +i +1 drop table t1; CREATE TABLE t1 ( id int(11) default NULL @@ -1485,6 +1488,65 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a < (select max(test.t2.b) from test.t2))) +select * from t3 where a >= some (select b from t2); +a +explain extended select * from t3 where a >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where <nop>((test.t3.a >= (select min(test.t2.b) from test.t2))) +select * from t3 where a >= all (select b from t2 group by 1); +a +6 +7 +3 +explain extended select * from t3 where a >= all (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a < <max>(select test.t2.b AS `b` from test.t2 group by test.t2.b))) +select * from t3 where a >= some (select b from t2 group by 1); +a +explain extended select * from t3 where a >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where <nop>((test.t3.a >= <min>(select test.t2.b AS `b` from test.t2 group by test.t2.b))) +select * from t3 where NULL >= any (select b from t2); +a +explain extended select * from t3 where NULL >= any (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= any (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= any (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= some (select b from t2); +a +explain extended select * from t3 where NULL >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= some (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a @@ -1987,3 +2049,222 @@ ac 700 NULL drop tables t1,t2; +create table t1 (a int not null, b int not null, c int, primary key (a,b)); +insert into t1 values (1,1,1), (2,2,2), (3,3,3); +set @b:= 0; +explain select sum(a) from t1 where b > @b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index +set @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +do @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +drop table t1; +set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ; +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5); +insert into t2 values (1,3),(2,1); +select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b; +a b (select max(b) from t2 where t1.b=t2.a) +1 1 3 +1 2 1 +1 3 NULL +2 4 NULL +2 5 NULL +drop table t1, t2; +create table t1 (id int); +create table t2 (id int, body text, fulltext (body)); +insert into t1 values(1),(2),(3); +insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test'); +select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode)); +count(distinct id) +1 +drop table t2,t1; +create table t1 (s1 int,s2 int); +insert into t1 values (20,15); +select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0)); +s1 s2 +drop table t1; +create table t1 (s1 int); +insert into t1 values (1),(null); +select * from t1 where s1 < all (select s1 from t1); +s1 +select s1, s1 < all (select s1 from t1) from t1; +s1 s1 < all (select s1 from t1) +1 0 +NULL NULL +drop table t1; +CREATE TABLE t1 ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', +Region char(26) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +IndepYear smallint(6) default NULL, +Population int(11) NOT NULL default '0', +LifeExpectancy float(3,1) default NULL, +GNP float(10,2) default NULL, +GNPOld float(10,2) default NULL, +LocalName char(45) NOT NULL default '', +GovernmentForm char(45) NOT NULL default '', +HeadOfState char(60) default NULL, +Capital int(11) default NULL, +Code2 char(2) NOT NULL default '' +) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); +INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); +/*!40000 ALTER TABLE t1 ENABLE KEYS */; +SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); +c +Oceania +drop table t1; +create table t1 (a1 int); +create table t2 (b1 int); +select * from t1 where a2 > any(select b1 from t2); +ERROR 42S22: Unknown column 'a2' in 'scalar IN/ALL/ANY subquery' +select * from t1 where a1 > any(select b1 from t2); +a1 +drop table t1,t2; +create table t1 (a integer, b integer); +select (select * from t1) = (select 1,2); +(select * from t1) = (select 1,2) +NULL +select (select 1,2) = (select * from t1); +(select 1,2) = (select * from t1) +NULL +select row(1,2) = ANY (select * from t1); +row(1,2) = ANY (select * from t1) +0 +select row(1,2) != ALL (select * from t1); +row(1,2) != ALL (select * from t1) +1 +drop table t1; +create table t1 (a integer, b integer); +select row(1,(2,2)) in (select * from t1 ); +ERROR 21000: Operand should contain 2 column(s) +select row(1,(2,2)) = (select * from t1 ); +ERROR 21000: Operand should contain 2 column(s) +select (select * from t1) = row(1,(2,2)); +ERROR 21000: Operand should contain 1 column(s) +drop table t1; +create table t1 (a integer); +insert into t1 values (1); +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx ; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 as xx, 1 = ALL ( select 1 from t1 where 1 = xx ); +xx 1 = ALL ( select 1 from t1 where 1 = xx ) +1 1 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +drop table t1; +CREATE TABLE t1 ( +categoryId int(11) NOT NULL, +courseId int(11) NOT NULL, +startDate datetime NOT NULL, +endDate datetime NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL, +attributes text NOT NULL +); +INSERT INTO t1 VALUES (1,41,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(1,86,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(1,87,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,52,'2004-03-15','2004-10-01','2004-03-15','2004-09-17',''), +(2,53,'2004-03-16','2004-10-01','2004-03-16','2004-09-17',''), +(2,88,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,89,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(3,51,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(5,12,'2004-02-18','2010-01-01','2004-02-18','2004-02-18',''); +CREATE TABLE t2 ( +userId int(11) NOT NULL, +courseId int(11) NOT NULL, +date datetime NOT NULL +); +INSERT INTO t2 VALUES (5141,71,'2003-11-18'), +(5141,72,'2003-11-25'),(5141,41,'2004-08-06'), +(5141,52,'2004-08-06'),(5141,53,'2004-08-06'), +(5141,12,'2004-08-06'),(5141,86,'2004-10-21'), +(5141,87,'2004-10-21'),(5141,88,'2004-10-21'), +(5141,89,'2004-10-22'),(5141,51,'2004-10-26'); +CREATE TABLE t3 ( +groupId int(11) NOT NULL, +parentId int(11) NOT NULL, +startDate datetime NOT NULL, +endDate datetime NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL, +ordering int(11) +); +INSERT INTO t3 VALUES (12,9,'1000-01-01','3999-12-31','2004-01-29','2004-01-29',NULL); +CREATE TABLE t4 ( +id int(11) NOT NULL, +groupTypeId int(11) NOT NULL, +groupKey varchar(50) NOT NULL, +name text, +ordering int(11), +description text, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL +); +INSERT INTO t4 VALUES (9,5,'stationer','stationer',0,'Stationer','2004-01-29','2004-01-29'), +(12,5,'group2','group2',0,'group2','2004-01-29','2004-01-29'); +CREATE TABLE t5 ( +userId int(11) NOT NULL, +groupId int(11) NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL +); +INSERT INTO t5 VALUES (5141,12,'2004-08-06','2004-08-06'); +select +count(distinct t2.userid) pass, +groupstuff.*, +count(t2.courseid) crse, +t1.categoryid, +t2.courseid, +date_format(date, '%b%y') as colhead +from t2 +join t1 on t2.courseid=t1.courseid +join +( +select +t5.userid, +parentid, +parentgroup, +childid, +groupname, +grouptypeid +from t5 +join +( +select t4.id as parentid, +t4.name as parentgroup, +t4.id as childid, +t4.name as groupname, +t4.grouptypeid +from t4 +) as gin on t5.groupid=gin.childid +) as groupstuff on t2.userid = groupstuff.userid +group by +groupstuff.groupname, colhead , t2.courseid; +pass userid parentid parentgroup childid groupname grouptypeid crse categoryid courseid colhead +1 5141 12 group2 12 group2 5 1 5 12 Aug04 +1 5141 12 group2 12 group2 5 1 1 41 Aug04 +1 5141 12 group2 12 group2 5 1 2 52 Aug04 +1 5141 12 group2 12 group2 5 1 2 53 Aug04 +1 5141 12 group2 12 group2 5 1 3 51 Oct04 +1 5141 12 group2 12 group2 5 1 1 86 Oct04 +1 5141 12 group2 12 group2 5 1 1 87 Oct04 +1 5141 12 group2 12 group2 5 1 2 88 Oct04 +1 5141 12 group2 12 group2 5 1 2 89 Oct04 +drop table if exists t1, t2, t3, t4, t5; diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index e8f6426f51b..0666fd76661 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -114,3 +114,41 @@ SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient unit ingredient xx yy drop table t1, t2; +CREATE TABLE t1 ( +id INT NOT NULL auto_increment, +date1 DATE, coworkerid INT, +description VARCHAR(255), +sum_used DOUBLE, +sum_remaining DOUBLE, +comments VARCHAR(255), +PRIMARY KEY(id) +) engine=innodb; +insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'); +SELECT DISTINCT +(SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, +(SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven +FROM t1; +somallontvangsten somalluitgaven +154 NULL +select * from t1; +id date1 coworkerid description sum_used sum_remaining comments +1 1999-01-01 1 test 22 33 comment +2 1999-01-01 1 test 22 33 comment +3 1999-01-01 1 test 22 33 comment +4 1998-01-01 1 test 22 33 comment +5 1998-01-01 1 test 22 33 comment +6 2004-01-01 1 test 22 33 comment +7 2004-01-01 1 test 22 33 comment +drop table t1; +CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (1,1,1); +INSERT INTO t2 VALUES (1,1,1); +PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having +count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; +EXECUTE my_stmt; +b count(*) +EXECUTE my_stmt; +b count(*) +deallocate prepare my_stmt; +drop table t1,t2; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index ebb24159373..141878a7bf6 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -21,18 +21,18 @@ db CREATE TABLE `db` ( `Host` char(60) collate utf8_bin NOT NULL default '', `Db` char(64) collate utf8_bin NOT NULL default '', `User` char(16) collate utf8_bin NOT NULL default '', - `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `References_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`,`User`), KEY `User` (`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges' @@ -41,18 +41,18 @@ Table Create Table host CREATE TABLE `host` ( `Host` char(60) collate utf8_bin NOT NULL default '', `Db` char(64) collate utf8_bin NOT NULL default '', - `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `References_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges' show create table user; @@ -61,28 +61,28 @@ user CREATE TABLE `user` ( `Host` varchar(60) collate utf8_bin NOT NULL default '', `User` varchar(16) collate utf8_bin NOT NULL default '', `Password` varchar(41) collate utf8_bin NOT NULL default '', - `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Reload_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Shutdown_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Process_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `File_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Show_db_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Super_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Repl_slave_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Repl_client_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `ssl_type` enum('','ANY','X509','SPECIFIED') collate utf8_bin NOT NULL default '', + `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Reload_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Shutdown_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Process_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `File_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `References_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Show_db_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Super_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Repl_slave_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Repl_client_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `ssl_type` enum('','ANY','X509','SPECIFIED') character set utf8 NOT NULL default '', `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, @@ -97,7 +97,7 @@ func CREATE TABLE `func` ( `name` char(64) collate utf8_bin NOT NULL default '', `ret` tinyint(1) NOT NULL default '0', `dl` char(128) collate utf8_bin NOT NULL default '', - `type` enum('function','aggregate') collate utf8_bin NOT NULL default 'function', + `type` enum('function','aggregate') character set utf8 NOT NULL default 'function', PRIMARY KEY (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions' show create table tables_priv; @@ -109,8 +109,8 @@ tables_priv CREATE TABLE `tables_priv` ( `Table_name` char(64) collate utf8_bin NOT NULL default '', `Grantor` char(77) collate utf8_bin NOT NULL default '', `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') collate utf8_bin NOT NULL default '', - `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '', + `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') character set utf8 NOT NULL default '', + `Column_priv` set('Select','Insert','Update','References') character set utf8 NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges' @@ -123,7 +123,7 @@ columns_priv CREATE TABLE `columns_priv` ( `Table_name` char(64) collate utf8_bin NOT NULL default '', `Column_name` char(64) collate utf8_bin NOT NULL default '', `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '', + `Column_priv` set('Select','Insert','Update','References') character set utf8 NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' show tables; diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 86264bf5b7e..206ff79e7ba 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, t2; create table t1 (ts timestamp); set time_zone='+00:00'; select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); @@ -256,18 +256,58 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; -grant usage on mysqltest.* to mysqltest_1@localhost; +create table t1 (a int, b datetime); +create table t2 (c int, d datetime); +grant all privileges on test.* to mysqltest_1@localhost; show grants for current_user(); Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost' set time_zone= '+00:00'; set time_zone= 'Europe/Moscow'; select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') 2004-10-21 15:00:00 +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +convert_tz(b, 'Europe/Moscow', 'UTC') +update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') +where t1.a = t2.c and t2.d = (select max(d) from t2); select * from mysql.time_zone_name; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; +grant all privileges on test.t1 to mysqltest_1@localhost; +grant all privileges on test.t2 to mysqltest_1@localhost; +show grants for current_user(); +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost' +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC'); +convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC') +2004-12-01 09:00:00 +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +convert_tz(b, 'Europe/Moscow', 'UTC') +update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') +where t1.a = t2.c and t2.d = (select max(d) from t2); +select * from mysql.time_zone_name; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; +drop table t1, t2; +select convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) from (select 'UTC' as custTimeZone) as tmp; +convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) +2005-01-14 17:00:00 +create table t1 select convert_tz(NULL, NULL, NULL); +select * from t1; +convert_tz(NULL, NULL, NULL) +NULL +drop table t1; diff --git a/mysql-test/r/timezone3.result b/mysql-test/r/timezone3.result new file mode 100644 index 00000000000..ec0b6045f93 --- /dev/null +++ b/mysql-test/r/timezone3.result @@ -0,0 +1,41 @@ +drop table if exists t1; +create table t1 (i int, c varchar(20)); +insert into t1 values +(unix_timestamp("2004-01-01 00:00:00"), "2004-01-01 00:00:00"); +insert into t1 values +(unix_timestamp("2004-03-28 01:59:59"), "2004-03-28 01:59:59"), +(unix_timestamp("2004-03-28 02:30:00"), "2004-03-28 02:30:00"), +(unix_timestamp("2004-03-28 03:00:00"), "2004-03-28 03:00:00"); +insert into t1 values +(unix_timestamp('2004-05-01 00:00:00'),'2004-05-01 00:00:00'); +insert into t1 values +(unix_timestamp('2004-10-31 01:00:00'),'2004-10-31 01:00:00'), +(unix_timestamp('2004-10-31 02:00:00'),'2004-10-31 02:00:00'), +(unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'), +(unix_timestamp('2004-10-31 04:00:00'),'2004-10-31 04:00:00'), +(unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'); +insert into t1 values +(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), +(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); +select i, from_unixtime(i), c from t1; +i from_unixtime(i) c +1072904422 2004-01-01 00:00:00 2004-01-01 00:00:00 +1080428421 2004-03-28 01:59:59 2004-03-28 01:59:59 +1080428422 2004-03-28 03:00:00 2004-03-28 02:30:00 +1080428422 2004-03-28 03:00:00 2004-03-28 03:00:00 +1083355222 2004-05-01 00:00:00 2004-05-01 00:00:00 +1099170022 2004-10-31 01:00:00 2004-10-31 01:00:00 +1099177222 2004-10-31 02:00:00 2004-10-31 02:00:00 +1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59 +1099184422 2004-10-31 04:00:00 2004-10-31 04:00:00 +1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59 +362793608 1981-07-01 03:59:59 1981-07-01 03:59:59 +362793610 1981-07-01 04:00:00 1981-07-01 04:00:00 +drop table t1; +create table t1 (ts timestamp); +insert into t1 values (19730101235900), (20040101235900); +select * from t1; +ts +1973-01-01 23:59:00 +2004-01-01 23:59:00 +drop table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 95bba1d4ec7..8a0c74b3ae5 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -682,8 +682,8 @@ id txt 3 NULL 1 Chevy drop table t1; -CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); -INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d)); +INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,''); select max(i) from t1 where c = ''; max(i) 4 diff --git a/mysql-test/r/type_blob.result.es b/mysql-test/r/type_blob.result.es index 84d02b4a4b4..a510eee8f38 100644 --- a/mysql-test/r/type_blob.result.es +++ b/mysql-test/r/type_blob.result.es @@ -684,8 +684,8 @@ id txt 3 NULL 1 Chevy drop table t1; -CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); -INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d)); +INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,''); select max(i) from t1 where c = ''; max(i) 4 diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 71d1b9ad381..3428b5969d9 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -96,3 +96,11 @@ f2 19781126 19781126 DROP TABLE t1, t2, t3; +CREATE TABLE t1 (y YEAR); +INSERT INTO t1 VALUES ('abc'); +Warnings: +Warning 1265 Data truncated for column 'y' at row 1 +SELECT * FROM t1; +y +0000 +DROP TABLE t1; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 524bc9c50d4..7b101d31fc5 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -97,13 +97,15 @@ select * from t1 where a is null or b is null; a b drop table t1; create table t1 (t datetime); -insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +insert into t1 values (20030102030460),(20030102036301),(20030102240401), +(20030132030401),(20031302030401),(100001202030401); Warnings: Warning 1265 Data truncated for column 't' at row 1 Warning 1265 Data truncated for column 't' at row 2 Warning 1265 Data truncated for column 't' at row 3 Warning 1265 Data truncated for column 't' at row 4 Warning 1265 Data truncated for column 't' at row 5 +Warning 1265 Data truncated for column 't' at row 6 select * from t1; t 0000-00-00 00:00:00 @@ -111,14 +113,18 @@ t 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +0000-00-00 00:00:00 delete from t1; -insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +insert into t1 values +("2003-01-02 03:04:60"),("2003-01-02 03:63:01"),("2003-01-02 24:04:01"), +("2003-01-32 03:04:01"),("2003-13-02 03:04:01"), ("10000-12-02 03:04:00"); Warnings: Warning 1264 Data truncated; out of range for column 't' at row 1 Warning 1264 Data truncated; out of range for column 't' at row 2 Warning 1264 Data truncated; out of range for column 't' at row 3 Warning 1264 Data truncated; out of range for column 't' at row 4 Warning 1264 Data truncated; out of range for column 't' at row 5 +Warning 1264 Data truncated; out of range for column 't' at row 6 select * from t1; t 0000-00-00 00:00:00 @@ -126,6 +132,7 @@ t 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +0000-00-00 00:00:00 delete from t1; insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); Warnings: @@ -136,3 +143,13 @@ t 0000-00-00 00:00:00 2003-01-01 00:00:00 drop table t1; +create table t1 (dt datetime); +insert into t1 values ("12-00-00"), ("00-00-00 01:00:00"); +insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); +select * from t1; +dt +2012-00-00 00:00:00 +2000-00-00 01:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +drop table t1; diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index da85ffe6495..14d3443bda9 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1693,3 +1693,55 @@ oe ue ss DROP TABLE t1; +CREATE TABLE t1 ( +a ENUM('ä','ö','ü') character set utf8 default 'ü' +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('ä','ö','ü') character set utf8 default 'ü' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('ä'), ('ö'), ('ü'); +select a from t1 order by a; +a +ä +ö +ü +drop table t1; +set names utf8; +CREATE TABLE t1 ( +a ENUM('ä','ö','ü') character set latin1 default 'ü' +); +insert into t1 values ('ä'),('ö'),('ü'); +set names latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('ä','ö','ü') default 'ü' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select a from t1 order by a; +a +ä +ö +ü +drop table t1; +create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin); +insert into t1 values ('Y'); +alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +select * from t1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 a a 254 1 1 Y 384 0 8 +def test t1 t1 b b 254 3 0 Y 2176 0 8 +def test t1 t1 c c 254 1 0 Y 384 0 8 +a b c +Y NULL NULL +drop table t1; +create table t1 (a enum('x','y') default 'x'); +alter table t1 alter a set default 'z'; +ERROR 42000: Invalid default value for 'a' +drop table t1; +create table t1 (a set('x','y') default 'x'); +alter table t1 alter a set default 'z'; +ERROR 42000: Invalid default value for 'a' +drop table t1; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 75f0298797a..c1cefe4b35d 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t2; SELECT 10,10.0,10.,.1e+2,100.0e-1; 10 10.0 10. .1e+2 100.0e-1 10 10.0 10 10 10 @@ -8,6 +8,15 @@ SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; 1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1 10 10 10 10 10 10 0.1 0.1 0.1 +SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; +0.001e+1 0.001e-1 -0.001e+01 -0.001e-01 +0.01 0.0001 -0.01 -0.0001 +SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; +123.23E+02 -123.23E-02 "123.23E+02"+0.0 "-123.23E-02"+0.0 +12323 -1.2323 12323 -1.2323 +SELECT 2147483647E+02,21474836.47E+06; +2147483647E+02 21474836.47E+06 +214748364700 21474836470000 create table t1 (f1 float(24),f2 float(52)); show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment @@ -22,14 +31,14 @@ select * from t1; f1 f2 10 10 100000 100000 -1.23457e+09 1234567890 +1.23457e+9 1234567890 1e+10 10000000000 1e+15 1e+15 1e+20 1e+20 3.40282e+38 1e+50 3.40282e+38 1e+150 -10 -10 -1e-05 1e-05 +1e-5 1e-5 1e-10 1e-10 1e-15 1e-15 1e-20 1e-20 @@ -139,7 +148,90 @@ create table t1 (c20 char); insert into t1 values (5000.0); Warnings: Warning 1265 Data truncated for column 'c20' at row 1 +insert into t1 values (0.5e4); +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; +create table t1 (d1 double, d2 double unsigned); +insert into t1 set d1 = -1.0; +update t1 set d2 = d1; +Warnings: +Warning 1264 Data truncated; out of range for column 'd2' at row 1 +select * from t1; +d1 d2 +-1 0 +drop table t1; +create table t1 (f float(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; +create table t1 (f double(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; +create table t1 (c char(20)); +insert into t1 values (5e-28); +select * from t1; +c +5e-28 +drop table t1; +create table t1 (c char(6)); +insert into t1 values (2e5),(2e6),(2e-4),(2e-5); +select * from t1; +c +200000 +2e+06 +0.0002 +2e-05 +drop table t1; +CREATE TABLE t1 ( +reckey int unsigned NOT NULL, +recdesc varchar(50) NOT NULL, +PRIMARY KEY (reckey) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (108, 'Has 108 as key'); +INSERT INTO t1 VALUES (109, 'Has 109 as key'); +select * from t1 where reckey=108; +reckey recdesc +108 Has 108 as key +select * from t1 where reckey=1.08E2; +reckey recdesc +108 Has 108 as key +select * from t1 where reckey=109; +reckey recdesc +109 Has 109 as key +select * from t1 where reckey=1.09E2; +reckey recdesc +109 Has 109 as key +drop table t1; diff --git a/mysql-test/r/type_float.result.es b/mysql-test/r/type_float.result.es index 411817bbfef..5fcf9213f83 100644 --- a/mysql-test/r/type_float.result.es +++ b/mysql-test/r/type_float.result.es @@ -22,14 +22,14 @@ select * from t1; f1 f2 10 10 100000 100000 -1.23457e+09 1234567890 +1.23457e+9 1234567890 1e+10 10000000000 1e+15 1e+15 1e+20 1e+20 3.40282e+38 1e+50 3.40282e+38 1e+150 -10 -10 -1e-05 1e-05 +1e-5 1e-5 1e-10 1e-10 1e-15 1e-15 1e-20 1e-20 @@ -137,7 +137,69 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (c20 char); insert into t1 values (5000.0); +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; +create table t1 (d1 double, d2 double unsigned); +insert into t1 set d1 = -1.0; +update t1 set d2 = d1; +Warnings: +Warning 1264 Data truncated; out of range for column 'd2' at row 1 +select * from t1; +d1 d2 +-1 0 +drop table t1; +create table t1 (f float(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; +create table t1 (f double(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; +create table t1 (c char(20)); +insert into t1 values (5e-28); +select * from t1; +c +5e-28 +drop table t1; +create table t1 (c char(6)); +insert into t1 values (2e5),(2e6),(2e-4),(2e-5); +select * from t1; +c +200000 +2e+06 +0.0002 +2e-05 +drop table t1; diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index 9c82f59fc69..5aedefda283 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -29,6 +29,12 @@ a A a,A a,A +select s from t1 order by concat(s); +s +A +a +a,A +a,A drop table t1; CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci); INSERT INTO t1 VALUES ('ä'),('ö'),('ü'),('ß'); @@ -47,4 +53,16 @@ ss ss ae,oe,ue,ss ae,oe,ue,ss +SELECT c FROM t1 ORDER BY concat(c); +c +ae +ae +ae,oe,ue,ss +ae,oe,ue,ss +oe +oe +ss +ss +ue +ue DROP TABLE t1; diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 42fdc7e50c6..6c46d308e7e 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -422,3 +422,13 @@ max(t) 2004-01-01 01:00:00 2004-02-01 00:00:00 drop table t1; +set sql_mode='maxdb'; +create table t1 (a timestamp, b timestamp(19)); +show create table t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" datetime default NULL, + "b" datetime default NULL +) +set sql_mode=''; +drop table t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 7820cd1d6ff..f58f0f5b0ac 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -554,7 +554,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` char(20) NOT NULL default '' + `a` binary(20) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; @@ -872,6 +872,22 @@ count(*) show status like 'Slow_queries'; Variable_name Value Slow_queries 3 +flush status; +select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6); +a +4 +5 +3 +6 +7 +8 +9 +10 +1 +2 +show status like 'Slow_queries'; +Variable_name Value +Slow_queries 1 drop table t1; create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM; insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777'); @@ -1110,4 +1126,72 @@ t1 CREATE TABLE `t1` ( `a` char(1) character set latin1 collate latin1_german1_ci default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +create table t1 as +(select a from t2) union +(select b from t2) union +(select 'c' collate latin1_german1_ci from t2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) character set latin1 collate latin1_german1_ci default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; drop table t2; +create table t1(a1 int, f1 char(10)); +create table t2 +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +union +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +order by f2, a1; +show columns from t2; +Field Type Null Key Default Extra +f2 date YES NULL +a1 int(11) YES NULL +drop table t1, t2; +create table t1 (f1 int); +create table t2 (f1 int, f2 int ,f3 date); +create table t3 (f1 int, f2 char(10)); +create table t4 +( +select t2.f3 as sdate +from t1 +left outer join t2 on (t1.f1 = t2.f1) +inner join t3 on (t2.f2 = t3.f1) +order by t1.f1, t3.f1, t2.f3 +) +union +( +select cast('2004-12-31' as date) as sdate +from t1 +left outer join t2 on (t1.f1 = t2.f1) +inner join t3 on (t2.f2 = t3.f1) +group by t1.f1 +order by t1.f1, t3.f1, t2.f3 +) +order by sdate; +show columns from t4; +Field Type Null Key Default Extra +sdate date YES NULL +drop table t1, t2, t3, t4; +create table t1 (a int not null, b char (10) not null); +insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); +select * from ((select * from t1 limit 1)) a; +a b +1 a +select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a; +a b +1 a +select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a; +a b +1 a +select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a; +a b +1 a +2 b +3 c +select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a; +a b +1 a +2 b +3 c +drop table t1; diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 6d2e623a6fb..ac370db9ecc 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -206,3 +206,16 @@ colC colA colD colE colF 3 4433 10005 492 500 DROP TABLE t1; DROP TABLE t2; +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; +create table t1 (id int not null auto_increment primary key, id_str varchar(32)); +insert into t1 (id_str) values ("test"); +update t1 set id_str = concat(id_str, id) where id = last_insert_id(); +select * from t1; +id id_str +1 test1 +drop table t1; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 2750478c1c5..d82c17b0fe0 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -123,7 +123,7 @@ drop table t1; set @a=_latin2'test'; select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_general_ci 3 +latin2 latin2_general_ci 2 select @a=_latin2'TEST'; @a=_latin2'TEST' 1 @@ -133,12 +133,13 @@ select @a=_latin2'TEST' collate latin2_bin; set @a=_latin2'test' collate latin2_general_ci; select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_general_ci 0 +latin2 latin2_general_ci 2 select @a=_latin2'TEST'; @a=_latin2'TEST' 1 select @a=_latin2'TEST' collate latin2_bin; -ERROR HY000: Illegal mix of collations (latin2_general_ci,EXPLICIT) and (latin2_bin,EXPLICIT) for operation '=' +@a=_latin2'TEST' collate latin2_bin +0 select charset(@a:=_latin2'test'); charset(@a:=_latin2'test') latin2 @@ -147,51 +148,48 @@ collation(@a:=_latin2'test') latin2_general_ci select coercibility(@a:=_latin2'test'); coercibility(@a:=_latin2'test') -3 +2 select collation(@a:=_latin2'test' collate latin2_bin); collation(@a:=_latin2'test' collate latin2_bin) latin2_bin select coercibility(@a:=_latin2'test' collate latin2_bin); coercibility(@a:=_latin2'test' collate latin2_bin) -0 +2 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' 0 select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_bin 0 +latin2 latin2_bin 2 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; -ERROR HY000: Illegal mix of collations (latin2_bin,EXPLICIT) and (latin2_general_ci,EXPLICIT) for operation '=' +(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci +1 create table t1 (a varchar(50)); reset master; SET TIMESTAMP=10000; SET @`a b`='hello'; INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; -insert into t1 values (@var1); -create table t2 (c char(30)) charset=ucs2; -set @v=convert('abc' using ucs2); -insert into t2 values (@v); +SET @var2=char(ascii('a')); +insert into t1 values (@var1),(@var2); show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci -master-bin.000001 226 Query 1 226 use `test`; insert into t1 values (@var1) -master-bin.000001 290 Query 1 290 use `test`; create table t2 (c char(30)) charset=ucs2 -master-bin.000001 366 User var 1 366 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci -master-bin.000001 406 Query 1 406 use `test`; insert into t2 values (@v) +master-bin.000001 226 User var 1 226 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci +master-bin.000001 264 Query 1 264 use `test`; insert into t1 values (@var1),(@var2) /*!40019 SET @@session.max_insert_delayed_threads=0*/; -SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci; +SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`; use test; SET TIMESTAMP=10000; INSERT INTO t1 VALUES(@`a b`); -SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci; -SET TIMESTAMP=10000; -insert into t1 values (@var1); -SET TIMESTAMP=10000; -create table t2 (c char(30)) charset=ucs2; -SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; +SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; +SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`; SET TIMESTAMP=10000; -insert into t2 values (@v); -drop table t1, t2; +insert into t1 values (@var1),(@var2); +drop table t1; +set @var= NULL ; +select FIELD( @var,'1it','Hit') as my_column; +my_column +0 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index b2a97ce3e48..633f7c139fd 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -115,13 +115,13 @@ set global concurrent_insert=DEFAULT; show variables like 'concurrent_insert'; Variable_name Value concurrent_insert ON -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="INNODB"; +set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; show local variables like 'storage_engine'; Variable_name Value storage_engine HEAP show global variables like 'storage_engine'; Variable_name Value -storage_engine InnoDB +storage_engine MERGE set GLOBAL query_cache_size=100000; set GLOBAL myisam_max_sort_file_size=2000000; show global variables like 'myisam_max_sort_file_size'; @@ -220,7 +220,7 @@ set max_join_size="hello"; ERROR 42000: Incorrect argument type to variable 'max_join_size' set storage_engine=UNKNOWN_TABLE_TYPE; ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE' -set storage_engine=INNODB, big_tables=2; +set storage_engine=MERGE, big_tables=2; ERROR 42000: Variable 'big_tables' can't be set to the value of '2' show local variables like 'storage_engine'; Variable_name Value @@ -478,3 +478,12 @@ t1 CREATE TABLE `t1` ( `c3` longtext ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; +SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; +Variable_name Value +myisam_data_pointer_size 8 +SET GLOBAL table_cache=-1; +SHOW VARIABLES LIKE 'table_cache'; +Variable_name Value +table_cache 1 +SET GLOBAL table_cache=DEFAULT; diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index d883feb7ce2..e03d72351d1 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -1,6 +1,33 @@ drop table if exists t1, t2; SET SQL_WARNINGS=1; create table t1 (a int); +create table t1 (a int); +ERROR 42S01: Table 't1' already exists +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1050 Table 't1' already exists +show warnings; +Level Code Message +Error 1050 Table 't1' already exists +create table t2(a int) default charset qwerty; +ERROR 42000: Unknown character set: 'qwerty' +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1115 Unknown character set: 'qwerty' +create table t (i); +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 ')' at line 1 +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1064 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 ')' at line 1 insert into t1 values (1); insert into t1 values ("hej"); Warnings: diff --git a/mysql-test/std_data/Moscow_leap b/mysql-test/std_data/Moscow_leap Binary files differnew file mode 100644 index 00000000000..4994c005595 --- /dev/null +++ b/mysql-test/std_data/Moscow_leap diff --git a/mysql-test/suite/jp/r/jp_alter_sjis.result b/mysql-test/suite/jp/r/jp_alter_sjis.result new file mode 100644 index 00000000000..f970508229a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_sjis.result @@ -0,0 +1,647 @@ +SET NAMES sjis; +SET character_set_database = sjis; +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES MUL NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + UNIQUE KEY `¸¸¸` (`¸¸¸`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚‚‚`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚‚‚ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚ NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚‚‚ char(1) YES MUL NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚‚‚` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + UNIQUE KEY `‚‚‚` (`‚‚‚`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚ +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +NULL •\•\•\•\•\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES MUL NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + UNIQUE KEY `”\”\”\` (`”\”\”\`), + KEY `\\\` (`\\`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +\\\\\ +”\”\”\”\”\ +•\•\•\•\•\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES MUL NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + UNIQUE KEY `¸¸¸` (`¸¸¸`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚‚‚`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚‚‚ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚ NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚‚‚ char(1) YES MUL NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚‚‚` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + UNIQUE KEY `‚‚‚` (`‚‚‚`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚ +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL •\•\•\•\•\ NULL NULL +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES MUL NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + UNIQUE KEY `”\”\”\` (`”\”\”\`), + KEY `\\\` (`\\`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +•\•\•\•\•\ +\\\\\ +”\”\”\”\”\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES MUL NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + UNIQUE KEY `¸¸¸` (`¸¸¸`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚‚‚`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚‚‚ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚ NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚‚‚ char(1) YES MUL NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚‚‚` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + UNIQUE KEY `‚‚‚` (`‚‚‚`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚ +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL •\•\•\•\•\ NULL NULL +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES MUL NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + UNIQUE KEY `”\”\”\` (`”\”\”\`), + KEY `\\\` (`\\`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +•\•\•\•\•\ +\\\\\ +”\”\”\”\”\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=BDB; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚‚‚ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚ NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚‚‚ char(1) YES NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚‚‚` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚ +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +NULL •\•\•\•\•\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + KEY `\\\` (`\\`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +\\\\\ +”\”\”\”\”\ +•\•\•\•\•\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/r/jp_alter_ucs2.result b/mysql-test/suite/jp/r/jp_alter_ucs2.result new file mode 100644 index 00000000000..2756e5a758d --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_ucs2.result @@ -0,0 +1,648 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/r/jp_alter_ujis.result b/mysql-test/suite/jp/r/jp_alter_ujis.result new file mode 100644 index 00000000000..afa3c79cbce --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_ujis.result @@ -0,0 +1,647 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=BDB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤¤¤ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤¤¤ char(6) PRI +¤¯¤¯¤¯ char(1) YES NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤¤¤` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤¤¤`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤¤¤ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤¤¤ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤¤¤` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/r/jp_alter_utf8.result b/mysql-test/suite/jp/r/jp_alter_utf8.result new file mode 100644 index 00000000000..19475e06a87 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_utf8.result @@ -0,0 +1,647 @@ +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES MUL NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + UNIQUE KEY `ククク` (`ククク`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES MUL NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + UNIQUE KEY `ããã` (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES MUL NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + UNIQUE KEY `丅丅丅` (`丅丅丅`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES MUL NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + UNIQUE KEY `ククク` (`ククク`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES MUL NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + UNIQUE KEY `ããã` (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES MUL NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + UNIQUE KEY `丅丅丅` (`丅丅丅`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES MUL NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + UNIQUE KEY `ククク` (`ククク`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES MUL NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + UNIQUE KEY `ããã` (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES MUL NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + UNIQUE KEY `丅丅丅` (`丅丅丅`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; diff --git a/mysql-test/suite/jp/r/jp_charlength_sjis.result b/mysql-test/suite/jp/r/jp_charlength_sjis.result new file mode 100644 index 00000000000..57d538ef8d0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚Q`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +‚ 1 +‚ ‚¢ 2 +‚ ‚¢‚¤ 3 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤‚¦‚¨ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚R`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +ƒ\ 1 +ƒ\\ 2 +ƒ\\•\ 3 +ƒ\\•\—\ 4 +ƒ\\•\—\\ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚S`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚T`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +‚ 1 +‚ ‚¢ 2 +‚ ‚¢‚¤ 3 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤‚¦‚¨ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚U`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +ƒ\ 1 +ƒ\\ 2 +ƒ\\•\ 3 +ƒ\\•\—\ 4 +ƒ\\•\—\\ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚V`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚W`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 5 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤ 3 +‚ ‚¢ 2 +‚ 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚X`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +ƒ\\•\—\\ 5 +ƒ\\•\—\ 4 +ƒ\\•\ 3 +ƒ\\ 2 +ƒ\ 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 5 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤ 3 +‚ ‚¢ 2 +‚ 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +ƒ\\•\—\\ 5 +ƒ\\•\—\ 4 +ƒ\\•\ 3 +ƒ\\ 2 +ƒ\ 1 + 0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_charlength_ucs2.result b/mysql-test/suite/jp/r/jp_charlength_ucs2.result new file mode 100644 index 00000000000..3695ee5159a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charlength_ujis.result b/mysql-test/suite/jp/r/jp_charlength_ujis.result new file mode 100644 index 00000000000..ccfbf4fa3a1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charlength_utf8.result b/mysql-test/suite/jp/r/jp_charlength_utf8.result new file mode 100644 index 00000000000..d4d7f68f933 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1`; +C1 CHAR_LENGTH(`C1`) + 0 +ï½± 1 +アイ 2 +アイウ 3 +アイウエ 4 +アイウエオ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼’`; +C1 CHAR_LENGTH(`C1`) + 0 +ã‚ 1 +ã‚ã„ 2 +ã‚ã„ㆠ3 +ã‚ã„ã†ãˆ 4 +ã‚ã„ã†ãˆãŠ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T3`; +C1 CHAR_LENGTH(`C1`) + 0 +é¾” 1 +龔龖 2 +龔龖龗 3 +龔龖龗龞 4 +龔龖龗龞龡 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼”`; +C1 CHAR_LENGTH(`C1`) + 0 +ï½± 1 +アイ 2 +アイウ 3 +アイウエ 4 +アイウエオ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T5`; +C1 CHAR_LENGTH(`C1`) + 0 +ã‚ 1 +ã‚ã„ 2 +ã‚ã„ㆠ3 +ã‚ã„ã†ãˆ 4 +ã‚ã„ã†ãˆãŠ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼–`; +C1 CHAR_LENGTH(`C1`) + 0 +é¾” 1 +龔龖 2 +龔龖龗 3 +龔龖龗龞 4 +龔龖龗龞龡 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼—`; +C1 CHAR_LENGTH(`C1`) +アイウエオ 5 +アイウエ 4 +アイウ 3 +アイ 2 +ï½± 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T8`; +C1 CHAR_LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 5 +ã‚ã„ã†ãˆ 4 +ã‚ã„ㆠ3 +ã‚ã„ 2 +ã‚ 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼™`; +C1 CHAR_LENGTH(`C1`) +龔龖龗龞龡 5 +龔龖龗龞 4 +龔龖龗 3 +龔龖 2 +é¾” 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1ï¼`; +C1 CHAR_LENGTH(`C1`) +アイウエオ 5 +アイウエ 4 +アイウ 3 +アイ 2 +ï½± 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T11`; +C1 CHAR_LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 5 +ã‚ã„ã†ãˆ 4 +ã‚ã„ㆠ3 +ã‚ã„ 2 +ã‚ 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T12`; +C1 CHAR_LENGTH(`C1`) +龔龖龗龞龡 5 +龔龖龗龞 4 +龔龖龗 3 +龔龖 2 +é¾” 1 + 0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_charset_sjis.result b/mysql-test/suite/jp/r/jp_charset_sjis.result new file mode 100644 index 00000000000..80ef24a7334 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_sjis.result @@ -0,0 +1,230 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚Q`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚R`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚S`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚T`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚U`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚V`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚W`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚X`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚O`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚P`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚Q`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_charset_ucs2.result b/mysql-test/suite/jp/r/jp_charset_ucs2.result new file mode 100644 index 00000000000..d121e98fc00 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_ucs2.result @@ -0,0 +1,306 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charset_ujis.result b/mysql-test/suite/jp/r/jp_charset_ujis.result new file mode 100644 index 00000000000..964477896bd --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_ujis.result @@ -0,0 +1,230 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charset_utf8.result b/mysql-test/suite/jp/r/jp_charset_utf8.result new file mode 100644 index 00000000000..2fdd3fb1a6b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_utf8.result @@ -0,0 +1,230 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT DISTINCT CHARSET(`C1`) FROM `T1`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼’`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T3`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T3`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T3`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T3`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T3`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼”`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T5`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼–`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T5`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T5`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T5`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T5`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼—`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T8`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼™`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T8`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T8`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T8`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T8`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`C1`) FROM `T1ï¼`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T11`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T12`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T11`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T11`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T11`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T11`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T12`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T12`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T12`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T12`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/r/jp_convert_sjis.result b/mysql-test/suite/jp/r/jp_convert_sjis.result new file mode 100644 index 00000000000..8c9df3606c8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_sjis.result @@ -0,0 +1,1046 @@ +SET NAMES sjis; +SET character_set_database = sjis; +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚Q`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚Q`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚Q`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚R`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚R`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚R`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚S`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚S`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚S`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚T`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚T`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚T`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚U`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚U`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚U`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚V`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚V`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚V`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚W`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚W`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚W`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚X`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚X`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚X`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚O`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚O`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚O`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚P`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚P`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚P`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚Q`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚Q`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚Q`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_convert_ucs2.result b/mysql-test/suite/jp/r/jp_convert_ucs2.result new file mode 100644 index 00000000000..92c2032993e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_ucs2.result @@ -0,0 +1,427 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using utf8) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using sjis) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using utf8) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using sjis) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using utf8) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using sjis) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_convert_ujis.result b/mysql-test/suite/jp/r/jp_convert_ujis.result new file mode 100644 index 00000000000..55f2ab0aea3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_ujis.result @@ -0,0 +1,1514 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦??????????????????? +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦??????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦??????????????????? +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦??????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦??????????????????? +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ ¡¦??????????????????? +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_convert_utf8.result b/mysql-test/suite/jp/r/jp_convert_utf8.result new file mode 100644 index 00000000000..505d6c1cebf --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_utf8.result @@ -0,0 +1,1514 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼’`; +C1 CONVERT(`C1` using ujis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼’`; +C1 CONVERT(`C1` using ucs2) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼’`; +C1 CONVERT(`C1` using sjis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T3`; +C1 CONVERT(`C1` using ujis) +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T3`; +C1 CONVERT(`C1` using ucs2) +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T3`; +C1 CONVERT(`C1` using sjis) +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ ????????・???????・??? +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +śŚşťţúùüûÅǔűūųůũǘǜǚ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +・áà äâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼”`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼”`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼”`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T5`; +C1 CONVERT(`C1` using ujis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T5`; +C1 CONVERT(`C1` using ucs2) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T5`; +C1 CONVERT(`C1` using sjis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼–`; +C1 CONVERT(`C1` using ujis) +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼–`; +C1 CONVERT(`C1` using ucs2) +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼–`; +C1 CONVERT(`C1` using sjis) +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ ????????・???????・??? +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +śŚşťţúùüûÅǔűūųůũǘǜǚ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +・áà äâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼—`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼—`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼—`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T8`; +C1 CONVERT(`C1` using ujis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T8`; +C1 CONVERT(`C1` using ucs2) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T8`; +C1 CONVERT(`C1` using sjis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼™`; +C1 CONVERT(`C1` using ujis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼™`; +C1 CONVERT(`C1` using ucs2) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼™`; +C1 CONVERT(`C1` using sjis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ ????????・???????・??? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +śŚşťţúùüûÅǔűūųůũǘǜǚ ???????????????????? +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1ï¼`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1ï¼`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1ï¼`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T11`; +C1 CONVERT(`C1` using ujis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T11`; +C1 CONVERT(`C1` using ucs2) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T11`; +C1 CONVERT(`C1` using sjis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  ・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ ・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ 稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T12`; +C1 CONVERT(`C1` using ujis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T12`; +C1 CONVERT(`C1` using ucs2) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë ・áà äâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûÅǔűūųůũǘǜǚ śŚşťţúùüûÅǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» 乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T12`; +C1 CONVERT(`C1` using sjis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ ????????・???????・??? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +śŚşťţúùüûÅǔűūųůũǘǜǚ ???????????????????? +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/r/jp_create_db_sjis.result b/mysql-test/suite/jp/r/jp_create_db_sjis.result new file mode 100644 index 00000000000..1ce0b7228d5 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_sjis.result @@ -0,0 +1,21 @@ +SET NAMES sjis; +SET character_set_database = sjis; +drop database if exists `ÆÎݺÞ`; +drop database if exists `“ú–{Œê`; +drop database if exists `ƒ\\•\`; +CREATE DATABASE `ÆÎݺÞ`; +CREATE DATABASE `“ú–{Œê`; +CREATE DATABASE `ƒ\\•\`; +SHOW DATABASES; +Database +mysql +test +ƒ\\•\ +“ú–{Œê +ÆÎÝºÞ +USE `ÆÎݺÞ`; +USE `“ú–{Œê`; +USE `ƒ\\•\`; +DROP DATABASE `ÆÎݺÞ`; +DROP DATABASE `“ú–{Œê`; +DROP DATABASE `ƒ\\•\`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ucs2.result b/mysql-test/suite/jp/r/jp_create_db_ucs2.result new file mode 100644 index 00000000000..8fd921ea8e6 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_ucs2.result @@ -0,0 +1,22 @@ +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET character_set_server = ucs2; +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; +SHOW DATABASES; +Database +mysql +test +ÆüËܸì +íÜíÝíÞ +ŽÆŽÎŽÝŽºŽÞ +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ujis.result b/mysql-test/suite/jp/r/jp_create_db_ujis.result new file mode 100644 index 00000000000..45fdb34717b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_ujis.result @@ -0,0 +1,21 @@ +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; +SHOW DATABASES; +Database +mysql +test +ÆüËܸì +íÜíÝíÞ +ŽÆŽÎŽÝŽºŽÞ +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/r/jp_create_db_utf8.result b/mysql-test/suite/jp/r/jp_create_db_utf8.result new file mode 100644 index 00000000000..c0e996040de --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_utf8.result @@ -0,0 +1,21 @@ +drop database if exists `ニホï¾ï½ºï¾ž`; +drop database if exists `日本語`; +drop database if exists `龔龖龗`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE DATABASE `ニホï¾ï½ºï¾ž`; +CREATE DATABASE `日本語`; +CREATE DATABASE `龔龖龗`; +SHOW DATABASES; +Database +mysql +test +日本語 +龔龖龗 +ニホï¾ï½ºï¾ž +USE `ニホï¾ï½ºï¾ž`; +USE `日本語`; +USE `龔龖龗`; +DROP DATABASE `ニホï¾ï½ºï¾ž`; +DROP DATABASE `日本語`; +DROP DATABASE `龔龖龗`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_sjis.result b/mysql-test/suite/jp/r/jp_create_tbl_sjis.result new file mode 100644 index 00000000000..ecc72f9d91b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_sjis.result @@ -0,0 +1,641 @@ +SET NAMES sjis; +SET character_set_database = sjis; +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `³³³`; +DROP TABLE IF EXISTS `´´´`; +DROP TABLE IF EXISTS `µµµ`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `‚¤‚¤‚¤`; +DROP TABLE IF EXISTS `‚¦‚¦‚¦`; +DROP TABLE IF EXISTS `‚¨‚¨‚¨`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +DROP TABLE IF EXISTS `•\•\•\`; +DROP TABLE IF EXISTS `—\—\—\`; +DROP TABLE IF EXISTS `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚‚‚ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚‚‚` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚‚‚ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚‚‚` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚‚‚ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚‚‚` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚‚‚ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚ CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚‚‚` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result b/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result new file mode 100644 index 00000000000..0bf5a6891b0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result @@ -0,0 +1,641 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +SET NAMES ujis; +SET character_set_database = ucs2; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_ujis.result b/mysql-test/suite/jp/r/jp_create_tbl_ujis.result new file mode 100644 index 00000000000..ae555e5af15 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_ujis.result @@ -0,0 +1,641 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=BDB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤¤¤ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤¤¤` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_utf8.result b/mysql-test/suite/jp/r/jp_create_tbl_utf8.result new file mode 100644 index 00000000000..d4873406c46 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_utf8.result @@ -0,0 +1,641 @@ +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ウウウ`; +DROP TABLE IF EXISTS `ï½´ï½´ï½´`; +DROP TABLE IF EXISTS `オオオ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `ã†ã†ã†`; +DROP TABLE IF EXISTS `ãˆãˆãˆ`; +DROP TABLE IF EXISTS `ãŠãŠãŠ`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +DROP TABLE IF EXISTS `龞龞龞`; +DROP TABLE IF EXISTS `龡龡龡`; +DROP TABLE IF EXISTS `龢龢龢`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; diff --git a/mysql-test/suite/jp/r/jp_enum_sjis.result b/mysql-test/suite/jp/r/jp_enum_sjis.result new file mode 100644 index 00000000000..1e46dbffbb1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_sjis.result @@ -0,0 +1,362 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚Q` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚R` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚S` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚T` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚U` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚V` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚W` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚X` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚O` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\'),('\'),('•\'); +SELECT * FROM `‚s‚P`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚Q`; +‚b‚P +‚ +‚¢ +‚¤ +SELECT * FROM `‚s‚R`; +‚b‚P +ƒ\ +\ +•\ +SELECT * FROM `‚s‚S`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚T`; +‚b‚P +‚ +‚¢ +‚¤ +SELECT * FROM `‚s‚U`; +‚b‚P +ƒ\ +\ +•\ +SELECT * FROM `‚s‚V`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚W`; +‚b‚P +‚ +‚¢ +‚¤ +SELECT * FROM `‚s‚X`; +‚b‚P +ƒ\ +\ +•\ +SELECT * FROM `‚s‚P‚O`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚P‚P`; +‚b‚P +‚ +‚¢ +‚¤ +SELECT * FROM `‚s‚P‚Q`; +‚b‚P +ƒ\ +\ +•\ +SHOW CREATE TABLE `‚s‚P`; +Table Create Table +‚s‚P CREATE TABLE `‚s‚P` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚Q`; +Table Create Table +‚s‚Q CREATE TABLE `‚s‚Q` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚R`; +Table Create Table +‚s‚R CREATE TABLE `‚s‚R` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚S`; +Table Create Table +‚s‚S CREATE TABLE `‚s‚S` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚T`; +Table Create Table +‚s‚T CREATE TABLE `‚s‚T` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚U`; +Table Create Table +‚s‚U CREATE TABLE `‚s‚U` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚V`; +Table Create Table +‚s‚V CREATE TABLE `‚s‚V` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚W`; +Table Create Table +‚s‚W CREATE TABLE `‚s‚W` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚X`; +Table Create Table +‚s‚X CREATE TABLE `‚s‚X` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚O`; +Table Create Table +‚s‚P‚O CREATE TABLE `‚s‚P‚O` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚P`; +Table Create Table +‚s‚P‚P CREATE TABLE `‚s‚P‚P` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚Q`; +Table Create Table +‚s‚P‚Q CREATE TABLE `‚s‚P‚Q` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DESC `‚s‚P`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚Q`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚R`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚S`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚T`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚U`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚V`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚W`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚X`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚P‚O`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚P‚P`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚P‚Q`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +ALTER TABLE `‚s‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚R` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚S` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚T` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚U` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚V` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚W` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚X` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚O` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +SHOW CREATE TABLE `‚s‚P`; +Table Create Table +‚s‚P CREATE TABLE `‚s‚P` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚Q`; +Table Create Table +‚s‚Q CREATE TABLE `‚s‚Q` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚R`; +Table Create Table +‚s‚R CREATE TABLE `‚s‚R` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚S`; +Table Create Table +‚s‚S CREATE TABLE `‚s‚S` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚T`; +Table Create Table +‚s‚T CREATE TABLE `‚s‚T` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚U`; +Table Create Table +‚s‚U CREATE TABLE `‚s‚U` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚V`; +Table Create Table +‚s‚V CREATE TABLE `‚s‚V` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚W`; +Table Create Table +‚s‚W CREATE TABLE `‚s‚W` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚X`; +Table Create Table +‚s‚X CREATE TABLE `‚s‚X` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚O`; +Table Create Table +‚s‚P‚O CREATE TABLE `‚s‚P‚O` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚P`; +Table Create Table +‚s‚P‚P CREATE TABLE `‚s‚P‚P` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚Q`; +Table Create Table +‚s‚P‚Q CREATE TABLE `‚s‚P‚Q` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DESC `‚s‚P`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚Q`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚R`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚S`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚T`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚U`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚V`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚W`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚X`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚P‚O`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚P‚P`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚P‚Q`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_enum_ucs2.result b/mysql-test/suite/jp/r/jp_enum_ucs2.result new file mode 100644 index 00000000000..a84cace35fe --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_ucs2.result @@ -0,0 +1,219 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); +SELECT * FROM `£Ô£±`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£²`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£³`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£´`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£µ`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£·`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£¸`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£±£°`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÜ +íÝ +íÞ +SHOW CREATE TABLE `£Ô£±`; +Table Create Table +£Ô£± CREATE TABLE `£Ô£±` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£²`; +Table Create Table +£Ô£² CREATE TABLE `£Ô£²` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£³`; +Table Create Table +£Ô£³ CREATE TABLE `£Ô£³` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£´`; +Table Create Table +£Ô£´ CREATE TABLE `£Ô£´` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£µ`; +Table Create Table +£Ô£µ CREATE TABLE `£Ô£µ` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£¶`; +Table Create Table +£Ô£¶ CREATE TABLE `£Ô£¶` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£·`; +Table Create Table +£Ô£· CREATE TABLE `£Ô£·` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£¸`; +Table Create Table +£Ô£¸ CREATE TABLE `£Ô£¸` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£¹`; +Table Create Table +£Ô£¹ CREATE TABLE `£Ô£¹` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£±£°`; +Table Create Table +£Ô£±£° CREATE TABLE `£Ô£±£°` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£±£±`; +Table Create Table +£Ô£±£± CREATE TABLE `£Ô£±£±` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£±£²`; +Table Create Table +£Ô£±£² CREATE TABLE `£Ô£±£²` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +DESC `£Ô£±`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£²`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£³`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£´`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£µ`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¶`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£·`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£¸`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¹`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£±£°`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£±£±`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£±£²`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_enum_ujis.result b/mysql-test/suite/jp/r/jp_enum_ujis.result new file mode 100644 index 00000000000..dbc850b1368 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_ujis.result @@ -0,0 +1,362 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); +SELECT * FROM `£Ô£±`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£²`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£³`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£´`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£µ`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£·`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£¸`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£±£°`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÜ +íÝ +íÞ +SHOW CREATE TABLE `£Ô£±`; +Table Create Table +£Ô£± CREATE TABLE `£Ô£±` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£²`; +Table Create Table +£Ô£² CREATE TABLE `£Ô£²` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£³`; +Table Create Table +£Ô£³ CREATE TABLE `£Ô£³` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£´`; +Table Create Table +£Ô£´ CREATE TABLE `£Ô£´` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£µ`; +Table Create Table +£Ô£µ CREATE TABLE `£Ô£µ` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¶`; +Table Create Table +£Ô£¶ CREATE TABLE `£Ô£¶` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£·`; +Table Create Table +£Ô£· CREATE TABLE `£Ô£·` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¸`; +Table Create Table +£Ô£¸ CREATE TABLE `£Ô£¸` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¹`; +Table Create Table +£Ô£¹ CREATE TABLE `£Ô£¹` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£°`; +Table Create Table +£Ô£±£° CREATE TABLE `£Ô£±£°` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£±`; +Table Create Table +£Ô£±£± CREATE TABLE `£Ô£±£±` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£²`; +Table Create Table +£Ô£±£² CREATE TABLE `£Ô£±£²` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DESC `£Ô£±`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£²`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£³`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£´`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£µ`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¶`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£·`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£¸`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¹`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£±£°`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£±£±`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£±£²`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +ALTER TABLE `£Ô£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£³` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£´` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£µ` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¶` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£·` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¸` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¹` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£°` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +SHOW CREATE TABLE `£Ô£±`; +Table Create Table +£Ô£± CREATE TABLE `£Ô£±` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£²`; +Table Create Table +£Ô£² CREATE TABLE `£Ô£²` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£³`; +Table Create Table +£Ô£³ CREATE TABLE `£Ô£³` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£´`; +Table Create Table +£Ô£´ CREATE TABLE `£Ô£´` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£µ`; +Table Create Table +£Ô£µ CREATE TABLE `£Ô£µ` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¶`; +Table Create Table +£Ô£¶ CREATE TABLE `£Ô£¶` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£·`; +Table Create Table +£Ô£· CREATE TABLE `£Ô£·` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¸`; +Table Create Table +£Ô£¸ CREATE TABLE `£Ô£¸` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¹`; +Table Create Table +£Ô£¹ CREATE TABLE `£Ô£¹` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£°`; +Table Create Table +£Ô£±£° CREATE TABLE `£Ô£±£°` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£±`; +Table Create Table +£Ô£±£± CREATE TABLE `£Ô£±£±` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£²`; +Table Create Table +£Ô£±£² CREATE TABLE `£Ô£±£²` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DESC `£Ô£±`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£²`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£³`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£´`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£µ`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¶`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£·`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£¸`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¹`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£±£°`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£±£±`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£±£²`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_enum_utf8.result b/mysql-test/suite/jp/r/jp_enum_utf8.result new file mode 100644 index 00000000000..f2515871ece --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_utf8.result @@ -0,0 +1,362 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T3` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼”` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T5` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼–` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼—` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T8` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼™` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T1ï¼` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T11` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T12` VALUES ('é¾”'),('é¾–'),('é¾—'); +SELECT * FROM `T1`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `ï¼´ï¼’`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `T3`; +C1 +é¾” +é¾– +é¾— +SELECT * FROM `ï¼´ï¼”`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `T5`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `ï¼´ï¼–`; +C1 +é¾” +é¾– +é¾— +SELECT * FROM `ï¼´ï¼—`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `T8`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `ï¼´ï¼™`; +C1 +é¾” +é¾– +é¾— +SELECT * FROM `T1ï¼`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `T11`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `T12`; +C1 +é¾” +é¾– +é¾— +SHOW CREATE TABLE `T1`; +Table Create Table +T1 CREATE TABLE `T1` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼’`; +Table Create Table +ï¼´ï¼’ CREATE TABLE `ï¼´ï¼’` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T3`; +Table Create Table +T3 CREATE TABLE `T3` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼”`; +Table Create Table +ï¼´ï¼” CREATE TABLE `ï¼´ï¼”` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T5`; +Table Create Table +T5 CREATE TABLE `T5` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼–`; +Table Create Table +ï¼´ï¼– CREATE TABLE `ï¼´ï¼–` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼—`; +Table Create Table +ï¼´ï¼— CREATE TABLE `ï¼´ï¼—` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T8`; +Table Create Table +T8 CREATE TABLE `T8` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼™`; +Table Create Table +ï¼´ï¼™ CREATE TABLE `ï¼´ï¼™` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T1ï¼`; +Table Create Table +ï¼´ï¼‘ï¼ CREATE TABLE `T1ï¼` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T11`; +Table Create Table +T11 CREATE TABLE `T11` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T12`; +Table Create Table +T12 CREATE TABLE `T12` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DESC `T1`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `ï¼´ï¼’`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T3`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼”`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T5`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼–`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼—`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T8`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼™`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `T1ï¼`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T11`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T12`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +ALTER TABLE `T1` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼’` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T3` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼”` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T5` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼–` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼—` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T8` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼™` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T1ï¼` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T11` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T12` ADD `C2` CHAR(1) NOT NULL FIRST; +SHOW CREATE TABLE `T1`; +Table Create Table +T1 CREATE TABLE `T1` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼’`; +Table Create Table +ï¼´ï¼’ CREATE TABLE `ï¼´ï¼’` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T3`; +Table Create Table +T3 CREATE TABLE `T3` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼”`; +Table Create Table +ï¼´ï¼” CREATE TABLE `ï¼´ï¼”` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T5`; +Table Create Table +T5 CREATE TABLE `T5` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼–`; +Table Create Table +ï¼´ï¼– CREATE TABLE `ï¼´ï¼–` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼—`; +Table Create Table +ï¼´ï¼— CREATE TABLE `ï¼´ï¼—` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T8`; +Table Create Table +T8 CREATE TABLE `T8` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼™`; +Table Create Table +ï¼´ï¼™ CREATE TABLE `ï¼´ï¼™` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T1ï¼`; +Table Create Table +ï¼´ï¼‘ï¼ CREATE TABLE `T1ï¼` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T11`; +Table Create Table +T11 CREATE TABLE `T11` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T12`; +Table Create Table +T12 CREATE TABLE `T12` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DESC `T1`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `ï¼´ï¼’`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T3`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼”`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T5`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼–`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼—`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T8`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼™`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `T1ï¼`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T11`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T12`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_insert_sjis.result b/mysql-test/suite/jp/r/jp_insert_sjis.result new file mode 100644 index 00000000000..c516986a256 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_sjis.result @@ -0,0 +1,905 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,1,' ') + ²³´µ +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,2,' ') + ³´µ +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,3,' ') + ´µ +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,4,' ') + µ +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,5,' ') + +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,1,' ') +± ³´µ +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,2,' ') +± ´µ +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,3,' ') +± µ +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,4,' ') +± +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,1,' ') +±² ´µ +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,2,' ') +±² µ +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,3,' ') +±² +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,1,' ') +±²³ µ +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,2,' ') +±²³ +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,5,1,' ') +±²³´ +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚') +‚©‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') +‚©‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') +‚©‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,2,'‚«‚') +‚ ‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,3,'‚«‚‚¯') +‚ ‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') +‚ ‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,1,'‚') +‚ ‚¢‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,2,'‚‚¯') +‚ ‚¢‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,3,'‚‚¯‚±') +‚ ‚¢‚‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,2,'”\”\' ) +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,3,'”\”\”\' ) +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,2,2,'”\”\' ) +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,2,3,'”\”\”\' ) +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,3,2,'”\”\' ) +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,3,3,'”\”\”\' ) +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,4,2,'”\”\' ) +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚S`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,1,' ') + ²³´µ +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,2,' ') + ³´µ +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,3,' ') + ´µ +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,4,' ') + µ +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,5,' ') + +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,1,' ') +± ³´µ +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,2,' ') +± ´µ +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,3,' ') +± µ +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,4,' ') +± +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,1,' ') +±² ´µ +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,2,' ') +±² µ +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,3,' ') +±² +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,1,' ') +±²³ µ +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,2,' ') +±²³ +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,5,1,' ') +±²³´ +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚') +‚©‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') +‚©‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') +‚©‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,2,'‚«‚') +‚ ‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,3,'‚«‚‚¯') +‚ ‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') +‚ ‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,1,'‚') +‚ ‚¢‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,2,'‚‚¯') +‚ ‚¢‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,3,'‚‚¯‚±') +‚ ‚¢‚‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,2,'”\”\' ) +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,3,'”\”\”\' ) +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,2,2,'”\”\') +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,2,3,'”\”\”\' ) +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,3,2,'”\”\' ) +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,3,3,'”\”\”\' ) +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,4,2,'”\”\' ) +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚V`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,1,' ') + ²³´µ +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,2,' ') + ³´µ +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,3,' ') + ´µ +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,4,' ') + µ +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,5,' ') + +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,1,' ') +± ³´µ +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,2,' ') +± ´µ +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,3,' ') +± µ +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,4,' ') +± +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,1,' ') +±² ´µ +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,2,' ') +±² µ +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,3,' ') +±² +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,1,' ') +±²³ µ +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,2,' ') +±²³ +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,5,1,' ') +±²³´ +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚') +‚©‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') +‚©‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') +‚©‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,2,'‚«‚') +‚ ‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,3,'‚«‚‚¯') +‚ ‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') +‚ ‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,1,'‚') +‚ ‚¢‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,2,'‚‚¯') +‚ ‚¢‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,3,'‚‚¯‚±') +‚ ‚¢‚‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,2,'”\”\' ) +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,3,'”\”\”\' ) +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,2,2,'”\”\' ) +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,2,3,'”\”\”\' ) +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,3,2,'”\”\' ) +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,3,3,'”\”\”\' ) +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,4,2,'”\”\' ) +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚') +‚©‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') +‚©‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') +‚©‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,2,'‚«‚') +‚ ‚«‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,3,'‚«‚‚¯') +‚ ‚«‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') +‚ ‚«‚‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,1,'‚') +‚ ‚¢‚‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,2,'‚‚¯') +‚ ‚¢‚‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,3,'‚‚¯‚±') +‚ ‚¢‚‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,2,'”\”\') +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,3,'”\”\”\') +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\') +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\') +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,2,'”\”\') +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,3,'”\”\”\') +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\') +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,3,2,'”\”\') +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,3,3,'”\”\”\') +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,4,2,'”\”\') +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_insert_ucs2.result b/mysql-test/suite/jp/r/jp_insert_ucs2.result new file mode 100644 index 00000000000..45487f65138 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_ucs2.result @@ -0,0 +1,906 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,2,'°¡°¡') +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡') +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡') +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,2,'°¡°¡') +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡') +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,2,'°¡°¡') +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_insert_ujis.result b/mysql-test/suite/jp/r/jp_insert_ujis.result new file mode 100644 index 00000000000..7f42d66c565 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_ujis.result @@ -0,0 +1,906 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +SET collation_connection = ujis_japanese_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,2,'°¡°¡') +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡') +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡') +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,2,'°¡°¡') +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡') +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,2,'°¡°¡') +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_insert_utf8.result b/mysql-test/suite/jp/r/jp_insert_utf8.result new file mode 100644 index 00000000000..368ba35f637 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_utf8.result @@ -0,0 +1,905 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,' ') FROM `T1`; +INSERT(`C1`,1,1,' ') + イウエオ +SELECT INSERT(`C1`,1,2,' ') FROM `T1`; +INSERT(`C1`,1,2,' ') + ウエオ +SELECT INSERT(`C1`,1,3,' ') FROM `T1`; +INSERT(`C1`,1,3,' ') + ï½´ï½µ +SELECT INSERT(`C1`,1,4,' ') FROM `T1`; +INSERT(`C1`,1,4,' ') + ï½µ +SELECT INSERT(`C1`,1,5,' ') FROM `T1`; +INSERT(`C1`,1,5,' ') + +SELECT INSERT(`C1`,2,1,' ') FROM `T1`; +INSERT(`C1`,2,1,' ') +ï½± ウエオ +SELECT INSERT(`C1`,2,2,' ') FROM `T1`; +INSERT(`C1`,2,2,' ') +ï½± ï½´ï½µ +SELECT INSERT(`C1`,2,3,' ') FROM `T1`; +INSERT(`C1`,2,3,' ') +ï½± ï½µ +SELECT INSERT(`C1`,2,4,' ') FROM `T1`; +INSERT(`C1`,2,4,' ') +ï½± +SELECT INSERT(`C1`,3,1,' ') FROM `T1`; +INSERT(`C1`,3,1,' ') +アイ ï½´ï½µ +SELECT INSERT(`C1`,3,2,' ') FROM `T1`; +INSERT(`C1`,3,2,' ') +アイ ï½µ +SELECT INSERT(`C1`,3,3,' ') FROM `T1`; +INSERT(`C1`,3,3,' ') +アイ +SELECT INSERT(`C1`,4,1,' ') FROM `T1`; +INSERT(`C1`,4,1,' ') +アイウ ï½µ +SELECT INSERT(`C1`,4,2,' ') FROM `T1`; +INSERT(`C1`,4,2,' ') +アイウ +SELECT INSERT(`C1`,5,1,' ') FROM `T1`; +INSERT(`C1`,5,1,' ') +アイウエ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `T3`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,1,2,'丂丂' ) +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `T3`; +INSERT(`C1`,1,3,'丂丂丂' ) +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `T3`; +INSERT(`C1`,1,4,'丂丂丂丂' ) +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `T3`; +INSERT(`C1`,1,5,'丂丂丂丂丂' ) +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `T3`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,2,2,'丂丂' ) +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `T3`; +INSERT(`C1`,2,3,'丂丂丂' ) +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `T3`; +INSERT(`C1`,2,4,'丂丂丂丂' ) +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `T3`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,3,2,'丂丂' ) +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `T3`; +INSERT(`C1`,3,3,'丂丂丂' ) +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `T3`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,4,2,'丂丂' ) +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `T3`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,1,' ') + イウエオ +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,2,' ') + ウエオ +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,3,' ') + ï½´ï½µ +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,4,' ') + ï½µ +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,5,' ') + +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,1,' ') +ï½± ウエオ +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,2,' ') +ï½± ï½´ï½µ +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,3,' ') +ï½± ï½µ +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,4,' ') +ï½± +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,1,' ') +アイ ï½´ï½µ +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,2,' ') +アイ ï½µ +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,3,' ') +アイ +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,1,' ') +アイウ ï½µ +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,2,' ') +アイウ +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,5,1,' ') +アイウエ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T5`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T5`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T5`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T5`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T5`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `T5`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `T5`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `T5`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `T5`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `T5`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `T5`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `T5`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `T5`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `T5`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `T5`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `T5`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `T5`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `T5`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `T5`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `T5`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,2,'丂丂' ) +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,3,'丂丂丂' ) +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,4,'丂丂丂丂' ) +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,5,'丂丂丂丂丂' ) +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,2,2,'丂丂') +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,2,3,'丂丂丂' ) +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,2,4,'丂丂丂丂' ) +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,3,2,'丂丂' ) +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,3,3,'丂丂丂' ) +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,4,2,'丂丂' ) +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,1,' ') + イウエオ +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,2,' ') + ウエオ +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,3,' ') + ï½´ï½µ +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,4,' ') + ï½µ +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,5,' ') + +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,1,' ') +ï½± ウエオ +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,2,' ') +ï½± ï½´ï½µ +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,3,' ') +ï½± ï½µ +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,4,' ') +ï½± +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,1,' ') +アイ ï½´ï½µ +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,2,' ') +アイ ï½µ +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,3,' ') +アイ +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,1,' ') +アイウ ï½µ +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,2,' ') +アイウ +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,5,1,' ') +アイウエ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T8`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T8`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T8`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T8`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T8`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `T8`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `T8`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `T8`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `T8`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `T8`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `T8`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `T8`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `T8`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `T8`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `T8`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `T8`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `T8`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `T8`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `T8`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `T8`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,2,'丂丂' ) +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,3,'丂丂丂' ) +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,4,'丂丂丂丂' ) +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,5,'丂丂丂丂丂' ) +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,2,2,'丂丂' ) +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,2,3,'丂丂丂' ) +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,2,4,'丂丂丂丂' ) +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,3,2,'丂丂' ) +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,3,3,'丂丂丂' ) +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,4,2,'丂丂' ) +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T11`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T11`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T11`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T11`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T11`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `T11`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `T11`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `T11`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `T11`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `T11`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `T11`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `T11`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `T11`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `T11`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `T11`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `T11`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `T11`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `T11`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `T11`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `T11`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `T12`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂') FROM `T12`; +INSERT(`C1`,1,2,'丂丂') +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂') FROM `T12`; +INSERT(`C1`,1,3,'丂丂丂') +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂') FROM `T12`; +INSERT(`C1`,1,4,'丂丂丂丂') +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂') FROM `T12`; +INSERT(`C1`,1,5,'丂丂丂丂丂') +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `T12`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂') FROM `T12`; +INSERT(`C1`,2,2,'丂丂') +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂') FROM `T12`; +INSERT(`C1`,2,3,'丂丂丂') +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂') FROM `T12`; +INSERT(`C1`,2,4,'丂丂丂丂') +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `T12`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂') FROM `T12`; +INSERT(`C1`,3,2,'丂丂') +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂') FROM `T12`; +INSERT(`C1`,3,3,'丂丂丂') +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `T12`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂') FROM `T12`; +INSERT(`C1`,4,2,'丂丂') +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `T12`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_instr_sjis.result b/mysql-test/suite/jp/r/jp_instr_sjis.result new file mode 100644 index 00000000000..9a6dea5a426 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_sjis.result @@ -0,0 +1,264 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚R`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚R`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚R`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚R`; +INSTR(`‚b‚P`,'‰\') +0 +SELECT INSTR(`‚b‚P`,'±') from `‚s‚S`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚S`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚S`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚S`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚S`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚S`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚T`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚T`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚U`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚U`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚U`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚U`; +INSTR(`‚b‚P`,'‰\') +0 +SELECT INSTR(`‚b‚P`,'±') from `‚s‚V`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚V`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚V`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚V`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚V`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚V`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚W`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚W`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚X`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚X`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚X`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚X`; +INSTR(`‚b‚P`,'‰\') +0 +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'‰\') +0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_instr_ucs2.result b/mysql-test/suite/jp/r/jp_instr_ucs2.result new file mode 100644 index 00000000000..352525eee0b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_ucs2.result @@ -0,0 +1,265 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; +INSTR(`£Ã£±`,'°¡') +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_instr_ujis.result b/mysql-test/suite/jp/r/jp_instr_ujis.result new file mode 100644 index 00000000000..0cf9895a740 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_ujis.result @@ -0,0 +1,264 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; +INSTR(`£Ã£±`,'°¡') +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_instr_utf8.result b/mysql-test/suite/jp/r/jp_instr_utf8.result new file mode 100644 index 00000000000..0e55227e4b7 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_utf8.result @@ -0,0 +1,264 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT INSTR(`C1`,'ï½±') from `T1`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `T1`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `T1`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `T1`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `T1`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `T1`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `ï¼´ï¼’`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `ï¼´ï¼’`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `ï¼´ï¼’`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `ï¼´ï¼’`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `ï¼´ï¼’`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `ï¼´ï¼’`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `T3`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `T3`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `T3`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `T3`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `T3`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `T3`; +INSTR(`C1`,'丂') +0 +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼”`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `T5`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `T5`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `T5`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `T5`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `T5`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `T5`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼–`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼–`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼–`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼–`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼–`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼–`; +INSTR(`C1`,'丂') +0 +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼—`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `T8`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `T8`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `T8`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `T8`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `T8`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `T8`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼™`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼™`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼™`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼™`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼™`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼™`; +INSTR(`C1`,'丂') +0 +SELECT INSTR(`C1`,'ï½±') from `T1ï¼`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `T1ï¼`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `T1ï¼`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `T1ï¼`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `T1ï¼`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `T1ï¼`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `T11`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `T11`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `T11`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `T11`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `T11`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `T11`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `T12`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `T12`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `T12`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `T12`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `T12`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `T12`; +INSTR(`C1`,'丂') +0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_join_sjis.result b/mysql-test/suite/jp/r/jp_join_sjis.result new file mode 100644 index 00000000000..a5ccc58ae4c --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_sjis.result @@ -0,0 +1,578 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Pa` CROSS JOIN `‚s‚Pb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚Qa` CROSS JOIN `‚s‚Qb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ra` CROSS JOIN `‚s‚Rb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Sa` CROSS JOIN `‚s‚Sb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚Ta` CROSS JOIN `‚s‚Tb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ua` CROSS JOIN `‚s‚Ub`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Va` CROSS JOIN `‚s‚Vb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚Wa` CROSS JOIN `‚s‚Wb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Xa` CROSS JOIN `‚s‚Xb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚P‚Oa` CROSS JOIN `‚s‚P‚Ob`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +SELECT * FROM `‚s‚P‚Pa` CROSS JOIN `‚s‚P‚Pb`; +‚b‚P ‚b‚P +‚ ‚ +‚© ‚ +‚³ ‚ +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +‚ ‚ +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` CROSS JOIN `‚s‚P‚Qb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/r/jp_join_ucs2.result b/mysql-test/suite/jp/r/jp_join_ucs2.result new file mode 100644 index 00000000000..76988f15cc4 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_ucs2.result @@ -0,0 +1,579 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_join_ujis.result b/mysql-test/suite/jp/r/jp_join_ujis.result new file mode 100644 index 00000000000..ac430cd9b5e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_ujis.result @@ -0,0 +1,578 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_join_utf8.result b/mysql-test/suite/jp/r/jp_join_utf8.result new file mode 100644 index 00000000000..716e97a2bb3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_utf8.result @@ -0,0 +1,578 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); +SELECT * FROM `T1a` JOIN `T1b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1a` INNER JOIN `T1b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1a` JOIN `T1b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1a` INNER JOIN `T1b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1a` CROSS JOIN `T1b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1a` LEFT JOIN `T1b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1a` LEFT JOIN `T1b` ON (`T1a`.`C1` = `T1b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1b` RIGHT JOIN `T1a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T1b` RIGHT JOIN `T1a` ON (`T1a`.`C1` = `T1b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `ï¼´ï¼’a` CROSS JOIN `ï¼´ï¼’b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T3a` JOIN `T3b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T3a` INNER JOIN `T3b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T3a` JOIN `T3b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T3a` INNER JOIN `T3b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T3a` CROSS JOIN `T3b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T3a` LEFT JOIN `T3b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T3a` LEFT JOIN `T3b` ON (`T3a`.`C1` = `T3b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T3b` RIGHT JOIN `T3a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `T3b` RIGHT JOIN `T3a` ON (`T3a`.`C1` = `T3b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼”a` CROSS JOIN `ï¼´ï¼”b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T5a` JOIN `T5b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T5a` INNER JOIN `T5b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T5a` JOIN `T5b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T5a` INNER JOIN `T5b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T5a` CROSS JOIN `T5b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T5a` LEFT JOIN `T5b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T5a` LEFT JOIN `T5b` ON (`T5a`.`C1` = `T5b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T5b` RIGHT JOIN `T5a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T5b` RIGHT JOIN `T5a` ON (`T5a`.`C1` = `T5b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼–a` CROSS JOIN `ï¼´ï¼–b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼—a` CROSS JOIN `ï¼´ï¼—b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T8a` JOIN `T8b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T8a` INNER JOIN `T8b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T8a` JOIN `T8b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T8a` INNER JOIN `T8b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T8a` CROSS JOIN `T8b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T8a` LEFT JOIN `T8b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T8a` LEFT JOIN `T8b` ON (`T8a`.`C1` = `T8b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T8b` RIGHT JOIN `T8a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T8b` RIGHT JOIN `T8a` ON (`T8a`.`C1` = `T8b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼™a` CROSS JOIN `ï¼´ï¼™b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1ï¼a` CROSS JOIN `T1ï¼b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T11a` JOIN `T11b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T11a` INNER JOIN `T11b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T11a` JOIN `T11b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T11a` INNER JOIN `T11b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T11a` CROSS JOIN `T11b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T11a` LEFT JOIN `T11b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T11a` LEFT JOIN `T11b` ON (`T11a`.`C1` = `T11b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T11b` RIGHT JOIN `T11a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T11b` RIGHT JOIN `T11a` ON (`T11a`.`C1` = `T11b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T12a` JOIN `T12b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T12a` INNER JOIN `T12b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T12a` JOIN `T12b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T12a` INNER JOIN `T12b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T12a` CROSS JOIN `T12b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T12a` LEFT JOIN `T12b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T12a` LEFT JOIN `T12b` ON (`T12a`.`C1` = `T12b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T12b` RIGHT JOIN `T12a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `T12b` RIGHT JOIN `T12a` ON (`T12a`.`C1` = `T12b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/r/jp_left_sjis.result b/mysql-test/suite/jp/r/jp_left_sjis.result new file mode 100644 index 00000000000..ae5564186ab --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_sjis.result @@ -0,0 +1,626 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,1) + +‚ ‚ +‚ ‚¢ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤‚¦‚¨ ‚ +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,1) + +‚ ‚ +‚ ‚¢ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤‚¦‚¨ ‚ +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢ ‚ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢ ‚ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_left_ucs2.result b/mysql-test/suite/jp/r/jp_left_ucs2.result new file mode 100644 index 00000000000..349883e9064 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_ucs2.result @@ -0,0 +1,627 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_left_ujis.result b/mysql-test/suite/jp/r/jp_left_ujis.result new file mode 100644 index 00000000000..bd3efc67eec --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_ujis.result @@ -0,0 +1,626 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_left_utf8.result b/mysql-test/suite/jp/r/jp_left_utf8.result new file mode 100644 index 00000000000..62cca976fe0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_utf8.result @@ -0,0 +1,626 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, LEFT(`C1`,0) FROM `T1`; +C1 LEFT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, LEFT(`C1`,1) FROM `T1`; +C1 LEFT(`C1`,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, LEFT(`C1`,2) FROM `T1`; +C1 LEFT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, LEFT(`C1`,3) FROM `T1`; +C1 LEFT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, LEFT(`C1`,4) FROM `T1`; +C1 LEFT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, LEFT(`C1`,5) FROM `T1`; +C1 LEFT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,0) FROM `T3`; +C1 LEFT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,1) FROM `T3`; +C1 LEFT(`C1`,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, LEFT(`C1`,2) FROM `T3`; +C1 LEFT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, LEFT(`C1`,3) FROM `T3`; +C1 LEFT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, LEFT(`C1`,4) FROM `T3`; +C1 LEFT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, LEFT(`C1`,5) FROM `T3`; +C1 LEFT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, LEFT(`C1`,0) FROM `T5`; +C1 LEFT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,1) FROM `T5`; +C1 LEFT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, LEFT(`C1`,2) FROM `T5`; +C1 LEFT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, LEFT(`C1`,3) FROM `T5`; +C1 LEFT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, LEFT(`C1`,4) FROM `T5`; +C1 LEFT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, LEFT(`C1`,5) FROM `T5`; +C1 LEFT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,0) FROM `T8`; +C1 LEFT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, LEFT(`C1`,1) FROM `T8`; +C1 LEFT(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,2) FROM `T8`; +C1 LEFT(`C1`,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,3) FROM `T8`; +C1 LEFT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,4) FROM `T8`; +C1 LEFT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,5) FROM `T8`; +C1 LEFT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,0) FROM `T1ï¼`; +C1 LEFT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, LEFT(`C1`,1) FROM `T1ï¼`; +C1 LEFT(`C1`,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,2) FROM `T1ï¼`; +C1 LEFT(`C1`,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,3) FROM `T1ï¼`; +C1 LEFT(`C1`,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,4) FROM `T1ï¼`; +C1 LEFT(`C1`,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,5) FROM `T1ï¼`; +C1 LEFT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,0) FROM `T11`; +C1 LEFT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, LEFT(`C1`,1) FROM `T11`; +C1 LEFT(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,2) FROM `T11`; +C1 LEFT(`C1`,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,3) FROM `T11`; +C1 LEFT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,4) FROM `T11`; +C1 LEFT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,5) FROM `T11`; +C1 LEFT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,0) FROM `T12`; +C1 LEFT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, LEFT(`C1`,1) FROM `T12`; +C1 LEFT(`C1`,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,2) FROM `T12`; +C1 LEFT(`C1`,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,3) FROM `T12`; +C1 LEFT(`C1`,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,4) FROM `T12`; +C1 LEFT(`C1`,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,5) FROM `T12`; +C1 LEFT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_length_sjis.result b/mysql-test/suite/jp/r/jp_length_sjis.result new file mode 100644 index 00000000000..51055e09233 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P`; +‚b‚P LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚Q`; +‚b‚P LENGTH(`‚b‚P`) + 0 +‚ 2 +‚ ‚¢ 4 +‚ ‚¢‚¤ 6 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤‚¦‚¨ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚R`; +‚b‚P LENGTH(`‚b‚P`) + 0 +ƒ\ 2 +ƒ\\ 4 +ƒ\\•\ 6 +ƒ\\•\—\ 8 +ƒ\\•\—\\ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚S`; +‚b‚P LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚T`; +‚b‚P LENGTH(`‚b‚P`) + 0 +‚ 2 +‚ ‚¢ 4 +‚ ‚¢‚¤ 6 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤‚¦‚¨ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚U`; +‚b‚P LENGTH(`‚b‚P`) + 0 +ƒ\ 2 +ƒ\\ 4 +ƒ\\•\ 6 +ƒ\\•\—\ 8 +ƒ\\•\—\\ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚V`; +‚b‚P LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚W`; +‚b‚P LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 10 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤ 6 +‚ ‚¢ 4 +‚ 2 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚X`; +‚b‚P LENGTH(`‚b‚P`) +ƒ\\•\—\\ 10 +ƒ\\•\—\ 8 +ƒ\\•\ 6 +ƒ\\ 4 +ƒ\ 2 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 10 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤ 6 +‚ ‚¢ 4 +‚ 2 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P LENGTH(`‚b‚P`) +ƒ\\•\—\\ 10 +ƒ\\•\—\ 8 +ƒ\\•\ 6 +ƒ\\ 4 +ƒ\ 2 + 0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_length_ucs2.result b/mysql-test/suite/jp/r/jp_length_ucs2.result new file mode 100644 index 00000000000..569e012f7d3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 2 +íÜíÝ 4 +íÜíÝíÞ 6 +íÜíÝíÞíß 8 +íÜíÝíÞíßíà 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 2 +íÜíÝ 4 +íÜíÝíÞ 6 +íÜíÝíÞíß 8 +íÜíÝíÞíßíà 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 10 +íÜíÝíÞíß 8 +íÜíÝíÞ 6 +íÜíÝ 4 +íÜ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 10 +íÜíÝíÞíß 8 +íÜíÝíÞ 6 +íÜíÝ 4 +íÜ 2 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_length_ujis.result b/mysql-test/suite/jp/r/jp_length_ujis.result new file mode 100644 index 00000000000..288cc06a2ef --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 3 +íÜíÝ 6 +íÜíÝíÞ 9 +íÜíÝíÞíß 12 +íÜíÝíÞíßíà 15 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 3 +íÜíÝ 6 +íÜíÝíÞ 9 +íÜíÝíÞíß 12 +íÜíÝíÞíßíà 15 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 15 +íÜíÝíÞíß 12 +íÜíÝíÞ 9 +íÜíÝ 6 +íÜ 3 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 15 +íÜíÝíÞíß 12 +íÜíÝíÞ 9 +íÜíÝ 6 +íÜ 3 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_length_utf8.result b/mysql-test/suite/jp/r/jp_length_utf8.result new file mode 100644 index 00000000000..11b4c523053 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, LENGTH(`C1`) FROM `T1`; +C1 LENGTH(`C1`) + 0 +ï½± 3 +アイ 6 +アイウ 9 +アイウエ 12 +アイウエオ 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼’`; +C1 LENGTH(`C1`) + 0 +ã‚ 3 +ã‚ã„ 6 +ã‚ã„ㆠ9 +ã‚ã„ã†ãˆ 12 +ã‚ã„ã†ãˆãŠ 15 +SELECT `C1`, LENGTH(`C1`) FROM `T3`; +C1 LENGTH(`C1`) + 0 +é¾” 3 +龔龖 6 +龔龖龗 9 +龔龖龗龞 12 +龔龖龗龞龡 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼”`; +C1 LENGTH(`C1`) + 0 +ï½± 3 +アイ 6 +アイウ 9 +アイウエ 12 +アイウエオ 15 +SELECT `C1`, LENGTH(`C1`) FROM `T5`; +C1 LENGTH(`C1`) + 0 +ã‚ 3 +ã‚ã„ 6 +ã‚ã„ㆠ9 +ã‚ã„ã†ãˆ 12 +ã‚ã„ã†ãˆãŠ 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼–`; +C1 LENGTH(`C1`) + 0 +é¾” 3 +龔龖 6 +龔龖龗 9 +龔龖龗龞 12 +龔龖龗龞龡 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼—`; +C1 LENGTH(`C1`) +アイウエオ 15 +アイウエ 12 +アイウ 9 +アイ 6 +ï½± 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T8`; +C1 LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 15 +ã‚ã„ã†ãˆ 12 +ã‚ã„ㆠ9 +ã‚ã„ 6 +ã‚ 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼™`; +C1 LENGTH(`C1`) +龔龖龗龞龡 15 +龔龖龗龞 12 +龔龖龗 9 +龔龖 6 +é¾” 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T1ï¼`; +C1 LENGTH(`C1`) +アイウエオ 15 +アイウエ 12 +アイウ 9 +アイ 6 +ï½± 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T11`; +C1 LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 15 +ã‚ã„ã†ãˆ 12 +ã‚ã„ㆠ9 +ã‚ã„ 6 +ã‚ 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T12`; +C1 LENGTH(`C1`) +龔龖龗龞龡 15 +龔龖龗龞 12 +龔龖龗 9 +龔龖 6 +é¾” 3 + 0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_like_sjis.result b/mysql-test/suite/jp/r/jp_like_sjis.result new file mode 100644 index 00000000000..a8145fb08f0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_sjis.result @@ -0,0 +1,322 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_like_ucs2.result b/mysql-test/suite/jp/r/jp_like_ucs2.result new file mode 100644 index 00000000000..229ef12a118 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_ucs2.result @@ -0,0 +1,419 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_like_ujis.result b/mysql-test/suite/jp/r/jp_like_ujis.result new file mode 100644 index 00000000000..5d623df0384 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_ujis.result @@ -0,0 +1,322 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_like_utf8.result b/mysql-test/suite/jp/r/jp_like_utf8.result new file mode 100644 index 00000000000..bf48da79951 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_utf8.result @@ -0,0 +1,319 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT * FROM `T1` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `T1` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `T1` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `T1` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `T1` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T1` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T1` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T3` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T5` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `T5` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `T5` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `T5` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `T5` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T8` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `T8` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `T8` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `T8` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `T8` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T1ï¼` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `T1ï¼` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T11` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `T11` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `T11` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +SELECT * FROM `T11` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `T12` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T12` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T12` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_locate_sjis.result b/mysql-test/suite/jp/r/jp_locate_sjis.result new file mode 100644 index 00000000000..b2455401db8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_sjis.result @@ -0,0 +1,264 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚R`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚R`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚R`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚R`; +LOCATE('‰\',`‚b‚P`) +0 +SELECT LOCATE('±',`‚b‚P`) from `‚s‚S`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚S`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚S`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚S`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚S`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚S`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚T`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚T`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚U`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚U`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚U`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚U`; +LOCATE('‰\',`‚b‚P`) +0 +SELECT LOCATE('±',`‚b‚P`) from `‚s‚V`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚V`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚V`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚V`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚V`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚V`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚W`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚W`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚X`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚X`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚X`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚X`; +LOCATE('‰\',`‚b‚P`) +0 +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('‰\',`‚b‚P`) +0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_locate_ucs2.result b/mysql-test/suite/jp/r/jp_locate_ucs2.result new file mode 100644 index 00000000000..37b219b3335 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_ucs2.result @@ -0,0 +1,265 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; +LOCATE('°¡',`£Ã£±`) +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_locate_ujis.result b/mysql-test/suite/jp/r/jp_locate_ujis.result new file mode 100644 index 00000000000..d139fa9203c --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_ujis.result @@ -0,0 +1,264 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; +LOCATE('°¡',`£Ã£±`) +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_locate_utf8.result b/mysql-test/suite/jp/r/jp_locate_utf8.result new file mode 100644 index 00000000000..a1ce9e8d2dc --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_utf8.result @@ -0,0 +1,264 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT LOCATE('ï½±',`C1`) from `T1`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `T1`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `T1`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `T1`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `T1`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `T1`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `ï¼´ï¼’`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `ï¼´ï¼’`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `ï¼´ï¼’`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `ï¼´ï¼’`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `ï¼´ï¼’`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `ï¼´ï¼’`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `T3`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `T3`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `T3`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `T3`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `T3`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `T3`; +LOCATE('丂',`C1`) +0 +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼”`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `T5`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `T5`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `T5`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `T5`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `T5`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `T5`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼–`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼–`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼–`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼–`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼–`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼–`; +LOCATE('丂',`C1`) +0 +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼—`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `T8`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `T8`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `T8`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `T8`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `T8`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `T8`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼™`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼™`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼™`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼™`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼™`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼™`; +LOCATE('丂',`C1`) +0 +SELECT LOCATE('ï½±',`C1`) from `T1ï¼`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `T1ï¼`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `T1ï¼`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `T1ï¼`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `T1ï¼`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `T1ï¼`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `T11`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `T11`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `T11`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `T11`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `T11`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `T11`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `T12`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `T12`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `T12`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `T12`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `T12`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `T12`; +LOCATE('丂',`C1`) +0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_lpad_sjis.result b/mysql-test/suite/jp/r/jp_lpad_sjis.result new file mode 100644 index 00000000000..b45427ebf3d --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +‚b‚P LPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ¡¡¡¡± +±² ¡¡¡±² +±²³ ¡¡±²³ +±²³´ ¡±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚ ‚w‚w‚w‚w‚ +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; +‚b‚P LPAD(`‚b‚P`,5,'–\') + –\–\–\–\–\ +ƒ\ –\–\–\–\ƒ\ +ƒ\\ –\–\–\ƒ\\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +‚b‚P LPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ¡¡¡¡± +±² ¡¡¡±² +±²³ ¡¡±²³ +±²³´ ¡±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚ ‚w‚w‚w‚w‚ +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; +‚b‚P LPAD(`‚b‚P`,5,'–\' ) + –\–\–\–\–\ +ƒ\ –\–\–\–\ƒ\ +ƒ\\ –\–\–\ƒ\\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +‚b‚P LPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ¡±²³´ +±²³ ¡¡±²³ +±² ¡¡¡±² +± ¡¡¡¡± + ¡¡¡¡¡ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚ ‚w‚w‚w‚w‚ + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; +‚b‚P LPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\ –\–\–\ƒ\\ +ƒ\ –\–\–\–\ƒ\ + –\–\–\–\–\ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +‚b‚P LPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ¡±²³´ +±²³ ¡¡±²³ +±² ¡¡¡±² +± ¡¡¡¡± + ¡¡¡¡¡ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚ ‚w‚w‚w‚w‚ + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; +‚b‚P LPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\ –\–\–\ƒ\\ +ƒ\ –\–\–\–\ƒ\ + –\–\–\–\–\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_lpad_ucs2.result b/mysql-test/suite/jp/r/jp_lpad_ucs2.result new file mode 100644 index 00000000000..951c5508a8f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± LPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_lpad_ujis.result b/mysql-test/suite/jp/r/jp_lpad_ujis.result new file mode 100644 index 00000000000..945e513d066 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± LPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_lpad_utf8.result b/mysql-test/suite/jp/r/jp_lpad_utf8.result new file mode 100644 index 00000000000..8a3bae0153e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1`; +C1 LPAD(`C1`,5,'。') + 。。。。。 +ï½± 。。。。ア +アイ 。。。アイ +アイウ 。。アイウ +アイウエ 。アイウエ +アイウエオ アイウエオ +SELECT `C1`, LPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +C1 LPAD(`C1`,5,'X') + XXXXX +゠XXXX゠+ã‚ㄠXXXã‚ã„ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LPAD(`C1`,5,'丄') FROM `T3`; +C1 LPAD(`C1`,5,'丄') + 丄丄丄丄丄 +é¾” 丄丄丄丄龔 +龔龖 丄丄丄龔龖 +龔龖龗 丄丄龔龖龗 +龔龖龗龞 丄龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +C1 LPAD(`C1`,5,'。') + 。。。。。 +ï½± 。。。。ア +アイ 。。。アイ +アイウ 。。アイウ +アイウエ 。アイウエ +アイウエオ アイウエオ +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T5`; +C1 LPAD(`C1`,5,'X') + XXXXX +゠XXXX゠+ã‚ㄠXXXã‚ã„ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; +C1 LPAD(`C1`,5,'丄' ) + 丄丄丄丄丄 +é¾” 丄丄丄丄龔 +龔龖 丄丄丄龔龖 +龔龖龗 丄丄龔龖龗 +龔龖龗龞 丄龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +C1 LPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ 。アイウエ +アイウ 。。アイウ +アイ 。。。アイ +ï½± 。。。。ア + 。。。。。 +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T8`; +C1 LPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ㄠXXXã‚ã„ +゠XXXX゠+ XXXXX +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; +C1 LPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 丄龔龖龗龞 +龔龖龗 丄丄龔龖龗 +龔龖 丄丄丄龔龖 +é¾” 丄丄丄丄龔 + 丄丄丄丄丄 +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1ï¼`; +C1 LPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ 。アイウエ +アイウ 。。アイウ +アイ 。。。アイ +ï½± 。。。。ア + 。。。。。 +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T11`; +C1 LPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ㄠXXXã‚ã„ +゠XXXX゠+ XXXXX +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `T12`; +C1 LPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 丄龔龖龗龞 +龔龖龗 丄丄龔龖龗 +龔龖 丄丄丄龔龖 +é¾” 丄丄丄丄龔 + 丄丄丄丄丄 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_sjis.result b/mysql-test/suite/jp/r/jp_ltrim_sjis.result new file mode 100644 index 00000000000..23032d65c56 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_sjis.result @@ -0,0 +1,228 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@@ƒ\\•\—\\'); +SELECT LTRIM(`‚b‚P`) from `‚s‚P`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +@@@±²³´µ +@@±²³´µ +@±²³´µ +±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚Q`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚R`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@@@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@ƒ\\•\—\\ +ƒ\\•\—\\ +SELECT LTRIM(`‚b‚P`) from `‚s‚S`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +@@@±²³´µ +@@±²³´µ +@±²³´µ +±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚T`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚U`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@@@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@ƒ\\•\—\\ +ƒ\\•\—\\ +SELECT LTRIM(`‚b‚P`) from `‚s‚V`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +@±²³´µ +@@±²³´µ +@@@±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚W`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚X`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@@@ƒ\\•\—\\ +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚O`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +@±²³´µ +@@±²³´µ +@@@±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚P`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚Q`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@@@ƒ\\•\—\\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_ucs2.result b/mysql-test/suite/jp/r/jp_ltrim_ucs2.result new file mode 100644 index 00000000000..533cf95a976 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_ucs2.result @@ -0,0 +1,229 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡Ž±Ž²Ž³Ž´Žµ +ޱ޲޳޴޵ +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡Ž±Ž²Ž³Ž´Žµ +ޱ޲޳޴޵ +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_ujis.result b/mysql-test/suite/jp/r/jp_ltrim_ujis.result new file mode 100644 index 00000000000..1c95f28907f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_ujis.result @@ -0,0 +1,228 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_utf8.result b/mysql-test/suite/jp/r/jp_ltrim_utf8.result new file mode 100644 index 00000000000..c6fae7233f1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_utf8.result @@ -0,0 +1,228 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES ('  アイウエオ'); +INSERT INTO `T1` VALUES ('   アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('   アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('   アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('   龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('  アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('   アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('   龔龖龗龞龡'); +SELECT LTRIM(`C1`) from `T1`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +   アイウエオ +  アイウエオ + アイウエオ +アイウエオ +SELECT LTRIM(`C1`) from `ï¼´ï¼’`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `T3`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +   龔龖龗龞龡 +  龔龖龗龞龡 + 龔龖龗龞龡 +龔龖龗龞龡 +SELECT LTRIM(`C1`) from `ï¼´ï¼”`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +   アイウエオ +  アイウエオ + アイウエオ +アイウエオ +SELECT LTRIM(`C1`) from `T5`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `ï¼´ï¼–`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +   龔龖龗龞龡 +  龔龖龗龞龡 + 龔龖龗龞龡 +龔龖龗龞龡 +SELECT LTRIM(`C1`) from `ï¼´ï¼—`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ + アイウエオ +  アイウエオ +   アイウエオ +SELECT LTRIM(`C1`) from `T8`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `ï¼´ï¼™`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 + 龔龖龗龞龡 +  龔龖龗龞龡 +   龔龖龗龞龡 +SELECT LTRIM(`C1`) from `T1ï¼`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ + アイウエオ +  アイウエオ +   アイウエオ +SELECT LTRIM(`C1`) from `T11`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `T12`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 + 龔龖龗龞龡 +  龔龖龗龞龡 +   龔龖龗龞龡 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_ps_sjis.result b/mysql-test/suite/jp/r/jp_ps_sjis.result new file mode 100644 index 00000000000..2397bc78c5b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ps_sjis.result @@ -0,0 +1,896 @@ +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\'); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +‚ +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚ +‚ +‚ +‚ +‚ +‚ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +‚ +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚ +‚ +‚ +‚ +‚ +‚ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE =HEAP; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +‚ +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚ +‚ +‚ +‚ +‚ +‚ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚ +‚ +‚ +‚ +‚ +‚ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚ •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚ +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/r/jp_ps_ujis.result b/mysql-test/suite/jp/r/jp_ps_ujis.result new file mode 100644 index 00000000000..9afef7f76d1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ps_ujis.result @@ -0,0 +1,896 @@ +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ'); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +¤¢ +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +¤¢ +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE =HEAP; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +¤¢ +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/r/jp_replace_sjis.result b/mysql-test/suite/jp/r/jp_replace_sjis.result new file mode 100644 index 00000000000..08e45968fdd --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_sjis.result @@ -0,0 +1,230 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_replace_ucs2.result b/mysql-test/suite/jp/r/jp_replace_ucs2.result new file mode 100644 index 00000000000..2911fe69b9a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_ucs2.result @@ -0,0 +1,231 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_replace_ujis.result b/mysql-test/suite/jp/r/jp_replace_ujis.result new file mode 100644 index 00000000000..7f776804ee9 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_ujis.result @@ -0,0 +1,230 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_replace_utf8.result b/mysql-test/suite/jp/r/jp_replace_utf8.result new file mode 100644 index 00000000000..16981fcd0d8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_utf8.result @@ -0,0 +1,230 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T3`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T3`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T3`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T3`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T3`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T5`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T5`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T5`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T5`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T5`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T8`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T8`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T8`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T8`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T8`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1ï¼`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1ï¼`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1ï¼`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1ï¼`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1ï¼`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T11`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T11`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T11`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T11`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T11`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T12`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T12`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T12`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T12`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T12`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_reverse_sjis.result b/mysql-test/suite/jp/r/jp_reverse_sjis.result new file mode 100644 index 00000000000..76cf9d6b571 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_sjis.result @@ -0,0 +1,86 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚Q`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚R`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚S`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚T`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚U`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚V`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚W`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚X`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚O`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚P`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚Q`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_reverse_ucs2.result b/mysql-test/suite/jp/r/jp_reverse_ucs2.result new file mode 100644 index 00000000000..ad9782d5048 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_ucs2.result @@ -0,0 +1,87 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_reverse_ujis.result b/mysql-test/suite/jp/r/jp_reverse_ujis.result new file mode 100644 index 00000000000..888f7f9e054 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_ujis.result @@ -0,0 +1,86 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_reverse_utf8.result b/mysql-test/suite/jp/r/jp_reverse_utf8.result new file mode 100644 index 00000000000..4e02cf69645 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_utf8.result @@ -0,0 +1,86 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT REVERSE(`C1`) FROM `T1`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `ï¼´ï¼’`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `T3`; +REVERSE(`C1`) +龡龞龗龖龔 +SELECT REVERSE(`C1`) FROM `ï¼´ï¼”`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `T5`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `ï¼´ï¼–`; +REVERSE(`C1`) +龡龞龗龖龔 +SELECT REVERSE(`C1`) FROM `ï¼´ï¼—`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `T8`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `ï¼´ï¼™`; +REVERSE(`C1`) +龡龞龗龖龔 +SELECT REVERSE(`C1`) FROM `T1ï¼`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `T11`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `T12`; +REVERSE(`C1`) +龡龞龗龖龔 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_right_sjis.result b/mysql-test/suite/jp/r/jp_right_sjis.result new file mode 100644 index 00000000000..249d7bbb0bc --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_sjis.result @@ -0,0 +1,626 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,1) + +± ± +±² ² +±²³ ³ +±²³´ ´ +±²³´µ µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ²³ +±²³´ ³´ +±²³´µ ´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ²³´ +±²³´µ ³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,1) + +‚ ‚ +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ \ +ƒ\\•\ •\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ \•\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,1) + +± ± +±² ² +±²³ ³ +±²³´ ´ +±²³´µ µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ²³ +±²³´ ³´ +±²³´µ ´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ²³´ +±²³´µ ³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,1) + +‚ ‚ +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ \ +ƒ\\•\ •\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ \•\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,1) +±²³´µ µ +±²³´ ´ +±²³ ³ +±² ² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,2) +±²³´µ ´µ +±²³´ ³´ +±²³ ²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,4) +±²³´µ ²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,1) +ƒ\\•\—\\ \ +ƒ\\•\—\ —\ +ƒ\\•\ •\ +ƒ\\ \ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,2) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ \•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,4) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,1) +±²³´µ µ +±²³´ ´ +±²³ ³ +±² ² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,2) +±²³´µ ´µ +±²³´ ³´ +±²³ ²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,4) +±²³´µ ²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,1) +ƒ\\•\—\\ \ +ƒ\\•\—\ —\ +ƒ\\•\ •\ +ƒ\\ \ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,2) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ \•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,4) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_right_ucs2.result b/mysql-test/suite/jp/r/jp_right_ucs2.result new file mode 100644 index 00000000000..a8a3fba0f92 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_ucs2.result @@ -0,0 +1,627 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_right_ujis.result b/mysql-test/suite/jp/r/jp_right_ujis.result new file mode 100644 index 00000000000..bb182853d95 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_ujis.result @@ -0,0 +1,626 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_right_utf8.result b/mysql-test/suite/jp/r/jp_right_utf8.result new file mode 100644 index 00000000000..50ba18ce3c4 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_utf8.result @@ -0,0 +1,626 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, RIGHT(`C1`,0) FROM `T1`; +C1 RIGHT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, RIGHT(`C1`,1) FROM `T1`; +C1 RIGHT(`C1`,1) + +ï½± ï½± +アイ ï½² +アイウ ï½³ +アイウエ ï½´ +アイウエオ ï½µ +SELECT `C1`, RIGHT(`C1`,2) FROM `T1`; +C1 RIGHT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ イウ +アイウエ ウエ +アイウエオ ï½´ï½µ +SELECT `C1`, RIGHT(`C1`,3) FROM `T1`; +C1 RIGHT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ イウエ +アイウエオ ウエオ +SELECT `C1`, RIGHT(`C1`,4) FROM `T1`; +C1 RIGHT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ イウエオ +SELECT `C1`, RIGHT(`C1`,5) FROM `T1`; +C1 RIGHT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,0) FROM `T3`; +C1 RIGHT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,1) FROM `T3`; +C1 RIGHT(`C1`,1) + +é¾” é¾” +龔龖 é¾– +龔龖龗 é¾— +龔龖龗龞 龞 +龔龖龗龞龡 龡 +SELECT `C1`, RIGHT(`C1`,2) FROM `T3`; +C1 RIGHT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 é¾–é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, RIGHT(`C1`,3) FROM `T3`; +C1 RIGHT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, RIGHT(`C1`,4) FROM `T3`; +C1 RIGHT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,5) FROM `T3`; +C1 RIGHT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,1) + +ï½± ï½± +アイ ï½² +アイウ ï½³ +アイウエ ï½´ +アイウエオ ï½µ +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ イウ +アイウエ ウエ +アイウエオ ï½´ï½µ +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ イウエ +アイウエオ ウエオ +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ イウエオ +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, RIGHT(`C1`,0) FROM `T5`; +C1 RIGHT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,1) FROM `T5`; +C1 RIGHT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, RIGHT(`C1`,2) FROM `T5`; +C1 RIGHT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, RIGHT(`C1`,3) FROM `T5`; +C1 RIGHT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,4) FROM `T5`; +C1 RIGHT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,5) FROM `T5`; +C1 RIGHT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,1) + +é¾” é¾” +龔龖 é¾– +龔龖龗 é¾— +龔龖龗龞 龞 +龔龖龗龞龡 龡 +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 é¾–é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,1) +アイウエオ ï½µ +アイウエ ï½´ +アイウ ï½³ +アイ ï½² +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,2) +アイウエオ ï½´ï½µ +アイウエ ウエ +アイウ イウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,3) +アイウエオ ウエオ +アイウエ イウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,4) +アイウエオ イウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,0) FROM `T8`; +C1 RIGHT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, RIGHT(`C1`,1) FROM `T8`; +C1 RIGHT(`C1`,1) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠㆠ+ã‚ã„ ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,2) FROM `T8`; +C1 RIGHT(`C1`,2) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,3) FROM `T8`; +C1 RIGHT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,4) FROM `T8`; +C1 RIGHT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,5) FROM `T8`; +C1 RIGHT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,1) +龔龖龗龞龡 龡 +龔龖龗龞 龞 +龔龖龗 é¾— +龔龖 é¾– +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,2) +龔龖龗龞龡 龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾–é¾— +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,4) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,0) FROM `T1ï¼`; +C1 RIGHT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, RIGHT(`C1`,1) FROM `T1ï¼`; +C1 RIGHT(`C1`,1) +アイウエオ ï½µ +アイウエ ï½´ +アイウ ï½³ +アイ ï½² +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,2) FROM `T1ï¼`; +C1 RIGHT(`C1`,2) +アイウエオ ï½´ï½µ +アイウエ ウエ +アイウ イウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,3) FROM `T1ï¼`; +C1 RIGHT(`C1`,3) +アイウエオ ウエオ +アイウエ イウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,4) FROM `T1ï¼`; +C1 RIGHT(`C1`,4) +アイウエオ イウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,5) FROM `T1ï¼`; +C1 RIGHT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,0) FROM `T11`; +C1 RIGHT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, RIGHT(`C1`,1) FROM `T11`; +C1 RIGHT(`C1`,1) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠㆠ+ã‚ã„ ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,2) FROM `T11`; +C1 RIGHT(`C1`,2) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,3) FROM `T11`; +C1 RIGHT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,4) FROM `T11`; +C1 RIGHT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,5) FROM `T11`; +C1 RIGHT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,0) FROM `T12`; +C1 RIGHT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, RIGHT(`C1`,1) FROM `T12`; +C1 RIGHT(`C1`,1) +龔龖龗龞龡 龡 +龔龖龗龞 龞 +龔龖龗 é¾— +龔龖 é¾– +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,2) FROM `T12`; +C1 RIGHT(`C1`,2) +龔龖龗龞龡 龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾–é¾— +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,3) FROM `T12`; +C1 RIGHT(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,4) FROM `T12`; +C1 RIGHT(`C1`,4) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,5) FROM `T12`; +C1 RIGHT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_rpad_sjis.result b/mysql-test/suite/jp/r/jp_rpad_sjis.result new file mode 100644 index 00000000000..9c61c200672 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +‚b‚P RPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ±¡¡¡¡ +±² ±²¡¡¡ +±²³ ±²³¡¡ +±²³´ ±²³´¡ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚ ‚ ‚w‚w‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; +‚b‚P RPAD(`‚b‚P`,5,'–\') + –\–\–\–\–\ +ƒ\ ƒ\–\–\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +‚b‚P RPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ±¡¡¡¡ +±² ±²¡¡¡ +±²³ ±²³¡¡ +±²³´ ±²³´¡ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚ ‚ ‚w‚w‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; +‚b‚P RPAD(`‚b‚P`,5,'–\' ) + –\–\–\–\–\ +ƒ\ ƒ\–\–\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +‚b‚P RPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ±²³´¡ +±²³ ±²³¡¡ +±² ±²¡¡¡ +± ±¡¡¡¡ + ¡¡¡¡¡ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚ ‚ ‚w‚w‚w‚w + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; +‚b‚P RPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\ ƒ\–\–\–\–\ + –\–\–\–\–\ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +‚b‚P RPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ±²³´¡ +±²³ ±²³¡¡ +±² ±²¡¡¡ +± ±¡¡¡¡ + ¡¡¡¡¡ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚ ‚ ‚w‚w‚w‚w + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; +‚b‚P RPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\ ƒ\–\–\–\–\ + –\–\–\–\–\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_rpad_ucs2.result b/mysql-test/suite/jp/r/jp_rpad_ucs2.result new file mode 100644 index 00000000000..b9df4cf6783 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± RPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rpad_ujis.result b/mysql-test/suite/jp/r/jp_rpad_ujis.result new file mode 100644 index 00000000000..3183b4f5fcd --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± RPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rpad_utf8.result b/mysql-test/suite/jp/r/jp_rpad_utf8.result new file mode 100644 index 00000000000..c482a058bd8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1`; +C1 RPAD(`C1`,5,'。') + 。。。。。 +ï½± ア。。。。 +アイ アイ。。。 +アイウ アイウ。。 +アイウエ アイウエ。 +アイウエオ アイウエオ +SELECT `C1`, RPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +C1 RPAD(`C1`,5,'X') + XXXXX +ã‚ ã‚XXXX +ã‚ã„ ã‚ã„XXX +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RPAD(`C1`,5,'丄') FROM `T3`; +C1 RPAD(`C1`,5,'丄') + 丄丄丄丄丄 +é¾” 龔丄丄丄丄 +龔龖 龔龖丄丄丄 +龔龖龗 龔龖龗丄丄 +龔龖龗龞 龔龖龗龞丄 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +C1 RPAD(`C1`,5,'。') + 。。。。。 +ï½± ア。。。。 +アイ アイ。。。 +アイウ アイウ。。 +アイウエ アイウエ。 +アイウエオ アイウエオ +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T5`; +C1 RPAD(`C1`,5,'X') + XXXXX +ã‚ ã‚XXXX +ã‚ã„ ã‚ã„XXX +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; +C1 RPAD(`C1`,5,'丄' ) + 丄丄丄丄丄 +é¾” 龔丄丄丄丄 +龔龖 龔龖丄丄丄 +龔龖龗 龔龖龗丄丄 +龔龖龗龞 龔龖龗龞丄 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +C1 RPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ アイウエ。 +アイウ アイウ。。 +アイ アイ。。。 +ï½± ア。。。。 + 。。。。。 +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T8`; +C1 RPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ ã‚ã„XXX +ã‚ ã‚XXXX + XXXXX +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; +C1 RPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞丄 +龔龖龗 龔龖龗丄丄 +龔龖 龔龖丄丄丄 +é¾” 龔丄丄丄丄 + 丄丄丄丄丄 +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1ï¼`; +C1 RPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ アイウエ。 +アイウ アイウ。。 +アイ アイ。。。 +ï½± ア。。。。 + 。。。。。 +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T11`; +C1 RPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ ã‚ã„XXX +ã‚ ã‚XXXX + XXXXX +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `T12`; +C1 RPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞丄 +龔龖龗 龔龖龗丄丄 +龔龖 龔龖丄丄丄 +é¾” 龔丄丄丄丄 + 丄丄丄丄丄 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_sjis.result b/mysql-test/suite/jp/r/jp_rtrim_sjis.result new file mode 100644 index 00000000000..01ab173c982 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_sjis.result @@ -0,0 +1,228 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@@'); +SELECT RTRIM(`‚b‚P`) from `‚s‚P`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚Q`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚R`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚S`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚T`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚U`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚V`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚W`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚X`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚O`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚P`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚Q`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_ucs2.result b/mysql-test/suite/jp/r/jp_rtrim_ucs2.result new file mode 100644 index 00000000000..905f5bef08f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_ucs2.result @@ -0,0 +1,229 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_ujis.result b/mysql-test/suite/jp/r/jp_rtrim_ujis.result new file mode 100644 index 00000000000..84b141c16dc --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_ujis.result @@ -0,0 +1,228 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_utf8.result b/mysql-test/suite/jp/r/jp_rtrim_utf8.result new file mode 100644 index 00000000000..09d719f3386 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_utf8.result @@ -0,0 +1,228 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ  '); +INSERT INTO `T1` VALUES ('アイウエオ   '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ   '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ   '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡   '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ  '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ   '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡   '); +SELECT RTRIM(`C1`) from `T1`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `ï¼´ï¼’`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `T3`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +SELECT RTRIM(`C1`) from `ï¼´ï¼”`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `T5`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `ï¼´ï¼–`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +SELECT RTRIM(`C1`) from `ï¼´ï¼—`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `T8`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `ï¼´ï¼™`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +SELECT RTRIM(`C1`) from `T1ï¼`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `T11`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `T12`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_select_sjis.result b/mysql-test/suite/jp/r/jp_select_sjis.result new file mode 100644 index 00000000000..d48d08d745f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_sjis.result @@ -0,0 +1,382 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT * FROM `‚s‚P`; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚Q`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT * FROM `‚s‚R`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚S`; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬®¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚T`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT * FROM `‚s‚U`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚V`; +‚b‚P + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚W`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +SELECT * FROM `‚s‚X`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚O`; +‚b‚P + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚P‚P`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +SELECT * FROM `‚s‚P‚Q`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_select_ucs2.result b/mysql-test/suite/jp/r/jp_select_ucs2.result new file mode 100644 index 00000000000..39d057ed107 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_ucs2.result @@ -0,0 +1,227 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT * FROM `£Ô£±`; +c1 + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£²`; +c1 +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT * FROM `£Ô£³`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT * FROM `£Ô£´`; +c1 + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£µ`; +c1 +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT * FROM `£Ô£¶`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT * FROM `£Ô£·`; +c1 +PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£¸`; +c1 +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT * FROM `£Ô£¹`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT * FROM `£Ô£±£°`; +c1 +PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£±`; +c1 +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +SELECT * FROM `£Ô£±£²`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_select_ujis.result b/mysql-test/suite/jp/r/jp_select_ujis.result new file mode 100644 index 00000000000..3eea73c8083 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_ujis.result @@ -0,0 +1,538 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT * FROM `£Ô£±`; +c1 + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£²`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£³`; +c1 +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£´`; +c1 + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£µ`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£¶`; +c1 +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£·`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£¸`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£¹`; +c1 +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£±£°`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£±`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£±£²`; +c1 +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_select_utf8.result b/mysql-test/suite/jp/r/jp_select_utf8.result new file mode 100644 index 00000000000..43704ad2f6e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_utf8.result @@ -0,0 +1,538 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT * FROM `T1`; +c1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `ï¼´ï¼’`; +c1 +θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT * FROM `T3`; +c1 +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûÅǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áà äâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT * FROM `ï¼´ï¼”`; +c1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T5`; +c1 +θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガã‚ギクグケゲコ +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT * FROM `ï¼´ï¼–`; +c1 +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûÅǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áà äâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT * FROM `ï¼´ï¼—`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T8`; +c1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +SELECT * FROM `ï¼´ï¼™`; +c1 +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûÅǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +SELECT * FROM `T1ï¼`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T11`; +c1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +SELECT * FROM `T12`; +c1 +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûÅǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/r/jp_subquery_sjis.result b/mysql-test/suite/jp/r/jp_subquery_sjis.result new file mode 100644 index 00000000000..b94de3630af --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_sjis.result @@ -0,0 +1,206 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Pb`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Qb`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Rb`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P +\ +•\ +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Sb`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Tb`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Ub`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P +\ +•\ +SELECT `‚b‚P` FROM `‚s‚Va` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Vb`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Va` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Va` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Wb`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Xb`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P +\ +•\ +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Ob`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Pb`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P +‚ +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Qb`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P +\ +•\ +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/r/jp_subquery_ucs2.result b/mysql-test/suite/jp/r/jp_subquery_ucs2.result new file mode 100644 index 00000000000..023100ecce3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_ucs2.result @@ -0,0 +1,207 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£´b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¸b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_subquery_ujis.result b/mysql-test/suite/jp/r/jp_subquery_ujis.result new file mode 100644 index 00000000000..0b6aa03970f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_ujis.result @@ -0,0 +1,206 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£´b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¸b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_subquery_utf8.result b/mysql-test/suite/jp/r/jp_subquery_utf8.result new file mode 100644 index 00000000000..ce56e660a65 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_utf8.result @@ -0,0 +1,206 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); +SELECT `C1` FROM `T1a` WHERE `C1` IN (SELECT `C1` FROM `T1b`); +C1 +ï½± +SELECT `C1` FROM `T1a` WHERE EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `T1a` WHERE NOT EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `ï¼´ï¼’a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼’b`); +C1 +ã‚ +SELECT `C1` FROM `ï¼´ï¼’a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `ï¼´ï¼’a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `T3a` WHERE `C1` IN (SELECT `C1` FROM `T3b`); +C1 +é¾” +SELECT `C1` FROM `T3a` WHERE EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `T3a` WHERE NOT EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +C1 +é¾– +é¾— +SELECT `C1` FROM `ï¼´ï¼”a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼”b`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼”a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼”a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `T5a` WHERE `C1` IN (SELECT `C1` FROM `T5b`); +C1 +ã‚ +SELECT `C1` FROM `T5a` WHERE EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `T5a` WHERE NOT EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `ï¼´ï¼–a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼–b`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼–a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼–a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 +é¾– +é¾— +SELECT `C1` FROM `ï¼´ï¼—a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼—b`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼—a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼—a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `T8a` WHERE `C1` IN (SELECT `C1` FROM `T8b`); +C1 +ã‚ +SELECT `C1` FROM `T8a` WHERE EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `T8a` WHERE NOT EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `ï¼´ï¼™a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼™b`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼™a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼™a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 +é¾– +é¾— +SELECT `C1` FROM `T1ï¼a` WHERE `C1` IN (SELECT `C1` FROM `T1ï¼b`); +C1 +ï½± +SELECT `C1` FROM `T1ï¼a` WHERE EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `T1ï¼a` WHERE NOT EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `T11a` WHERE `C1` IN (SELECT `C1` FROM `T11b`); +C1 +ã‚ +SELECT `C1` FROM `T11a` WHERE EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `T11a` WHERE NOT EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `T12a` WHERE `C1` IN (SELECT `C1` FROM `T12b`); +C1 +é¾” +SELECT `C1` FROM `T12a` WHERE EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `T12a` WHERE NOT EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); +C1 +é¾– +é¾— +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/r/jp_substring_sjis.result b/mysql-test/suite/jp/r/jp_substring_sjis.result new file mode 100644 index 00000000000..3fe5bf44b86 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_sjis.result @@ -0,0 +1,2738 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +‚ +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +‚ +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +‚ ‚ +‚ ‚¢ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤‚¦‚¨ ‚ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +‚ ‚ +‚ ‚¢ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤‚¦‚¨ ‚ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +‚ +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +‚ +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +‚ ‚ +‚ ‚¢ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤‚¦‚¨ ‚ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +‚ +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +‚ ‚ +‚ ‚¢ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤‚¦‚¨ ‚ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +‚ ‚ +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +‚ ‚¢‚¤‚¦‚¨ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢ ‚ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +‚ ‚¢‚¤‚¦‚¨ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢ ‚ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +‚ ‚¢‚¤‚¦‚¨ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢ ‚ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +‚ ‚¢‚¤‚¦‚¨ ‚ +‚ ‚¢‚¤‚¦ ‚ +‚ ‚¢‚¤ ‚ +‚ ‚¢ ‚ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚ ‚ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_substring_ucs2.result b/mysql-test/suite/jp/r/jp_substring_ucs2.result new file mode 100644 index 00000000000..cb2a5b5b946 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_ucs2.result @@ -0,0 +1,1395 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_substring_ujis.result b/mysql-test/suite/jp/r/jp_substring_ujis.result new file mode 100644 index 00000000000..229de0c0236 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_ujis.result @@ -0,0 +1,2738 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_substring_utf8.result b/mysql-test/suite/jp/r/jp_substring_utf8.result new file mode 100644 index 00000000000..f838a2e75e2 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_utf8.result @@ -0,0 +1,2738 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1`; +C1 SUBSTRING(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1`; +C1 SUBSTRING(`C1`,1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1`; +C1 SUBSTRING(`C1`,2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1`; +C1 SUBSTRING(`C1`,3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1`; +C1 SUBSTRING(`C1`,4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1`; +C1 SUBSTRING(`C1`,5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1`; +C1 SUBSTRING(`C1`,6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1`; +C1 SUBSTRING(`C1` FROM 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1`; +C1 SUBSTRING(`C1` FROM 2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1`; +C1 SUBSTRING(`C1` FROM 3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1`; +C1 SUBSTRING(`C1` FROM 4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1`; +C1 SUBSTRING(`C1` FROM 5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1`; +C1 SUBSTRING(`C1` FROM 6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1`; +C1 SUBSTRING(`C1`,1,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1`; +C1 SUBSTRING(`C1`,1,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1`; +C1 SUBSTRING(`C1`,1,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1`; +C1 SUBSTRING(`C1`,1,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1`; +C1 SUBSTRING(`C1`,1,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1`; +C1 SUBSTRING(`C1`,1,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1`; +C1 SUBSTRING(`C1`,1,6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T3`; +C1 SUBSTRING(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T3`; +C1 SUBSTRING(`C1`,1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T3`; +C1 SUBSTRING(`C1`,2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T3`; +C1 SUBSTRING(`C1`,3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T3`; +C1 SUBSTRING(`C1`,4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T3`; +C1 SUBSTRING(`C1`,5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T3`; +C1 SUBSTRING(`C1`,6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T3`; +C1 SUBSTRING(`C1` FROM 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T3`; +C1 SUBSTRING(`C1` FROM 2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T3`; +C1 SUBSTRING(`C1` FROM 3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T3`; +C1 SUBSTRING(`C1` FROM 4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T3`; +C1 SUBSTRING(`C1` FROM 5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T3`; +C1 SUBSTRING(`C1` FROM 6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T3`; +C1 SUBSTRING(`C1`,1,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T3`; +C1 SUBSTRING(`C1`,1,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T3`; +C1 SUBSTRING(`C1`,1,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T3`; +C1 SUBSTRING(`C1`,1,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T3`; +C1 SUBSTRING(`C1`,1,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T3`; +C1 SUBSTRING(`C1`,1,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T3`; +C1 SUBSTRING(`C1`,1,6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T5`; +C1 SUBSTRING(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T5`; +C1 SUBSTRING(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T5`; +C1 SUBSTRING(`C1`,2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T5`; +C1 SUBSTRING(`C1`,3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T5`; +C1 SUBSTRING(`C1`,4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T5`; +C1 SUBSTRING(`C1`,5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T5`; +C1 SUBSTRING(`C1`,6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T5`; +C1 SUBSTRING(`C1` FROM 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T5`; +C1 SUBSTRING(`C1` FROM 2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T5`; +C1 SUBSTRING(`C1` FROM 3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T5`; +C1 SUBSTRING(`C1` FROM 4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T5`; +C1 SUBSTRING(`C1` FROM 5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T5`; +C1 SUBSTRING(`C1` FROM 6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T5`; +C1 SUBSTRING(`C1`,1,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T5`; +C1 SUBSTRING(`C1`,1,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T5`; +C1 SUBSTRING(`C1`,1,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T5`; +C1 SUBSTRING(`C1`,1,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T5`; +C1 SUBSTRING(`C1`,1,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T5`; +C1 SUBSTRING(`C1`,1,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T5`; +C1 SUBSTRING(`C1`,1,6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T8`; +C1 SUBSTRING(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T8`; +C1 SUBSTRING(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T8`; +C1 SUBSTRING(`C1`,2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T8`; +C1 SUBSTRING(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T8`; +C1 SUBSTRING(`C1`,4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T8`; +C1 SUBSTRING(`C1`,5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T8`; +C1 SUBSTRING(`C1`,6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T8`; +C1 SUBSTRING(`C1` FROM 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T8`; +C1 SUBSTRING(`C1` FROM 2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T8`; +C1 SUBSTRING(`C1` FROM 3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T8`; +C1 SUBSTRING(`C1` FROM 4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T8`; +C1 SUBSTRING(`C1` FROM 5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T8`; +C1 SUBSTRING(`C1` FROM 6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T8`; +C1 SUBSTRING(`C1`,1,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T8`; +C1 SUBSTRING(`C1`,1,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T8`; +C1 SUBSTRING(`C1`,1,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T8`; +C1 SUBSTRING(`C1`,1,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T8`; +C1 SUBSTRING(`C1`,1,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T8`; +C1 SUBSTRING(`C1`,1,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T8`; +C1 SUBSTRING(`C1`,1,6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T11`; +C1 SUBSTRING(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T11`; +C1 SUBSTRING(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T11`; +C1 SUBSTRING(`C1`,2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T11`; +C1 SUBSTRING(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T11`; +C1 SUBSTRING(`C1`,4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T11`; +C1 SUBSTRING(`C1`,5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T11`; +C1 SUBSTRING(`C1`,6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T11`; +C1 SUBSTRING(`C1` FROM 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T11`; +C1 SUBSTRING(`C1` FROM 2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T11`; +C1 SUBSTRING(`C1` FROM 3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T11`; +C1 SUBSTRING(`C1` FROM 4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T11`; +C1 SUBSTRING(`C1` FROM 5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T11`; +C1 SUBSTRING(`C1` FROM 6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T11`; +C1 SUBSTRING(`C1`,1,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T11`; +C1 SUBSTRING(`C1`,1,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T11`; +C1 SUBSTRING(`C1`,1,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T11`; +C1 SUBSTRING(`C1`,1,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T11`; +C1 SUBSTRING(`C1`,1,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T11`; +C1 SUBSTRING(`C1`,1,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T11`; +C1 SUBSTRING(`C1`,1,6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T12`; +C1 SUBSTRING(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T12`; +C1 SUBSTRING(`C1`,1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T12`; +C1 SUBSTRING(`C1`,2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T12`; +C1 SUBSTRING(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T12`; +C1 SUBSTRING(`C1`,4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T12`; +C1 SUBSTRING(`C1`,5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T12`; +C1 SUBSTRING(`C1`,6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T12`; +C1 SUBSTRING(`C1` FROM 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T12`; +C1 SUBSTRING(`C1` FROM 2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T12`; +C1 SUBSTRING(`C1` FROM 3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T12`; +C1 SUBSTRING(`C1` FROM 4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T12`; +C1 SUBSTRING(`C1` FROM 5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T12`; +C1 SUBSTRING(`C1` FROM 6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T12`; +C1 SUBSTRING(`C1`,1,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T12`; +C1 SUBSTRING(`C1`,1,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T12`; +C1 SUBSTRING(`C1`,1,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T12`; +C1 SUBSTRING(`C1`,1,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T12`; +C1 SUBSTRING(`C1`,1,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T12`; +C1 SUBSTRING(`C1`,1,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T12`; +C1 SUBSTRING(`C1`,1,6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_trim_sjis.result b/mysql-test/suite/jp/r/jp_trim_sjis.result new file mode 100644 index 00000000000..e6ab86fd20a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_sjis.result @@ -0,0 +1,672 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚P` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\ '); +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(`‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(`‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(TRAILING '–\'FROM `‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(TRAILING '–\'FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(`‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(`‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(`‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(TRAILING '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(`‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(`‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(TRAILING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(`‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(`‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(TRAILING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(`‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_trim_ucs2.result b/mysql-test/suite/jp/r/jp_trim_ucs2.result new file mode 100644 index 00000000000..6ef73301a49 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_ucs2.result @@ -0,0 +1,673 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(TRAILING '°¡'FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_trim_ujis.result b/mysql-test/suite/jp/r/jp_trim_ujis.result new file mode 100644 index 00000000000..b79a1b24a37 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_ujis.result @@ -0,0 +1,672 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(TRAILING '°¡'FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_trim_utf8.result b/mysql-test/suite/jp/r/jp_trim_utf8.result new file mode 100644 index 00000000000..99fb785e495 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_utf8.result @@ -0,0 +1,672 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES ('アイウエオカ'); +INSERT INTO `T1` VALUES ('アイウエオカカ'); +INSERT INTO `T1` VALUES ('アイウエオカカカ'); +INSERT INTO `T1` VALUES ('カアイウエオ'); +INSERT INTO `T1` VALUES ('カカアイウエオ'); +INSERT INTO `T1` VALUES ('カカカアイウエオ'); +INSERT INTO `T1` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `T1` VALUES (' アイウエオ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡 '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES ('カアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡 '); +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `T1`; +C1 TRIM(`C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼’`; +C1 TRIM(`C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(TRAILING '丂'FROM `C1`) FROM `T3`; +C1 TRIM(TRAILING '丂'FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T3`; +C1 TRIM(LEADING '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T3`; +C1 TRIM(BOTH '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `T3`; +C1 TRIM(`C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼”`; +C1 TRIM(`C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T5`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T5`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T5`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `T5`; +C1 TRIM(`C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +C1 TRIM(TRAILING '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +C1 TRIM(LEADING '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼–`; +C1 TRIM(BOTH '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼–`; +C1 TRIM(`C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼—`; +C1 TRIM(`C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T8`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T8`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T8`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `T8`; +C1 TRIM(`C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +C1 TRIM(TRAILING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +C1 TRIM(LEADING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼™`; +C1 TRIM(BOTH '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼™`; +C1 TRIM(`C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1ï¼`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `T1ï¼`; +C1 TRIM(`C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T11`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T11`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T11`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `T11`; +C1 TRIM(`C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `T12`; +C1 TRIM(TRAILING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T12`; +C1 TRIM(LEADING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T12`; +C1 TRIM(BOTH '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `T12`; +C1 TRIM(`C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_union_ujis.result b/mysql-test/suite/jp/r/jp_union_ujis.result new file mode 100644 index 00000000000..4b74c570ffe --- /dev/null +++ b/mysql-test/suite/jp/r/jp_union_ujis.result @@ -0,0 +1,422 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = InnoDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MyISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; diff --git a/mysql-test/suite/jp/r/jp_update_sjis.result b/mysql-test/suite/jp/r/jp_update_sjis.result new file mode 100644 index 00000000000..65151cc7021 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_sjis.result @@ -0,0 +1,98 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +UPDATE `‚s‚P` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚Q` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚R` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚S` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚T` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚U` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚V` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚W` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚X` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚P‚O` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚P‚P` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚P‚Q` SET `‚b‚P` = ('‰\Ž\\“\”\'); +SELECT * FROM `‚s‚P`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚Q`; +‚b‚P +‚©‚«‚‚¯‚± +SELECT * FROM `‚s‚R`; +‚b‚P +‰\Ž\\“\”\ +SELECT * FROM `‚s‚S`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚T`; +‚b‚P +‚©‚«‚‚¯‚± +SELECT * FROM `‚s‚U`; +‚b‚P +‰\Ž\\“\”\ +SELECT * FROM `‚s‚V`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚W`; +‚b‚P +‚©‚«‚‚¯‚± +SELECT * FROM `‚s‚X`; +‚b‚P +‰\Ž\\“\”\ +SELECT * FROM `‚s‚P‚O`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚P‚P`; +‚b‚P +‚©‚«‚‚¯‚± +SELECT * FROM `‚s‚P‚Q`; +‚b‚P +‰\Ž\\“\”\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_update_ucs2.result b/mysql-test/suite/jp/r/jp_update_ucs2.result new file mode 100644 index 00000000000..2796958ac3e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_ucs2.result @@ -0,0 +1,99 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +SELECT * FROM `£Ô£±`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£²`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£³`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£´`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£µ`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£·`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£¸`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£±£°`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÈíÉíÊíËíÌ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_update_ujis.result b/mysql-test/suite/jp/r/jp_update_ujis.result new file mode 100644 index 00000000000..e9633d14f0c --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_ujis.result @@ -0,0 +1,98 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +SELECT * FROM `£Ô£±`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£²`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£³`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£´`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£µ`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£·`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£¸`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£±£°`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤«¤¤¯¤±¤³ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÈíÉíÊíËíÌ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_update_utf8.result b/mysql-test/suite/jp/r/jp_update_utf8.result new file mode 100644 index 00000000000..f690d2f0247 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_utf8.result @@ -0,0 +1,98 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +UPDATE `T1` SET `C1` = ('カキクケコ'); +UPDATE `ï¼´ï¼’` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T3` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼”` SET `C1` = ('カキクケコ'); +UPDATE `T5` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼–` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼—` SET `C1` = ('カキクケコ'); +UPDATE `T8` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼™` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `T1ï¼` SET `C1` = ('カキクケコ'); +UPDATE `T11` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T12` SET `C1` = ('齗齘齚é½é½ž'); +SELECT * FROM `T1`; +C1 +カキクケコ +SELECT * FROM `ï¼´ï¼’`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `T3`; +C1 +齗齘齚é½é½ž +SELECT * FROM `ï¼´ï¼”`; +C1 +カキクケコ +SELECT * FROM `T5`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `ï¼´ï¼–`; +C1 +齗齘齚é½é½ž +SELECT * FROM `ï¼´ï¼—`; +C1 +カキクケコ +SELECT * FROM `T8`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `ï¼´ï¼™`; +C1 +齗齘齚é½é½ž +SELECT * FROM `T1ï¼`; +C1 +カキクケコ +SELECT * FROM `T11`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `T12`; +C1 +齗齘齚é½é½ž +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_where_sjis.result b/mysql-test/suite/jp/r/jp_where_sjis.result new file mode 100644 index 00000000000..a3cbc24c113 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_sjis.result @@ -0,0 +1,118 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚R` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚U` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚X` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +CREATE TABLE t1(c1 char(1)) default charset = sjis engine=innodb; +CREATE TABLE t2(c1 char(1)) default charset = sjis engine=myisam; +CREATE TABLE t3(c1 char(1)) default charset = sjis engine=heap; +CREATE TABLE t4(c1 char(1)) default charset = sjis engine=bdb; +INSERT INTO t1 VALUES('“S'),('“s'); +INSERT INTO t2 VALUES('“S'),('“s'); +INSERT INTO t3 VALUES('“S'),('“s'); +INSERT INTO t4 VALUES('“S'),('“s'); +SELECT * FROM t1 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t2 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t3 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t4 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t1 WHERE c1 = '“s'; +c1 +“s +SELECT * FROM t2 WHERE c1 = '“s'; +c1 +“s +SELECT * FROM t3 WHERE c1 = '“s'; +c1 +“s +SELECT * FROM t4 WHERE c1 = '“s'; +c1 +“s +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_where_ucs2.result b/mysql-test/suite/jp/r/jp_where_ucs2.result new file mode 100644 index 00000000000..a05b1da9b68 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_ucs2.result @@ -0,0 +1,163 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_where_ujis.result b/mysql-test/suite/jp/r/jp_where_ujis.result new file mode 100644 index 00000000000..b13b8a10ef8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_ujis.result @@ -0,0 +1,86 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_where_utf8.result b/mysql-test/suite/jp/r/jp_where_utf8.result new file mode 100644 index 00000000000..d69aaf8715d --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_utf8.result @@ -0,0 +1,86 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT * FROM `T1` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T3` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼”` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T5` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼–` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼—` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T8` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼™` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T1ï¼` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T11` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T12` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/std_data/jisx0201_sjis.dat b/mysql-test/suite/jp/std_data/jisx0201_sjis.dat new file mode 100644 index 00000000000..7556c4d3085 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0201_sjis.dat @@ -0,0 +1,10 @@ + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬®¯ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß diff --git a/mysql-test/suite/jp/std_data/jisx0201_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0201_ucs2.dat Binary files differnew file mode 100644 index 00000000000..777f956a6cf --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0201_ucs2.dat diff --git a/mysql-test/suite/jp/std_data/jisx0201_ujis.dat b/mysql-test/suite/jp/std_data/jisx0201_ujis.dat new file mode 100644 index 00000000000..07169ec8ab2 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0201_ujis.dat @@ -0,0 +1,10 @@ + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß diff --git a/mysql-test/suite/jp/std_data/jisx0201_utf8.dat b/mysql-test/suite/jp/std_data/jisx0201_utf8.dat new file mode 100644 index 00000000000..3052e4fcc8b --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0201_utf8.dat @@ -0,0 +1,10 @@ + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャï½ï½®ï½¯ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis.dat new file mode 100644 index 00000000000..767be2090ac --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_sjis.dat @@ -0,0 +1,66 @@ +@@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat new file mode 100644 index 00000000000..d731cc0e3b2 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat @@ -0,0 +1,2 @@ +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ + diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat new file mode 100644 index 00000000000..b636aacdb62 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat @@ -0,0 +1,5 @@ +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ diff --git a/mysql-test/suite/jp/std_data/jisx0208_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0208_ucs2.dat Binary files differnew file mode 100644 index 00000000000..3ac15368c05 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_ucs2.dat diff --git a/mysql-test/suite/jp/std_data/jisx0208_ujis.dat b/mysql-test/suite/jp/std_data/jisx0208_ujis.dat new file mode 100644 index 00000000000..6076ade4245 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_ujis.dat @@ -0,0 +1,66 @@ +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬ÏϮϯϰϱϲϳ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ diff --git a/mysql-test/suite/jp/std_data/jisx0208_utf8.dat b/mysql-test/suite/jp/std_data/jisx0208_utf8.dat new file mode 100644 index 00000000000..4ab29099a60 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_utf8.dat @@ -0,0 +1,66 @@ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ <>≦≧∞∴♂♀°′″℃¥ +ï¼„Â¢Â£ï¼…ï¼ƒï¼†ï¼Šï¼ Â§â˜†â˜…â—‹â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯â™â™ªâ€ ‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG +HIJKLï¼ï¼®ï¼¯ï¼°ï¼±ï¼²ï¼³ï¼´ï¼µï¼¶ï¼·ï¼¸ï¼¹ï¼ºãƒ» +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ãã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガã‚ギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ メモャヤュユョヨラリルレãƒãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬÐЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—葦芦鯵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +ç§»ç¶ç·¯èƒƒèŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› 姻引飲淫胤è”・・・・・ +ãƒ»è“®é€£éŒ¬å‘‚é¯æ«“炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼ç¯è€è¾è‹éƒŽå…麓禄肋録論å€å’Œè©±æªè³„脇惑 +æž é·²äº™äº˜é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +äºŸäº äº¢äº°äº³äº¶ä»Žä»ä»„仆仂仗仞ä»ä»Ÿä»·ä¼‰ä½šä¼°ä½› +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦é·é·¯é·½é¸šé¸›é¸žé¹µé¹¹é¹½éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéºé¡é»Œé»Žé»é»é»”é»œé»žé» +é» é»¥é»¨é»¯é»´é»¶é»·é»¹é»»é»¼é»½é¼‡é¼ˆçš·é¼•é¼¡é¼¬é¼¾é½Šé½’ +é½”é½£é½Ÿé½ é½¡é½¦é½§é½¬é½ªé½·é½²é½¶é¾•é¾œé¾ ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +ãƒ»å ¯æ§‡é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ diff --git a/mysql-test/suite/jp/std_data/jisx0212_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0212_ucs2.dat Binary files differnew file mode 100644 index 00000000000..001c9589910 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0212_ucs2.dat diff --git a/mysql-test/suite/jp/std_data/jisx0212_ujis.dat b/mysql-test/suite/jp/std_data/jisx0212_ujis.dat new file mode 100644 index 00000000000..40c8645825b --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0212_ujis.dat @@ -0,0 +1,40 @@ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ªª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬««®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ diff --git a/mysql-test/suite/jp/std_data/jisx0212_utf8.dat b/mysql-test/suite/jp/std_data/jisx0212_utf8.dat new file mode 100644 index 00000000000..3f9354255d0 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0212_utf8.dat @@ -0,0 +1,40 @@ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άÎήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÃŠÄšÄ–Ä’Ä˜ãƒ»ÄœÄžÄ¢Ä Ä¤ÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áà äâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥÃìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûÅǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä» +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +ä¼™ä¼®ä¼±ä½ ä¼³ä¼µä¼·ä¼¹ä¼»ä¼¾ä½€ä½‚ä½ˆä½‰ä½‹ä½Œä½’ä½”ä½–ä½˜ +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ diff --git a/mysql-test/suite/jp/t/jp_alter_sjis.test b/mysql-test/suite/jp/t/jp_alter_sjis.test new file mode 100644 index 00000000000..b7b31862599 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_sjis.test @@ -0,0 +1,416 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; +--disable_warnings +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +--enable_warnings + +# +# Test altering table with Japanese characters in sjis encoding +# + +# +# Test InnoDB +# +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +# Test basic alter operation + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚‚‚`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚‚‚`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; + +# +# Test MyISAM +# + +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚‚‚`); +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚‚‚`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; + +# +# Test HEAP +# + +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚‚‚`); +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚‚‚`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; + +# +# Test BDB +# + +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=BDB; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +#ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚‚‚` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +#ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚‚‚`); +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +#ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚‚‚`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚‚‚`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/t/jp_alter_ucs2.test b/mysql-test/suite/jp/t/jp_alter_ucs2.test new file mode 100644 index 00000000000..6c5b3132edf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_ucs2.test @@ -0,0 +1,419 @@ +--source include/have_ucs2.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +--enable_warnings + +# +# Test altering table with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +# +# Test InnoDB +# +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +# Test basic alter operation + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test MyISAM +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test HEAP +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test BDB +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +#ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +#ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +#ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +#ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +#ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/t/jp_alter_ujis.test b/mysql-test/suite/jp/t/jp_alter_ujis.test new file mode 100644 index 00000000000..d388d20c49b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_ujis.test @@ -0,0 +1,418 @@ +--source include/have_ujis.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +--enable_warnings + +# +# Test altering table with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +# +# Test InnoDB +# +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=INNODB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +# Test basic alter operation + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test MyISAM +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test HEAP +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=HEAP; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test BDB +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤¤¤` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=BDB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +#ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤¤¤`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤¤¤`); +#ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤¤¤` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +#ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +#ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +#ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/t/jp_alter_utf8.test b/mysql-test/suite/jp/t/jp_alter_utf8.test new file mode 100644 index 00000000000..6771343f38f --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_utf8.test @@ -0,0 +1,416 @@ +--disable_warnings +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +--enable_warnings + +# +# Test altering table with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +# +# Test InnoDB +# +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +# Test basic alter operation + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; + +# +# Test MyISAM +# + +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; + +# +# Test HEAP +# + +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; + +# +# Test BDB +# + +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=BDB; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +#ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +#ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +#ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +#ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; diff --git a/mysql-test/suite/jp/t/jp_charlength_sjis.test b/mysql-test/suite/jp/t/jp_charlength_sjis.test new file mode 100644 index 00000000000..5f3543bb7a6 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_charlength_ucs2.test b/mysql-test/suite/jp/t/jp_charlength_ucs2.test new file mode 100644 index 00000000000..2db9db7cfc6 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charlength_ujis.test b/mysql-test/suite/jp/t/jp_charlength_ujis.test new file mode 100644 index 00000000000..08973231f27 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charlength_utf8.test b/mysql-test/suite/jp/t/jp_charlength_utf8.test new file mode 100644 index 00000000000..a3f74db27ee --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼’`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T3`; + +#MyISAM +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼”`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T5`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼—`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T8`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1ï¼`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T11`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_charset_sjis.test b/mysql-test/suite/jp/t/jp_charset_sjis.test new file mode 100644 index 00000000000..3a9f264bdfe --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_sjis.test @@ -0,0 +1,133 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚R`; + +#MyISAM +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚U`; + +#Heap +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚X`; + +#BDB +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚Q`; + +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_charset_ucs2.test b/mysql-test/suite/jp/t/jp_charset_ucs2.test new file mode 100644 index 00000000000..5183071033b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_ucs2.test @@ -0,0 +1,221 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; + +#MyISAM +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; + +#Heap +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; + +#BDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charset_ujis.test b/mysql-test/suite/jp/t/jp_charset_ujis.test new file mode 100644 index 00000000000..de9ef318530 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_ujis.test @@ -0,0 +1,135 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; + +#MyISAM +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; + +#Heap +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; + +#BDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charset_utf8.test b/mysql-test/suite/jp/t/jp_charset_utf8.test new file mode 100644 index 00000000000..2d73daba42a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_utf8.test @@ -0,0 +1,133 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT DISTINCT CHARSET(`C1`) FROM `T1`; +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(`C1`) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T3`; + +#MyISAM +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(`C1`) FROM `T5`; +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼–`; + +#Heap +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(`C1`) FROM `T8`; +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼™`; + +#BDB +SELECT DISTINCT CHARSET(`C1`) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(`C1`) FROM `T11`; +SELECT DISTINCT CHARSET(`C1`) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T12`; + +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/t/jp_convert_sjis.test b/mysql-test/suite/jp/t/jp_convert_sjis.test new file mode 100644 index 00000000000..93fa33029bf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_sjis.test @@ -0,0 +1,110 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; + +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in sjis encoding +# + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚R`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚R`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚S`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚S`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚S`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚T`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚T`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚T`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚U`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚U`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚U`; + +#Heap +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚V`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚V`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚V`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚W`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚W`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚W`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚X`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚X`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚Q`; + +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_convert_ucs2.test b/mysql-test/suite/jp/t/jp_convert_ucs2.test new file mode 100644 index 00000000000..88b0d0c9cba --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_ucs2.test @@ -0,0 +1,203 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; + +#Heap +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_convert_ujis.test b/mysql-test/suite/jp/t/jp_convert_ujis.test new file mode 100644 index 00000000000..d6303b66f34 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_ujis.test @@ -0,0 +1,115 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; + +#Heap +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_convert_utf8.test b/mysql-test/suite/jp/t/jp_convert_utf8.test new file mode 100644 index 00000000000..a687b0f06cb --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_utf8.test @@ -0,0 +1,113 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼’`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼’`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼’`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T3`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T3`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T3`; + +#MyISAM +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼”`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼”`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼”`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T5`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T5`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T5`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼–`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼–`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼–`; + +#Heap +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼—`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼—`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼—`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T8`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T8`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T8`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼™`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼™`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1ï¼`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1ï¼`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1ï¼`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T11`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T11`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T11`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T12`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T12`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T12`; + +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/t/jp_create_db_sjis.test b/mysql-test/suite/jp/t/jp_create_db_sjis.test new file mode 100644 index 00000000000..ef66d338fce --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_sjis.test @@ -0,0 +1,26 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; +--disable_warnings +drop database if exists `ÆÎݺÞ`; +drop database if exists `“ú–{Œê`; +drop database if exists `ƒ\\•\`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in ujis encoding +# + +CREATE DATABASE `ÆÎݺÞ`; +CREATE DATABASE `“ú–{Œê`; +CREATE DATABASE `ƒ\\•\`; + +SHOW DATABASES; + +USE `ÆÎݺÞ`; +USE `“ú–{Œê`; +USE `ƒ\\•\`; + +DROP DATABASE `ÆÎݺÞ`; +DROP DATABASE `“ú–{Œê`; +DROP DATABASE `ƒ\\•\`; diff --git a/mysql-test/suite/jp/t/jp_create_db_ucs2.test b/mysql-test/suite/jp/t/jp_create_db_ucs2.test new file mode 100644 index 00000000000..9e8ca7d2a0f --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_ucs2.test @@ -0,0 +1,29 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET character_set_server = ucs2; + +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; + +SHOW DATABASES; + +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; + +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/t/jp_create_db_ujis.test b/mysql-test/suite/jp/t/jp_create_db_ujis.test new file mode 100644 index 00000000000..0095f864836 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_ujis.test @@ -0,0 +1,28 @@ +--source include/have_ujis.inc + +--disable_warnings +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; + +SHOW DATABASES; + +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; + +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/t/jp_create_db_utf8.test b/mysql-test/suite/jp/t/jp_create_db_utf8.test new file mode 100644 index 00000000000..4f8eb24cbe3 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_utf8.test @@ -0,0 +1,26 @@ +--disable_warnings +drop database if exists `ニホï¾ï½ºï¾ž`; +drop database if exists `日本語`; +drop database if exists `龔龖龗`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE DATABASE `ニホï¾ï½ºï¾ž`; +CREATE DATABASE `日本語`; +CREATE DATABASE `龔龖龗`; + +SHOW DATABASES; + +USE `ニホï¾ï½ºï¾ž`; +USE `日本語`; +USE `龔龖龗`; + +DROP DATABASE `ニホï¾ï½ºï¾ž`; +DROP DATABASE `日本語`; +DROP DATABASE `龔龖龗`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_sjis.test b/mysql-test/suite/jp/t/jp_create_tbl_sjis.test new file mode 100644 index 00000000000..45c0b24388b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_sjis.test @@ -0,0 +1,308 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; +--disable_warnings +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `³³³`; +DROP TABLE IF EXISTS `´´´`; +DROP TABLE IF EXISTS `µµµ`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `‚¤‚¤‚¤`; +DROP TABLE IF EXISTS `‚¦‚¦‚¦`; +DROP TABLE IF EXISTS `‚¨‚¨‚¨`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +DROP TABLE IF EXISTS `•\•\•\`; +DROP TABLE IF EXISTS `—\—\—\`; +DROP TABLE IF EXISTS `\\\`; +--enable_warnings + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚‚‚` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=BDB; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test b/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test new file mode 100644 index 00000000000..519697e3530 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test @@ -0,0 +1,314 @@ +--source include/have_ucs2.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +--enable_warnings + +# +# Test creating table with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_ujis.test b/mysql-test/suite/jp/t/jp_create_tbl_ujis.test new file mode 100644 index 00000000000..ac70facdce9 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_ujis.test @@ -0,0 +1,314 @@ +--source include/have_ujis.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +--enable_warnings + +# +# Test creating table with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=INNODB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=HEAP; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤¤¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=BDB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_utf8.test b/mysql-test/suite/jp/t/jp_create_tbl_utf8.test new file mode 100644 index 00000000000..5c816eb169a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_utf8.test @@ -0,0 +1,312 @@ +--disable_warnings +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ウウウ`; +DROP TABLE IF EXISTS `ï½´ï½´ï½´`; +DROP TABLE IF EXISTS `オオオ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `ã†ã†ã†`; +DROP TABLE IF EXISTS `ãˆãˆãˆ`; +DROP TABLE IF EXISTS `ãŠãŠãŠ`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +DROP TABLE IF EXISTS `龞龞龞`; +DROP TABLE IF EXISTS `龡龡龡`; +DROP TABLE IF EXISTS `龢龢龢`; +--enable_warnings + +# +# Test creating table with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=BDB; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; diff --git a/mysql-test/suite/jp/t/jp_enum_sjis.test b/mysql-test/suite/jp/t/jp_enum_sjis.test new file mode 100644 index 00000000000..2ea1bf320e0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_sjis.test @@ -0,0 +1,153 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +#drop table if exists t1; +--enable_warnings + +# +# Test ENUM values with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚Q` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚R` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚S` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚T` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚U` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚V` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚W` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚X` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚O` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\'),('\'),('•\'); + +SELECT * FROM `‚s‚P`; +SELECT * FROM `‚s‚Q`; +SELECT * FROM `‚s‚R`; +SELECT * FROM `‚s‚S`; +SELECT * FROM `‚s‚T`; +SELECT * FROM `‚s‚U`; +SELECT * FROM `‚s‚V`; +SELECT * FROM `‚s‚W`; +SELECT * FROM `‚s‚X`; +SELECT * FROM `‚s‚P‚O`; +SELECT * FROM `‚s‚P‚P`; +SELECT * FROM `‚s‚P‚Q`; + +SHOW CREATE TABLE `‚s‚P`; +SHOW CREATE TABLE `‚s‚Q`; +SHOW CREATE TABLE `‚s‚R`; +SHOW CREATE TABLE `‚s‚S`; +SHOW CREATE TABLE `‚s‚T`; +SHOW CREATE TABLE `‚s‚U`; +SHOW CREATE TABLE `‚s‚V`; +SHOW CREATE TABLE `‚s‚W`; +SHOW CREATE TABLE `‚s‚X`; +SHOW CREATE TABLE `‚s‚P‚O`; +SHOW CREATE TABLE `‚s‚P‚P`; +SHOW CREATE TABLE `‚s‚P‚Q`; + +DESC `‚s‚P`; +DESC `‚s‚Q`; +DESC `‚s‚R`; +DESC `‚s‚S`; +DESC `‚s‚T`; +DESC `‚s‚U`; +DESC `‚s‚V`; +DESC `‚s‚W`; +DESC `‚s‚X`; +DESC `‚s‚P‚O`; +DESC `‚s‚P‚P`; +DESC `‚s‚P‚Q`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# + +ALTER TABLE `‚s‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚R` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚S` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚T` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚U` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚V` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚W` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚X` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚O` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; + +SHOW CREATE TABLE `‚s‚P`; +SHOW CREATE TABLE `‚s‚Q`; +SHOW CREATE TABLE `‚s‚R`; +SHOW CREATE TABLE `‚s‚S`; +SHOW CREATE TABLE `‚s‚T`; +SHOW CREATE TABLE `‚s‚U`; +SHOW CREATE TABLE `‚s‚V`; +SHOW CREATE TABLE `‚s‚W`; +SHOW CREATE TABLE `‚s‚X`; +SHOW CREATE TABLE `‚s‚P‚O`; +SHOW CREATE TABLE `‚s‚P‚P`; +SHOW CREATE TABLE `‚s‚P‚Q`; + +# +# Test to distinguish 0x9353 and 0x9373 +# bug #6206 need to be fixed + +#CREATE TABLE t1(c1 enum('“S','“s')) default character set = sjis; +#INSERT INTO t1 VALUES('“S'),('“s'); +#SELECT * FROM t1 WHERE c1 LIKE '“S'; +#DROP TABLE t1; + +DESC `‚s‚P`; +DESC `‚s‚Q`; +DESC `‚s‚R`; +DESC `‚s‚S`; +DESC `‚s‚T`; +DESC `‚s‚U`; +DESC `‚s‚V`; +DESC `‚s‚W`; +DESC `‚s‚X`; +DESC `‚s‚P‚O`; +DESC `‚s‚P‚P`; +DESC `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2.test b/mysql-test/suite/jp/t/jp_enum_ucs2.test new file mode 100644 index 00000000000..2239ebab478 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_ucs2.test @@ -0,0 +1,149 @@ +--source include/have_ucs2.inc + +# half-with kana is not handled correctly in 4.1 +# because of bug #5174 +# It will be fixed in 5.0 + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test ENUM values with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); + +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +SHOW CREATE TABLE `£Ô£±`; +SHOW CREATE TABLE `£Ô£²`; +SHOW CREATE TABLE `£Ô£³`; +SHOW CREATE TABLE `£Ô£´`; +SHOW CREATE TABLE `£Ô£µ`; +SHOW CREATE TABLE `£Ô£¶`; +SHOW CREATE TABLE `£Ô£·`; +SHOW CREATE TABLE `£Ô£¸`; +SHOW CREATE TABLE `£Ô£¹`; +SHOW CREATE TABLE `£Ô£±£°`; +SHOW CREATE TABLE `£Ô£±£±`; +SHOW CREATE TABLE `£Ô£±£²`; + +DESC `£Ô£±`; +DESC `£Ô£²`; +DESC `£Ô£³`; +DESC `£Ô£´`; +DESC `£Ô£µ`; +DESC `£Ô£¶`; +DESC `£Ô£·`; +DESC `£Ô£¸`; +DESC `£Ô£¹`; +DESC `£Ô£±£°`; +DESC `£Ô£±£±`; +DESC `£Ô£±£²`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# Cannot test until the bug#7302 is fixed + +#ALTER TABLE `£Ô£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£³` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£´` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£µ` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£¶` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£·` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£¸` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£¹` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£±£°` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£±£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£±£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; + +#SHOW CREATE TABLE `£Ô£±`; +#SHOW CREATE TABLE `£Ô£²`; +#SHOW CREATE TABLE `£Ô£³`; +#SHOW CREATE TABLE `£Ô£´`; +#SHOW CREATE TABLE `£Ô£µ`; +#SHOW CREATE TABLE `£Ô£¶`; +#SHOW CREATE TABLE `£Ô£·`; +#SHOW CREATE TABLE `£Ô£¸`; +#SHOW CREATE TABLE `£Ô£¹`; +#SHOW CREATE TABLE `£Ô£±£°`; +#SHOW CREATE TABLE `£Ô£±£±`; +#SHOW CREATE TABLE `£Ô£±£²`; + +#DESC `£Ô£±`; +#DESC `£Ô£²`; +#DESC `£Ô£³`; +#DESC `£Ô£´`; +#DESC `£Ô£µ`; +#DESC `£Ô£¶`; +#DESC `£Ô£·`; +#DESC `£Ô£¸`; +#DESC `£Ô£¹`; +#DESC `£Ô£±£°`; +#DESC `£Ô£±£±`; +#DESC `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_enum_ujis.test b/mysql-test/suite/jp/t/jp_enum_ujis.test new file mode 100644 index 00000000000..da41165aad0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_ujis.test @@ -0,0 +1,144 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test ENUM values with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); + +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +SHOW CREATE TABLE `£Ô£±`; +SHOW CREATE TABLE `£Ô£²`; +SHOW CREATE TABLE `£Ô£³`; +SHOW CREATE TABLE `£Ô£´`; +SHOW CREATE TABLE `£Ô£µ`; +SHOW CREATE TABLE `£Ô£¶`; +SHOW CREATE TABLE `£Ô£·`; +SHOW CREATE TABLE `£Ô£¸`; +SHOW CREATE TABLE `£Ô£¹`; +SHOW CREATE TABLE `£Ô£±£°`; +SHOW CREATE TABLE `£Ô£±£±`; +SHOW CREATE TABLE `£Ô£±£²`; + +DESC `£Ô£±`; +DESC `£Ô£²`; +DESC `£Ô£³`; +DESC `£Ô£´`; +DESC `£Ô£µ`; +DESC `£Ô£¶`; +DESC `£Ô£·`; +DESC `£Ô£¸`; +DESC `£Ô£¹`; +DESC `£Ô£±£°`; +DESC `£Ô£±£±`; +DESC `£Ô£±£²`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# + +ALTER TABLE `£Ô£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£³` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£´` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£µ` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¶` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£·` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¸` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¹` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£°` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; + +SHOW CREATE TABLE `£Ô£±`; +SHOW CREATE TABLE `£Ô£²`; +SHOW CREATE TABLE `£Ô£³`; +SHOW CREATE TABLE `£Ô£´`; +SHOW CREATE TABLE `£Ô£µ`; +SHOW CREATE TABLE `£Ô£¶`; +SHOW CREATE TABLE `£Ô£·`; +SHOW CREATE TABLE `£Ô£¸`; +SHOW CREATE TABLE `£Ô£¹`; +SHOW CREATE TABLE `£Ô£±£°`; +SHOW CREATE TABLE `£Ô£±£±`; +SHOW CREATE TABLE `£Ô£±£²`; + +DESC `£Ô£±`; +DESC `£Ô£²`; +DESC `£Ô£³`; +DESC `£Ô£´`; +DESC `£Ô£µ`; +DESC `£Ô£¶`; +DESC `£Ô£·`; +DESC `£Ô£¸`; +DESC `£Ô£¹`; +DESC `£Ô£±£°`; +DESC `£Ô£±£±`; +DESC `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_enum_utf8.test b/mysql-test/suite/jp/t/jp_enum_utf8.test new file mode 100644 index 00000000000..4ce3576b604 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_utf8.test @@ -0,0 +1,142 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test ENUM values with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T3` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼”` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T5` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼–` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼—` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T8` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼™` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T1ï¼` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T11` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T12` VALUES ('é¾”'),('é¾–'),('é¾—'); + +SELECT * FROM `T1`; +SELECT * FROM `ï¼´ï¼’`; +SELECT * FROM `T3`; +SELECT * FROM `ï¼´ï¼”`; +SELECT * FROM `T5`; +SELECT * FROM `ï¼´ï¼–`; +SELECT * FROM `ï¼´ï¼—`; +SELECT * FROM `T8`; +SELECT * FROM `ï¼´ï¼™`; +SELECT * FROM `T1ï¼`; +SELECT * FROM `T11`; +SELECT * FROM `T12`; + +SHOW CREATE TABLE `T1`; +SHOW CREATE TABLE `ï¼´ï¼’`; +SHOW CREATE TABLE `T3`; +SHOW CREATE TABLE `ï¼´ï¼”`; +SHOW CREATE TABLE `T5`; +SHOW CREATE TABLE `ï¼´ï¼–`; +SHOW CREATE TABLE `ï¼´ï¼—`; +SHOW CREATE TABLE `T8`; +SHOW CREATE TABLE `ï¼´ï¼™`; +SHOW CREATE TABLE `T1ï¼`; +SHOW CREATE TABLE `T11`; +SHOW CREATE TABLE `T12`; + +DESC `T1`; +DESC `ï¼´ï¼’`; +DESC `T3`; +DESC `ï¼´ï¼”`; +DESC `T5`; +DESC `ï¼´ï¼–`; +DESC `ï¼´ï¼—`; +DESC `T8`; +DESC `ï¼´ï¼™`; +DESC `T1ï¼`; +DESC `T11`; +DESC `T12`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# + +ALTER TABLE `T1` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼’` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T3` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼”` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T5` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼–` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼—` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T8` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼™` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T1ï¼` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T11` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T12` ADD `C2` CHAR(1) NOT NULL FIRST; + +SHOW CREATE TABLE `T1`; +SHOW CREATE TABLE `ï¼´ï¼’`; +SHOW CREATE TABLE `T3`; +SHOW CREATE TABLE `ï¼´ï¼”`; +SHOW CREATE TABLE `T5`; +SHOW CREATE TABLE `ï¼´ï¼–`; +SHOW CREATE TABLE `ï¼´ï¼—`; +SHOW CREATE TABLE `T8`; +SHOW CREATE TABLE `ï¼´ï¼™`; +SHOW CREATE TABLE `T1ï¼`; +SHOW CREATE TABLE `T11`; +SHOW CREATE TABLE `T12`; + +DESC `T1`; +DESC `ï¼´ï¼’`; +DESC `T3`; +DESC `ï¼´ï¼”`; +DESC `T5`; +DESC `ï¼´ï¼–`; +DESC `ï¼´ï¼—`; +DESC `T8`; +DESC `ï¼´ï¼™`; +DESC `T1ï¼`; +DESC `T11`; +DESC `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_insert_sjis.test b/mysql-test/suite/jp/t/jp_insert_sjis.test new file mode 100644 index 00000000000..0266ad1eaca --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_sjis.test @@ -0,0 +1,354 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚R`; + +#MyISAM +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚U`; + +#HEAP +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚X`; + +#BDB +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,1,'‚') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,2,'‚‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,3,'‚‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_insert_ucs2.test b/mysql-test/suite/jp/t/jp_insert_ucs2.test new file mode 100644 index 00000000000..9b0a02e57d8 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_ucs2.test @@ -0,0 +1,356 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; + +#MyISAM +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; + +#HEAP +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; + +#BDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_insert_ujis.test b/mysql-test/suite/jp/t/jp_insert_ujis.test new file mode 100644 index 00000000000..7b6d2838386 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_ujis.test @@ -0,0 +1,356 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; +SET collation_connection = ujis_japanese_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; + +#MyISAM +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; + +#HEAP +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; + +#BDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_insert_utf8.test b/mysql-test/suite/jp/t/jp_insert_utf8.test new file mode 100644 index 00000000000..ef6acb90063 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_utf8.test @@ -0,0 +1,353 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('é¾”龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,1,' ') FROM `T1`; +SELECT INSERT(`C1`,1,2,' ') FROM `T1`; +SELECT INSERT(`C1`,1,3,' ') FROM `T1`; +SELECT INSERT(`C1`,1,4,' ') FROM `T1`; +SELECT INSERT(`C1`,1,5,' ') FROM `T1`; +SELECT INSERT(`C1`,2,1,' ') FROM `T1`; +SELECT INSERT(`C1`,2,2,' ') FROM `T1`; +SELECT INSERT(`C1`,2,3,' ') FROM `T1`; +SELECT INSERT(`C1`,2,4,' ') FROM `T1`; +SELECT INSERT(`C1`,3,1,' ') FROM `T1`; +SELECT INSERT(`C1`,3,2,' ') FROM `T1`; +SELECT INSERT(`C1`,3,3,' ') FROM `T1`; +SELECT INSERT(`C1`,4,1,' ') FROM `T1`; +SELECT INSERT(`C1`,4,2,' ') FROM `T1`; +SELECT INSERT(`C1`,5,1,' ') FROM `T1`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,3,'   ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,4,'    ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,5,'     ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,3,'   ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,4,'    ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,3,'   ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,2,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,3,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,4,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,5,1,'丂') FROM `T3`; + +#MyISAM +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,1,' ') FROM `T5`; +SELECT INSERT(`C1`,1,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,1,3,'   ') FROM `T5`; +SELECT INSERT(`C1`,1,4,'    ') FROM `T5`; +SELECT INSERT(`C1`,1,5,'     ') FROM `T5`; +SELECT INSERT(`C1`,2,1,' ') FROM `T5`; +SELECT INSERT(`C1`,2,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,2,3,'   ') FROM `T5`; +SELECT INSERT(`C1`,2,4,'    ') FROM `T5`; +SELECT INSERT(`C1`,3,1,' ') FROM `T5`; +SELECT INSERT(`C1`,3,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,3,3,'   ') FROM `T5`; +SELECT INSERT(`C1`,4,1,' ') FROM `T5`; +SELECT INSERT(`C1`,4,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,5,1,' ') FROM `T5`; +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,2,'丂丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼–`; + +#HEAP +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,1,' ') FROM `T8`; +SELECT INSERT(`C1`,1,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,1,3,'   ') FROM `T8`; +SELECT INSERT(`C1`,1,4,'    ') FROM `T8`; +SELECT INSERT(`C1`,1,5,'     ') FROM `T8`; +SELECT INSERT(`C1`,2,1,' ') FROM `T8`; +SELECT INSERT(`C1`,2,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,2,3,'   ') FROM `T8`; +SELECT INSERT(`C1`,2,4,'    ') FROM `T8`; +SELECT INSERT(`C1`,3,1,' ') FROM `T8`; +SELECT INSERT(`C1`,3,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,3,3,'   ') FROM `T8`; +SELECT INSERT(`C1`,4,1,' ') FROM `T8`; +SELECT INSERT(`C1`,4,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,5,1,' ') FROM `T8`; +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼™`; + +#BDB +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,1,' ') FROM `T11`; +SELECT INSERT(`C1`,1,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,1,3,'   ') FROM `T11`; +SELECT INSERT(`C1`,1,4,'    ') FROM `T11`; +SELECT INSERT(`C1`,1,5,'     ') FROM `T11`; +SELECT INSERT(`C1`,2,1,' ') FROM `T11`; +SELECT INSERT(`C1`,2,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,2,3,'   ') FROM `T11`; +SELECT INSERT(`C1`,2,4,'    ') FROM `T11`; +SELECT INSERT(`C1`,3,1,' ') FROM `T11`; +SELECT INSERT(`C1`,3,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,3,3,'   ') FROM `T11`; +SELECT INSERT(`C1`,4,1,' ') FROM `T11`; +SELECT INSERT(`C1`,4,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,5,1,' ') FROM `T11`; +SELECT INSERT(`C1`,1,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,1,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,1,3,'丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,2,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,2,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,2,3,'丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,3,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,3,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,3,3,'丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,4,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,4,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,5,1,'丂') FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_instr_sjis.test b/mysql-test/suite/jp/t/jp_instr_sjis.test new file mode 100644 index 00000000000..c19b5f2b14c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_sjis.test @@ -0,0 +1,139 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚R`; + +#MyISAM +SELECT INSTR(`‚b‚P`,'±') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚U`; + +#HEAP +SELECT INSTR(`‚b‚P`,'±') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚X`; + +#BDB +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_instr_ucs2.test b/mysql-test/suite/jp/t/jp_instr_ucs2.test new file mode 100644 index 00000000000..b8f83961e90 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_ucs2.test @@ -0,0 +1,141 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; + +#MyISAM +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; + +#HEAP +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; + +#BDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_instr_ujis.test b/mysql-test/suite/jp/t/jp_instr_ujis.test new file mode 100644 index 00000000000..696e1147372 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_ujis.test @@ -0,0 +1,140 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; + +#MyISAM +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; + +#HEAP +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; + +#BDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_instr_utf8.test b/mysql-test/suite/jp/t/jp_instr_utf8.test new file mode 100644 index 00000000000..b25b72bc8d0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_utf8.test @@ -0,0 +1,138 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT INSTR(`C1`,'ï½±') from `T1`; +SELECT INSTR(`C1`,'ï½²') from `T1`; +SELECT INSTR(`C1`,'ï½³') from `T1`; +SELECT INSTR(`C1`,'ï½´') from `T1`; +SELECT INSTR(`C1`,'ï½µ') from `T1`; +SELECT INSTR(`C1`,'ï¾') from `T1`; +SELECT INSTR(`C1`,'ã‚') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ã„') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ã†') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ãˆ') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ãŠ') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ã‚“') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'é¾”') from `T3`; +SELECT INSTR(`C1`,'é¾–') from `T3`; +SELECT INSTR(`C1`,'é¾—') from `T3`; +SELECT INSTR(`C1`,'龞') from `T3`; +SELECT INSTR(`C1`,'龡') from `T3`; +SELECT INSTR(`C1`,'丂') from `T3`; + +#MyISAM +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ã‚') from `T5`; +SELECT INSTR(`C1`,'ã„') from `T5`; +SELECT INSTR(`C1`,'ã†') from `T5`; +SELECT INSTR(`C1`,'ãˆ') from `T5`; +SELECT INSTR(`C1`,'ãŠ') from `T5`; +SELECT INSTR(`C1`,'ã‚“') from `T5`; +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼–`; + +#HEAP +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ã‚') from `T8`; +SELECT INSTR(`C1`,'ã„') from `T8`; +SELECT INSTR(`C1`,'ã†') from `T8`; +SELECT INSTR(`C1`,'ãˆ') from `T8`; +SELECT INSTR(`C1`,'ãŠ') from `T8`; +SELECT INSTR(`C1`,'ã‚“') from `T8`; +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼™`; + +#BDB +SELECT INSTR(`C1`,'ï½±') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½²') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½³') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½´') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½µ') from `T1ï¼`; +SELECT INSTR(`C1`,'ï¾') from `T1ï¼`; +SELECT INSTR(`C1`,'ã‚') from `T11`; +SELECT INSTR(`C1`,'ã„') from `T11`; +SELECT INSTR(`C1`,'ã†') from `T11`; +SELECT INSTR(`C1`,'ãˆ') from `T11`; +SELECT INSTR(`C1`,'ãŠ') from `T11`; +SELECT INSTR(`C1`,'ã‚“') from `T11`; +SELECT INSTR(`C1`,'é¾”') from `T12`; +SELECT INSTR(`C1`,'é¾–') from `T12`; +SELECT INSTR(`C1`,'é¾—') from `T12`; +SELECT INSTR(`C1`,'龞') from `T12`; +SELECT INSTR(`C1`,'龡') from `T12`; +SELECT INSTR(`C1`,'丂') from `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_join_sjis.test b/mysql-test/suite/jp/t/jp_join_sjis.test new file mode 100644 index 00000000000..30b23913929 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_sjis.test @@ -0,0 +1,218 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test table JOIN using Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); + +#Test for innodb +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb`; +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb`; +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pa` CROSS JOIN `‚s‚Pb`; +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb`; +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb`; +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qa` CROSS JOIN `‚s‚Qb`; +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb`; +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb`; +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ra` CROSS JOIN `‚s‚Rb`; +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` USING (`‚b‚P`); +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); + +#Test for myisam +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb`; +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb`; +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sa` CROSS JOIN `‚s‚Sb`; +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb`; +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb`; +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ta` CROSS JOIN `‚s‚Tb`; +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` USING (`‚b‚P`); +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub`; +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub`; +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ua` CROSS JOIN `‚s‚Ub`; +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); + +#Test for heap +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb`; +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb`; +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Va` CROSS JOIN `‚s‚Vb`; +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` USING (`‚b‚P`); +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb`; +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb`; +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wa` CROSS JOIN `‚s‚Wb`; +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb`; +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb`; +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xa` CROSS JOIN `‚s‚Xb`; +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); + +#Test for heap +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob`; +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob`; +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Oa` CROSS JOIN `‚s‚P‚Ob`; +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb`; +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb`; +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` CROSS JOIN `‚s‚P‚Pb`; +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb`; +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb`; +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` CROSS JOIN `‚s‚P‚Qb`; +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); + +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/t/jp_join_ucs2.test b/mysql-test/suite/jp/t/jp_join_ucs2.test new file mode 100644 index 00000000000..27e49203dd2 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_ucs2.test @@ -0,0 +1,220 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test table JOIN using Japanese characters +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); + +#Test for innodb +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); + +#Test for myisam +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); + +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/t/jp_join_ujis.test b/mysql-test/suite/jp/t/jp_join_ujis.test new file mode 100644 index 00000000000..079f260cc26 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_ujis.test @@ -0,0 +1,219 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test table JOIN using Japanese characters +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); + +#Test for innodb +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); + +#Test for myisam +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); + +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/t/jp_join_utf8.test b/mysql-test/suite/jp/t/jp_join_utf8.test new file mode 100644 index 00000000000..0b2f033f8bb --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_utf8.test @@ -0,0 +1,217 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test table JOIN using Japanese characters in utf8 +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); + +#Test for innodb +SELECT * FROM `T1a` JOIN `T1b`; +SELECT * FROM `T1a` INNER JOIN `T1b`; +SELECT * FROM `T1a` JOIN `T1b` USING (`C1`); +SELECT * FROM `T1a` INNER JOIN `T1b` USING (`C1`); +SELECT * FROM `T1a` CROSS JOIN `T1b`; +SELECT * FROM `T1a` LEFT JOIN `T1b` USING (`C1`); +SELECT * FROM `T1a` LEFT JOIN `T1b` ON (`T1a`.`C1` = `T1b`.`C1`); +SELECT * FROM `T1b` RIGHT JOIN `T1a` USING (`C1`); +SELECT * FROM `T1b` RIGHT JOIN `T1a` ON (`T1a`.`C1` = `T1b`.`C1`); +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b`; +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b`; +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b` USING (`C1`); +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b` USING (`C1`); +SELECT * FROM `ï¼´ï¼’a` CROSS JOIN `ï¼´ï¼’b`; +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` USING (`C1`); +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` USING (`C1`); +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT * FROM `T3a` JOIN `T3b`; +SELECT * FROM `T3a` INNER JOIN `T3b`; +SELECT * FROM `T3a` JOIN `T3b` USING (`C1`); +SELECT * FROM `T3a` INNER JOIN `T3b` USING (`C1`); +SELECT * FROM `T3a` CROSS JOIN `T3b`; +SELECT * FROM `T3a` LEFT JOIN `T3b` USING (`C1`); +SELECT * FROM `T3a` LEFT JOIN `T3b` ON (`T3a`.`C1` = `T3b`.`C1`); +SELECT * FROM `T3b` RIGHT JOIN `T3a` USING (`C1`); +SELECT * FROM `T3b` RIGHT JOIN `T3a` ON (`T3a`.`C1` = `T3b`.`C1`); + +#Test for myisam +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b`; +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b`; +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b` USING (`C1`); +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b` USING (`C1`); +SELECT * FROM `ï¼´ï¼”a` CROSS JOIN `ï¼´ï¼”b`; +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` USING (`C1`); +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` USING (`C1`); +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT * FROM `T5a` JOIN `T5b`; +SELECT * FROM `T5a` INNER JOIN `T5b`; +SELECT * FROM `T5a` JOIN `T5b` USING (`C1`); +SELECT * FROM `T5a` INNER JOIN `T5b` USING (`C1`); +SELECT * FROM `T5a` CROSS JOIN `T5b`; +SELECT * FROM `T5a` LEFT JOIN `T5b` USING (`C1`); +SELECT * FROM `T5a` LEFT JOIN `T5b` ON (`T5a`.`C1` = `T5b`.`C1`); +SELECT * FROM `T5b` RIGHT JOIN `T5a` USING (`C1`); +SELECT * FROM `T5b` RIGHT JOIN `T5a` ON (`T5a`.`C1` = `T5b`.`C1`); +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b`; +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b`; +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b` USING (`C1`); +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b` USING (`C1`); +SELECT * FROM `ï¼´ï¼–a` CROSS JOIN `ï¼´ï¼–b`; +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` USING (`C1`); +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` USING (`C1`); +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); + +#Test for heap +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b`; +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b`; +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b` USING (`C1`); +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b` USING (`C1`); +SELECT * FROM `ï¼´ï¼—a` CROSS JOIN `ï¼´ï¼—b`; +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` USING (`C1`); +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` USING (`C1`); +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT * FROM `T8a` JOIN `T8b`; +SELECT * FROM `T8a` INNER JOIN `T8b`; +SELECT * FROM `T8a` JOIN `T8b` USING (`C1`); +SELECT * FROM `T8a` INNER JOIN `T8b` USING (`C1`); +SELECT * FROM `T8a` CROSS JOIN `T8b`; +SELECT * FROM `T8a` LEFT JOIN `T8b` USING (`C1`); +SELECT * FROM `T8a` LEFT JOIN `T8b` ON (`T8a`.`C1` = `T8b`.`C1`); +SELECT * FROM `T8b` RIGHT JOIN `T8a` USING (`C1`); +SELECT * FROM `T8b` RIGHT JOIN `T8a` ON (`T8a`.`C1` = `T8b`.`C1`); +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b`; +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b`; +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b` USING (`C1`); +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b` USING (`C1`); +SELECT * FROM `ï¼´ï¼™a` CROSS JOIN `ï¼´ï¼™b`; +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` USING (`C1`); +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` USING (`C1`); +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); + +#Test for heap +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b`; +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b`; +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b` USING (`C1`); +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b` USING (`C1`); +SELECT * FROM `T1ï¼a` CROSS JOIN `T1ï¼b`; +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` USING (`C1`); +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` USING (`C1`); +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT * FROM `T11a` JOIN `T11b`; +SELECT * FROM `T11a` INNER JOIN `T11b`; +SELECT * FROM `T11a` JOIN `T11b` USING (`C1`); +SELECT * FROM `T11a` INNER JOIN `T11b` USING (`C1`); +SELECT * FROM `T11a` CROSS JOIN `T11b`; +SELECT * FROM `T11a` LEFT JOIN `T11b` USING (`C1`); +SELECT * FROM `T11a` LEFT JOIN `T11b` ON (`T11a`.`C1` = `T11b`.`C1`); +SELECT * FROM `T11b` RIGHT JOIN `T11a` USING (`C1`); +SELECT * FROM `T11b` RIGHT JOIN `T11a` ON (`T11a`.`C1` = `T11b`.`C1`); +SELECT * FROM `T12a` JOIN `T12b`; +SELECT * FROM `T12a` INNER JOIN `T12b`; +SELECT * FROM `T12a` JOIN `T12b` USING (`C1`); +SELECT * FROM `T12a` INNER JOIN `T12b` USING (`C1`); +SELECT * FROM `T12a` CROSS JOIN `T12b`; +SELECT * FROM `T12a` LEFT JOIN `T12b` USING (`C1`); +SELECT * FROM `T12a` LEFT JOIN `T12b` ON (`T12a`.`C1` = `T12b`.`C1`); +SELECT * FROM `T12b` RIGHT JOIN `T12a` USING (`C1`); +SELECT * FROM `T12b` RIGHT JOIN `T12a` ON (`T12a`.`C1` = `T12b`.`C1`); + +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/t/jp_left_sjis.test b/mysql-test/suite/jp/t/jp_left_sjis.test new file mode 100644 index 00000000000..5d69d9892e2 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_sjis.test @@ -0,0 +1,141 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_left_ucs2.test b/mysql-test/suite/jp/t/jp_left_ucs2.test new file mode 100644 index 00000000000..59d10b7d736 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_ucs2.test @@ -0,0 +1,143 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_left_ujis.test b/mysql-test/suite/jp/t/jp_left_ujis.test new file mode 100644 index 00000000000..718639cd8a4 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_ujis.test @@ -0,0 +1,142 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_left_utf8.test b/mysql-test/suite/jp/t/jp_left_utf8.test new file mode 100644 index 00000000000..f9c99718e0f --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_utf8.test @@ -0,0 +1,140 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, LEFT(`C1`,0) FROM `T1`; +SELECT `C1`, LEFT(`C1`,1) FROM `T1`; +SELECT `C1`, LEFT(`C1`,2) FROM `T1`; +SELECT `C1`, LEFT(`C1`,3) FROM `T1`; +SELECT `C1`, LEFT(`C1`,4) FROM `T1`; +SELECT `C1`, LEFT(`C1`,5) FROM `T1`; +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,0) FROM `T3`; +SELECT `C1`, LEFT(`C1`,1) FROM `T3`; +SELECT `C1`, LEFT(`C1`,2) FROM `T3`; +SELECT `C1`, LEFT(`C1`,3) FROM `T3`; +SELECT `C1`, LEFT(`C1`,4) FROM `T3`; +SELECT `C1`, LEFT(`C1`,5) FROM `T3`; + +#MyISAM +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,0) FROM `T5`; +SELECT `C1`, LEFT(`C1`,1) FROM `T5`; +SELECT `C1`, LEFT(`C1`,2) FROM `T5`; +SELECT `C1`, LEFT(`C1`,3) FROM `T5`; +SELECT `C1`, LEFT(`C1`,4) FROM `T5`; +SELECT `C1`, LEFT(`C1`,5) FROM `T5`; +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,0) FROM `T8`; +SELECT `C1`, LEFT(`C1`,1) FROM `T8`; +SELECT `C1`, LEFT(`C1`,2) FROM `T8`; +SELECT `C1`, LEFT(`C1`,3) FROM `T8`; +SELECT `C1`, LEFT(`C1`,4) FROM `T8`; +SELECT `C1`, LEFT(`C1`,5) FROM `T8`; +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, LEFT(`C1`,0) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,1) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,2) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,3) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,4) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,5) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,0) FROM `T11`; +SELECT `C1`, LEFT(`C1`,1) FROM `T11`; +SELECT `C1`, LEFT(`C1`,2) FROM `T11`; +SELECT `C1`, LEFT(`C1`,3) FROM `T11`; +SELECT `C1`, LEFT(`C1`,4) FROM `T11`; +SELECT `C1`, LEFT(`C1`,5) FROM `T11`; +SELECT `C1`, LEFT(`C1`,0) FROM `T12`; +SELECT `C1`, LEFT(`C1`,1) FROM `T12`; +SELECT `C1`, LEFT(`C1`,2) FROM `T12`; +SELECT `C1`, LEFT(`C1`,3) FROM `T12`; +SELECT `C1`, LEFT(`C1`,4) FROM `T12`; +SELECT `C1`, LEFT(`C1`,5) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_length_sjis.test b/mysql-test/suite/jp/t/jp_length_sjis.test new file mode 100644 index 00000000000..7023891b7f0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_length_ucs2.test b/mysql-test/suite/jp/t/jp_length_ucs2.test new file mode 100644 index 00000000000..9951c9b6cd1 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_length_ujis.test b/mysql-test/suite/jp/t/jp_length_ujis.test new file mode 100644 index 00000000000..ac3aef2c768 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_length_utf8.test b/mysql-test/suite/jp/t/jp_length_utf8.test new file mode 100644 index 00000000000..5c5021f37be --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, LENGTH(`C1`) FROM `T1`; +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼’`; +SELECT `C1`, LENGTH(`C1`) FROM `T3`; + +#MyISAM +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼”`; +SELECT `C1`, LENGTH(`C1`) FROM `T5`; +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼—`; +SELECT `C1`, LENGTH(`C1`) FROM `T8`; +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, LENGTH(`C1`) FROM `T1ï¼`; +SELECT `C1`, LENGTH(`C1`) FROM `T11`; +SELECT `C1`, LENGTH(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_like_sjis.test b/mysql-test/suite/jp/t/jp_like_sjis.test new file mode 100644 index 00000000000..5c41b9ff7ef --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_sjis.test @@ -0,0 +1,168 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%¿'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚í'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ž\'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#MyISAM +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%¿'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚í'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ž\'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#Heap +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%¿'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚í'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ž\'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +#BDB +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%¿'; +#SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +#SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚í'; +#SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +#SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±%'; +#SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ž\'; +#SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +#SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +#SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_like_ucs2.test b/mysql-test/suite/jp/t/jp_like_ucs2.test new file mode 100644 index 00000000000..feae40de49e --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_ucs2.test @@ -0,0 +1,271 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#INNODB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_like_ujis.test b/mysql-test/suite/jp/t/jp_like_ujis.test new file mode 100644 index 00000000000..29ef7c5d48b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_ujis.test @@ -0,0 +1,170 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +#SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +#SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +#SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +#SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³%'; +#SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +#SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +#SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +#SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_like_utf8.test b/mysql-test/suite/jp/t/jp_like_utf8.test new file mode 100644 index 00000000000..4247242029d --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_utf8.test @@ -0,0 +1,168 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT * FROM `T1` WHERE `C1` LIKE ' %'; +SELECT * FROM `T1` WHERE `C1` LIKE '% %'; +SELECT * FROM `T1` WHERE `C1` LIKE '% '; +SELECT * FROM `T1` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ソ'; +SELECT * FROM `T1` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE ' %'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% %'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% '; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T3` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%é½–'; +SELECT * FROM `T3` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#MyISAM +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE ' %'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% %'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% '; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ソ'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T5` WHERE `C1` LIKE ' %'; +SELECT * FROM `T5` WHERE `C1` LIKE '% %'; +SELECT * FROM `T5` WHERE `C1` LIKE '% '; +SELECT * FROM `T5` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚'; +SELECT * FROM `T5` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%é½–'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#Heap +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE ' %'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% %'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% '; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ソ'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T8` WHERE `C1` LIKE ' %'; +SELECT * FROM `T8` WHERE `C1` LIKE '% %'; +SELECT * FROM `T8` WHERE `C1` LIKE '% '; +SELECT * FROM `T8` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚'; +SELECT * FROM `T8` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%é½–'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +#BDB +SELECT * FROM `T1ï¼` WHERE `C1` LIKE ' %'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% %'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% '; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ソ'; +#SELECT * FROM `T1ï¼` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +#SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +#SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T11` WHERE `C1` LIKE ' %'; +SELECT * FROM `T11` WHERE `C1` LIKE '% %'; +SELECT * FROM `T11` WHERE `C1` LIKE '% '; +SELECT * FROM `T11` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚'; +#SELECT * FROM `T11` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +#SELECT * FROM `T11` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +#SELECT * FROM `T11` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T12` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `T12` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `T12` WHERE `C1` LIKE '%é½–'; +#SELECT * FROM `T12` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +#SELECT * FROM `T12` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +#SELECT * FROM `T12` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_locate_sjis.test b/mysql-test/suite/jp/t/jp_locate_sjis.test new file mode 100644 index 00000000000..92c671199b6 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_sjis.test @@ -0,0 +1,141 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚R`; + +#MyISAM +SELECT LOCATE('±',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚U`; + + +#HEAP +SELECT LOCATE('±',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚X`; + + +#BDB +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚P‚Q`; + + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_locate_ucs2.test b/mysql-test/suite/jp/t/jp_locate_ucs2.test new file mode 100644 index 00000000000..d00ad67235a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_ucs2.test @@ -0,0 +1,144 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; + + +#HEAP +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; + + +#BDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; + + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_locate_ujis.test b/mysql-test/suite/jp/t/jp_locate_ujis.test new file mode 100644 index 00000000000..5375fad75db --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_ujis.test @@ -0,0 +1,143 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; + + +#HEAP +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; + + +#BDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; + + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_locate_utf8.test b/mysql-test/suite/jp/t/jp_locate_utf8.test new file mode 100644 index 00000000000..cbf6714e322 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_utf8.test @@ -0,0 +1,141 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT LOCATE('ï½±',`C1`) from `T1`; +SELECT LOCATE('ï½²',`C1`) from `T1`; +SELECT LOCATE('ï½³',`C1`) from `T1`; +SELECT LOCATE('ï½´',`C1`) from `T1`; +SELECT LOCATE('ï½µ',`C1`) from `T1`; +SELECT LOCATE('ï¾',`C1`) from `T1`; +SELECT LOCATE('ã‚',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ã„',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ã†',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ãˆ',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ãŠ',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ã‚“',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('é¾”',`C1`) from `T3`; +SELECT LOCATE('é¾–',`C1`) from `T3`; +SELECT LOCATE('é¾—',`C1`) from `T3`; +SELECT LOCATE('龞',`C1`) from `T3`; +SELECT LOCATE('龡',`C1`) from `T3`; +SELECT LOCATE('丂',`C1`) from `T3`; + +#MyISAM +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ã‚',`C1`) from `T5`; +SELECT LOCATE('ã„',`C1`) from `T5`; +SELECT LOCATE('ã†',`C1`) from `T5`; +SELECT LOCATE('ãˆ',`C1`) from `T5`; +SELECT LOCATE('ãŠ',`C1`) from `T5`; +SELECT LOCATE('ã‚“',`C1`) from `T5`; +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼–`; + + +#HEAP +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ã‚',`C1`) from `T8`; +SELECT LOCATE('ã„',`C1`) from `T8`; +SELECT LOCATE('ã†',`C1`) from `T8`; +SELECT LOCATE('ãˆ',`C1`) from `T8`; +SELECT LOCATE('ãŠ',`C1`) from `T8`; +SELECT LOCATE('ã‚“',`C1`) from `T8`; +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼™`; + + +#BDB +SELECT LOCATE('ï½±',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½²',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½³',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½´',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½µ',`C1`) from `T1ï¼`; +SELECT LOCATE('ï¾',`C1`) from `T1ï¼`; +SELECT LOCATE('ã‚',`C1`) from `T11`; +SELECT LOCATE('ã„',`C1`) from `T11`; +SELECT LOCATE('ã†',`C1`) from `T11`; +SELECT LOCATE('ãˆ',`C1`) from `T11`; +SELECT LOCATE('ãŠ',`C1`) from `T11`; +SELECT LOCATE('ã‚“',`C1`) from `T11`; +SELECT LOCATE('é¾”',`C1`) from `T12`; +SELECT LOCATE('é¾–',`C1`) from `T12`; +SELECT LOCATE('é¾—',`C1`) from `T12`; +SELECT LOCATE('龞',`C1`) from `T12`; +SELECT LOCATE('龡',`C1`) from `T12`; +SELECT LOCATE('丂',`C1`) from `T12`; + + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_lpad_sjis.test b/mysql-test/suite/jp/t/jp_lpad_sjis.test new file mode 100644 index 00000000000..7038112cbc8 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_lpad_ucs2.test b/mysql-test/suite/jp/t/jp_lpad_ucs2.test new file mode 100644 index 00000000000..e3bead0855a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_lpad_ujis.test b/mysql-test/suite/jp/t/jp_lpad_ujis.test new file mode 100644 index 00000000000..eea4877ec3a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_lpad_utf8.test b/mysql-test/suite/jp/t/jp_lpad_utf8.test new file mode 100644 index 00000000000..599bf5eba28 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +SELECT `C1`, LPAD(`C1`,5,'丄') FROM `T3`; + +#MyISAM +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T5`; +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T8`; +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1ï¼`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T11`; +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_sjis.test b/mysql-test/suite/jp/t/jp_ltrim_sjis.test new file mode 100644 index 00000000000..864238df07c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_sjis.test @@ -0,0 +1,163 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚Q` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚R` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚S` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚T` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚U` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚V` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚W` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚X` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚O` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚P` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚Q` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@@ƒ\\•\—\\'); + +#InnoDB +SELECT LTRIM(`‚b‚P`) from `‚s‚P`; +SELECT LTRIM(`‚b‚P`) from `‚s‚Q`; +SELECT LTRIM(`‚b‚P`) from `‚s‚R`; + +#MyISAM +SELECT LTRIM(`‚b‚P`) from `‚s‚S`; +SELECT LTRIM(`‚b‚P`) from `‚s‚T`; +SELECT LTRIM(`‚b‚P`) from `‚s‚U`; + +#HEAP +SELECT LTRIM(`‚b‚P`) from `‚s‚V`; +SELECT LTRIM(`‚b‚P`) from `‚s‚W`; +SELECT LTRIM(`‚b‚P`) from `‚s‚X`; + +#BDB +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚O`; +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚P`; +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_ucs2.test b/mysql-test/suite/jp/t/jp_ltrim_ucs2.test new file mode 100644 index 00000000000..0ae647f5222 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_ucs2.test @@ -0,0 +1,165 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); + +#InnoDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_ujis.test b/mysql-test/suite/jp/t/jp_ltrim_ujis.test new file mode 100644 index 00000000000..64363aa330b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_ujis.test @@ -0,0 +1,164 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); + +#InnoDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_utf8.test b/mysql-test/suite/jp/t/jp_ltrim_utf8.test new file mode 100644 index 00000000000..846ce11163b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_utf8.test @@ -0,0 +1,162 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES ('  アイウエオ'); +INSERT INTO `T1` VALUES ('   アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('   アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('   アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('   龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('  アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('   アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('   龔龖龗龞龡'); + +#InnoDB +SELECT LTRIM(`C1`) from `T1`; +SELECT LTRIM(`C1`) from `ï¼´ï¼’`; +SELECT LTRIM(`C1`) from `T3`; + +#MyISAM +SELECT LTRIM(`C1`) from `ï¼´ï¼”`; +SELECT LTRIM(`C1`) from `T5`; +SELECT LTRIM(`C1`) from `ï¼´ï¼–`; + +#HEAP +SELECT LTRIM(`C1`) from `ï¼´ï¼—`; +SELECT LTRIM(`C1`) from `T8`; +SELECT LTRIM(`C1`) from `ï¼´ï¼™`; + +#BDB +SELECT LTRIM(`C1`) from `T1ï¼`; +SELECT LTRIM(`C1`) from `T11`; +SELECT LTRIM(`C1`) from `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_ps_sjis.test b/mysql-test/suite/jp/t/jp_ps_sjis.test new file mode 100644 index 00000000000..cc93dca2a79 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ps_sjis.test @@ -0,0 +1,454 @@ +--character_set sjis +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +--enable_warnings + +# +# Test Prepares Statement with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +### Test InnoDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = InnoDB; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\'); + +# Japanese parameter for column name +# the parameter for stmt is not interpreted as column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +# Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test MyISAM ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = MyISAM; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test HEAP ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE =HEAP; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test BDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +##Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/t/jp_ps_ujis.test b/mysql-test/suite/jp/t/jp_ps_ujis.test new file mode 100644 index 00000000000..7d61c12e496 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ps_ujis.test @@ -0,0 +1,455 @@ +--source include/have_ujis.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +--enable_warnings + +# +# Test Prepares Statement with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +### Test InnoDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = InnoDB; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ'); + +# Japanese parameter for column name +# the parameter for stmt is not interpreted as column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +# Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test MyISAM ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = MyISAM; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test HEAP ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE =HEAP; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test BDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +##Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/t/jp_replace_sjis.test b/mysql-test/suite/jp/t/jp_replace_sjis.test new file mode 100644 index 00000000000..811d3350a34 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_sjis.test @@ -0,0 +1,129 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; + +#MyISAM +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; + +#HEAP +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; + +#BDB +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_replace_ucs2.test b/mysql-test/suite/jp/t/jp_replace_ucs2.test new file mode 100644 index 00000000000..7739a30cd9c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_ucs2.test @@ -0,0 +1,131 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; + +#MyISAM +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; + +#HEAP +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; + +#BDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_replace_ujis.test b/mysql-test/suite/jp/t/jp_replace_ujis.test new file mode 100644 index 00000000000..3d8724e63d5 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_ujis.test @@ -0,0 +1,130 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; + +#MyISAM +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; + +#HEAP +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; + +#BDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_replace_utf8.test b/mysql-test/suite/jp/t/jp_replace_utf8.test new file mode 100644 index 00000000000..1d89a43648b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_utf8.test @@ -0,0 +1,128 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T3`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T3`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T3`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T3`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T3`; + +#MyISAM +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T5`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T5`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T5`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T5`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T5`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼–`; + +#HEAP +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T8`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T8`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T8`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T8`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T8`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼™`; + +#BDB +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T11`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T11`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T11`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T11`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T11`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T12`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T12`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T12`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T12`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_reverse_sjis.test b/mysql-test/suite/jp/t/jp_reverse_sjis.test new file mode 100644 index 00000000000..c1e2b2a17ca --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚Q`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT REVERSE(`‚b‚P`) FROM `‚s‚S`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚T`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT REVERSE(`‚b‚P`) FROM `‚s‚V`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚W`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_reverse_ucs2.test b/mysql-test/suite/jp/t/jp_reverse_ucs2.test new file mode 100644 index 00000000000..d91ec7f70e8 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_reverse_ujis.test b/mysql-test/suite/jp/t/jp_reverse_ujis.test new file mode 100644 index 00000000000..d37d363f59a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_reverse_utf8.test b/mysql-test/suite/jp/t/jp_reverse_utf8.test new file mode 100644 index 00000000000..4e53d4be049 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT REVERSE(`C1`) FROM `T1`; +SELECT REVERSE(`C1`) FROM `ï¼´ï¼’`; +SELECT REVERSE(`C1`) FROM `T3`; + +#MyISAM +SELECT REVERSE(`C1`) FROM `ï¼´ï¼”`; +SELECT REVERSE(`C1`) FROM `T5`; +SELECT REVERSE(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT REVERSE(`C1`) FROM `ï¼´ï¼—`; +SELECT REVERSE(`C1`) FROM `T8`; +SELECT REVERSE(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT REVERSE(`C1`) FROM `T1ï¼`; +SELECT REVERSE(`C1`) FROM `T11`; +SELECT REVERSE(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_right_sjis.test b/mysql-test/suite/jp/t/jp_right_sjis.test new file mode 100644 index 00000000000..f481ec532ec --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_sjis.test @@ -0,0 +1,141 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_right_ucs2.test b/mysql-test/suite/jp/t/jp_right_ucs2.test new file mode 100644 index 00000000000..23ca2fa4fae --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_ucs2.test @@ -0,0 +1,143 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_right_ujis.test b/mysql-test/suite/jp/t/jp_right_ujis.test new file mode 100644 index 00000000000..b5284489c7e --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_ujis.test @@ -0,0 +1,142 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_right_utf8.test b/mysql-test/suite/jp/t/jp_right_utf8.test new file mode 100644 index 00000000000..863755c1dcf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_utf8.test @@ -0,0 +1,140 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, RIGHT(`C1`,0) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T3`; + +#MyISAM +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, RIGHT(`C1`,0) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_rpad_sjis.test b/mysql-test/suite/jp/t/jp_rpad_sjis.test new file mode 100644 index 00000000000..cc008631548 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_rpad_ucs2.test b/mysql-test/suite/jp/t/jp_rpad_ucs2.test new file mode 100644 index 00000000000..ca5059497d3 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rpad_ujis.test b/mysql-test/suite/jp/t/jp_rpad_ujis.test new file mode 100644 index 00000000000..d7725b80af7 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rpad_utf8.test b/mysql-test/suite/jp/t/jp_rpad_utf8.test new file mode 100644 index 00000000000..b5a335bc6ce --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +SELECT `C1`, RPAD(`C1`,5,'丄') FROM `T3`; + +#MyISAM +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T5`; +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T8`; +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1ï¼`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T11`; +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_sjis.test b/mysql-test/suite/jp/t/jp_rtrim_sjis.test new file mode 100644 index 00000000000..c80cf9410f9 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_sjis.test @@ -0,0 +1,163 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚S` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚V` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@@'); + +#InnoDB +SELECT RTRIM(`‚b‚P`) from `‚s‚P`; +SELECT RTRIM(`‚b‚P`) from `‚s‚Q`; +SELECT RTRIM(`‚b‚P`) from `‚s‚R`; + +#MyISAM +SELECT RTRIM(`‚b‚P`) from `‚s‚S`; +SELECT RTRIM(`‚b‚P`) from `‚s‚T`; +SELECT RTRIM(`‚b‚P`) from `‚s‚U`; + +#HEAP +SELECT RTRIM(`‚b‚P`) from `‚s‚V`; +SELECT RTRIM(`‚b‚P`) from `‚s‚W`; +SELECT RTRIM(`‚b‚P`) from `‚s‚X`; + +#BDB +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚O`; +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚P`; +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_ucs2.test b/mysql-test/suite/jp/t/jp_rtrim_ucs2.test new file mode 100644 index 00000000000..0fac38d12d1 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_ucs2.test @@ -0,0 +1,165 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); + +#InnoDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_ujis.test b/mysql-test/suite/jp/t/jp_rtrim_ujis.test new file mode 100644 index 00000000000..46cda84dd55 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_ujis.test @@ -0,0 +1,164 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); + +#InnoDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_utf8.test b/mysql-test/suite/jp/t/jp_rtrim_utf8.test new file mode 100644 index 00000000000..4880a42db3e --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_utf8.test @@ -0,0 +1,162 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ  '); +INSERT INTO `T1` VALUES ('アイウエオ   '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ   '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ   '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡   '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ  '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ   '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡   '); + +#InnoDB +SELECT RTRIM(`C1`) from `T1`; +SELECT RTRIM(`C1`) from `ï¼´ï¼’`; +SELECT RTRIM(`C1`) from `T3`; + +#MyISAM +SELECT RTRIM(`C1`) from `ï¼´ï¼”`; +SELECT RTRIM(`C1`) from `T5`; +SELECT RTRIM(`C1`) from `ï¼´ï¼–`; + +#HEAP +SELECT RTRIM(`C1`) from `ï¼´ï¼—`; +SELECT RTRIM(`C1`) from `T8`; +SELECT RTRIM(`C1`) from `ï¼´ï¼™`; + +#BDB +SELECT RTRIM(`C1`) from `T1ï¼`; +SELECT RTRIM(`C1`) from `T11`; +SELECT RTRIM(`C1`) from `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_select_sjis.test b/mysql-test/suite/jp/t/jp_select_sjis.test new file mode 100644 index 00000000000..d84ed7a4b2c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_sjis.test @@ -0,0 +1,83 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test Displaying Japanese charact in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT * FROM `‚s‚P`; +SELECT * FROM `‚s‚Q`; +SELECT * FROM `‚s‚R`; +#MyISAM +SELECT * FROM `‚s‚S`; +SELECT * FROM `‚s‚T`; +SELECT * FROM `‚s‚U`; +#Heap +SELECT * FROM `‚s‚V`; +SELECT * FROM `‚s‚W`; +SELECT * FROM `‚s‚X`; +#BDB +SELECT * FROM `‚s‚P‚O`; +SELECT * FROM `‚s‚P‚P`; +SELECT * FROM `‚s‚P‚Q`; + +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_select_ucs2.test b/mysql-test/suite/jp/t/jp_select_ucs2.test new file mode 100644 index 00000000000..2e4602e7ea4 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_ucs2.test @@ -0,0 +1,172 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; + +#INSERT the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +#Heap +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_select_ujis.test b/mysql-test/suite/jp/t/jp_select_ujis.test new file mode 100644 index 00000000000..4ad9e581a92 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_ujis.test @@ -0,0 +1,84 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +#Heap +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_select_utf8.test b/mysql-test/suite/jp/t/jp_select_utf8.test new file mode 100644 index 00000000000..e614b9ccfb0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_utf8.test @@ -0,0 +1,82 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test Displaying Japanese charact in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT * FROM `T1`; +SELECT * FROM `ï¼´ï¼’`; +SELECT * FROM `T3`; +#MyISAM +SELECT * FROM `ï¼´ï¼”`; +SELECT * FROM `T5`; +SELECT * FROM `ï¼´ï¼–`; +#Heap +SELECT * FROM `ï¼´ï¼—`; +SELECT * FROM `T8`; +SELECT * FROM `ï¼´ï¼™`; +#BDB +SELECT * FROM `T1ï¼`; +SELECT * FROM `T11`; +SELECT * FROM `T12`; + +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/t/jp_subquery_sjis.test b/mysql-test/suite/jp/t/jp_subquery_sjis.test new file mode 100644 index 00000000000..5292c7a2519 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_subquery_sjis.test @@ -0,0 +1,140 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test subquery using Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); + +#Test for innodb +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Pb`); +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Qb`); +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Rb`); +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Sb`); +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Tb`); +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Ub`); +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Va` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Vb`); +SELECT `‚b‚P` FROM `‚s‚Va` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Va` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Wb`); +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Xb`); +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Ob`); +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Pb`); +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Qb`); +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); + +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/t/jp_subquery_ucs2.test b/mysql-test/suite/jp/t/jp_subquery_ucs2.test new file mode 100644 index 00000000000..311433438f4 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_subquery_ucs2.test @@ -0,0 +1,143 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test subquery using Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); + +#Test for innodb +SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£´b`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¸b`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); + +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; + diff --git a/mysql-test/suite/jp/t/jp_subquery_ujis.test b/mysql-test/suite/jp/t/jp_subquery_ujis.test new file mode 100644 index 00000000000..67c9f00fd85 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_subquery_ujis.test @@ -0,0 +1,142 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test subquery using Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); + +#Test for innodb +SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£´b`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¸b`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); + +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; + diff --git a/mysql-test/suite/jp/t/jp_subquery_utf8.test b/mysql-test/suite/jp/t/jp_subquery_utf8.test new file mode 100644 index 00000000000..97c2df8ce30 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_subquery_utf8.test @@ -0,0 +1,139 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test subquery using Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); + +#Test for innodb +SELECT `C1` FROM `T1a` WHERE `C1` IN (SELECT `C1` FROM `T1b`); +SELECT `C1` FROM `T1a` WHERE EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +SELECT `C1` FROM `T1a` WHERE NOT EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼’a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼’b`); +SELECT `C1` FROM `ï¼´ï¼’a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼’a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT `C1` FROM `T3a` WHERE `C1` IN (SELECT `C1` FROM `T3b`); +SELECT `C1` FROM `T3a` WHERE EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +SELECT `C1` FROM `T3a` WHERE NOT EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼”a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼”b`); +SELECT `C1` FROM `ï¼´ï¼”a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼”a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT `C1` FROM `T5a` WHERE `C1` IN (SELECT `C1` FROM `T5b`); +SELECT `C1` FROM `T5a` WHERE EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +SELECT `C1` FROM `T5a` WHERE NOT EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼–a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼–b`); +SELECT `C1` FROM `ï¼´ï¼–a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼–a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼—a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼—b`); +SELECT `C1` FROM `ï¼´ï¼—a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼—a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT `C1` FROM `T8a` WHERE `C1` IN (SELECT `C1` FROM `T8b`); +SELECT `C1` FROM `T8a` WHERE EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +SELECT `C1` FROM `T8a` WHERE NOT EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼™a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼™b`); +SELECT `C1` FROM `ï¼´ï¼™a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼™a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +SELECT `C1` FROM `T1ï¼a` WHERE `C1` IN (SELECT `C1` FROM `T1ï¼b`); +SELECT `C1` FROM `T1ï¼a` WHERE EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT `C1` FROM `T1ï¼a` WHERE NOT EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT `C1` FROM `T11a` WHERE `C1` IN (SELECT `C1` FROM `T11b`); +SELECT `C1` FROM `T11a` WHERE EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +SELECT `C1` FROM `T11a` WHERE NOT EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +SELECT `C1` FROM `T12a` WHERE `C1` IN (SELECT `C1` FROM `T12b`); +SELECT `C1` FROM `T12a` WHERE EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); +SELECT `C1` FROM `T12a` WHERE NOT EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); + +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/t/jp_substring_sjis.test b/mysql-test/suite/jp/t/jp_substring_sjis.test new file mode 100644 index 00000000000..ac929114880 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_sjis.test @@ -0,0 +1,413 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚Q`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚S`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚T`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚V`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚W`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚O`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚P`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_substring_ucs2.test b/mysql-test/suite/jp/t/jp_substring_ucs2.test new file mode 100644 index 00000000000..f3cd5550072 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_ucs2.test @@ -0,0 +1,418 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +# Test of SUBSTRING(str,pos) and SUBSTRING(str FROM pos) +# is not available until the bug #5364 is fixed + +#InnoDB +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; + +#MyISAM +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; + +#HEAP +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; + +#BDB +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_substring_ujis.test b/mysql-test/suite/jp/t/jp_substring_ujis.test new file mode 100644 index 00000000000..c201c7148da --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_ujis.test @@ -0,0 +1,414 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_substring_utf8.test b/mysql-test/suite/jp/t/jp_substring_utf8.test new file mode 100644 index 00000000000..9f88115c899 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_utf8.test @@ -0,0 +1,412 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼’`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T3`; + +#MyISAM +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼”`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T5`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼—`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T8`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1ï¼`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T11`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_trim_sjis.test b/mysql-test/suite/jp/t/jp_trim_sjis.test new file mode 100644 index 00000000000..0f6821605ed --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_sjis.test @@ -0,0 +1,219 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +# Nothing to trim +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶¶'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `‚s‚P` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ¶¶¶'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `‚s‚P` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\ '); + +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\ '); + +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\ '); + +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\ '); + +#InnoDB +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(TRAILING '–\'FROM `‚b‚P`) FROM `‚s‚R`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚R`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚R`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚U`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚X`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_trim_ucs2.test b/mysql-test/suite/jp/t/jp_trim_ucs2.test new file mode 100644 index 00000000000..1d8a12650e0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_ucs2.test @@ -0,0 +1,221 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +# Nothing to trim +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); + +#InnoDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_trim_ujis.test b/mysql-test/suite/jp/t/jp_trim_ujis.test new file mode 100644 index 00000000000..de401217fcf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_ujis.test @@ -0,0 +1,220 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +# Nothing to trim +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); + +#InnoDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_trim_utf8.test b/mysql-test/suite/jp/t/jp_trim_utf8.test new file mode 100644 index 00000000000..0777de15c36 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_utf8.test @@ -0,0 +1,218 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +# Nothing to trim +INSERT INTO `T1` VALUES ('アイウエオ'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `T1` VALUES ('アイウエオカ'); +INSERT INTO `T1` VALUES ('アイウエオカカ'); +INSERT INTO `T1` VALUES ('アイウエオカカカ'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `T1` VALUES ('カアイウエオ'); +INSERT INTO `T1` VALUES ('カカアイウエオ'); +INSERT INTO `T1` VALUES ('カカカアイウエオ'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `T1` VALUES ('カカカアイウエオカカカ'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `T1` VALUES (' アイウエオ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡 '); + +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡 '); + +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡 '); + +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES ('カアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡 '); + +#InnoDB +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1`; +SELECT `C1`,TRIM(`C1`) FROM `T1`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(TRAILING '丂'FROM `C1`) FROM `T3`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T3`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T3`; +SELECT `C1`,TRIM(`C1`) FROM `T3`; + +#MyISAM +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T5`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T5`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T5`; +SELECT `C1`,TRIM(`C1`) FROM `T5`; +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼–`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T8`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T8`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T8`; +SELECT `C1`,TRIM(`C1`) FROM `T8`; +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼™`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(`C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T11`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T11`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T11`; +SELECT `C1`,TRIM(`C1`) FROM `T11`; +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `T12`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T12`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T12`; +SELECT `C1`,TRIM(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_union_ujis.test b/mysql-test/suite/jp/t/jp_union_ujis.test new file mode 100644 index 00000000000..e36d18c85c0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_union_ujis.test @@ -0,0 +1,129 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test UNION with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +#InnoDB +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +#MyISAM +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +#HEAP +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +#BDB +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +# Test mixed strage engine +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = InnoDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MyISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; diff --git a/mysql-test/suite/jp/t/jp_update_sjis.test b/mysql-test/suite/jp/t/jp_update_sjis.test new file mode 100644 index 00000000000..0dc7372ae92 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_sjis.test @@ -0,0 +1,94 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test Updating with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +UPDATE `‚s‚P` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚Q` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚R` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚S` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚T` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚U` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚V` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚W` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚X` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚P‚O` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚P‚P` SET `‚b‚P` = ('‚©‚«‚‚¯‚±'); +UPDATE `‚s‚P‚Q` SET `‚b‚P` = ('‰\Ž\\“\”\'); + +#InnoDB +SELECT * FROM `‚s‚P`; +SELECT * FROM `‚s‚Q`; +SELECT * FROM `‚s‚R`; + +#MyISAM +SELECT * FROM `‚s‚S`; +SELECT * FROM `‚s‚T`; +SELECT * FROM `‚s‚U`; + +#HEAP +SELECT * FROM `‚s‚V`; +SELECT * FROM `‚s‚W`; +SELECT * FROM `‚s‚X`; + +#BDB +SELECT * FROM `‚s‚P‚O`; +SELECT * FROM `‚s‚P‚P`; +SELECT * FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_update_ucs2.test b/mysql-test/suite/jp/t/jp_update_ucs2.test new file mode 100644 index 00000000000..7a3c1233210 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_ucs2.test @@ -0,0 +1,96 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Updating with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; + +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; + +#HEAP +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; + +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_update_ujis.test b/mysql-test/suite/jp/t/jp_update_ujis.test new file mode 100644 index 00000000000..852e45b9eeb --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_ujis.test @@ -0,0 +1,95 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Updating with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; + +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; + +#HEAP +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; + +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_update_utf8.test b/mysql-test/suite/jp/t/jp_update_utf8.test new file mode 100644 index 00000000000..b4b3d18ecab --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_utf8.test @@ -0,0 +1,93 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test Updating with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +UPDATE `T1` SET `C1` = ('カキクケコ'); +UPDATE `ï¼´ï¼’` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T3` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼”` SET `C1` = ('カキクケコ'); +UPDATE `T5` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼–` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼—` SET `C1` = ('カキクケコ'); +UPDATE `T8` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼™` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `T1ï¼` SET `C1` = ('カキクケコ'); +UPDATE `T11` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T12` SET `C1` = ('齗齘齚é½é½ž'); + +#InnoDB +SELECT * FROM `T1`; +SELECT * FROM `ï¼´ï¼’`; +SELECT * FROM `T3`; + +#MyISAM +SELECT * FROM `ï¼´ï¼”`; +SELECT * FROM `T5`; +SELECT * FROM `ï¼´ï¼–`; + +#HEAP +SELECT * FROM `ï¼´ï¼—`; +SELECT * FROM `T8`; +SELECT * FROM `ï¼´ï¼™`; + +#BDB +SELECT * FROM `T1ï¼`; +SELECT * FROM `T11`; +SELECT * FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_where_sjis.test b/mysql-test/suite/jp/t/jp_where_sjis.test new file mode 100644 index 00000000000..452d137f643 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_sjis.test @@ -0,0 +1,104 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT * FROM `‚s‚P` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#MyISAM +SELECT * FROM `‚s‚S` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#Heap +SELECT * FROM `‚s‚V` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#BDB +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#Test to distinguish 0x9353 and 0x9373 +CREATE TABLE t1(c1 char(1)) default charset = sjis engine=innodb; +CREATE TABLE t2(c1 char(1)) default charset = sjis engine=myisam; +CREATE TABLE t3(c1 char(1)) default charset = sjis engine=heap; +CREATE TABLE t4(c1 char(1)) default charset = sjis engine=bdb; +INSERT INTO t1 VALUES('“S'),('“s'); +INSERT INTO t2 VALUES('“S'),('“s'); +INSERT INTO t3 VALUES('“S'),('“s'); +INSERT INTO t4 VALUES('“S'),('“s'); +SELECT * FROM t1 WHERE c1 = '“S'; +SELECT * FROM t2 WHERE c1 = '“S'; +SELECT * FROM t3 WHERE c1 = '“S'; +SELECT * FROM t4 WHERE c1 = '“S'; +SELECT * FROM t1 WHERE c1 = '“s'; +SELECT * FROM t2 WHERE c1 = '“s'; +SELECT * FROM t3 WHERE c1 = '“s'; +SELECT * FROM t4 WHERE c1 = '“s'; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_where_ucs2.test b/mysql-test/suite/jp/t/jp_where_ucs2.test new file mode 100644 index 00000000000..3b82eacd615 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_ucs2.test @@ -0,0 +1,175 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬ŽŽ®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬ÐЮЯабвг') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬óó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_where_ujis.test b/mysql-test/suite/jp/t/jp_where_ujis.test new file mode 100644 index 00000000000..e96404fbb17 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_ujis.test @@ -0,0 +1,87 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_where_utf8.test b/mysql-test/suite/jp/t/jp_where_utf8.test new file mode 100644 index 00000000000..7280bc33f21 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_utf8.test @@ -0,0 +1,85 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT * FROM `T1` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T3` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#MyISAM +SELECT * FROM `ï¼´ï¼”` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T5` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#Heap +SELECT * FROM `ï¼´ï¼—` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T8` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#BDB +SELECT * FROM `T1ï¼` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T11` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T12` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index eb35aa90fe2..c2277dc1755 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -207,6 +207,7 @@ alter table t1 change a a text character set cp1251; select a,hex(a) from t1; alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; +delete from t1; # # Test ALTER TABLE .. CHARACTER SET .. @@ -323,3 +324,26 @@ alter table t1 rename to `t1\\`; rename table t1 to `t1\\`; drop table t1; +# +# Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns +# +# The column's character set was changed but the actual data was not +# modified. In other words, the values were reinterpreted +# as UTF8 instead of being converted. +create table t1 (a text) character set koi8r; +insert into t1 values (_koi8r'ÔÅÓÔ'); +select hex(a) from t1; +alter table t1 convert to character set cp1251; +select hex(a) from t1; +drop table t1; + +# +# Test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix" +# MySQL should not think that packed field with non-zero decimals is +# geometry field and allow to create prefix index which is +# shorter than packed field length. +# +create table t1 ( a timestamp ); +--error 1089 +alter table t1 add unique ( a(1) ); +drop table t1; diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 47f3473584b..52e367769a2 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -38,3 +38,12 @@ select * from t2; insert into t2 select * from t1 procedure analyse(); select * from t2; drop table t1,t2; + +# +# Bug#2813 - analyse does not quote string values in enums from string +# + +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +select * from t1 procedure analyse(); +drop table t1; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index f55aea6e104..ee78b53f9c8 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1,6 +1,6 @@ # # Simple test for archive example -# Taken fromm the select test +# Taken from the select test # -- source include/have_archive.inc diff --git a/mysql-test/t/bdb-deadlock.tminus b/mysql-test/t/bdb-deadlock.tminus new file mode 100644 index 00000000000..d86403fcffc --- /dev/null +++ b/mysql-test/t/bdb-deadlock.tminus @@ -0,0 +1,57 @@ +# This test doesn't work with the embedded version as this code +# assumes that one query is running while we are doing queries on +# a second connection. +# This would work if mysqltest run would be threaded and handle each +# connection in a separate thread. +# + +#-- source include/not_embedded.inc +-- source include/have_bdb.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +connection con1; +create table t1 (id integer, x integer) engine=BDB; +create table t2 (id integer, x integer) engine=BDB; +insert into t1 values(0, 0); +insert into t2 values(0, 0); +set autocommit=0; +update t1 set x = 1 where id = 0; + +connection con2; +set autocommit=0; +update t2 set x = 1 where id = 0; + +# The following query should hang because con1 is locking the page +--send +select x from t1 where id = 0; + +connection con1; +# This should generate a deadlock as we are trying to access a locked row +--send +select x from t2 where id = 0; + +connection con2; +--error 1213 +reap; +commit; + +connection con1; +reap; +commit; + +connection con2; +select * from t1; +select * from t2; +commit; + +connection con1; +select * from t1; +select * from t2; +commit; + +drop table t1,t2; diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test index 3e702fd5257..54ad8e92237 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -80,3 +80,10 @@ select * from t1 where firstname='john' and firstname = binary 'john'; select * from t1 where firstname='John' and firstname like binary 'john'; select * from t1 where firstname='john' and firstname like binary 'John'; drop table t1; + +# +# Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not +# +create table t1 (a binary); +show create table t1; +drop table t1; diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index e5681dedbac..23bba7d5aff 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -108,3 +108,13 @@ SELECT a, CAST(a AS CHAR(3)) FROM t1 ORDER BY CAST(a AS CHAR(2)), a; SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ; SELECT a, CAST(a AS CHAR(2)) FROM t1 ORDER BY CAST(a AS CHAR(3)), a; DROP TABLE t1; + +# +# Test for bug #6914 "Problems using time()/date() output in expressions". +# When we are casting datetime value to DATE/TIME we should throw away +# time/date parts (correspondingly). +# +select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour); +select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00'); +# Still we should not throw away "days" part of time value +select timediff(cast('1 12:00:00' as time), '12:00:00'); diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test deleted file mode 100644 index b56e8038d9b..00000000000 --- a/mysql-test/t/client_test.test +++ /dev/null @@ -1,2 +0,0 @@ ---disable_result_log ---exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT diff --git a/mysql-test/t/comments.test b/mysql-test/t/comments.test index 2fc6237907c..087df60f3f5 100644 --- a/mysql-test/t/comments.test +++ b/mysql-test/t/comments.test @@ -5,7 +5,8 @@ select 1+2/*hello*/+3; select 1 /* long multi line comment */; -!$1065 ; +--error 1065 + ; select 1 /*!32301 +1 */; select 1 /*!52301 +1 */; select 1--1; diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index b0cef48dd3f..bc20786227b 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -30,3 +30,8 @@ CREATE TABLE t1 (a char(10) not null); INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; DROP TABLE t1; + +# Bug #8134: Comparison against CHAR(31) at end of string +SELECT CHAR(31) = '', '' = CHAR(31); +# Extra test +SELECT CHAR(30) = '', '' = CHAR(30); diff --git a/mysql-test/t/consistent_snapshot.test b/mysql-test/t/consistent_snapshot.test new file mode 100644 index 00000000000..7afdae36325 --- /dev/null +++ b/mysql-test/t/consistent_snapshot.test @@ -0,0 +1,41 @@ +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +### Test 1: +### - While a consistent snapshot transaction is executed, +### no external inserts should be visible to the transaction. + +connection con1; +create table t1 (a int) engine=innodb; +start transaction with consistent snapshot; + +connection con2; +insert into t1 values(1); + +connection con1; +select * from t1; # if consistent snapshot was set as expected, we +# should see nothing. +commit; + +### Test 2: +### - For any non-consistent snapshot transaction, external +### committed inserts should be visible to the transaction. + +delete from t1; +start transaction; # Now we omit WITH CONSISTENT SNAPSHOT + +connection con2; +insert into t1 values(1); + +connection con1; +select * from t1; # if consistent snapshot was not set, as expected, we +# should see 1. +commit; + +drop table t1; diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index 9bf1808636e..8b75123ca32 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -7,12 +7,12 @@ drop table if exists t1; --enable_warnings -SET NAMES big5; +SET @test_character_set= 'big5'; +SET @test_collation= 'big5_chinese_ci'; +-- source include/ctype_common.inc -# -# Bug 1883: LIKE did not work in some cases with a key. -# -CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c)); -INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT * FROM t1 WHERE c LIKE 'aaa%'; -DROP TABLE t1; +SET NAMES big5; +SET collation_connection='big5_chinese_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='big5_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 66a8a5aa909..2d670ec3607 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -32,3 +32,17 @@ select * from t1 where lower(b)='bbb'; select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1; select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; drop table t1; + +# Test for BUG#8560 +create table t1 ( + a varchar(16) character set cp1251 collate cp1251_bin not null, + b int(10) default null, + primary key(a) +) charset=cp1251; +insert into t1 (a) values ('air'), + ('we'),('g'),('we_toshko'), ('s0urce'),('we_ivo'),('we_iliyan'), + ('we_martin'),('vw_grado'),('vw_vasko'),('tn_vili'),('tn_kalina'), + ('tn_fakira'),('vw_silvia'),('vw_starshi'),('vw_geo'),('vw_b0x1'); + +select * from t1 where a like 'we_%'; +drop table t1; diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test index 9a5cb025474..e97017ab416 100644 --- a/mysql-test/t/ctype_create.test +++ b/mysql-test/t/ctype_create.test @@ -86,3 +86,15 @@ create database d1 default character set latin1 collate latin2_bin; # # DROP DATABASE mysqltest1; + + +# +# Synatx: 'ALTER DATABASE' without db_name +# +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +use mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +show create database mysqltest2; +drop database mysqltest2; +--error 1046 +ALTER DATABASE DEFAULT CHARACTER SET latin2; diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 14062437428..6006ee4c527 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -53,3 +53,25 @@ SELECT hex(@l:=convert(@u using latin1)), a=@l FROM t1; DROP TABLE t1; + +# +# Bug #6737: REGEXP gives wrong result with case sensitive collation +# +select 'a' regexp 'A' collate latin1_general_ci; +select 'a' regexp 'A' collate latin1_general_cs; +select 'a' regexp 'A' collate latin1_bin; + + +SET collation_connection='latin1_swedish_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='latin1_bin'; +-- source include/ctype_filesort.inc + +# +# Bug#8041 +# An unknown character (e.g. 0x84) should result in ERROR, +# It was treated like a space character earlier. +# Howerver, it should still work fine as a string part. +--error 1064 +CREATE TABLE „a (a int); +SELECT '„a' as str; diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index 1c9576c1c56..512ae88a445 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -114,3 +114,21 @@ SELECT s1,COUNT(*) FROM t1 GROUP BY s1; SELECT COUNT(DISTINCT s1) FROM t1; SELECT FIELD('ue',s1), FIELD('Ü',s1), s1='ue', s1='Ü' FROM t1; DROP TABLE t1; + +-- source include/ctype_filesort.inc + +# +# Bug#7878 with utf8_general_ci, equals (=) has problem with +# accent insensitivity. +# Although originally this problem was found with UTF8 character set, +# '=' behaved wrong for latin1_german2_ci as well. +# Let's check it does not work incorrect anymore. +# +SET NAMES latin1; +CREATE TABLE t1 ( + col1 varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 collate latin1_german2_ci; +INSERT INTO t1 VALUES ('ß'),('ss'),('ss'); +ALTER TABLE t1 ADD KEY ifword(col1); +SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1; +DROP TABLE t1; diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 82d0643b577..0e5e954c720 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -121,3 +121,61 @@ CREATE TABLE `goodÐÌÏÈÏ` (a int); SET NAMES utf8; --error 1300 CREATE TABLE `goodÐÌÏÈÏ` (a int); + + +# +# Test that we produce a warnign when conversion loses data. +# +set names latin1; +create table t1 (a char(10) character set koi8r, b text character set koi8r); +insert into t1 values ('test','test'); +insert into t1 values ('ÊÃÕË','ÊÃÕË'); +drop table t1; + +# +# Try to apply an automatic conversion in some cases: +# E.g. when mixing a column to a string, the string +# is converted into the column character set. +# If conversion loses data, then error. Otherwise, +# the string is replaced by its converted representation +# +set names koi8r; +create table t1 (a char(10) character set cp1251); +insert into t1 values (_koi8r'×ÁÓÑ'); +# this is possible: +select * from t1 where a=_koi8r'×ÁÓÑ'; +# this is not possible, because we have a function, not just a constant: +--error 1267 +select * from t1 where a=concat(_koi8r'×ÁÓÑ'); +# this is not posible, cannot convert _latin1'×ÁÓÑ' into cp1251: +--error 1267 +select * from t1 where a=_latin1'×ÁÓÑ'; +drop table t1; +set names latin1; + +# +# Check more automatic conversion +# +set names koi8r; +create table t1 (c1 char(10) character set cp1251); +insert into t1 values ('ß'); +select c1 from t1 where c1 between 'ß' and 'ß'; +select ifnull(c1,'ß'), ifnull(null,c1) from t1; +select if(1,c1,'ö'), if(0,c1,'ö') from t1; +select coalesce('ö',c1), coalesce(null,c1) from t1; +select least(c1,'ö'), greatest(c1,'ö') from t1; +select locate(c1,'ß'), locate('ß',c1) from t1; +select field(c1,'ß'),field('ß',c1) from t1; +select concat(c1,'ö'), concat('ö',c1) from t1; +select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1; +select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1; +select substring_index(c1,'öößß',2) from t1; +select elt(1,c1,'ö'),elt(1,'ö',c1) from t1; +select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1; +select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1; +select trim(c1 from 'ß'),trim('ß' from c1) from t1; +select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1; +select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; +# TODO +#select case c1 when 'ß' then 'ß' when 'ö' then 'ö' else 'c' end from t1; +#select export_set(5,c1,'ö'), export_set(5,'ö',c1) from t1; diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index c910812ef8a..50d286f28b9 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -51,3 +51,27 @@ insert into t1 values (0x9353); insert into t1 values (0x9373); select hex(c) from t1; drop table t1; + +# +# Bug #6223 Japanese half-width kana characters get truncated +# +SET NAMES sjis; +CREATE TABLE t1 ( + c char(16) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis; +insert into t1 values(0xb1),(0xb2),(0xb3); +select hex(c) from t1; +drop table t1; + + +SET collation_connection='sjis_japanese_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='sjis_bin'; +-- source include/ctype_filesort.inc + +# Check parsing of string literals in SJIS with multibyte characters that +# have an embedded \ in them. (Bug #8303) + +--character_set sjis +SET NAMES sjis; +SELECT HEX('²“‘@\Œ\') FROM DUAL; diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test index 92a9eada05f..87047db9b54 100644 --- a/mysql-test/t/ctype_tis620.test +++ b/mysql-test/t/ctype_tis620.test @@ -116,3 +116,44 @@ CREATE TABLE t1 (a char(10) not null) CHARACTER SET tis620; INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; DROP TABLE t1; + +# +# Bug#6608 +# +CREATE TABLE t1 ( + `id` int(11) NOT NULL auto_increment, + `url` varchar(200) NOT NULL default '', + `name` varchar(250) NOT NULL default '', + `type` int(11) NOT NULL default '0', + `website` varchar(250) NOT NULL default '', + `adddate` date NOT NULL default '0000-00-00', + `size` varchar(20) NOT NULL default '', + `movieid` int(11) NOT NULL default '0', + `musicid` int(11) NOT NULL default '0', + `star` varchar(20) NOT NULL default '', + `download` int(11) NOT NULL default '0', + `lastweek` int(11) NOT NULL default '0', + `thisweek` int(11) NOT NULL default '0', + `page` varchar(250) NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`url`) +) CHARACTER SET tis620; + +INSERT INTO t1 VALUES +(1,'http://www.siamzone.com/download/download/000001-frodo_1024.jpg','The Lord +of the Rings +Wallpapers',1,'http://www.lordoftherings.net','2002-01-22','',448,0,'',3805,0,0, +''); +INSERT INTO t1 VALUES (2,'http://www.othemovie.com/OScreenSaver1.EXE','O +Screensaver',2,'','2002-01-22','',491,0,'',519,0,0,''); +INSERT INTO t1 VALUES +(3,'http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg','Jaso +n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,''); +select * from t1 order by id; +DROP TABLE t1; + + +SET collation_connection='tis620_thai_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='tis620_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 708a31d637e..dfca82fa70a 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -25,6 +25,11 @@ select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; select 'a a' > 'a', 'a \t' < 'a'; # +# Bug #6787 LIKE not working properly with _ and utf8 data +# +select 'c' like '\_' as want0; + +# # Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters # CREATE TABLE t ( @@ -435,3 +440,18 @@ INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; DROP TABLE t1; + +SET @test_character_set= 'utf8'; +SET @test_collation= 'utf8_swedish_ci'; +-- source include/ctype_common.inc + +# +# Bug 7111 server crashes when regexp is used +# +create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; +insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); +select a, a regexp '[a]' from t1 order by binary a; +drop table t1; + +SET collation_connection='utf8_unicode_ci'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index d9ef91496e9..38956e12a3b 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -4,6 +4,10 @@ DROP TABLE IF EXISTS t1; --enable_warnings +SET NAMES latin1; +SET character_set_connection=ucs2; +-- source include/endspace.inc + SET CHARACTER SET koi8r; # @@ -315,3 +319,95 @@ alter table t1 modify a char(5); select a, hex(a) from t1; drop table t1; +# +# Check prepare statement from an UCS2 string +# +set @ivar= 1234; +set @str1 = 'select ?'; +set @str2 = convert(@str1 using ucs2); +prepare stmt1 from @str2; +execute stmt1 using @ivar; + +# +# Check correct binlogging of UCS2 user variables (BUG#3875) +# +SET TIMESTAMP=10000; +create table t2 (c char(30)) charset=ucs2; +set @v=convert('abc' using ucs2); +reset master; +insert into t2 values (@v); +show binlog events from 79; +# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we +# absolutely need variables names to be quoted and strings to be +# escaped). +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 +drop table t2; + + +# +# Check that ucs2 works with ENUM and SET type +# +set names latin1; +create table t1 (a enum('x','y','z') character set ucs2); +show create table t1; +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2; +show create table t1; +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('Ä'); +insert into t1 values ('Ö'); +insert into t1 values ('Ü'); +select a, hex(a) from t1 order by a; +drop table t1; + +create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2); +show create table t1; +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,Ä,Ö,Ü'); +select a, hex(a) from t1 order by a; +drop table t1; + +# +# Bug#7302 UCS2 data in ENUM fields get truncated when new column is added +# +create table t1(a enum('a','b','c')) default character set ucs2; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +select * from t1 order by a; +drop table t1; + +SET collation_connection='ucs2_general_ci'; +-- source include/ctype_filesort.inc +SET NAMES latin1; +SET collation_connection='ucs2_bin'; +-- source include/ctype_filesort.inc + +SET NAMES latin1; +# +# Bug#8235 +# +# This bug also helped to find another problem that +# INSERT of a UCS2 string containing a negative number +# into a unsigned int column didn't produce warnings. +# This test covers both problems. +# +SET collation_connection='ucs2_swedish_ci'; +CREATE TABLE t1 (Field1 int(10) default '0'); +# no warnings, negative numbers are allowed +INSERT INTO t1 VALUES ('-1'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (Field1 int(10) unsigned default '0'); +# this should generate a "Data truncated" warning +INSERT INTO t1 VALUES ('-1'); +DROP TABLE t1; +SET NAMES latin1; diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index e5405d9f1bd..407287be30a 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -83,3 +83,1067 @@ CREATE TABLE t1 ( SHOW CREATE TABLE t1; SHOW COLUMNS FROM t1; DROP TABLE t1; + +# +# Bug #6345 Unexpected behaviour with partial indices +# +--disable_warnings +CREATE TABLE t1 +( + a INTEGER NOT NULL, + b VARCHAR(50) NOT NULL DEFAULT '', + PRIMARY KEY (a), + KEY b (b(10)) +) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +--enable_warnings +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +DROP TABLE t1; +--disable_warnings +CREATE TABLE t1 +( + a INTEGER NOT NULL, + b VARCHAR(50) NOT NULL DEFAULT '', + PRIMARY KEY (a), + KEY b (b(10)) +) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +--enable_warnings +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +DROP TABLE t1; + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(c char(1)) character set ujis; +INSERT INTO t1 VALUES(0xA2AF); +INSERT INTO t1 VALUES(0xA2B0); +INSERT INTO t1 VALUES(0xA2B1); +INSERT INTO t1 VALUES(0xA2B2); +INSERT INTO t1 VALUES(0xA2B3); +INSERT INTO t1 VALUES(0xA2B4); +INSERT INTO t1 VALUES(0xA2B5); +INSERT INTO t1 VALUES(0xA2B6); +INSERT INTO t1 VALUES(0xA2B7); +INSERT INTO t1 VALUES(0xA2B8); +INSERT INTO t1 VALUES(0xA2B9); +INSERT INTO t1 VALUES(0xA2C2); +INSERT INTO t1 VALUES(0xA2C3); +INSERT INTO t1 VALUES(0xA2C4); +INSERT INTO t1 VALUES(0xA2C5); +INSERT INTO t1 VALUES(0xA2C6); +INSERT INTO t1 VALUES(0xA2C7); +INSERT INTO t1 VALUES(0xA2C8); +INSERT INTO t1 VALUES(0xA2C9); +INSERT INTO t1 VALUES(0xA2D1); +INSERT INTO t1 VALUES(0xA2D2); +INSERT INTO t1 VALUES(0xA2D3); +INSERT INTO t1 VALUES(0xA2D4); +INSERT INTO t1 VALUES(0xA2D5); +INSERT INTO t1 VALUES(0xA2D6); +INSERT INTO t1 VALUES(0xA2D7); +INSERT INTO t1 VALUES(0xA2D8); +INSERT INTO t1 VALUES(0xA2D9); +INSERT INTO t1 VALUES(0xA2DA); +INSERT INTO t1 VALUES(0xA2DB); +INSERT INTO t1 VALUES(0xA2EB); +INSERT INTO t1 VALUES(0xA2EC); +INSERT INTO t1 VALUES(0xA2ED); +INSERT INTO t1 VALUES(0xA2EE); +INSERT INTO t1 VALUES(0xA2EF); +INSERT INTO t1 VALUES(0xA2F0); +INSERT INTO t1 VALUES(0xA2F1); +INSERT INTO t1 VALUES(0xA2FA); +INSERT INTO t1 VALUES(0xA2FB); +INSERT INTO t1 VALUES(0xA2FC); +INSERT INTO t1 VALUES(0xA2FD); +INSERT INTO t1 VALUES(0xA3A1); +INSERT INTO t1 VALUES(0xA3A2); +INSERT INTO t1 VALUES(0xA3A3); +INSERT INTO t1 VALUES(0xA3A4); +INSERT INTO t1 VALUES(0xA3A5); +INSERT INTO t1 VALUES(0xA3A6); +INSERT INTO t1 VALUES(0xA3A7); +INSERT INTO t1 VALUES(0xA3A8); +INSERT INTO t1 VALUES(0xA3A9); +INSERT INTO t1 VALUES(0xA3AA); +INSERT INTO t1 VALUES(0xA3AB); +INSERT INTO t1 VALUES(0xA3AC); +INSERT INTO t1 VALUES(0xA3AD); +INSERT INTO t1 VALUES(0xA3AE); +INSERT INTO t1 VALUES(0xA3AF); +INSERT INTO t1 VALUES(0xA3BA); +INSERT INTO t1 VALUES(0xA3BB); +INSERT INTO t1 VALUES(0xA3BC); +INSERT INTO t1 VALUES(0xA3BD); +INSERT INTO t1 VALUES(0xA3BE); +INSERT INTO t1 VALUES(0xA3BF); +INSERT INTO t1 VALUES(0xA3C0); +INSERT INTO t1 VALUES(0xA3DB); +INSERT INTO t1 VALUES(0xA3DC); +INSERT INTO t1 VALUES(0xA3DD); +INSERT INTO t1 VALUES(0xA3DE); +INSERT INTO t1 VALUES(0xA3DF); +INSERT INTO t1 VALUES(0xA3E0); +INSERT INTO t1 VALUES(0xA3FB); +INSERT INTO t1 VALUES(0xA3FC); +INSERT INTO t1 VALUES(0xA3FD); +INSERT INTO t1 VALUES(0xA3FE); +INSERT INTO t1 VALUES(0xA4F4); +INSERT INTO t1 VALUES(0xA4F5); +INSERT INTO t1 VALUES(0xA4F6); +INSERT INTO t1 VALUES(0xA4F7); +INSERT INTO t1 VALUES(0xA4F8); +INSERT INTO t1 VALUES(0xA4F9); +INSERT INTO t1 VALUES(0xA4FA); +INSERT INTO t1 VALUES(0xA4FB); +INSERT INTO t1 VALUES(0xA4FC); +INSERT INTO t1 VALUES(0xA4FD); +INSERT INTO t1 VALUES(0xA4FE); +INSERT INTO t1 VALUES(0xA5F7); +INSERT INTO t1 VALUES(0xA5F8); +INSERT INTO t1 VALUES(0xA5F9); +INSERT INTO t1 VALUES(0xA5FA); +INSERT INTO t1 VALUES(0xA5FB); +INSERT INTO t1 VALUES(0xA5FC); +INSERT INTO t1 VALUES(0xA5FD); +INSERT INTO t1 VALUES(0xA5FE); +INSERT INTO t1 VALUES(0xA6B9); +INSERT INTO t1 VALUES(0xA6BA); +INSERT INTO t1 VALUES(0xA6BB); +INSERT INTO t1 VALUES(0xA6BC); +INSERT INTO t1 VALUES(0xA6BD); +INSERT INTO t1 VALUES(0xA6BE); +INSERT INTO t1 VALUES(0xA6BF); +INSERT INTO t1 VALUES(0xA6C0); +INSERT INTO t1 VALUES(0xA6D9); +INSERT INTO t1 VALUES(0xA6DA); +INSERT INTO t1 VALUES(0xA6DB); +INSERT INTO t1 VALUES(0xA6DC); +INSERT INTO t1 VALUES(0xA6DD); +INSERT INTO t1 VALUES(0xA6DE); +INSERT INTO t1 VALUES(0xA6DF); +INSERT INTO t1 VALUES(0xA6E0); +INSERT INTO t1 VALUES(0xA6E1); +INSERT INTO t1 VALUES(0xA6E2); +INSERT INTO t1 VALUES(0xA6E3); +INSERT INTO t1 VALUES(0xA6E4); +INSERT INTO t1 VALUES(0xA6E5); +INSERT INTO t1 VALUES(0xA6E6); +INSERT INTO t1 VALUES(0xA6E7); +INSERT INTO t1 VALUES(0xA6E8); +INSERT INTO t1 VALUES(0xA6E9); +INSERT INTO t1 VALUES(0xA6EA); +INSERT INTO t1 VALUES(0xA6EB); +INSERT INTO t1 VALUES(0xA6EC); +INSERT INTO t1 VALUES(0xA6ED); +INSERT INTO t1 VALUES(0xA6EE); +INSERT INTO t1 VALUES(0xA6EF); +INSERT INTO t1 VALUES(0xA6F0); +INSERT INTO t1 VALUES(0xA6F1); +INSERT INTO t1 VALUES(0xA6F2); +INSERT INTO t1 VALUES(0xA6F3); +INSERT INTO t1 VALUES(0xA6F4); +INSERT INTO t1 VALUES(0xA6F5); +INSERT INTO t1 VALUES(0xA6F6); +INSERT INTO t1 VALUES(0xA6F7); +INSERT INTO t1 VALUES(0xA6F8); +INSERT INTO t1 VALUES(0xA6F9); +INSERT INTO t1 VALUES(0xA6FA); +INSERT INTO t1 VALUES(0xA6FB); +INSERT INTO t1 VALUES(0xA6FC); +INSERT INTO t1 VALUES(0xA6FD); +INSERT INTO t1 VALUES(0xA6FE); +INSERT INTO t1 VALUES(0xA7C2); +INSERT INTO t1 VALUES(0xA7C3); +INSERT INTO t1 VALUES(0xA7C4); +INSERT INTO t1 VALUES(0xA7C5); +INSERT INTO t1 VALUES(0xA7C6); +INSERT INTO t1 VALUES(0xA7C7); +INSERT INTO t1 VALUES(0xA7C8); +INSERT INTO t1 VALUES(0xA7C9); +INSERT INTO t1 VALUES(0xA7CA); +INSERT INTO t1 VALUES(0xA7CB); +INSERT INTO t1 VALUES(0xA7CC); +INSERT INTO t1 VALUES(0xA7CD); +INSERT INTO t1 VALUES(0xA7CE); +INSERT INTO t1 VALUES(0xA7CF); +INSERT INTO t1 VALUES(0xA7D0); +INSERT INTO t1 VALUES(0xA7F2); +INSERT INTO t1 VALUES(0xA7F3); +INSERT INTO t1 VALUES(0xA7F4); +INSERT INTO t1 VALUES(0xA7F5); +INSERT INTO t1 VALUES(0xA7F6); +INSERT INTO t1 VALUES(0xA7F7); +INSERT INTO t1 VALUES(0xA7F8); +INSERT INTO t1 VALUES(0xA7F9); +INSERT INTO t1 VALUES(0xA7FA); +INSERT INTO t1 VALUES(0xA7FB); +INSERT INTO t1 VALUES(0xA7FC); +INSERT INTO t1 VALUES(0xA7FD); +INSERT INTO t1 VALUES(0xA7FE); +INSERT INTO t1 VALUES(0xA8C1); +INSERT INTO t1 VALUES(0xA8C2); +INSERT INTO t1 VALUES(0xA8C3); +INSERT INTO t1 VALUES(0xA8C4); +INSERT INTO t1 VALUES(0xA8C5); +INSERT INTO t1 VALUES(0xA8C6); +INSERT INTO t1 VALUES(0xA8C7); +INSERT INTO t1 VALUES(0xA8C8); +INSERT INTO t1 VALUES(0xA8C9); +INSERT INTO t1 VALUES(0xA8CA); +INSERT INTO t1 VALUES(0xA8CB); +INSERT INTO t1 VALUES(0xA8CC); +INSERT INTO t1 VALUES(0xA8CD); +INSERT INTO t1 VALUES(0xA8CE); +INSERT INTO t1 VALUES(0xA8CF); +INSERT INTO t1 VALUES(0xA8D0); +INSERT INTO t1 VALUES(0xA8D1); +INSERT INTO t1 VALUES(0xA8D2); +INSERT INTO t1 VALUES(0xA8D3); +INSERT INTO t1 VALUES(0xA8D4); +INSERT INTO t1 VALUES(0xA8D5); +INSERT INTO t1 VALUES(0xA8D6); +INSERT INTO t1 VALUES(0xA8D7); +INSERT INTO t1 VALUES(0xA8D8); +INSERT INTO t1 VALUES(0xA8D9); +INSERT INTO t1 VALUES(0xA8DA); +INSERT INTO t1 VALUES(0xA8DB); +INSERT INTO t1 VALUES(0xA8DC); +INSERT INTO t1 VALUES(0xA8DD); +INSERT INTO t1 VALUES(0xA8DE); +INSERT INTO t1 VALUES(0xA8DF); +INSERT INTO t1 VALUES(0xA8E0); +INSERT INTO t1 VALUES(0xA8E1); +INSERT INTO t1 VALUES(0xA8E2); +INSERT INTO t1 VALUES(0xA8E3); +INSERT INTO t1 VALUES(0xA8E4); +INSERT INTO t1 VALUES(0xA8E5); +INSERT INTO t1 VALUES(0xA8E6); +INSERT INTO t1 VALUES(0xA8E7); +INSERT INTO t1 VALUES(0xA8E8); +INSERT INTO t1 VALUES(0xA8E9); +INSERT INTO t1 VALUES(0xA8EA); +INSERT INTO t1 VALUES(0xA8EB); +INSERT INTO t1 VALUES(0xA8EC); +INSERT INTO t1 VALUES(0xA8ED); +INSERT INTO t1 VALUES(0xA8EE); +INSERT INTO t1 VALUES(0xA8EF); +INSERT INTO t1 VALUES(0xA8F0); +INSERT INTO t1 VALUES(0xA8F1); +INSERT INTO t1 VALUES(0xA8F2); +INSERT INTO t1 VALUES(0xA8F3); +INSERT INTO t1 VALUES(0xA8F4); +INSERT INTO t1 VALUES(0xA8F5); +INSERT INTO t1 VALUES(0xA8F6); +INSERT INTO t1 VALUES(0xA8F7); +INSERT INTO t1 VALUES(0xA8F8); +INSERT INTO t1 VALUES(0xA8F9); +INSERT INTO t1 VALUES(0xA8FA); +INSERT INTO t1 VALUES(0xA8FB); +INSERT INTO t1 VALUES(0xA8FC); +INSERT INTO t1 VALUES(0xA8FD); +INSERT INTO t1 VALUES(0xA8FE); +INSERT INTO t1 VALUES(0xA9A1); +INSERT INTO t1 VALUES(0xA9A2); +INSERT INTO t1 VALUES(0xA9A3); +INSERT INTO t1 VALUES(0xA9A4); +INSERT INTO t1 VALUES(0xA9A5); +INSERT INTO t1 VALUES(0xA9A6); +INSERT INTO t1 VALUES(0xA9A7); +INSERT INTO t1 VALUES(0xA9A8); +INSERT INTO t1 VALUES(0xA9A9); +INSERT INTO t1 VALUES(0xA9AA); +INSERT INTO t1 VALUES(0xA9AB); +INSERT INTO t1 VALUES(0xA9AC); +INSERT INTO t1 VALUES(0xA9AD); +INSERT INTO t1 VALUES(0xA9AE); +INSERT INTO t1 VALUES(0xA9AF); +INSERT INTO t1 VALUES(0xA9B0); +INSERT INTO t1 VALUES(0xA9B1); +INSERT INTO t1 VALUES(0xA9B2); +INSERT INTO t1 VALUES(0xA9B3); +INSERT INTO t1 VALUES(0xA9B4); +INSERT INTO t1 VALUES(0xA9B5); +INSERT INTO t1 VALUES(0xA9B6); +INSERT INTO t1 VALUES(0xA9B7); +INSERT INTO t1 VALUES(0xA9B8); +INSERT INTO t1 VALUES(0xA9B9); +INSERT INTO t1 VALUES(0xA9BA); +INSERT INTO t1 VALUES(0xA9BB); +INSERT INTO t1 VALUES(0xA9BC); +INSERT INTO t1 VALUES(0xA9BD); +INSERT INTO t1 VALUES(0xA9BE); +INSERT INTO t1 VALUES(0xA9BF); +INSERT INTO t1 VALUES(0xA9C0); +INSERT INTO t1 VALUES(0xA9C1); +INSERT INTO t1 VALUES(0xA9C2); +INSERT INTO t1 VALUES(0xA9C3); +INSERT INTO t1 VALUES(0xA9C4); +INSERT INTO t1 VALUES(0xA9C5); +INSERT INTO t1 VALUES(0xA9C6); +INSERT INTO t1 VALUES(0xA9C7); +INSERT INTO t1 VALUES(0xA9C8); +INSERT INTO t1 VALUES(0xA9C9); +INSERT INTO t1 VALUES(0xA9CA); +INSERT INTO t1 VALUES(0xA9CB); +INSERT INTO t1 VALUES(0xA9CC); +INSERT INTO t1 VALUES(0xA9CD); +INSERT INTO t1 VALUES(0xA9CE); +INSERT INTO t1 VALUES(0xA9CF); +INSERT INTO t1 VALUES(0xA9D0); +INSERT INTO t1 VALUES(0xA9D1); +INSERT INTO t1 VALUES(0xA9D2); +INSERT INTO t1 VALUES(0xA9D3); +INSERT INTO t1 VALUES(0xA9D4); +INSERT INTO t1 VALUES(0xA9D5); +INSERT INTO t1 VALUES(0xA9D6); +INSERT INTO t1 VALUES(0xA9D7); +INSERT INTO t1 VALUES(0xA9D8); +INSERT INTO t1 VALUES(0xA9D9); +INSERT INTO t1 VALUES(0xA9DA); +INSERT INTO t1 VALUES(0xA9DB); +INSERT INTO t1 VALUES(0xA9DC); +INSERT INTO t1 VALUES(0xA9DD); +INSERT INTO t1 VALUES(0xA9DE); +INSERT INTO t1 VALUES(0xA9DF); +INSERT INTO t1 VALUES(0xA9E0); +INSERT INTO t1 VALUES(0xA9E1); +INSERT INTO t1 VALUES(0xA9E2); +INSERT INTO t1 VALUES(0xA9E3); +INSERT INTO t1 VALUES(0xA9E4); +INSERT INTO t1 VALUES(0xA9E5); +INSERT INTO t1 VALUES(0xA9E6); +INSERT INTO t1 VALUES(0xA9E7); +INSERT INTO t1 VALUES(0xA9E8); +INSERT INTO t1 VALUES(0xA9E9); +INSERT INTO t1 VALUES(0xA9EA); +INSERT INTO t1 VALUES(0xA9EB); +INSERT INTO t1 VALUES(0xA9EC); +INSERT INTO t1 VALUES(0xA9ED); +INSERT INTO t1 VALUES(0xA9EE); +INSERT INTO t1 VALUES(0xA9EF); +INSERT INTO t1 VALUES(0xA9F0); +INSERT INTO t1 VALUES(0xA9F1); +INSERT INTO t1 VALUES(0xA9F2); +INSERT INTO t1 VALUES(0xA9F3); +INSERT INTO t1 VALUES(0xA9F4); +INSERT INTO t1 VALUES(0xA9F5); +INSERT INTO t1 VALUES(0xA9F6); +INSERT INTO t1 VALUES(0xA9F7); +INSERT INTO t1 VALUES(0xA9F8); +INSERT INTO t1 VALUES(0xA9F9); +INSERT INTO t1 VALUES(0xA9FA); +INSERT INTO t1 VALUES(0xA9FB); +INSERT INTO t1 VALUES(0xA9FC); +INSERT INTO t1 VALUES(0xA9FD); +INSERT INTO t1 VALUES(0xA9FE); +INSERT INTO t1 VALUES(0xAAA1); +INSERT INTO t1 VALUES(0xAAA2); +INSERT INTO t1 VALUES(0xAAA3); +INSERT INTO t1 VALUES(0xAAA4); +INSERT INTO t1 VALUES(0xAAA5); +INSERT INTO t1 VALUES(0xAAA6); +INSERT INTO t1 VALUES(0xAAA7); +INSERT INTO t1 VALUES(0xAAA8); +INSERT INTO t1 VALUES(0xAAA9); +INSERT INTO t1 VALUES(0xAAAA); +INSERT INTO t1 VALUES(0xAAAB); +INSERT INTO t1 VALUES(0xAAAC); +INSERT INTO t1 VALUES(0xAAAD); +INSERT INTO t1 VALUES(0xAAAE); +INSERT INTO t1 VALUES(0xAAAF); +INSERT INTO t1 VALUES(0xAAB0); +INSERT INTO t1 VALUES(0xAAB1); +INSERT INTO t1 VALUES(0xAAB2); +INSERT INTO t1 VALUES(0xAAB3); +INSERT INTO t1 VALUES(0xAAB4); +INSERT INTO t1 VALUES(0xAAB5); +INSERT INTO t1 VALUES(0xAAB6); +INSERT INTO t1 VALUES(0xAAB7); +INSERT INTO t1 VALUES(0xAAB8); +INSERT INTO t1 VALUES(0xAAB9); +INSERT INTO t1 VALUES(0xAABA); +INSERT INTO t1 VALUES(0xAABB); +INSERT INTO t1 VALUES(0xAABC); +INSERT INTO t1 VALUES(0xAABD); +INSERT INTO t1 VALUES(0xAABE); +INSERT INTO t1 VALUES(0xAABF); +INSERT INTO t1 VALUES(0xAAC0); +INSERT INTO t1 VALUES(0xAAC1); +INSERT INTO t1 VALUES(0xAAC2); +INSERT INTO t1 VALUES(0xAAC3); +INSERT INTO t1 VALUES(0xAAC4); +INSERT INTO t1 VALUES(0xAAC5); +INSERT INTO t1 VALUES(0xAAC6); +INSERT INTO t1 VALUES(0xAAC7); +INSERT INTO t1 VALUES(0xAAC8); +INSERT INTO t1 VALUES(0xAAC9); +INSERT INTO t1 VALUES(0xAACA); +INSERT INTO t1 VALUES(0xAACB); +INSERT INTO t1 VALUES(0xAACC); +INSERT INTO t1 VALUES(0xAACD); +INSERT INTO t1 VALUES(0xAACE); +INSERT INTO t1 VALUES(0xAACF); +INSERT INTO t1 VALUES(0xAAD0); +INSERT INTO t1 VALUES(0xAAD1); +INSERT INTO t1 VALUES(0xAAD2); +INSERT INTO t1 VALUES(0xAAD3); +INSERT INTO t1 VALUES(0xAAD4); +INSERT INTO t1 VALUES(0xAAD5); +INSERT INTO t1 VALUES(0xAAD6); +INSERT INTO t1 VALUES(0xAAD7); +INSERT INTO t1 VALUES(0xAAD8); +INSERT INTO t1 VALUES(0xAAD9); +INSERT INTO t1 VALUES(0xAADA); +INSERT INTO t1 VALUES(0xAADB); +INSERT INTO t1 VALUES(0xAADC); +INSERT INTO t1 VALUES(0xAADD); +INSERT INTO t1 VALUES(0xAADE); +INSERT INTO t1 VALUES(0xAADF); +INSERT INTO t1 VALUES(0xAAE0); +INSERT INTO t1 VALUES(0xAAE1); +INSERT INTO t1 VALUES(0xAAE2); +INSERT INTO t1 VALUES(0xAAE3); +INSERT INTO t1 VALUES(0xAAE4); +INSERT INTO t1 VALUES(0xAAE5); +INSERT INTO t1 VALUES(0xAAE6); +INSERT INTO t1 VALUES(0xAAE7); +INSERT INTO t1 VALUES(0xAAE8); +INSERT INTO t1 VALUES(0xAAE9); +INSERT INTO t1 VALUES(0xAAEA); +INSERT INTO t1 VALUES(0xAAEB); +INSERT INTO t1 VALUES(0xAAEC); +INSERT INTO t1 VALUES(0xAAED); +INSERT INTO t1 VALUES(0xAAEE); +INSERT INTO t1 VALUES(0xAAEF); +INSERT INTO t1 VALUES(0xAAF0); +INSERT INTO t1 VALUES(0xAAF1); +INSERT INTO t1 VALUES(0xAAF2); +INSERT INTO t1 VALUES(0xAAF3); +INSERT INTO t1 VALUES(0xAAF4); +INSERT INTO t1 VALUES(0xAAF5); +INSERT INTO t1 VALUES(0xAAF6); +INSERT INTO t1 VALUES(0xAAF7); +INSERT INTO t1 VALUES(0xAAF8); +INSERT INTO t1 VALUES(0xAAF9); +INSERT INTO t1 VALUES(0xAAFA); +INSERT INTO t1 VALUES(0xAAFB); +INSERT INTO t1 VALUES(0xAAFC); +INSERT INTO t1 VALUES(0xAAFD); +INSERT INTO t1 VALUES(0xAAFE); +INSERT INTO t1 VALUES(0xABA1); +INSERT INTO t1 VALUES(0xABA2); +INSERT INTO t1 VALUES(0xABA3); +INSERT INTO t1 VALUES(0xABA4); +INSERT INTO t1 VALUES(0xABA5); +INSERT INTO t1 VALUES(0xABA6); +INSERT INTO t1 VALUES(0xABA7); +INSERT INTO t1 VALUES(0xABA8); +INSERT INTO t1 VALUES(0xABA9); +INSERT INTO t1 VALUES(0xABAA); +INSERT INTO t1 VALUES(0xABAB); +INSERT INTO t1 VALUES(0xABAC); +INSERT INTO t1 VALUES(0xABAD); +INSERT INTO t1 VALUES(0xABAE); +INSERT INTO t1 VALUES(0xABAF); +INSERT INTO t1 VALUES(0xABB0); +INSERT INTO t1 VALUES(0xABB1); +INSERT INTO t1 VALUES(0xABB2); +INSERT INTO t1 VALUES(0xABB3); +INSERT INTO t1 VALUES(0xABB4); +INSERT INTO t1 VALUES(0xABB5); +INSERT INTO t1 VALUES(0xABB6); +INSERT INTO t1 VALUES(0xABB7); +INSERT INTO t1 VALUES(0xABB8); +INSERT INTO t1 VALUES(0xABB9); +INSERT INTO t1 VALUES(0xABBA); +INSERT INTO t1 VALUES(0xABBB); +INSERT INTO t1 VALUES(0xABBC); +INSERT INTO t1 VALUES(0xABBD); +INSERT INTO t1 VALUES(0xABBE); +INSERT INTO t1 VALUES(0xABBF); +INSERT INTO t1 VALUES(0xABC0); +INSERT INTO t1 VALUES(0xABC1); +INSERT INTO t1 VALUES(0xABC2); +INSERT INTO t1 VALUES(0xABC3); +INSERT INTO t1 VALUES(0xABC4); +INSERT INTO t1 VALUES(0xABC5); +INSERT INTO t1 VALUES(0xABC6); +INSERT INTO t1 VALUES(0xABC7); +INSERT INTO t1 VALUES(0xABC8); +INSERT INTO t1 VALUES(0xABC9); +INSERT INTO t1 VALUES(0xABCA); +INSERT INTO t1 VALUES(0xABCB); +INSERT INTO t1 VALUES(0xABCC); +INSERT INTO t1 VALUES(0xABCD); +INSERT INTO t1 VALUES(0xABCE); +INSERT INTO t1 VALUES(0xABCF); +INSERT INTO t1 VALUES(0xABD0); +INSERT INTO t1 VALUES(0xABD1); +INSERT INTO t1 VALUES(0xABD2); +INSERT INTO t1 VALUES(0xABD3); +INSERT INTO t1 VALUES(0xABD4); +INSERT INTO t1 VALUES(0xABD5); +INSERT INTO t1 VALUES(0xABD6); +INSERT INTO t1 VALUES(0xABD7); +INSERT INTO t1 VALUES(0xABD8); +INSERT INTO t1 VALUES(0xABD9); +INSERT INTO t1 VALUES(0xABDA); +INSERT INTO t1 VALUES(0xABDB); +INSERT INTO t1 VALUES(0xABDC); +INSERT INTO t1 VALUES(0xABDD); +INSERT INTO t1 VALUES(0xABDE); +INSERT INTO t1 VALUES(0xABDF); +INSERT INTO t1 VALUES(0xABE0); +INSERT INTO t1 VALUES(0xABE1); +INSERT INTO t1 VALUES(0xABE2); +INSERT INTO t1 VALUES(0xABE3); +INSERT INTO t1 VALUES(0xABE4); +INSERT INTO t1 VALUES(0xABE5); +INSERT INTO t1 VALUES(0xABE6); +INSERT INTO t1 VALUES(0xABE7); +INSERT INTO t1 VALUES(0xABE8); +INSERT INTO t1 VALUES(0xABE9); +INSERT INTO t1 VALUES(0xABEA); +INSERT INTO t1 VALUES(0xABEB); +INSERT INTO t1 VALUES(0xABEC); +INSERT INTO t1 VALUES(0xABED); +INSERT INTO t1 VALUES(0xABEE); +INSERT INTO t1 VALUES(0xABEF); +INSERT INTO t1 VALUES(0xABF0); +INSERT INTO t1 VALUES(0xABF1); +INSERT INTO t1 VALUES(0xABF2); +INSERT INTO t1 VALUES(0xABF3); +INSERT INTO t1 VALUES(0xABF4); +INSERT INTO t1 VALUES(0xABF5); +INSERT INTO t1 VALUES(0xABF6); +INSERT INTO t1 VALUES(0xABF7); +INSERT INTO t1 VALUES(0xABF8); +INSERT INTO t1 VALUES(0xABF9); +INSERT INTO t1 VALUES(0xABFA); +INSERT INTO t1 VALUES(0xABFB); +INSERT INTO t1 VALUES(0xABFC); +INSERT INTO t1 VALUES(0xABFD); +INSERT INTO t1 VALUES(0xABFE); +INSERT INTO t1 VALUES(0xACA1); +INSERT INTO t1 VALUES(0xACA2); +INSERT INTO t1 VALUES(0xACA3); +INSERT INTO t1 VALUES(0xACA4); +INSERT INTO t1 VALUES(0xACA5); +INSERT INTO t1 VALUES(0xACA6); +INSERT INTO t1 VALUES(0xACA7); +INSERT INTO t1 VALUES(0xACA8); +INSERT INTO t1 VALUES(0xACA9); +INSERT INTO t1 VALUES(0xACAA); +INSERT INTO t1 VALUES(0xACAB); +INSERT INTO t1 VALUES(0xACAC); +INSERT INTO t1 VALUES(0xACAD); +INSERT INTO t1 VALUES(0xACAE); +INSERT INTO t1 VALUES(0xACAF); +INSERT INTO t1 VALUES(0xACB0); +INSERT INTO t1 VALUES(0xACB1); +INSERT INTO t1 VALUES(0xACB2); +INSERT INTO t1 VALUES(0xACB3); +INSERT INTO t1 VALUES(0xACB4); +INSERT INTO t1 VALUES(0xACB5); +INSERT INTO t1 VALUES(0xACB6); +INSERT INTO t1 VALUES(0xACB7); +INSERT INTO t1 VALUES(0xACB8); +INSERT INTO t1 VALUES(0xACB9); +INSERT INTO t1 VALUES(0xACBA); +INSERT INTO t1 VALUES(0xACBB); +INSERT INTO t1 VALUES(0xACBC); +INSERT INTO t1 VALUES(0xACBD); +INSERT INTO t1 VALUES(0xACBE); +INSERT INTO t1 VALUES(0xACBF); +INSERT INTO t1 VALUES(0xACC0); +INSERT INTO t1 VALUES(0xACC1); +INSERT INTO t1 VALUES(0xACC2); +INSERT INTO t1 VALUES(0xACC3); +INSERT INTO t1 VALUES(0xACC4); +INSERT INTO t1 VALUES(0xACC5); +INSERT INTO t1 VALUES(0xACC6); +INSERT INTO t1 VALUES(0xACC7); +INSERT INTO t1 VALUES(0xACC8); +INSERT INTO t1 VALUES(0xACC9); +INSERT INTO t1 VALUES(0xACCA); +INSERT INTO t1 VALUES(0xACCB); +INSERT INTO t1 VALUES(0xACCC); +INSERT INTO t1 VALUES(0xACCD); +INSERT INTO t1 VALUES(0xACCE); +INSERT INTO t1 VALUES(0xACCF); +INSERT INTO t1 VALUES(0xACD0); +INSERT INTO t1 VALUES(0xACD1); +INSERT INTO t1 VALUES(0xACD2); +INSERT INTO t1 VALUES(0xACD3); +INSERT INTO t1 VALUES(0xACD4); +INSERT INTO t1 VALUES(0xACD5); +INSERT INTO t1 VALUES(0xACD6); +INSERT INTO t1 VALUES(0xACD7); +INSERT INTO t1 VALUES(0xACD8); +INSERT INTO t1 VALUES(0xACD9); +INSERT INTO t1 VALUES(0xACDA); +INSERT INTO t1 VALUES(0xACDB); +INSERT INTO t1 VALUES(0xACDC); +INSERT INTO t1 VALUES(0xACDD); +INSERT INTO t1 VALUES(0xACDE); +INSERT INTO t1 VALUES(0xACDF); +INSERT INTO t1 VALUES(0xACE0); +INSERT INTO t1 VALUES(0xACE1); +INSERT INTO t1 VALUES(0xACE2); +INSERT INTO t1 VALUES(0xACE3); +INSERT INTO t1 VALUES(0xACE4); +INSERT INTO t1 VALUES(0xACE5); +INSERT INTO t1 VALUES(0xACE6); +INSERT INTO t1 VALUES(0xACE7); +INSERT INTO t1 VALUES(0xACE8); +INSERT INTO t1 VALUES(0xACE9); +INSERT INTO t1 VALUES(0xACEA); +INSERT INTO t1 VALUES(0xACEB); +INSERT INTO t1 VALUES(0xACEC); +INSERT INTO t1 VALUES(0xACED); +INSERT INTO t1 VALUES(0xACEE); +INSERT INTO t1 VALUES(0xACEF); +INSERT INTO t1 VALUES(0xACF0); +INSERT INTO t1 VALUES(0xACF1); +INSERT INTO t1 VALUES(0xACF2); +INSERT INTO t1 VALUES(0xACF3); +INSERT INTO t1 VALUES(0xACF4); +INSERT INTO t1 VALUES(0xACF5); +INSERT INTO t1 VALUES(0xACF6); +INSERT INTO t1 VALUES(0xACF7); +INSERT INTO t1 VALUES(0xACF8); +INSERT INTO t1 VALUES(0xACF9); +INSERT INTO t1 VALUES(0xACFA); +INSERT INTO t1 VALUES(0xACFB); +INSERT INTO t1 VALUES(0xACFC); +INSERT INTO t1 VALUES(0xACFD); +INSERT INTO t1 VALUES(0xACFE); +INSERT INTO t1 VALUES(0xADA1); +INSERT INTO t1 VALUES(0xADA2); +INSERT INTO t1 VALUES(0xADA3); +INSERT INTO t1 VALUES(0xADA4); +INSERT INTO t1 VALUES(0xADA5); +INSERT INTO t1 VALUES(0xADA6); +INSERT INTO t1 VALUES(0xADA7); +INSERT INTO t1 VALUES(0xADA8); +INSERT INTO t1 VALUES(0xADA9); +INSERT INTO t1 VALUES(0xADAA); +INSERT INTO t1 VALUES(0xADAB); +INSERT INTO t1 VALUES(0xADAC); +INSERT INTO t1 VALUES(0xADAD); +INSERT INTO t1 VALUES(0xADAE); +INSERT INTO t1 VALUES(0xADAF); +INSERT INTO t1 VALUES(0xADB0); +INSERT INTO t1 VALUES(0xADB1); +INSERT INTO t1 VALUES(0xADB2); +INSERT INTO t1 VALUES(0xADB3); +INSERT INTO t1 VALUES(0xADB4); +INSERT INTO t1 VALUES(0xADB5); +INSERT INTO t1 VALUES(0xADB6); +INSERT INTO t1 VALUES(0xADB7); +INSERT INTO t1 VALUES(0xADB8); +INSERT INTO t1 VALUES(0xADB9); +INSERT INTO t1 VALUES(0xADBA); +INSERT INTO t1 VALUES(0xADBB); +INSERT INTO t1 VALUES(0xADBC); +INSERT INTO t1 VALUES(0xADBD); +INSERT INTO t1 VALUES(0xADBE); +INSERT INTO t1 VALUES(0xADBF); +INSERT INTO t1 VALUES(0xADC0); +INSERT INTO t1 VALUES(0xADC1); +INSERT INTO t1 VALUES(0xADC2); +INSERT INTO t1 VALUES(0xADC3); +INSERT INTO t1 VALUES(0xADC4); +INSERT INTO t1 VALUES(0xADC5); +INSERT INTO t1 VALUES(0xADC6); +INSERT INTO t1 VALUES(0xADC7); +INSERT INTO t1 VALUES(0xADC8); +INSERT INTO t1 VALUES(0xADC9); +INSERT INTO t1 VALUES(0xADCA); +INSERT INTO t1 VALUES(0xADCB); +INSERT INTO t1 VALUES(0xADCC); +INSERT INTO t1 VALUES(0xADCD); +INSERT INTO t1 VALUES(0xADCE); +INSERT INTO t1 VALUES(0xADCF); +INSERT INTO t1 VALUES(0xADD0); +INSERT INTO t1 VALUES(0xADD1); +INSERT INTO t1 VALUES(0xADD2); +INSERT INTO t1 VALUES(0xADD3); +INSERT INTO t1 VALUES(0xADD4); +INSERT INTO t1 VALUES(0xADD5); +INSERT INTO t1 VALUES(0xADD6); +INSERT INTO t1 VALUES(0xADD7); +INSERT INTO t1 VALUES(0xADD8); +INSERT INTO t1 VALUES(0xADD9); +INSERT INTO t1 VALUES(0xADDA); +INSERT INTO t1 VALUES(0xADDB); +INSERT INTO t1 VALUES(0xADDC); +INSERT INTO t1 VALUES(0xADDD); +INSERT INTO t1 VALUES(0xADDE); +INSERT INTO t1 VALUES(0xADDF); +INSERT INTO t1 VALUES(0xADE0); +INSERT INTO t1 VALUES(0xADE1); +INSERT INTO t1 VALUES(0xADE2); +INSERT INTO t1 VALUES(0xADE3); +INSERT INTO t1 VALUES(0xADE4); +INSERT INTO t1 VALUES(0xADE5); +INSERT INTO t1 VALUES(0xADE6); +INSERT INTO t1 VALUES(0xADE7); +INSERT INTO t1 VALUES(0xADE8); +INSERT INTO t1 VALUES(0xADE9); +INSERT INTO t1 VALUES(0xADEA); +INSERT INTO t1 VALUES(0xADEB); +INSERT INTO t1 VALUES(0xADEC); +INSERT INTO t1 VALUES(0xADED); +INSERT INTO t1 VALUES(0xADEE); +INSERT INTO t1 VALUES(0xADEF); +INSERT INTO t1 VALUES(0xADF0); +INSERT INTO t1 VALUES(0xADF1); +INSERT INTO t1 VALUES(0xADF2); +INSERT INTO t1 VALUES(0xADF3); +INSERT INTO t1 VALUES(0xADF4); +INSERT INTO t1 VALUES(0xADF5); +INSERT INTO t1 VALUES(0xADF6); +INSERT INTO t1 VALUES(0xADF7); +INSERT INTO t1 VALUES(0xADF8); +INSERT INTO t1 VALUES(0xADF9); +INSERT INTO t1 VALUES(0xADFA); +INSERT INTO t1 VALUES(0xADFB); +INSERT INTO t1 VALUES(0xADFC); +INSERT INTO t1 VALUES(0xADFD); +INSERT INTO t1 VALUES(0xADFE); +INSERT INTO t1 VALUES(0xAEA1); +INSERT INTO t1 VALUES(0xAEA2); +INSERT INTO t1 VALUES(0xAEA3); +INSERT INTO t1 VALUES(0xAEA4); +INSERT INTO t1 VALUES(0xAEA5); +INSERT INTO t1 VALUES(0xAEA6); +INSERT INTO t1 VALUES(0xAEA7); +INSERT INTO t1 VALUES(0xAEA8); +INSERT INTO t1 VALUES(0xAEA9); +INSERT INTO t1 VALUES(0xAEAA); +INSERT INTO t1 VALUES(0xAEAB); +INSERT INTO t1 VALUES(0xAEAC); +INSERT INTO t1 VALUES(0xAEAD); +INSERT INTO t1 VALUES(0xAEAE); +INSERT INTO t1 VALUES(0xAEAF); +INSERT INTO t1 VALUES(0xAEB0); +INSERT INTO t1 VALUES(0xAEB1); +INSERT INTO t1 VALUES(0xAEB2); +INSERT INTO t1 VALUES(0xAEB3); +INSERT INTO t1 VALUES(0xAEB4); +INSERT INTO t1 VALUES(0xAEB5); +INSERT INTO t1 VALUES(0xAEB6); +INSERT INTO t1 VALUES(0xAEB7); +INSERT INTO t1 VALUES(0xAEB8); +INSERT INTO t1 VALUES(0xAEB9); +INSERT INTO t1 VALUES(0xAEBA); +INSERT INTO t1 VALUES(0xAEBB); +INSERT INTO t1 VALUES(0xAEBC); +INSERT INTO t1 VALUES(0xAEBD); +INSERT INTO t1 VALUES(0xAEBE); +INSERT INTO t1 VALUES(0xAEBF); +INSERT INTO t1 VALUES(0xAEC0); +INSERT INTO t1 VALUES(0xAEC1); +INSERT INTO t1 VALUES(0xAEC2); +INSERT INTO t1 VALUES(0xAEC3); +INSERT INTO t1 VALUES(0xAEC4); +INSERT INTO t1 VALUES(0xAEC5); +INSERT INTO t1 VALUES(0xAEC6); +INSERT INTO t1 VALUES(0xAEC7); +INSERT INTO t1 VALUES(0xAEC8); +INSERT INTO t1 VALUES(0xAEC9); +INSERT INTO t1 VALUES(0xAECA); +INSERT INTO t1 VALUES(0xAECB); +INSERT INTO t1 VALUES(0xAECC); +INSERT INTO t1 VALUES(0xAECD); +INSERT INTO t1 VALUES(0xAECE); +INSERT INTO t1 VALUES(0xAECF); +INSERT INTO t1 VALUES(0xAED0); +INSERT INTO t1 VALUES(0xAED1); +INSERT INTO t1 VALUES(0xAED2); +INSERT INTO t1 VALUES(0xAED3); +INSERT INTO t1 VALUES(0xAED4); +INSERT INTO t1 VALUES(0xAED5); +INSERT INTO t1 VALUES(0xAED6); +INSERT INTO t1 VALUES(0xAED7); +INSERT INTO t1 VALUES(0xAED8); +INSERT INTO t1 VALUES(0xAED9); +INSERT INTO t1 VALUES(0xAEDA); +INSERT INTO t1 VALUES(0xAEDB); +INSERT INTO t1 VALUES(0xAEDC); +INSERT INTO t1 VALUES(0xAEDD); +INSERT INTO t1 VALUES(0xAEDE); +INSERT INTO t1 VALUES(0xAEDF); +INSERT INTO t1 VALUES(0xAEE0); +INSERT INTO t1 VALUES(0xAEE1); +INSERT INTO t1 VALUES(0xAEE2); +INSERT INTO t1 VALUES(0xAEE3); +INSERT INTO t1 VALUES(0xAEE4); +INSERT INTO t1 VALUES(0xAEE5); +INSERT INTO t1 VALUES(0xAEE6); +INSERT INTO t1 VALUES(0xAEE7); +INSERT INTO t1 VALUES(0xAEE8); +INSERT INTO t1 VALUES(0xAEE9); +INSERT INTO t1 VALUES(0xAEEA); +INSERT INTO t1 VALUES(0xAEEB); +INSERT INTO t1 VALUES(0xAEEC); +INSERT INTO t1 VALUES(0xAEED); +INSERT INTO t1 VALUES(0xAEEE); +INSERT INTO t1 VALUES(0xAEEF); +INSERT INTO t1 VALUES(0xAEF0); +INSERT INTO t1 VALUES(0xAEF1); +INSERT INTO t1 VALUES(0xAEF2); +INSERT INTO t1 VALUES(0xAEF3); +INSERT INTO t1 VALUES(0xAEF4); +INSERT INTO t1 VALUES(0xAEF5); +INSERT INTO t1 VALUES(0xAEF6); +INSERT INTO t1 VALUES(0xAEF7); +INSERT INTO t1 VALUES(0xAEF8); +INSERT INTO t1 VALUES(0xAEF9); +INSERT INTO t1 VALUES(0xAEFA); +INSERT INTO t1 VALUES(0xAEFB); +INSERT INTO t1 VALUES(0xAEFC); +INSERT INTO t1 VALUES(0xAEFD); +INSERT INTO t1 VALUES(0xAEFE); +INSERT INTO t1 VALUES(0xAFA1); +INSERT INTO t1 VALUES(0xAFA2); +INSERT INTO t1 VALUES(0xAFA3); +INSERT INTO t1 VALUES(0xAFA4); +INSERT INTO t1 VALUES(0xAFA5); +INSERT INTO t1 VALUES(0xAFA6); +INSERT INTO t1 VALUES(0xAFA7); +INSERT INTO t1 VALUES(0xAFA8); +INSERT INTO t1 VALUES(0xAFA9); +INSERT INTO t1 VALUES(0xAFAA); +INSERT INTO t1 VALUES(0xAFAB); +INSERT INTO t1 VALUES(0xAFAC); +INSERT INTO t1 VALUES(0xAFAD); +INSERT INTO t1 VALUES(0xAFAE); +INSERT INTO t1 VALUES(0xAFAF); +INSERT INTO t1 VALUES(0xAFB0); +INSERT INTO t1 VALUES(0xAFB1); +INSERT INTO t1 VALUES(0xAFB2); +INSERT INTO t1 VALUES(0xAFB3); +INSERT INTO t1 VALUES(0xAFB4); +INSERT INTO t1 VALUES(0xAFB5); +INSERT INTO t1 VALUES(0xAFB6); +INSERT INTO t1 VALUES(0xAFB7); +INSERT INTO t1 VALUES(0xAFB8); +INSERT INTO t1 VALUES(0xAFB9); +INSERT INTO t1 VALUES(0xAFBA); +INSERT INTO t1 VALUES(0xAFBB); +INSERT INTO t1 VALUES(0xAFBC); +INSERT INTO t1 VALUES(0xAFBD); +INSERT INTO t1 VALUES(0xAFBE); +INSERT INTO t1 VALUES(0xAFBF); +INSERT INTO t1 VALUES(0xAFC0); +INSERT INTO t1 VALUES(0xAFC1); +INSERT INTO t1 VALUES(0xAFC2); +INSERT INTO t1 VALUES(0xAFC3); +INSERT INTO t1 VALUES(0xAFC4); +INSERT INTO t1 VALUES(0xAFC5); +INSERT INTO t1 VALUES(0xAFC6); +INSERT INTO t1 VALUES(0xAFC7); +INSERT INTO t1 VALUES(0xAFC8); +INSERT INTO t1 VALUES(0xAFC9); +INSERT INTO t1 VALUES(0xAFCA); +INSERT INTO t1 VALUES(0xAFCB); +INSERT INTO t1 VALUES(0xAFCC); +INSERT INTO t1 VALUES(0xAFCD); +INSERT INTO t1 VALUES(0xAFCE); +INSERT INTO t1 VALUES(0xAFCF); +INSERT INTO t1 VALUES(0xAFD0); +INSERT INTO t1 VALUES(0xAFD1); +INSERT INTO t1 VALUES(0xAFD2); +INSERT INTO t1 VALUES(0xAFD3); +INSERT INTO t1 VALUES(0xAFD4); +INSERT INTO t1 VALUES(0xAFD5); +INSERT INTO t1 VALUES(0xAFD6); +INSERT INTO t1 VALUES(0xAFD7); +INSERT INTO t1 VALUES(0xAFD8); +INSERT INTO t1 VALUES(0xAFD9); +INSERT INTO t1 VALUES(0xAFDA); +INSERT INTO t1 VALUES(0xAFDB); +INSERT INTO t1 VALUES(0xAFDC); +INSERT INTO t1 VALUES(0xAFDD); +INSERT INTO t1 VALUES(0xAFDE); +INSERT INTO t1 VALUES(0xAFDF); +INSERT INTO t1 VALUES(0xAFE0); +INSERT INTO t1 VALUES(0xAFE1); +INSERT INTO t1 VALUES(0xAFE2); +INSERT INTO t1 VALUES(0xAFE3); +INSERT INTO t1 VALUES(0xAFE4); +INSERT INTO t1 VALUES(0xAFE5); +INSERT INTO t1 VALUES(0xAFE6); +INSERT INTO t1 VALUES(0xAFE7); +INSERT INTO t1 VALUES(0xAFE8); +INSERT INTO t1 VALUES(0xAFE9); +INSERT INTO t1 VALUES(0xAFEA); +INSERT INTO t1 VALUES(0xAFEB); +INSERT INTO t1 VALUES(0xAFEC); +INSERT INTO t1 VALUES(0xAFED); +INSERT INTO t1 VALUES(0xAFEE); +INSERT INTO t1 VALUES(0xAFEF); +INSERT INTO t1 VALUES(0xAFF0); +INSERT INTO t1 VALUES(0xAFF1); +INSERT INTO t1 VALUES(0xAFF2); +INSERT INTO t1 VALUES(0xAFF3); +INSERT INTO t1 VALUES(0xAFF4); +INSERT INTO t1 VALUES(0xAFF5); +INSERT INTO t1 VALUES(0xAFF6); +INSERT INTO t1 VALUES(0xAFF7); +INSERT INTO t1 VALUES(0xAFF8); +INSERT INTO t1 VALUES(0xAFF9); +INSERT INTO t1 VALUES(0xAFFA); +INSERT INTO t1 VALUES(0xAFFB); +INSERT INTO t1 VALUES(0xAFFC); +INSERT INTO t1 VALUES(0xAFFD); +INSERT INTO t1 VALUES(0xAFFE); +INSERT INTO t1 VALUES(0xCFD4); +INSERT INTO t1 VALUES(0xCFD5); +INSERT INTO t1 VALUES(0xCFD6); +INSERT INTO t1 VALUES(0xCFD7); +INSERT INTO t1 VALUES(0xCFD8); +INSERT INTO t1 VALUES(0xCFD9); +INSERT INTO t1 VALUES(0xCFDA); +INSERT INTO t1 VALUES(0xCFDB); +INSERT INTO t1 VALUES(0xCFDC); +INSERT INTO t1 VALUES(0xCFDD); +INSERT INTO t1 VALUES(0xCFDE); +INSERT INTO t1 VALUES(0xCFDF); +INSERT INTO t1 VALUES(0xCFE0); +INSERT INTO t1 VALUES(0xCFE1); +INSERT INTO t1 VALUES(0xCFE2); +INSERT INTO t1 VALUES(0xCFE3); +INSERT INTO t1 VALUES(0xCFE4); +INSERT INTO t1 VALUES(0xCFE5); +INSERT INTO t1 VALUES(0xCFE6); +INSERT INTO t1 VALUES(0xCFE7); +INSERT INTO t1 VALUES(0xCFE8); +INSERT INTO t1 VALUES(0xCFE9); +INSERT INTO t1 VALUES(0xCFEA); +INSERT INTO t1 VALUES(0xCFEB); +INSERT INTO t1 VALUES(0xCFEC); +INSERT INTO t1 VALUES(0xCFED); +INSERT INTO t1 VALUES(0xCFEE); +INSERT INTO t1 VALUES(0xCFEF); +INSERT INTO t1 VALUES(0xCFF0); +INSERT INTO t1 VALUES(0xCFF1); +INSERT INTO t1 VALUES(0xCFF2); +INSERT INTO t1 VALUES(0xCFF3); +INSERT INTO t1 VALUES(0xCFF4); +INSERT INTO t1 VALUES(0xCFF5); +INSERT INTO t1 VALUES(0xCFF6); +INSERT INTO t1 VALUES(0xCFF7); +INSERT INTO t1 VALUES(0xCFF8); +INSERT INTO t1 VALUES(0xCFF9); +INSERT INTO t1 VALUES(0xCFFA); +INSERT INTO t1 VALUES(0xCFFB); +INSERT INTO t1 VALUES(0xCFFC); +INSERT INTO t1 VALUES(0xCFFD); +INSERT INTO t1 VALUES(0xCFFE); +INSERT INTO t1 VALUES(0xF4A7); +INSERT INTO t1 VALUES(0xF4A8); +INSERT INTO t1 VALUES(0xF4A9); +INSERT INTO t1 VALUES(0xF4AA); +INSERT INTO t1 VALUES(0xF4AB); +INSERT INTO t1 VALUES(0xF4AC); +INSERT INTO t1 VALUES(0xF4AD); +INSERT INTO t1 VALUES(0xF4AE); +INSERT INTO t1 VALUES(0xF4AF); +INSERT INTO t1 VALUES(0xF4B0); +INSERT INTO t1 VALUES(0xF4B1); +INSERT INTO t1 VALUES(0xF4B2); +INSERT INTO t1 VALUES(0xF4B3); +INSERT INTO t1 VALUES(0xF4B4); +INSERT INTO t1 VALUES(0xF4B5); +INSERT INTO t1 VALUES(0xF4B6); +INSERT INTO t1 VALUES(0xF4B7); +INSERT INTO t1 VALUES(0xF4B8); +INSERT INTO t1 VALUES(0xF4B9); +INSERT INTO t1 VALUES(0xF4BA); +INSERT INTO t1 VALUES(0xF4BB); +INSERT INTO t1 VALUES(0xF4BC); +INSERT INTO t1 VALUES(0xF4BD); +INSERT INTO t1 VALUES(0xF4BE); +INSERT INTO t1 VALUES(0xF4BF); +INSERT INTO t1 VALUES(0xF4C0); +INSERT INTO t1 VALUES(0xF4C1); +INSERT INTO t1 VALUES(0xF4C2); +INSERT INTO t1 VALUES(0xF4C3); +INSERT INTO t1 VALUES(0xF4C4); +INSERT INTO t1 VALUES(0xF4C5); +INSERT INTO t1 VALUES(0xF4C6); +INSERT INTO t1 VALUES(0xF4C7); +INSERT INTO t1 VALUES(0xF4C8); +INSERT INTO t1 VALUES(0xF4C9); +INSERT INTO t1 VALUES(0xF4CA); +INSERT INTO t1 VALUES(0xF4CB); +INSERT INTO t1 VALUES(0xF4CC); +INSERT INTO t1 VALUES(0xF4CD); +INSERT INTO t1 VALUES(0xF4CE); +INSERT INTO t1 VALUES(0xF4CF); +INSERT INTO t1 VALUES(0xF4D0); +INSERT INTO t1 VALUES(0xF4D1); +INSERT INTO t1 VALUES(0xF4D2); +INSERT INTO t1 VALUES(0xF4D3); +INSERT INTO t1 VALUES(0xF4D4); +INSERT INTO t1 VALUES(0xF4D5); +INSERT INTO t1 VALUES(0xF4D6); +INSERT INTO t1 VALUES(0xF4D7); +INSERT INTO t1 VALUES(0xF4D8); +INSERT INTO t1 VALUES(0xF4D9); +INSERT INTO t1 VALUES(0xF4DA); +INSERT INTO t1 VALUES(0xF4DB); +INSERT INTO t1 VALUES(0xF4DC); +INSERT INTO t1 VALUES(0xF4DD); +INSERT INTO t1 VALUES(0xF4DE); +INSERT INTO t1 VALUES(0xF4DF); +INSERT INTO t1 VALUES(0xF4E0); +INSERT INTO t1 VALUES(0xF4E1); +INSERT INTO t1 VALUES(0xF4E2); +INSERT INTO t1 VALUES(0xF4E3); +INSERT INTO t1 VALUES(0xF4E4); +INSERT INTO t1 VALUES(0xF4E5); +INSERT INTO t1 VALUES(0xF4E6); +INSERT INTO t1 VALUES(0xF4E7); +INSERT INTO t1 VALUES(0xF4E8); +INSERT INTO t1 VALUES(0xF4E9); +INSERT INTO t1 VALUES(0xF4EA); +INSERT INTO t1 VALUES(0xF4EB); +INSERT INTO t1 VALUES(0xF4EC); +INSERT INTO t1 VALUES(0xF4ED); +INSERT INTO t1 VALUES(0xF4EE); +INSERT INTO t1 VALUES(0xF4EF); +INSERT INTO t1 VALUES(0xF4F0); +INSERT INTO t1 VALUES(0xF4F1); +INSERT INTO t1 VALUES(0xF4F2); +INSERT INTO t1 VALUES(0xF4F3); +INSERT INTO t1 VALUES(0xF4F4); +INSERT INTO t1 VALUES(0xF4F5); +INSERT INTO t1 VALUES(0xF4F6); +INSERT INTO t1 VALUES(0xF4F7); +INSERT INTO t1 VALUES(0xF4F8); +INSERT INTO t1 VALUES(0xF4F9); +INSERT INTO t1 VALUES(0xF4FA); +INSERT INTO t1 VALUES(0xF4FB); +INSERT INTO t1 VALUES(0xF4FC); +INSERT INTO t1 VALUES(0xF4FD); +INSERT INTO t1 VALUES(0xF4FE); +SELECT HEX(c) FROM t1 ORDER BY BINARY c; +DROP TABLE t1; + + +SET collation_connection='ujis_japanese_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='ujis_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 0c8bdd6a94d..35f2b2642be 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -645,6 +645,7 @@ insert into t1 values(1,'foo'),(2,'foobar'); select * from t1 where b like 'foob%'; --disable_warnings alter table t1 engine=bdb; +--enable_warnings select * from t1 where b like 'foob%'; drop table t1; @@ -659,3 +660,41 @@ create table t2 select concat(a,_utf8'') as a, concat(b,_utf8'')as b from t1; show create table t2; drop table t2; drop table t1; + +# +# Bug #6787 LIKE not working properly with _ and utf8 data +# +select 'c' like '\_' as want0; + +# +# Bug #7730 Server crash using soundex on an utf8 table +# +create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci); +insert into t1 values (1, 'Test'); +select * from t1 where soundex(a) = soundex('Test'); +select * from t1 where soundex(a) = soundex('TEST'); +select * from t1 where soundex(a) = soundex('test'); +drop table t1; + + +SET collation_connection='utf8_general_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='utf8_bin'; +-- source include/ctype_filesort.inc + +# +# Bug #7874 CONCAT() gives wrong results mixing +# latin1 field and utf8 string literals +# +CREATE TABLE t1 ( + user varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('one'),('two'); +SELECT CHARSET('a'); +SELECT user, CONCAT('<', user, '>') AS c FROM t1; +DROP TABLE t1; + +# +# Bug#8385: utf8_general_ci treats Cyrillic letters I and SHORT I as the same +# +select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8); diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index c369a9c85d5..800e5880b09 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -166,6 +166,8 @@ select date,format,cast(str_to_date(date, format) as datetime) as datetime from select date,format,DATE(str_to_date(date, format)) as date2 from t1; select date,format,TIME(str_to_date(date, format)) as time from t1; select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; +# Test small bug in %f handling +select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); # Test wrong dates or converion specifiers diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 4cf26b330c6..40bd7a912f3 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -14,7 +14,7 @@ insert delayed into t1 set a = 4; insert delayed into t1 set a = 5, tmsp = 19711006010203; insert delayed into t1 (a, tmsp) values (6, 19711006010203); insert delayed into t1 (a, tmsp) values (7, NULL); ---sleep 1 +--sleep 2 insert into t1 set a = 8,tmsp=19711006010203; select * from t1 where tmsp=0; select * from t1 where tmsp=19711006010203; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 5f60445d765..a6335d77a0c 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -29,12 +29,34 @@ drop table t1; # (This assumes a block size of 1024) # -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); +create table t1 ( + a bigint not null, + b bigint not null default 0, + c bigint not null default 0, + d bigint not null default 0, + e bigint not null default 0, + f bigint not null default 0, + g bigint not null default 0, + h bigint not null default 0, + i bigint not null default 0, + j bigint not null default 0, + primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); delete from t1 where a=26; drop table t1; -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); +create table t1 ( + a bigint not null, + b bigint not null default 0, + c bigint not null default 0, + d bigint not null default 0, + e bigint not null default 0, + f bigint not null default 0, + g bigint not null default 0, + h bigint not null default 0, + i bigint not null default 0, + j bigint not null default 0, + primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; @@ -119,3 +141,14 @@ delete t1 from t1 where a = 3; check table t1; select * from t1; drop table t1; + +# +# Bug #8392: delete with ORDER BY containing a direct reference to the table +# + +CREATE TABLE t1 ( a int PRIMARY KEY ); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; +INSERT INTO t1 VALUES (0),(1),(2); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1; +SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 64e3fe8929b..bd27e0654e0 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -214,3 +214,25 @@ CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) N insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10); SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices; DROP TABLE t1; + +# +# DISTINCT over grouped select on subquery in the FROM clause +# +create table t1 (a integer, b integer); +insert into t1 values (1,4), (2,2),(2,2), (4,1),(4,1),(4,1),(4,1); +select distinct sum(b) from t1 group by a; +select distinct sum(b) from (select a,b from t1) y group by a; +drop table t1; + +# +# test of union subquery in the FROM clause with complex distinct/all (BUG#6565) +# +create table t1(a int); +create table t2(a int); +create table t3(a int); +insert into t1 values(1),(1); +insert into t2 values(2),(2); +insert into t3 values(3),(3); +select * from t1 union distinct select * from t2 union all select * from t3; +select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; +drop table t1, t2, t3; diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index 88c47803f48..6f0e5b3f14c 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -2,6 +2,8 @@ --disable_warnings drop table if exists t1; drop database if exists mysqltest; +# If earlier test failed +drop database if exists client_test_db; --enable_warnings --error 1051; diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/t/drop_temp_table.test index 1a7d8796bb3..dcd95721179 100644 --- a/mysql-test/t/drop_temp_table.test +++ b/mysql-test/t/drop_temp_table.test @@ -4,7 +4,9 @@ connection con1; reset master; create database `drop-temp+table-test`; use `drop-temp+table-test`; +create temporary table shortn1 (a int); create temporary table `table:name` (a int); +create temporary table shortn2 (a int); select get_lock("a",10); disconnect con1; @@ -15,5 +17,6 @@ connection con2; select get_lock("a",10); let $VERSION=`select version()`; --replace_result $VERSION VERSION +--replace_column 2 # 5 # show binlog events; drop database `drop-temp+table-test`; diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test index 9ee5e32967a..462bc3083e1 100644 --- a/mysql-test/t/endspace.test +++ b/mysql-test/t/endspace.test @@ -7,13 +7,7 @@ drop table if exists t1; --enable_warnings -select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; -select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; -select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; -select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; -select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; -select 'a a' > 'a', 'a \0' < 'a'; -select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +-- source include/endspace.inc # # Test MyISAM tables. diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test index 3d13086f517..87715452089 100644 --- a/mysql-test/t/flush_block_commit.test +++ b/mysql-test/t/flush_block_commit.test @@ -1,6 +1,7 @@ # Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing # transactions. # We verify that we did not introduce a deadlock. +# This is intended to mimick how mysqldump and innobackup work. -- source include/have_innodb.inc @@ -48,5 +49,26 @@ reap; connection con3; reap; unlock tables; + +# BUG#6732 FLUSH TABLES WITH READ LOCK + COMMIT hangs later FLUSH TABLES +# WITH READ LOCK + +connection con2; +commit; # unlock InnoDB row locks to allow insertions connection con1; +begin; +insert into t1 values(10); +flush tables with read lock; +commit; +unlock tables; +connection con2; +flush tables with read lock; # bug caused hang here +unlock tables; + +# BUG#7358 SHOW CREATE DATABASE fails if open transaction + +begin; +select * from t1; +show create database test; + drop table t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 66df5b1cb92..4809f6f0357 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -67,6 +67,7 @@ select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); +select * from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); # bug#2708, bug#3870 crash @@ -98,6 +99,8 @@ select * from t1 where match a against ("+aaa* +bbb*" in boolean mode); select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode); select * from t1 where match a against ("+aaa* +ccc*" in boolean mode); select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode); +select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode); +select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode); drop table t1; # @@ -253,10 +256,17 @@ select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against(' # bug with many short (< ft_min_word_len) words in boolean search # select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode); - drop table t1,t2; # +# bug with repair-by-sort and incorrect records estimation +# + +create table t1 (a text, fulltext key (a)); +insert into t1 select "xxxx yyyy zzzz"; +drop table t1; + +# # UTF8 # SET NAMES latin1; @@ -272,7 +282,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); SET NAMES latin1; SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); -SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); +SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); #alter table t1 modify t text character set latin1 collate latin1_german2_ci not null; alter table t1 modify t varchar(200) collate latin1_german2_ci not null; SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); @@ -288,3 +298,43 @@ insert into t1 (s) values ('pära para para'),('para para para'); select * from t1 where match(s) against('para' in boolean mode); select * from t1 where match(s) against('par*' in boolean mode); DROP TABLE t1; + +# +# icc -ip bug (ip = interprocedural optimization) +# bug#5528 +# +CREATE TABLE t1 (h text, FULLTEXT (h)); +INSERT INTO t1 VALUES ('Jesses Hasse Ling and his syncopators of Swing'); +REPAIR TABLE t1; +select count(*) from t1; +drop table t1; + +# +# testing out of bounds memory access in ft_nlq_find_relevance() +# (bug#8522); visible in valgrind. +# +CREATE TABLE t1 ( a TEXT, FULLTEXT (a) ); +INSERT INTO t1 VALUES ('testing ft_nlq_find_relevance'); +SELECT MATCH(a) AGAINST ('nosuchword') FROM t1; +DROP TABLE t1; +# +# bug#6784 +# mi_flush_bulk_insert (on dup key error in mi_write) +# was mangling info->dupp_key_pos +# + +create table t1 (a int primary key, b text, fulltext(b)); +create table t2 (a int, b text); +insert t1 values (1, "aaaa"), (2, "bbbb"); +insert t2 values (10, "aaaa"), (2, "cccc"); +replace t1 select * from t2; +drop table t1, t2; + +# +# bug#8351 +# +CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t)); +SET NAMES latin1; +INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück'); +SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE); +DROP TABLE t1; diff --git a/mysql-test/t/fulltext_cache.test b/mysql-test/t/fulltext_cache.test index 234deab91e6..b01f0d18b76 100644 --- a/mysql-test/t/fulltext_cache.test +++ b/mysql-test/t/fulltext_cache.test @@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test index f8afe49d95d..5856f68ec9e 100644 --- a/mysql-test/t/fulltext_order_by.test +++ b/mysql-test/t/fulltext_order_by.test @@ -10,25 +10,25 @@ CREATE TABLE t1 ( INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"), ("steve"),("is"),("cool"),("steve is cool"); # basic MATCH -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve'); +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve'); SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve'); -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); # MATCH + ORDER BY (with ft-ranges) -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a; # MATCH + ORDER BY (with normal ranges) + UNIQUE -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC; # MATCH + ORDER BY + UNIQUE (const_table) -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1; # ORDER BY MATCH -SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; drop table t1; diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 7b70289d2c0..f46589e9e0e 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -38,7 +38,10 @@ drop table t1; # # Bug #5497: a problem with large strings +# note that when LOW_MEMORY is set the "test" below is meaningless # set @@max_allowed_packet=1048576*100; -select compress(repeat('aaaaaaaaaa', 10000000)) is null; +--replace_result "''" XXX "'1'" XXX +eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null; + diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index 0cf1502b10e..b94901e9966 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -34,3 +34,19 @@ create table t1 (a char(4), b double, c date, d tinyint(4)); insert into t1 values ('AAAA', 105, '2003-03-01', 1); select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; drop table t1; + +# BUG#6825 +select 'a' union select concat('a', -4); +select 'a' union select concat('a', -4.5); + +select 'a' union select concat('a', -(4 + 1)); +select 'a' union select concat('a', 4 - 5); + +select 'a' union select concat('a', -'3'); +select 'a' union select concat('a', -concat('3',4)); + +select 'a' union select concat('a', -0); + +--replace_result 'a-0.0' good 'a0.0' good +select 'a' union select concat('a', -0.0); + diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index e0737a42221..6a91a7ac9c7 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -277,3 +277,10 @@ select group_concat(b order by b) from t1 group by a; select group_concat(distinct b order by b) from t1 group by a; drop table t1; + +# +# bug #7769: group_concat returning null is checked in having +# +CREATE TABLE t1 (id int); +SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; +DROP TABLE t1; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 8d8779e9d1b..465611a5ebb 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -384,6 +384,17 @@ select coercibility(max(a)) from t1; drop table t1; # +# Bug #6658 MAX(column) returns incorrect coercibility +# +create table t1 (a char character set latin2); +insert into t1 values ('a'),('b'); +select charset(max(a)), coercibility(max(a)), + charset(min(a)), coercibility(min(a)) from t1; +create table t2 select max(a),min(a) from t1; +show create table t2; +drop table t2,t1; + +# # aggregate functions on static tables # create table t1 (a int); @@ -462,3 +473,17 @@ INSERT INTO t1 VALUES select val, count(*) from t1 group by val; drop table t1; + + +# +# Bug 7833: Wrong datatype of aggregate column is returned +# + +create table t1(f1 datetime); +insert into t1 values (now()); +create table t2 select f2 from (select max(now()) f2 from t1) a; +show columns from t2; +drop table t2; +create table t2 select f2 from (select now() f2 from t1) a; +show columns from t2; +drop table t2, t1; diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 22079377ad2..6e0883b821f 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -80,6 +80,11 @@ create table t1 (a char(10) character set utf8 not null); insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ'); select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a; drop table t1; +# Bug#7834 Illegal mix of collations in IN operator +create table t1 (a char(10) character set latin1 not null); +insert into t1 values ('a'),('b'),('c'); +select a from t1 where a IN ('a','b','c') order by a; +drop table t1; set names latin1; select '1.0' in (1,2); @@ -89,3 +94,10 @@ select 1 in ('1.0',2.0); select 1 in (1.0,'2.0'); select 1 in ('1.1',2); select 1 in ('1.1',2.0); + +# Test case for bug #6365 + +create table t1 (a char(20) character set binary); +insert into t1 values ('aa'), ('bb'); +select * from t1 where a in (NULL, 'aa'); +drop table t1; diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index e58c097b5a6..668aefc2d8d 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -51,3 +51,10 @@ SELECT ASIN(1.2-0.2); #select floor(log(16)/log(2)); explain extended select degrees(pi()),radians(360); + +# +# Bug #7281: problem with rand() +# + +--error 1054 +select rand(rand); diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index e73f2a1b26c..89aba7ee583 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -23,3 +23,18 @@ select length(format('nan', 2)) > 0; # Test for bug #628 # select concat("$",format(2500,2)); + +# Test for BUG#7716 +create table t1 ( a timestamp ); +insert into t1 values ( '2004-01-06 12:34' ); +select a from t1 where left(a+0,6) in ( left(20040106,6) ); +select a from t1 where left(a+0,6) = ( left(20040106,6) ); + +select a from t1 where right(a+0,6) in ( right(20040106123400,6) ); +select a from t1 where right(a+0,6) = ( right(20040106123400,6) ); + +select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) ); +select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) ); + +drop table t1; + diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 2ae3c438243..de433485fca 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -54,6 +54,7 @@ select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002"); select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); +select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50"); --enable_ps_protocol select maketime(10,11,12); diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 3eab694ee05..b1f144cbca2 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -83,6 +83,12 @@ select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), select length(unhex(md5("abrakadabra"))); # +# Bug #6564: QUOTE(NULL +# + +select concat('a', quote(NULL)); + +# # Wrong usage of functions # @@ -189,6 +195,18 @@ select trim(trailing 'foo' from 'foo'); select trim(leading 'foo' from 'foo'); # +# crashing bug with QUOTE() and LTRIM() or TRIM() fixed +# Bug #7495 +# + +select quote(ltrim(concat(' ', 'a'))); +select quote(trim(concat(' ', 'a'))); + +# Bad results from QUOTE(). Bug #8248 +CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; +SELECT QUOTE('A') FROM t1; +DROP TABLE t1; + # Test collation and coercibility # @@ -415,3 +433,52 @@ drop table t1; # select left(1234, 3) + 0; + +# +# Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation +# +create table t1 (a int not null primary key, b varchar(40), c datetime); +insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +drop table t1; + +# +# Bug#7455 unexpected result: TRIM(<NULL> FROM <whatever>) gives NOT NULL +# According to ANSI if one of the TRIM arguments is NULL, then the result +# must be NULL too. +# +select trim(null from 'kate') as "must_be_null"; +select trim('xyz' from null) as "must_be_null"; + +# +# Bug #7751 - conversion for a bigint unsigned constant +# + +CREATE TABLE t1 ( + id int(11) NOT NULL auto_increment, + a bigint(20) unsigned default NULL, + PRIMARY KEY (id) +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES +('0','16307858876001849059'); + +SELECT CONV('e251273eb74a8ee3', 16, 10); + +EXPLAIN +SELECT id + FROM t1 + WHERE a = 16307858876001849059; + +EXPLAIN + SELECT id + FROM t1 + WHERE a = CONV('e251273eb74a8ee3', 16, 10); + +DROP TABLE t1; + +# +# Bug #6317: string function CHAR, parameter is NULL, wrong result +# +SELECT CHAR(NULL,121,83,81,'76') as my_column; +SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 67192c55ef9..0f495ef891d 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -230,6 +230,17 @@ select unix_timestamp(@a); select unix_timestamp('1969-12-01 19:00:01'); # +# Test for bug #6439 "unix_timestamp() function returns wrong datetime +# values for too big argument" and bug #7515 "from_unixtime(0) now +# returns NULL instead of the epoch". unix_timestamp() should return error +# for too big or negative argument. It should return Epoch value for zero +# argument since it seems that many user's rely on this fact. +# +select from_unixtime(-1); +select from_unixtime(2145916800); +select from_unixtime(0); + +# # Test types from + INTERVAL # diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 817249b7e4c..716dd38a119 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -118,3 +118,57 @@ CREATE TABLE t1 ( INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); #select * from t1 where g<GeomFromText('LineString(1 2, 2 3)'); drop table t1; + +CREATE TABLE t1 ( + geoobjid INT NOT NULL, + line LINESTRING NOT NULL, + kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', + name VARCHAR(32), + + SPATIAL KEY (line) + + +) engine=myisam; + +ALTER TABLE t1 DISABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES + ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), + ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), + ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), + ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), + ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), + ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), + ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), + ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), + ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), + ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), + ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), + ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), + ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), + ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), + ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), + ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), + ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), + ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), + ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), + ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), + ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), + ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), + ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), + ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), + ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), + ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), + ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), + ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), + ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); + +ALTER TABLE t1 ENABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); +drop table t1; + +CREATE TABLE t1 (st varchar(100)); +INSERT INTO t1 VALUES ("Fake string"); +CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); +--error 1105 +INSERT INTO t2 SELECT GeomFromText(st) FROM t1; +drop table t1, t2; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 739fced1f29..86c34eacbc5 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -284,3 +284,78 @@ drop table t1; create table t1 select POINT(1,3); show create table t1; drop table t1; + +CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` +geometry NOT NULL default '') ENGINE=MyISAM ; + +insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 +36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163 +36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363 +36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364 +36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882 +36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207 +36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017 +36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072 +36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755 +36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725 +36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556 +36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105 +36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344 +36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356 +36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499 +36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308 +36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527 +36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113 +36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354 +36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768 +36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662 +36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659 +36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764 +36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517 +36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403 +36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183 +36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729 +36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934 +36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731 +36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759 +36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835 +36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758 +36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843 +36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051 +36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913 +36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918 +36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314 +36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858 +36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335 +36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734 +36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491 +36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133 +36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233 +36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533 +36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331 +36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535 +36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135 +36.240569,-115.083135 36.240569,-115.079835 +36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107 +36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226 +36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733 +36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107 +36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438 +36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545 +36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757 +36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489 +36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519 +36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553 +36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347 +36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069 +36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039 +36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439 +36.252666,-115.261439 36.247366,-115.247239 36.247066)))')); + +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85998; + +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85984; + +drop table t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index d9c281cfebc..ca9ca9a5f97 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -5,6 +5,8 @@ drop table if exists t1; --enable_warnings +connect (master,localhost,root,,); +connection master; SET NAMES binary; # @@ -31,6 +33,23 @@ delete from mysql.user where user='mysqltest_1'; flush privileges; # +# Test of GRANTS specifying user limits +# +delete from mysql.user where user='mysqltest_1'; +flush privileges; +grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +# This is just to double check that one won't ignore results of selects +flush privileges; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +flush privileges; + +# # Test that the new db privileges are stored/retrieved correctly # @@ -98,6 +117,30 @@ GRANT FILE on mysqltest.* to mysqltest_1@localhost; select 1; -- To test that the previous command didn't cause problems # +# Bug #4898: User privileges depending on ORDER BY Settings of table db +# +insert into mysql.user (host, user) values ('localhost', 'test11'); +insert into mysql.db (host, db, user, select_priv) values +('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); +alter table mysql.db order by db asc; +flush privileges; +show grants for test11@localhost; +alter table mysql.db order by db desc; +flush privileges; +show grants for test11@localhost; +delete from mysql.user where user='test11'; +delete from mysql.db where user='test11'; + +# +# Bug#6123: GRANT USAGE inserts useless Db row +# +create database mysqltest1; +grant usage on mysqltest1.* to test6123 identified by 'magic123'; +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +delete from mysql.user where user='test6123'; +drop database mysqltest1; + +# # Test for 'drop user', 'revoke privileges, grant' # @@ -175,21 +218,6 @@ DROP DATABASE ÂÄ; SET NAMES latin1; # -# Bug #4898: User privileges depending on ORDER BY Settings of table db -# -insert into mysql.user (host, user) values ('localhost', 'test11'); -insert into mysql.db (host, db, user, select_priv) values -('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); -alter table mysql.db order by db asc; -flush privileges; -show grants for test11@localhost; -alter table mysql.db order by db desc; -flush privileges; -show grants for test11@localhost; -delete from mysql.user where user='test11'; -delete from mysql.db where user='test11'; - -# # Bug #5831: REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything # USE test; @@ -258,3 +286,86 @@ DROP DATABASE testdb8; DROP DATABASE testdb9; DROP DATABASE testdb10; +# +# Bug #6932: a problem with 'revoke ALL PRIVILEGES' +# + +create table t1(a int, b int, c int, d int); +grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost; +show grants for grant_user@localhost; +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +revoke ALL PRIVILEGES on t1 from grant_user@localhost; +show grants for grant_user@localhost; +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +drop user grant_user@localhost; +drop table t1; + +# +# Bug#7391: Cross-database multi-table UPDATE security problem +# +create database mysqltest_1; +create database mysqltest_2; +create table mysqltest_1.t1 select 1 a, 2 q; +create table mysqltest_1.t2 select 1 b, 2 r; +create table mysqltest_2.t1 select 1 c, 2 s; +create table mysqltest_2.t2 select 1 d, 2 t; + +#test the column privileges +grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; +grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; +grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; +grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; +connect (conn1,localhost,mysqltest_3,,); +connection conn1; +show grants for mysqltest_3@localhost; +--error 1143 +update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; +--error 1143 +update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +--error 1143 +update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; +--error 1143 +update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; +#the following two should work +update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; +update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; +connection master; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +revoke all on mysqltest_1.t1 from mysqltest_3@localhost; +revoke all on mysqltest_1.t2 from mysqltest_3@localhost; +revoke all on mysqltest_2.t1 from mysqltest_3@localhost; +revoke all on mysqltest_2.t2 from mysqltest_3@localhost; + +#test the db/table level privileges +grant all on mysqltest_2.* to mysqltest_3@localhost; +grant select on *.* to mysqltest_3@localhost; +flush privileges; +disconnect conn1; +connect (conn2,localhost,mysqltest_3,,); +connection conn2; +use mysqltest_1; +update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; +# the following failed before, should fail now. +--error 1143 +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +use mysqltest_2; +#the following used to succeed, it must fail now. +--error 1044 +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +--error 1044 +update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; +--error 1044 +update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; +#lets see the result +connection master; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; + +delete from mysql.user where user='mysqltest_3'; +delete from mysql.db where user="mysqltest_3"; +delete from mysql.tables_priv where user="mysqltest_3"; +delete from mysql.columns_priv where user="mysqltest_3"; +flush privileges; +drop database mysqltest_1; +drop database mysqltest_2; diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index f86be0c95b9..7060d35e9a4 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -50,10 +50,9 @@ flush privileges; use mysqltest; create table t1 (id int primary key, data varchar(255)); -connect (mrbad, localhost, mysqltest_1,,); +connect (mrbad, localhost, mysqltest_1,,mysqltest); connection mrbad; show grants for current_user(); -use mysqltest; insert into t1 values (1, 'I can''t change it!'); --error 1044 update t1 set data='I can change it!' where id = 1; @@ -61,11 +60,32 @@ update t1 set data='I can change it!' where id = 1; --error 1044 insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!'; select * from t1; +disconnect mrbad; + +connection default; +drop table t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; + +create table t1 (a int, b int); +grant select (a) on t1 to mysqltest_1@localhost with grant option; +connect (mrugly, localhost, mysqltest_1,,mysqltest); +connection mrugly; +--error 1143 +grant select (a,b) on t1 to mysqltest_2@localhost; +--error 1142 +grant select on t1 to mysqltest_3@localhost; +disconnect mrugly; connection default; drop table t1; -drop database mysqltest; -use test; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; + +drop database mysqltest; +use test; + diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 59983594c32..afd479c520e 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -457,6 +457,14 @@ SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; DROP TABLE t1; +#Test for BUG#6976: Aggregate functions have incorrect NULL-ness +create table t1 (a int); +insert into t1 values(null); +select min(a) is null from t1; +select min(a) is null or null from t1; +select 1 and min(a) is null from t1; +drop table t1; + # Test for BUG#5400: GROUP_CONCAT returns everything twice. create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); @@ -465,3 +473,19 @@ select group_concat( distinct col1 ) as alias from t1 drop table t1; +# +# Test BUG#8216 when referring in HAVING to n alias which is rand() function +# + +create table t1 (a integer, b integer, c integer); +insert into t1 (a,b) values (1,2),(1,3),(2,5); +select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +# rand(100)*10 will be < 2 only for the first row (of 6) +select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2; +select a,sum(b) from t1 where a=1 group by c; +select a*sum(b) from t1 where a=1 group by c; +select sum(a)*sum(b) from t1 where a=1 group by c; +select a,sum(b) from t1 where a=1 group by c having a=1; +select a as d,sum(b) from t1 where a=1 group by c having d=1; +select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0; +drop table t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index e1776245d9e..bc0b28370ec 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -174,3 +174,24 @@ CREATE TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=HEAP; INSERT INTO t1 VALUES(1,1), (1,NULL); SELECT * FROM t1 WHERE B is not null; DROP TABLE t1; + +# +# Bug #6748 +# heap_rfirst() doesn't work (and never did!) +# +CREATE TABLE t1 (pseudo char(35) PRIMARY KEY, date int(10) unsigned NOT NULL) ENGINE=HEAP; +INSERT INTO t1 VALUES ('massecot',1101106491),('altec',1101106492),('stitch+',1101106304),('Seb Corgan',1101106305),('beerfilou',1101106263),('flaker',1101106529),('joce8',5),('M4vrick',1101106418),('gabay008',1101106525),('Vamp irX',1101106291),('ZoomZip',1101106546),('rip666',1101106502),('CBP ',1101106397),('guezpard',1101106496); +DELETE FROM t1 WHERE date<1101106546; +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug #6878: a problem with small length records +# + +create table t1(a char(2)) engine=memory; +insert into t1 values (NULL), (NULL); +delete from t1 where a is null; +insert into t1 values ('2'), ('3'); +select * from t1; +drop table t1; diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index 412b6f2e705..6d27f19dfad 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -3,7 +3,7 @@ # --disable_warnings -drop table if exists t1; +drop table if exists t1,t2; --enable_warnings create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; @@ -141,3 +141,119 @@ INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11); DELETE from t1 where a < 100; SELECT * from t1; DROP TABLE t1; + + +# +# Hash index # records estimate test +# +create table t1 +( + a char(8) not null, + b char(20) not null, + c int not null, + key (a) +) engine=heap; + +insert into t1 values ('aaaa', 'prefill-hash=5',0); +insert into t1 values ('aaab', 'prefill-hash=0',0); +insert into t1 values ('aaac', 'prefill-hash=7',0); +insert into t1 values ('aaad', 'prefill-hash=2',0); +insert into t1 values ('aaae', 'prefill-hash=1',0); +insert into t1 values ('aaaf', 'prefill-hash=4',0); +insert into t1 values ('aaag', 'prefill-hash=3',0); +insert into t1 values ('aaah', 'prefill-hash=6',0); + +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; +insert into t1 select * from t1; + +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; + +# a known effect: table reload causes statistics to be updated: +flush tables; +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; + +# Check if delete_all_rows() updates #hash_buckets +create table t2 as select * from t1; +delete from t1; +insert into t1 select * from t2; +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; +drop table t1, t2; + + +# Btree and hash index use costs. +create table t1 ( + id int unsigned not null primary key auto_increment, + name varchar(20) not null, + index heap_idx(name), + index btree_idx using btree(name) +) engine=heap; + +create table t2 ( + id int unsigned not null primary key auto_increment, + name varchar(20) not null, + index btree_idx using btree(name), + index heap_idx(name) +) engine=heap; + +insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'), + ('Suzy'), ('Hoppy'), ('Burrito'), ('Mimi'), ('Sherry'), ('Ben'), ('Phil'), + ('Emily'), ('Mike'); +insert into t2 select * from t1; +explain select * from t1 where name='matt'; +explain select * from t2 where name='matt'; + +explain select * from t1 where name='Lilu'; +explain select * from t2 where name='Lilu'; + +explain select * from t1 where name='Phil'; +explain select * from t2 where name='Phil'; + +explain select * from t1 where name='Lilu'; +explain select * from t2 where name='Lilu'; + +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +flush tables; +select count(*) from t1 where name='Matt'; +explain select * from t1 ignore index (btree_idx) where name='matt'; +show index from t1; + +show index from t1; + +create table t3 +( + a varchar(20) not null, + b varchar(20) not null, + key (a,b) +) engine=heap; +insert into t3 select name, name from t1; +show index from t3; +show index from t3; + +# test rec_per_key use for joins. +explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name; + +drop table t1, t2, t3; + +# Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table +create temporary table t1 ( a int, index (a) ) engine=memory; +insert into t1 values (1),(2),(3),(4),(5); +select a from t1 where a in (1,3); +explain select a from t1 where a in (1,3); +drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 50ab3bdb8bd..cf7be4f882c 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1110,6 +1110,7 @@ show create table t2; drop table t2; # Test error handling +--replace_result \\ / --error 1005 create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; @@ -1157,3 +1158,25 @@ show status like "binlog_cache_use"; show status like "binlog_cache_disk_use"; drop table t1; + +# +# Bug #6126: Duplicate columns in keys gives misleading error message +# +--error 1060 +create table t1 (c char(10), index (c,c)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +--error 1060 +alter table t1 add key (c1,c1); +--error 1060 +alter table t1 add key (c2,c1,c1); +--error 1060 +alter table t1 add key (c1,c2,c1); +--error 1060 +alter table t1 add key (c1,c1,c2); +drop table t1; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 54379685731..f5acab05108 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -99,46 +99,57 @@ create table t1(number int auto_increment primary key, original_value varchar(50 set @value= "aa"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "1aa"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "aa1"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "1e+1111111111a"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "-1e+1111111111a"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= 1e+1111111111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1e+1111111111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= 1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= 1; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() drop table t1; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index db5dc8d91da..39b8bfcaaaa 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -89,6 +89,19 @@ show binlog events; select * from t1; drop table t1, t2; +# Verify that a partly-completed CREATE TABLE .. SELECT does not +# get into the binlog (Bug #6682) +create table t1(a int); +insert into t1 values(1),(1); +reset master; +--error 1062 +create table t2(unique(a)) select a from t1; +# The above should produce an error, *and* not appear in the binlog +let $VERSION=`select version()`; +--replace_result $VERSION VERSION +show binlog events; +drop table t1; + # # Test of insert ... select from same table # @@ -169,3 +182,18 @@ insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2 select * from t2; drop table t1, t2; + +# +# BUG#6034 - Error code 124: Wrong medium type +# +CREATE TABLE t1 ( + ID int(11) NOT NULL auto_increment, + NO int(11) NOT NULL default '0', + SEQ int(11) NOT NULL default '0', + PRIMARY KEY (ID), + KEY t1$NO (SEQ,NO) +) ENGINE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +drop table t1; + diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index fc54ce88f8a..188de8a5379 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -48,3 +48,35 @@ disable_info; select * from t1; drop table t1; + +# WorkLog #2274 - enable INSERT .. SELECT .. UPDATE syntax +# Same tests as beginning of this test except that insert source +# is a result from a select statement +# +CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B)); +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; +SELECT * FROM t1; +INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; +SELECT * FROM t1; +-- error 1062 +INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; +SELECT * FROM t1; +TRUNCATE TABLE t1; +INSERT t1 VALUES (1,2,10), (3,4,20); +CREATE TABLE t2 (a INT, b INT, c INT, d INT); +# column names deliberately clash with columns in t1 (Bug#8147) +INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); +INSERT t2 VALUES (2,1,11,2), (7,4,40,2); +INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; +SELECT * FROM t1; +INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +SELECT *, VALUES(a) FROM t1; +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 0c4c9614d88..d177a68e685 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -34,11 +34,14 @@ explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1; select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a); # The next query should rearange the left joins to get this to work -!$1120 explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -!$1120 select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); +--error 1120 +explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); +--error 1120 +select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); # The next query should give an error in MySQL -!$1120 select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); +--error 1120 +select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); # Test of inner join select t1.*,t2.* from t1 inner join t2 using (a); @@ -94,7 +97,8 @@ WHERE t1.uniq_id = 4 ORDER BY t2.c_amount; INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); -!$1062 INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); +--error 1062 +INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes'); #3rd select should show that one record is returned with null entries for the @@ -288,7 +292,8 @@ insert into t3 values (1); insert into t4 values (1,1); insert into t5 values (1,1); -!$1120 explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; +--error 1120 +explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; drop table t1,t2,t3,t4,t5; @@ -501,3 +506,79 @@ select s.*, '*', m.*, (s.match_1_h - m.home) UUX from order by UUX desc; drop table t1, t2; + +# Tests for bugs #6307 and 6460 + +create table t1 (a int, b int, unique index idx (a, b)); +create table t2 (a int, b int, c int, unique index idx (a, b)); + +insert into t1 values (1, 10), (1,11), (2,10), (2,11); +insert into t2 values (1,10,3); + +select t1.a, t1.b, t2.c from t1 left join t2 + on t1.a=t2.a and t1.b=t2.b and t2.c=3 + where t1.a=1 and t2.c is null; + +drop table t1, t2; + +CREATE TABLE t1 ( + ts_id bigint(20) default NULL, + inst_id tinyint(4) default NULL, + flag_name varchar(64) default NULL, + flag_value text, + UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE t2 ( + ts_id bigint(20) default NULL, + inst_id tinyint(4) default NULL, + flag_name varchar(64) default NULL, + flag_value text, + UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES + (111056548820001, 0, 'flag1', NULL), + (111056548820001, 0, 'flag2', NULL), + (2, 0, 'other_flag', NULL); + +INSERT INTO t2 VALUES + (111056548820001, 3, 'flag1', 'sss'); + +SELECT t1.flag_name,t2.flag_value + FROM t1 LEFT JOIN t2 + ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND + t2.inst_id = 3) + WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND + t2.flag_value IS NULL; + +DROP TABLE t1,t2; + +CREATE TABLE invoice ( + id int(11) unsigned NOT NULL auto_increment, + text_id int(10) unsigned default NULL, + PRIMARY KEY (id) +); + +INSERT INTO invoice VALUES("1", "0"); +INSERT INTO invoice VALUES("2", "10"); + +CREATE TABLE text_table ( + text_id char(3) NOT NULL default '', + language_id char(3) NOT NULL default '', + text_data text, + PRIMARY KEY (text_id,language_id) +); + +INSERT INTO text_table VALUES("0", "EN", "0-EN"); +INSERT INTO text_table VALUES("0", "SV", "0-SV"); +INSERT INTO text_table VALUES("10", "EN", "10-EN"); +INSERT INTO text_table VALUES("10", "SV", "10-SV"); + +SELECT invoice.id, invoice.text_id, text_table.text_data + FROM invoice LEFT JOIN text_table + ON invoice.text_id = text_table.text_id + AND text_table.language_id = 'SV' + WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%'); + +DROP TABLE invoice, text_table; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 4be34cac30e..a0a291fdf3c 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -146,7 +146,8 @@ create table t1 ); INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); INSERT INTO t1 VALUES (1, 1, 1, 1, 'b'); -!$1062 INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); +--error 1062 +INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); drop table t1; # @@ -296,3 +297,26 @@ drop table t1; --error 1105 create table t1 (c char(10), index (c(0))); + +# +# Bug #6126: Duplicate columns in keys should fail +# Bug #6252: (dup) +# +--error 1060 +create table t1 (c char(10), index (c,c)); +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)); +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)); +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)); +create table t1 (c1 char(10), c2 char(10)); +--error 1060 +alter table t1 add key (c1,c1); +--error 1060 +alter table t1 add key (c2,c1,c1); +--error 1060 +alter table t1 add key (c1,c2,c1); +--error 1060 +alter table t1 add key (c1,c1,c2); +drop table t1; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 9d3125efa61..5ff26b315e2 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -71,7 +71,7 @@ show status like 'key_blocks_used'; # Following results differs on 64 and 32 bit systems because of different # pointer sizes, which takes up different amount of space in key cache ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; insert into t1 values (1, 'qqqq'), (11, 'yyyy'); @@ -84,7 +84,7 @@ update t1 set p=2 where p=1; update t2 set i=2 where i=1; show status like 'key_blocks_used'; ---replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED +--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED 1820 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; cache index t1 key (`primary`) in keycache1; @@ -146,7 +146,7 @@ cache index t1,t2 in default; drop table t1,t2,t3; show status like 'key_blocks_used'; ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; # Cleanup @@ -156,3 +156,14 @@ set global keycache2.key_buffer_size=0; # Test to set up a too small size for a key cache (bug #2064) set global keycache3.key_buffer_size=100; set global keycache3.key_buffer_size=0; + +# Test case for buf 6447 + +create table t1 (mytext text, FULLTEXT (mytext)); +insert t1 values ('aaabbb'); + +check table t1; +set GLOBAL key_cache_block_size=2048; +check table t1; + +drop table t1; diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test index 61c57c9b468..28b287a5d4a 100644 --- a/mysql-test/t/limit.test +++ b/mysql-test/t/limit.test @@ -49,3 +49,13 @@ SELECT * FROM t1; DELETE FROM t1 WHERE id2 = 0 ORDER BY id desc LIMIT 1; SELECT * FROM t1; DROP TABLE t1; + +# +# Bug#8023 - limit on UNION with from DUAL, causes syntax error +# +create table t1 (a integer); +insert into t1 values (1); +# both queries must return one row +select 1 as a from t1 union all select 1 from dual limit 1; +(select 1 as a from t1) union all (select 1 from dual) limit 1; +drop table t1; diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index a4eaeac4ef4..eff5f2a99ec 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -100,3 +100,31 @@ show tables like 'T1%'; alter table t1 add index (A); show tables like 't1%'; drop table t1; + +# +# Bug #7261: Alter table loses temp table +# + +create temporary table T1(a int(11), b varchar(8)); +insert into T1 values (1, 'abc'); +select * from T1; +alter table T1 add index (a); +select * from T1; +drop table T1; + +# +# Bug #8355: Tables not dropped from table cache on drop db +# +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +insert into myUC values (1),(2),(3); +select * from myUC; +use test; +drop database mysqltest_LC2; +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +select * from myUC; +use test; +drop database mysqltest_LC2; diff --git a/mysql-test/t/lowercase_table_grant-master.opt b/mysql-test/t/lowercase_table_grant-master.opt new file mode 100644 index 00000000000..c718e2feb1b --- /dev/null +++ b/mysql-test/t/lowercase_table_grant-master.opt @@ -0,0 +1 @@ +--lower_case_table_names diff --git a/mysql-test/t/lowercase_table_grant.test b/mysql-test/t/lowercase_table_grant.test new file mode 100644 index 00000000000..5ac35c81c21 --- /dev/null +++ b/mysql-test/t/lowercase_table_grant.test @@ -0,0 +1,25 @@ +# Test of grants when lower_case_table_names is on +use mysql; + +# mixed-case database name for testing +create database MYSQLtest; + +# check that database name gets forced to lowercase +grant all on MySQLtest.* to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; + +# now force it to mixed case, but see that it is lowercased in the acl cache +select * from db where user = 'mysqltest_1'; +update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +show grants for mysqltest_1@localhost; +select * from db where user = 'mysqltest_1'; + +# clear out the user we created +# +# can't use REVOKE because of the mixed-case database name +delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +drop user mysqltest_1@localhost; + +drop database MYSQLtest; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 9580c1ab44c..508f9da225e 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -285,3 +285,24 @@ create table t3 engine=merge union=(t1, t2) select * from t1; --error 1093 create table t3 engine=merge union=(t1, t2) select * from t2; drop table t1, t2; + +# BUG#6699 : no sorting on 'ref' retrieval +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) + engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); + +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +select a,b,c from t3 force index (a) where a=1 order by a,b,c; + +# this actually wasn't affected: +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; + +# BUG#7377 SHOW index on MERGE table crashes debug server +show index from t3; + +drop table t1, t2, t3; + diff --git a/mysql-test/t/mix_innodb_myisam_binlog-master.opt b/mysql-test/t/mix_innodb_myisam_binlog-master.opt new file mode 100644 index 00000000000..cb48f1aaf60 --- /dev/null +++ b/mysql-test/t/mix_innodb_myisam_binlog-master.opt @@ -0,0 +1 @@ +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test index 9c576b080ca..89a7f8f3036 100644 --- a/mysql-test/t/mix_innodb_myisam_binlog.test +++ b/mysql-test/t/mix_innodb_myisam_binlog.test @@ -172,4 +172,36 @@ select a from t1 order by a; # check that savepoints work :) show binlog events from 79; +# Test for BUG#5714, where a MyISAM update in the transaction used to +# release row-level locks in InnoDB + +connect (con3,localhost,root,,); + +connection con3; +delete from t1; +delete from t2; +--disable_warnings +alter table t2 type=MyISAM; +--enable_warnings +insert into t1 values (1); +begin; +select * from t1 for update; + +connection con2; +select (@before:=unix_timestamp())*0; # always give repeatable output +begin; +send select * from t1 for update; + +connection con3; +insert into t2 values (20); + +connection con2; +--error 1205 +reap; +select (@after:=unix_timestamp())*0; # always give repeatable output +# verify that innodb_lock_wait_timeout was exceeded. When there was +# the bug, the reap would return immediately after the insert into t2. +select (@after-@before) >= 2; + +# cleanup drop table t1,t2; diff --git a/mysql-test/t/multi_statement-master.opt b/mysql-test/t/multi_statement-master.opt new file mode 100644 index 00000000000..b30df037531 --- /dev/null +++ b/mysql-test/t/multi_statement-master.opt @@ -0,0 +1,2 @@ +--log-slow-queries=slow.log +--log-queries-not-using-indexes diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index 862f2294641..2abec332878 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -14,3 +14,18 @@ select "abcd'";'abcd'select "'abcd";'abcd' select 5'abcd' delimiter ;'abcd' select 'finish'; + +# Bug #8475: Make sure every statement that is a slow query in +# a multi-statement query gets logged as a slow query. +flush status; +delimiter ||||; +create table t1 (i int); +insert into t1 values (1); +select * from t1 where i = 1; +insert into t1 values (2),(3),(4); +select * from t1 where i = 2; +select * from t1 where i = 3|||| +show status like 'Slow_queries'|||| +drop table t1|||| + +delimiter ;|||| diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index e2aebd014f8..4a7367a333c 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -5,9 +5,9 @@ --disable_warnings drop table if exists t1,t2,t3; drop database if exists mysqltest; ---error 0,1141 +--error 0,1141,1147 revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; ---error 0,1141 +--error 0,1141,1147 revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user=_binary'mysqltest_1'; --enable_warnings @@ -431,3 +431,20 @@ update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; -- error 1093 delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; drop table t1,t2; + +# Test for BUG#5837 - delete with outer join and const tables +--disable_warnings +create table t1 ( + aclid bigint not null primary key, + status tinyint(1) not null +) engine = innodb; + +create table t2 ( + refid bigint not null primary key, + aclid bigint, index idx_acl(aclid) +) engine = innodb; +--enable_warnings +insert into t2 values(1,null); +delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; +drop table t1, t2; + diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index f9081e8769b..c8ed7910b76 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -498,11 +498,12 @@ alter table t1 disable keys; show keys from t1; create table t2 (a int); let $i=1000; +set @@rand_seed1=31415926,@@rand_seed2=2718281828; --disable_query_log while ($i) { dec $i; - eval insert t2 values (rand()*100000); + insert t2 values (rand()*100000); } --enable_query_log insert t1 select * from t2; diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test new file mode 100644 index 00000000000..3639fc2e262 --- /dev/null +++ b/mysql-test/t/mysql_client_test.test @@ -0,0 +1,10 @@ +# We run with different binaries for normal and --embedded-server +# +# If this test fails with "command "$MYSQL_CLIENT_TEST" failed", +# you should either run mysql_client_test separartely against a running +# server or run mysql-test-run --debug mysql_client_test and check +# var/log/mysql_client_test.trace + +--disable_result_log +--exec echo $MYSQL_CLIENT_TEST +--exec $MYSQL_CLIENT_TEST diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 89b3739f955..255ae50a8ca 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -127,3 +127,41 @@ insert into t1 values (1),(2),(3); --exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql --exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt drop table t1; + +# +# Bug #6101: create database problem +# + +--exec $MYSQL_DUMP --skip-comments --databases test + +create database mysqldump_test_db character set latin2 collate latin2_bin; +--exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db; +drop database mysqldump_test_db; + +# +# Bug #7020 +# Check that we don't dump in UTF8 in compatible mode by default, +# but use the default compiled values, or the values given in +# --default-character-set=xxx. However, we should dump in UTF8 +# if it is explicitely set. + +CREATE TABLE t1 (a CHAR(10)); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 +DROP TABLE t1; + +# +# WL #2319: Exclude Tables from dump +# + +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (4),(5),(6); +--exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index c18dfe1e25c..0802c18ed6c 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -6,17 +6,24 @@ # ============================================================================ # ---------------------------------------------------------------------------- +# $mysql_errno contains the return code of the last command +# send to the server. +# ---------------------------------------------------------------------------- +# get $mysql_errno before the first statement +# $mysql_errno should be -1 +eval select $mysql_errno as "before_use_test" ; + + +# ---------------------------------------------------------------------------- # Positive case(statement) # ---------------------------------------------------------------------------- select otto from (select 1 as otto) as t1; # expectation = response -!$0 select otto from (select 1 as otto) as t1; --error 0 select otto from (select 1 as otto) as t1; # expectation <> response --- // !$1054 select otto from (select 1 as otto) as t1; -- // --error 1054 -- // select otto from (select 1 as otto) as t1; @@ -29,12 +36,10 @@ select otto from (select 1 as otto) as t1; # ---------------------------------------------------------------------------- # expectation <> response -#!$0 select friedrich from (select 1 as otto) as t1; #--error 0 #select friedrich from (select 1 as otto) as t1; # expectation = response -!$1054 select friedrich from (select 1 as otto) as t1; --error 1054 select friedrich from (select 1 as otto) as t1; @@ -76,3 +81,208 @@ select friedrich from (select 1 as otto) as t1; #--error S00000 #select friedrich from (select 1 as otto) as t1; + +# ---------------------------------------------------------------------------- +# test cases for $mysql_errno +# +# $mysql_errno is a builtin variable of mysqltest and contains the return code +# of the last command send to the server. +# +# The following test cases often initialize $mysql_errno to 1064 by +# a command with wrong syntax. +# Example: --error 1064 To prevent the abort after the error. +# garbage ; +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# check mysql_errno = 0 after successful statement +# ---------------------------------------------------------------------------- +select otto from (select 1 as otto) as t1; +eval select $mysql_errno as "after_successful_stmt_errno" ; + +#---------------------------------------------------------------------------- +# check mysql_errno = 1064 after statement with wrong syntax +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +eval select $mysql_errno as "after_wrong_syntax_errno" ; + +# ---------------------------------------------------------------------------- +# check if let $my_var= 'abc' ; affects $mysql_errno +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +let $my_var= 'abc' ; +eval select $mysql_errno as "after_let_var_equal_value" ; + +# ---------------------------------------------------------------------------- +# check if set @my_var= 'abc' ; affects $mysql_errno +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +set @my_var= 'abc' ; +eval select $mysql_errno as "after_set_var_equal_value" ; + +# ---------------------------------------------------------------------------- +# check if the setting of --disable-warnings itself affects $mysql_errno +# (May be --<whatever> modifies $mysql_errno.) +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +--disable_warnings +eval select $mysql_errno as "after_disable_warnings_command" ; + +# ---------------------------------------------------------------------------- +# check if --disable-warnings + command with warning affects the errno +# stored within $mysql_errno +# (May be disabled warnings affect $mysql_errno.) +# ---------------------------------------------------------------------------- +drop table if exists t1 ; +--error 1064 +garbage ; +drop table if exists t1 ; +eval select $mysql_errno as "after_disable_warnings" ; +--enable_warnings + +# ---------------------------------------------------------------------------- +# check if masked errors affect $mysql_errno +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +--error 1146 +select 3 from t1 ; +eval select $mysql_errno as "after_minus_masked" ; +--error 1064 +garbage ; +--error 1146 +select 3 from t1 ; +eval select $mysql_errno as "after_!_masked" ; + +# ---------------------------------------------------------------------------- +# Will manipulations of $mysql_errno be possible and visible ? +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +let $mysql_errno= -1; +eval select $mysql_errno as "after_let_errno_equal_value" ; + +# ---------------------------------------------------------------------------- +# How affect actions on prepared statements $mysql_errno ? +# ---------------------------------------------------------------------------- +# failing prepare +--error 1064 +garbage ; +--error 1146 +prepare stmt from "select 3 from t1" ; +eval select $mysql_errno as "after_failing_prepare" ; +create table t1 ( f1 char(10)); + +# successful prepare +--error 1064 +garbage ; +prepare stmt from "select 3 from t1" ; +eval select $mysql_errno as "after_successful_prepare" ; + +# successful execute +--error 1064 +garbage ; +execute stmt; +eval select $mysql_errno as "after_successful_execute" ; + +# failing execute (table dropped) +drop table t1; +--error 1064 +garbage ; +--error 1146 +execute stmt; +eval select $mysql_errno as "after_failing_execute" ; + +# failing execute (unknown statement) +--error 1064 +garbage ; +--error 1243 +execute __stmt_; +eval select $mysql_errno as "after_failing_execute" ; + +# successful deallocate +--error 1064 +garbage ; +deallocate prepare stmt; +eval select $mysql_errno as "after_successful_deallocate" ; + +# failing deallocate ( statement handle does not exist ) +--error 1064 +garbage ; +--error 1243 +deallocate prepare __stmt_; +eval select $mysql_errno as "after_failing_deallocate" ; + + +# ---------------------------------------------------------------------------- +# test cases for "--disable_abort_on_error" +# +# "--disable_abort_on_error" switches the abort of mysqltest +# after "unmasked" failing statements off. +# +# The default is "--enable_abort_on_error". +# +# "Maskings" are +# --error <error number> and --error <error number> +# in the line before the failing statement. +# +# There are some additional test case for $mysql_errno +# because "--disable_abort_on_error" enables a new situation. +# Example: "unmasked" statement fails + analysis of $mysql_errno +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Switch the abort on error off and check the effect on $mysql_errno +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +--disable_abort_on_error +eval select $mysql_errno as "after_--disable_abort_on_error" ; + +# ---------------------------------------------------------------------------- +# "unmasked" failing statement should not cause an abort +# ---------------------------------------------------------------------------- +select 3 from t1 ; + +# ---------------------------------------------------------------------------- +# masked failing statements +# ---------------------------------------------------------------------------- +# expected error = response +--error 1146 +select 3 from t1 ; +--error 1146 +select 3 from t1 ; +eval select $mysql_errno as "after_!errno_masked_error" ; +# expected error <> response +# --error 1000 +# select 3 from t1 ; +# --error 1000 +# select 3 from t1 ; + +# ---------------------------------------------------------------------------- +# Switch the abort on error on and check the effect on $mysql_errno +# ---------------------------------------------------------------------------- +--error 1064 +garbage ; +--enable_abort_on_error +eval select $mysql_errno as "after_--enable_abort_on_error" ; + +# ---------------------------------------------------------------------------- +# masked failing statements +# ---------------------------------------------------------------------------- +# expected error = response +--error 1146 +select 3 from t1 ; + +# ---------------------------------------------------------------------------- +# check that the old default behaviour is not changed +# Please remove the '#' to get the abort on error +# ---------------------------------------------------------------------------- +#--error 1064 +#select 3 from t1 ; +# +#select 3 from t1 ; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 22b1a0e476d..892443a1407 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -2,6 +2,7 @@ --disable_warnings DROP TABLE IF EXISTS t1; +drop database if exists mysqltest; --enable_warnings # @@ -21,6 +22,22 @@ SELECT * FROM t1; DROP TABLE t1; # +# Verfify changing table names between databases +# +CREATE DATABASE mysqltest; +USE mysqltest; +CREATE TABLE t1 ( + a INT NOT NULL, + b INT NOT NULL +) ENGINE=ndbcluster; +RENAME TABLE t1 TO test.t1; +SHOW TABLES; +DROP DATABASE mysqltest; +USE test; +SHOW TABLES; +DROP TABLE t1; + +# # More advanced test # create table t1 ( diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 95b616fc7b2..037115f5e82 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc --disable_warnings -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; --enable_warnings ################################################ @@ -199,7 +199,7 @@ insert into t4 values (1, "Automatic"); select * from t4; # Remove the table from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; # # Test that correct error is returned @@ -230,7 +230,7 @@ select * from t4; flush tables; # Remove the table from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; SHOW TABLES; @@ -264,8 +264,8 @@ insert into t8 values (8, "myisam table 8"); insert into t9 values (9); # Remove t3, t5 from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ; # Remove t6, t7 from disk system rm var/master-data/test/t6.frm > /dev/null ; system rm var/master-data/test/t7.frm > /dev/null ; @@ -306,8 +306,8 @@ insert into t8 values (8, "myisam table 8"); insert into t9 values (9); # Remove t3, t5 from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ; # Remove t6, t7 from disk system rm var/master-data/test/t6.frm > /dev/null ; system rm var/master-data/test/t7.frm > /dev/null ; @@ -472,5 +472,11 @@ system rm var/master-data/test/t9.frm ; # MySQL Server will have been restarted because it has a # ndb_autodiscover2-master.opt file. +create table t10 ( + a int not null primary key, + b blob +) engine=ndb; +insert into t10 values (1, 'kalle'); +--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB` >> $NDB_TOOLS_OUTPUT 2>&1 || true diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test index cce75d5ca4f..11e1cc204f7 100644 --- a/mysql-test/t/ndb_autodiscover2.test +++ b/mysql-test/t/ndb_autodiscover2.test @@ -13,4 +13,7 @@ show status like 'handler_discover%'; drop table t9; +--error 1296 +select * from t10; +drop table t10; diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index e79815bbeb1..f460c573a9d 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -36,6 +36,8 @@ UPDATE t1 SET pk1=2 WHERE attr1=1; SELECT * FROM t1 ORDER BY pk1; UPDATE t1 SET pk1=pk1 + 1; SELECT * FROM t1 ORDER BY pk1; +UPDATE t1 SET pk1=4 WHERE pk1 = 3; +SELECT * FROM t1 ORDER BY pk1; # Delete the record DELETE FROM t1; @@ -359,6 +361,21 @@ drop table test.t1, t2; drop database mysqltest; # +# BUG#6031 - DROP DATABASE doesn't drop database on first try +# + +--disable_warnings +drop database if exists ndbtest1; +--enable_warnings + +create database ndbtest1; +use ndbtest1; +create table t1(id int) engine=ndbcluster; +drop database ndbtest1; +--error 1008 +drop database ndbtest1; + +# # test support of char(0) # @@ -371,3 +388,192 @@ select * from t1 order by b; select * from t1 where b IS NULL; select * from t1 where b IS NOT NULL; drop table t1; + +# +# test the limit of no of attributes in one table +# + +create table t1 ( +c1 int, +c2 int, +c3 int, +c4 int, +c5 int, +c6 int, +c7 int, +c8 int, +c9 int, +c10 int, +c11 int, +c12 int, +c13 int, +c14 int, +c15 int, +c16 int, +c17 int, +c18 int, +c19 int, +c20 int, +c21 int, +c22 int, +c23 int, +c24 int, +c25 int, +c26 int, +c27 int, +c28 int, +c29 int, +c30 int, +c31 int, +c32 int, +c33 int, +c34 int, +c35 int, +c36 int, +c37 int, +c38 int, +c39 int, +c40 int, +c41 int, +c42 int, +c43 int, +c44 int, +c45 int, +c46 int, +c47 int, +c48 int, +c49 int, +c50 int, +c51 int, +c52 int, +c53 int, +c54 int, +c55 int, +c56 int, +c57 int, +c58 int, +c59 int, +c60 int, +c61 int, +c62 int, +c63 int, +c64 int, +c65 int, +c66 int, +c67 int, +c68 int, +c69 int, +c70 int, +c71 int, +c72 int, +c73 int, +c74 int, +c75 int, +c76 int, +c77 int, +c78 int, +c79 int, +c80 int, +c81 int, +c82 int, +c83 int, +c84 int, +c85 int, +c86 int, +c87 int, +c88 int, +c89 int, +c90 int, +c91 int, +c92 int, +c93 int, +c94 int, +c95 int, +c96 int, +c97 int, +c98 int, +c99 int, +c100 int, +c101 int, +c102 int, +c103 int, +c104 int, +c105 int, +c106 int, +c107 int, +c108 int, +c109 int, +c110 int, +c111 int, +c112 int, +c113 int, +c114 int, +c115 int, +c116 int, +c117 int, +c118 int, +c119 int, +c120 int, +c121 int, +c122 int, +c123 int, +c124 int, +c125 int, +c126 int, +c127 int, +c128 int, +primary key(c1)) engine=ndb; +drop table t1; + +# +# test max size of attribute name and truncation +# + +create table t1 ( +a1234567890123456789012345678901234567890 int primary key, +a12345678901234567890123456789a1234567890 int, +index(a12345678901234567890123456789a1234567890) +) engine=ndb; +show tables; +insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1); +explain select * from t1 where a12345678901234567890123456789a1234567890=2; +select * from t1 where a12345678901234567890123456789a1234567890=2; +drop table t1; + +# +# test fragment creation +# +# first a table with _many_ fragments per node group +# then a table with just one fragment per node group +# +create table t1 + (a bigint, b bigint, c bigint, d bigint, + primary key (a,b,c,d)) + engine=ndb + max_rows=200000000; +insert into t1 values + (1,2,3,4),(2,3,4,5),(3,4,5,6), + (3,2,3,4),(1,3,4,5),(2,4,5,6), + (1,2,3,5),(2,3,4,8),(3,4,5,9), + (3,2,3,5),(1,3,4,8),(2,4,5,9), + (1,2,3,6),(2,3,4,6),(3,4,5,7), + (3,2,3,6),(1,3,4,6),(2,4,5,7), + (1,2,3,7),(2,3,4,7),(3,4,5,8), + (3,2,3,7),(1,3,4,7),(2,4,5,8), + (1,3,3,4),(2,4,4,5),(3,5,5,6), + (3,3,3,4),(1,4,4,5),(2,5,5,6), + (1,3,3,5),(2,4,4,8),(3,5,5,9), + (3,3,3,5),(1,4,4,8),(2,5,5,9), + (1,3,3,6),(2,4,4,6),(3,5,5,7), + (3,3,3,6),(1,4,4,6),(2,5,5,7), + (1,3,3,7),(2,4,4,7),(3,5,5,8), + (3,3,3,7),(1,4,4,7),(2,5,5,8); +select count(*) from t1; +drop table t1; + +create table t1 + (a bigint, b bigint, c bigint, d bigint, + primary key (a)) + engine=ndb + max_rows=1; +drop table t1; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index 5454dd91d26..96e38bfb58e 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -2,7 +2,7 @@ --disable_warnings drop table if exists t1; -drop database if exists mysqltest; +drop database if exists test2; --enable_warnings # @@ -12,31 +12,7 @@ drop database if exists mysqltest; # A prerequisite for this handler test is that "testBlobs" succeeds. # -# -- bug-5252 tinytext crashes -- - -create table t1 ( - a int not null primary key, - b tinytext -) engine=ndbcluster; - -insert into t1 values(1, 'x'); -update t1 set b = 'y'; -select * from t1; -delete from t1; -drop table t1; - -# -- bug-5013 insert empty string to text -- - -create table t1 ( - a int not null primary key, - b text not null -) engine=ndbcluster; - -insert into t1 values(1, ''); -select * from t1; -drop table t1; - --- general test starts -- +# -- general test starts -- # make test harder with autocommit off set autocommit=0; @@ -117,7 +93,6 @@ from t1 where a=2; # pk update to null update t1 set d=null where a=1; commit; -# FIXME now fails at random due to weird mixup between the 2 rows select a from t1 where d is null; # pk delete @@ -126,6 +101,49 @@ delete from t1 where a=2; commit; select count(*) from t1; +# -- replace ( bug-6018 ) -- + +# insert +replace t1 set a=1,b=@b1,c=111,d=@d1; +replace t1 set a=2,b=@b2,c=222,d=@d2; +commit; +explain select * from t1 where a = 1; + +# pk read +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=1; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=2; + +# update +replace t1 set a=1,b=@b2,c=111,d=@d2; +replace t1 set a=2,b=@b1,c=222,d=@d1; +commit; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=1; +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=2; + +# update +replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2); +replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1); +commit; +select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3) +from t1 where a=1; +select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3) +from t1 where a=2; + +# update to null +replace t1 set a=1,b='xyz',c=111,d=null; +commit; +select a,b from t1 where d is null; + +# pk delete +delete from t1 where a=1; +delete from t1 where a=2; +commit; +select count(*) from t1; + # -- hash index ops -- insert into t1 values(1,@b1,111,@d1); @@ -231,39 +249,6 @@ where c >= 100; commit; select * from t1 where c >= 100 order by a; -# alter table - -select * from t1 order by a; -alter table t1 add x int; -select * from t1 order by a; -alter table t1 drop x; -select * from t1 order by a; - -# multi db - -create database mysqltest; -use mysqltest; - -CREATE TABLE t2 ( - a bigint unsigned NOT NULL PRIMARY KEY, - b int unsigned not null, - c int unsigned -) engine=ndbcluster; - -insert into t2 values (1,1,1),(2,2,2); -select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; - -drop table t2; -use test; - -# alter table - -select * from t1 order by a; -alter table t1 add x int; -select * from t1 order by a; -alter table t1 drop x; -select * from t1 order by a; - # range scan delete delete from t1 where c >= 100; commit; @@ -306,10 +291,82 @@ select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) from t1 order by a; rollback; select count(*) from t1; + +# -- alter table and multi db -- + +insert into t1 values(1,'b1',111,'dd1'); +insert into t1 values(2,'b2',222,'dd2'); +insert into t1 values(3,'b3',333,'dd3'); +insert into t1 values(4,'b4',444,'dd4'); +insert into t1 values(5,'b5',555,'dd5'); +insert into t1 values(6,'b6',666,'dd6'); +insert into t1 values(7,'b7',777,'dd7'); +insert into t1 values(8,'b8',888,'dd8'); +insert into t1 values(9,'b9',999,'dd9'); +commit; + +select * from t1 order by a; +alter table t1 add x int; +select * from t1 order by a; +alter table t1 drop x; +select * from t1 order by a; + +create database test2; +use test2; + +CREATE TABLE t2 ( + a bigint unsigned NOT NULL PRIMARY KEY, + b int unsigned not null, + c int unsigned +) engine=ndbcluster; + +insert into t2 values (1,1,1),(2,2,2); +select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; + +drop table t2; +use test; + +select * from t1 order by a; +alter table t1 add x int; +select * from t1 order by a; +alter table t1 drop x; +select * from t1 order by a; + +# -- end general test -- + +drop table t1; +drop database test2; + +# -- bug-5252 tinytext crashes plus no-commit result -- + +set autocommit=0; +create table t1 ( + a int not null primary key, + b tinytext +) engine=ndbcluster; + +insert into t1 values(1, 'x'); +update t1 set b = 'y'; +select * from t1; +delete from t1; +select * from t1; +commit; drop table t1; -drop database mysqltest; -# bug #5349 +# -- bug-5013 insert empty string to text -- + +set autocommit=0; +create table t1 ( + a int not null primary key, + b text not null +) engine=ndbcluster; + +insert into t1 values(1, ''); +select * from t1; +commit; +drop table t1; + +# -- bug #5349 -- set autocommit=1; use test; CREATE TABLE t1 ( @@ -327,7 +384,22 @@ select * from t1 order by a; alter table t1 engine=ndb; select * from t1 order by a; -# bug #5872 +# -- bug #5872 -- +set autocommit=1; alter table t1 engine=myisam; select * from t1 order by a; drop table t1; + +# -- bug #7340 -- +create table t1 ( + id int(11) unsigned primary key NOT NULL auto_increment, + msg text NOT NULL +) engine=ndbcluster default charset=utf8; +insert into t1 (msg) values( +'Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length).'); +select * from t1; +drop table t1; diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test index b9f28ed0faf..1b9e7e8bfcc 100644 --- a/mysql-test/t/ndb_charset.test +++ b/mysql-test/t/ndb_charset.test @@ -86,9 +86,9 @@ create table t1 ( # ok insert into t1 values(1, 'aAa'); # fail ---error 1169 +--error 1062 insert into t1 values(2, 'aaa'); ---error 1169 +--error 1062 insert into t1 values(3, 'AAA'); # 1 select * from t1 order by p; @@ -157,3 +157,13 @@ select * from t1 where a = 'AaA' order by p; # 6 select * from t1 where a = 'AAA' order by p; drop table t1; + +# bug +create table t1 ( + a varchar(10) primary key +) engine=ndb; +insert into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +select * from t1; +drop table t1; diff --git a/mysql-test/t/ndb_grant.later b/mysql-test/t/ndb_grant.later new file mode 100644 index 00000000000..d3899d9972f --- /dev/null +++ b/mysql-test/t/ndb_grant.later @@ -0,0 +1,374 @@ +-- source include/have_ndb.inc +# Test of GRANT commands + +# Cleanup +--disable_warnings +drop table if exists t1; +--enable_warnings + +SET NAMES binary; + +# +# Alter mysql system tables to ndb +# make sure you alter all back in the end +# +use mysql; +alter table columns_priv engine=ndb; +alter table db engine=ndb; +alter table func engine=ndb; +alter table help_category engine=ndb; +alter table help_keyword engine=ndb; +alter table help_relation engine=ndb; +alter table help_topic engine=ndb; +alter table host engine=ndb; +alter table tables_priv engine=ndb; +alter table time_zone engine=ndb; +alter table time_zone_leap_second engine=ndb; +alter table time_zone_name engine=ndb; +alter table time_zone_transition engine=ndb; +alter table time_zone_transition_type engine=ndb; +alter table user engine=ndb; +use test; + +# +# Test that SSL options works properly +# +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +flush privileges; +begin; +grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +commit; +show grants for mysqltest_1@localhost; +begin; +grant delete on mysqltest.* to mysqltest_1@localhost; +commit; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +begin; +revoke delete on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +grant select on mysqltest.* to mysqltest_1@localhost require NONE; +commit; +show grants for mysqltest_1@localhost; +begin; +grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB"; +commit; +show grants for mysqltest_1@localhost; +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +flush privileges; + +# +# Test that the new db privileges are stored/retrieved correctly +# + +begin; +grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +flush privileges; +show grants for mysqltest_1@localhost; +begin; +revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION; +commit; +flush privileges; +show grants for mysqltest_1@localhost; +begin; +revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +delete from mysql.user where user='mysqltest_1'; +flush privileges; +begin; +grant usage on test.* to mysqltest_1@localhost with grant option; +commit; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +delete from mysql.tables_priv where user='mysqltest_1'; +delete from mysql.columns_priv where user='mysqltest_1'; +flush privileges; +--error 1141 +show grants for mysqltest_1@localhost; + +# +# Test what happens when you have same table and colum level grants +# + +create table t1 (a int); +begin; +GRANT select,update,insert on t1 to mysqltest_1@localhost; +GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +begin; +REVOKE select (a), update on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +GRANT select,references on t1 to mysqltest_1@localhost; +commit; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +begin; +grant all on test.* to mysqltest_3@localhost with grant option; +revoke all on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +begin; +revoke grant option on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +begin; +grant all on test.t1 to mysqltest_2@localhost with grant option; +revoke all on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +begin; +revoke grant option on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +flush privileges; +drop table t1; + +# +# Test some error conditions +# +begin; +--error 1221 +GRANT FILE on mysqltest.* to mysqltest_1@localhost; +commit; +select 1; -- To test that the previous command didn't cause problems + +# +# Bug#6123: GRANT USAGE inserts useless Db row +# +create database mysqltest1; +begin; +grant usage on mysqltest1.* to test6123 identified by 'magic123'; +commit; +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +delete from mysql.user where user='test6123'; +drop database mysqltest1; + +# +# Test for 'drop user', 'revoke privileges, grant' +# + +create table t1 (a int); +begin; +grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION; +commit; +show grants for drop_user2@localhost; +begin; +revoke all privileges, grant option from drop_user2@localhost; +commit; +drop user drop_user2@localhost; + +begin; +grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION; +grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION; +grant select(a) on test.t1 to drop_user@localhost; +commit; +show grants for drop_user@localhost; + +# +# Bug3086 +# +set sql_mode=ansi_quotes; +show grants for drop_user@localhost; +set sql_mode=default; + +set sql_quote_show_create=0; +show grants for drop_user@localhost; +set sql_mode="ansi_quotes"; +show grants for drop_user@localhost; +set sql_quote_show_create=1; +show grants for drop_user@localhost; +set sql_mode=""; +show grants for drop_user@localhost; + +revoke all privileges, grant option from drop_user@localhost; +show grants for drop_user@localhost; +drop user drop_user@localhost; +begin; +--error 1269 +revoke all privileges, grant option from drop_user@localhost; +commit; + +begin; +grant select(a) on test.t1 to drop_user1@localhost; +commit; +flush privileges; +begin; +grant select on test.t1 to drop_user2@localhost; +grant select on test.* to drop_user3@localhost; +grant select on *.* to drop_user4@localhost; +commit; +--error 1268 +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +begin; +revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost, +drop_user3@localhost, drop_user4@localhost; +commit; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +drop table t1; +begin; +grant usage on *.* to mysqltest_1@localhost identified by "password"; +grant select, update, insert on test.* to mysqltest@localhost; +commit; +show grants for mysqltest_1@localhost; +drop user mysqltest_1@localhost; + +# +# Bug #3403 Wrong encodin in SHOW GRANTS output +# +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁ (ËÏÌ int); + +begin; +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +begin; +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +commit; + +begin; +GRANT SELECT ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +begin; +REVOKE SELECT ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +commit; + +begin; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +begin; +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +commit; + +DROP DATABASE ÂÄ; +SET NAMES latin1; + +# +# Bug #5831: REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything +# +USE test; +CREATE TABLE t1 (a int ); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +CREATE TABLE t4 LIKE t1; +CREATE TABLE t5 LIKE t1; +CREATE TABLE t6 LIKE t1; +CREATE TABLE t7 LIKE t1; +CREATE TABLE t8 LIKE t1; +CREATE TABLE t9 LIKE t1; +CREATE TABLE t10 LIKE t1; +CREATE DATABASE testdb1; +CREATE DATABASE testdb2; +CREATE DATABASE testdb3; +CREATE DATABASE testdb4; +CREATE DATABASE testdb5; +CREATE DATABASE testdb6; +CREATE DATABASE testdb7; +CREATE DATABASE testdb8; +CREATE DATABASE testdb9; +CREATE DATABASE testdb10; +begin; +GRANT ALL ON testdb1.* TO testuser@localhost; +GRANT ALL ON testdb2.* TO testuser@localhost; +GRANT ALL ON testdb3.* TO testuser@localhost; +GRANT ALL ON testdb4.* TO testuser@localhost; +GRANT ALL ON testdb5.* TO testuser@localhost; +GRANT ALL ON testdb6.* TO testuser@localhost; +GRANT ALL ON testdb7.* TO testuser@localhost; +GRANT ALL ON testdb8.* TO testuser@localhost; +GRANT ALL ON testdb9.* TO testuser@localhost; +GRANT ALL ON testdb10.* TO testuser@localhost; +GRANT SELECT ON test.t1 TO testuser@localhost; +GRANT SELECT ON test.t2 TO testuser@localhost; +GRANT SELECT ON test.t3 TO testuser@localhost; +GRANT SELECT ON test.t4 TO testuser@localhost; +GRANT SELECT ON test.t5 TO testuser@localhost; +GRANT SELECT ON test.t6 TO testuser@localhost; +GRANT SELECT ON test.t7 TO testuser@localhost; +GRANT SELECT ON test.t8 TO testuser@localhost; +GRANT SELECT ON test.t9 TO testuser@localhost; +GRANT SELECT ON test.t10 TO testuser@localhost; +GRANT SELECT (a) ON test.t1 TO testuser@localhost; +GRANT SELECT (a) ON test.t2 TO testuser@localhost; +GRANT SELECT (a) ON test.t3 TO testuser@localhost; +GRANT SELECT (a) ON test.t4 TO testuser@localhost; +GRANT SELECT (a) ON test.t5 TO testuser@localhost; +GRANT SELECT (a) ON test.t6 TO testuser@localhost; +GRANT SELECT (a) ON test.t7 TO testuser@localhost; +GRANT SELECT (a) ON test.t8 TO testuser@localhost; +GRANT SELECT (a) ON test.t9 TO testuser@localhost; +GRANT SELECT (a) ON test.t10 TO testuser@localhost; +commit; +begin; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; +commit; +SHOW GRANTS FOR testuser@localhost; +DROP USER testuser@localhost; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +DROP DATABASE testdb1; +DROP DATABASE testdb2; +DROP DATABASE testdb3; +DROP DATABASE testdb4; +DROP DATABASE testdb5; +DROP DATABASE testdb6; +DROP DATABASE testdb7; +DROP DATABASE testdb8; +DROP DATABASE testdb9; +DROP DATABASE testdb10; + +# +# Alter mysql system tables back to myisam +# +use mysql; +alter table columns_priv engine=myisam; +alter table db engine=myisam; +alter table func engine=myisam; +alter table help_category engine=myisam; +alter table help_keyword engine=myisam; +alter table help_relation engine=myisam; +alter table help_topic engine=myisam; +alter table host engine=myisam; +alter table tables_priv engine=myisam; +alter table time_zone engine=myisam; +alter table time_zone_leap_second engine=myisam; +alter table time_zone_name engine=myisam; +alter table time_zone_transition engine=myisam; +alter table time_zone_transition_type engine=myisam; +alter table user engine=myisam; +use test; +flush privileges; diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 64291c8ab97..010060a694d 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc --disable_warnings -drop table if exists t1; +drop table if exists t1, test1, test2; --enable_warnings # @@ -146,3 +146,173 @@ select * from t1 use index (bc) where b IS NULL and c = 2 order by a; select * from t1 use index (bc) where b < 4 order by a; select * from t1 use index (bc) where b IS NOT NULL order by a; drop table t1; + +# +# Bug #6435 +CREATE TABLE test1 ( +SubscrID int(11) NOT NULL auto_increment, +UsrID int(11) NOT NULL default '0', +PRIMARY KEY (SubscrID), +KEY idx_usrid (UsrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; + +INSERT INTO test1 VALUES (2,224),(3,224),(1,224); + +CREATE TABLE test2 ( +SbclID int(11) NOT NULL auto_increment, +SbcrID int(11) NOT NULL default '0', +PRIMARY KEY (SbclID), +KEY idx_sbcrid (SbcrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; + +INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2); +select * from test1 order by 1; +select * from test2 order by 1; +SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON +l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2; +drop table test1; +drop table test2; + +# bug#7424 + bug#7725 + +create table t1 ( + pk int primary key, + dt datetime not null, + da date not null, + ye year not null, + ti time not null, + ts timestamp not null, + index(dt), + index(da), + index(ye), + index(ti), + index(ts) +) engine=ndb; + +insert into t1 (pk,dt,da,ye,ti,ts) values + (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'), + (2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'), + (3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'), + (4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'), + (5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'), + (6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'), + (7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'), + (8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'), + (9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59'); + +# datetime +select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +select count(*)-6 from t1 use index (dt) where dt >= '1955-12-31 00:00:00'; +select count(*)-5 from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +select count(*)-5 from t1 use index (dt) where dt < '1970-03-03 22:22:22'; +select count(*)-7 from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +select count(*)-8 from t1 use index (dt) where dt <= '2001-01-01 10:11:11'; +select count(*)-9 from t1 use index (dt) where dt <= '2055-01-01 00:00:00'; + +# date +select count(*)-9 from t1 use index (da) where da > '1900-01-01'; +select count(*)-6 from t1 use index (da) where da >= '1955-12-31'; +select count(*)-5 from t1 use index (da) where da > '1955-12-31'; +select count(*)-5 from t1 use index (da) where da < '1970-03-03'; +select count(*)-6 from t1 use index (da) where da < '2001-01-01'; +select count(*)-8 from t1 use index (da) where da <= '2001-01-02'; +select count(*)-9 from t1 use index (da) where da <= '2055-01-01'; + +# year +select count(*)-9 from t1 use index (ye) where ye > '1900'; +select count(*)-6 from t1 use index (ye) where ye >= '1955'; +select count(*)-5 from t1 use index (ye) where ye > '1955'; +select count(*)-5 from t1 use index (ye) where ye < '1970'; +select count(*)-6 from t1 use index (ye) where ye < '2001'; +select count(*)-8 from t1 use index (ye) where ye <= '2001'; +select count(*)-9 from t1 use index (ye) where ye <= '2055'; + +# time +select count(*)-9 from t1 use index (ti) where ti >= '00:00:00'; +select count(*)-7 from t1 use index (ti) where ti > '00:00:00'; +select count(*)-7 from t1 use index (ti) where ti > '05:05:05'; +select count(*)-5 from t1 use index (ti) where ti > '06:06:06'; +select count(*)-5 from t1 use index (ti) where ti < '10:11:11'; +select count(*)-6 from t1 use index (ti) where ti <= '10:11:11'; +select count(*)-8 from t1 use index (ti) where ti < '23:59:59'; +select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; + +# timestamp +select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00'; +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00'; +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05'; +select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06'; +select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11'; +select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11'; +select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59'; +select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; + +drop table t1; + +# decimal (not the new 5.0 thing) + +create table t1 ( + a int primary key, + s decimal(12), + t decimal(12, 5), + u decimal(12) unsigned, + v decimal(12, 5) unsigned, + key (s), + key (t), + key (u), + key (v) +) engine=ndb; +# +insert into t1 values + ( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042), + ( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003), + ( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488), + ( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013), + ( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002), + ( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018), + ( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001), + ( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374), + ( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000), + ( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008); +# +select count(*)- 5 from t1 use index (s) where s < -000000000007; +select count(*)- 7 from t1 use index (s) where s <= -000000000007; +select count(*)- 2 from t1 use index (s) where s = -000000000007; +select count(*)- 5 from t1 use index (s) where s >= -000000000007; +select count(*)- 3 from t1 use index (s) where s > -000000000007; +# +select count(*)- 4 from t1 use index (t) where t < -0000061.00003; +select count(*)- 5 from t1 use index (t) where t <= -0000061.00003; +select count(*)- 1 from t1 use index (t) where t = -0000061.00003; +select count(*)- 6 from t1 use index (t) where t >= -0000061.00003; +select count(*)- 5 from t1 use index (t) where t > -0000061.00003; +# +select count(*)- 2 from t1 use index (u) where u < 000000000061; +select count(*)- 4 from t1 use index (u) where u <= 000000000061; +select count(*)- 2 from t1 use index (u) where u = 000000000061; +select count(*)- 8 from t1 use index (u) where u >= 000000000061; +select count(*)- 6 from t1 use index (u) where u > 000000000061; +# +select count(*)- 5 from t1 use index (v) where v < 0000965.00042; +select count(*)- 6 from t1 use index (v) where v <= 0000965.00042; +select count(*)- 1 from t1 use index (v) where v = 0000965.00042; +select count(*)- 5 from t1 use index (v) where v >= 0000965.00042; +select count(*)- 4 from t1 use index (v) where v > 0000965.00042; + +drop table t1; + +# bug#7798 +create table t1(a int primary key, b int not null, index(b)); +insert into t1 values (1,1), (2,2); +connect (con1,localhost,,,test); +connect (con2,localhost,,,test); +connection con1; +set autocommit=0; +begin; +select count(*) from t1; +connection con2; +ALTER TABLE t1 ADD COLUMN c int; +connection con1; +select a from t1 where b = 2; +show tables; +drop table t1; diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index 4a0c689bafb..9bbea75028b 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -21,7 +21,7 @@ select * from t1 where b = 4 order by b; insert into t1 values(7,8,3); select * from t1 where b = 4 order by a; --- error 1169 +-- error 1062 insert into t1 values(8, 2, 3); select * from t1 order by a; delete from t1 where a = 1; @@ -30,6 +30,32 @@ select * from t1 order by a; drop table t1; +# +# Indexing NULL values +# + +CREATE TABLE t1 ( + a int unsigned NOT NULL PRIMARY KEY, + b int unsigned, + c int unsigned, + UNIQUE bc(b,c) +) engine = ndb; + +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 use index (bc) where b IS NULL order by a; + +select * from t1 use index (bc)order by a; +select * from t1 use index (bc) order by a; +select * from t1 use index (PRIMARY) where b IS NULL order by a; +select * from t1 use index (bc) where b IS NULL order by a; +select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; +select * from t1 use index (bc) where b IS NULL and c = 2 order by a; +select * from t1 use index (bc) where b < 4 order by a; +select * from t1 use index (bc) where b IS NOT NULL order by a; +-- error 1062 +insert into t1 values(5,1,1); +drop table t1; + # # Show use of UNIQUE USING HASH indexes @@ -49,7 +75,7 @@ select * from t2 where c = 6; insert into t2 values(7,8,3); select * from t2 where b = 4 order by a; --- error 1169 +-- error 1062 insert into t2 values(8, 2, 3); select * from t2 order by a; delete from t2 where a = 1; @@ -58,6 +84,14 @@ select * from t2 order by a; drop table t2; +-- error 1121 +CREATE TABLE t2 ( + a int unsigned NOT NULL PRIMARY KEY, + b int unsigned not null, + c int unsigned, + UNIQUE USING HASH (b, c) +) engine=ndbcluster; + # # Show use of PRIMARY KEY USING HASH indexes # @@ -92,7 +126,7 @@ insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4); select * from t1 order by pk; ---error 1169 +--error 1062 insert into t1 values (5,0); select * from t1 order by pk; delete from t1 where a = 0; @@ -111,7 +145,7 @@ insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc'); select * from t2 order by pk; ---error 1169 +--error 1062 insert into t2 values(2,3,19,'abc'); select * from t2 order by pk; delete from t2 where c IS NOT NULL; @@ -231,4 +265,45 @@ select * from t4 where rid = 2 order by cid; drop table t1,t2,t3,t4,t5,t6,t7; +# test null in indexes +CREATE TABLE t1 ( + a int unsigned NOT NULL PRIMARY KEY, + b int unsigned, + c int unsigned, + UNIQUE bc(b,c) ) engine = ndb; + +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 where b=1 and c=1; +select * from t1 where b is null and c is null; +select * from t1 where b is null and c = 2; +select * from t1 where b = 4 and c is null; +create table t8 as +select * from t1 where (b = 1 and c = 1) + or (b is null and c is null) + or (b is null and c = 2) + or (b = 4 and c is null); +select * from t8 order by a; +select * from t1 order by a; +drop table t1, t8; +############################### +# Bug 8101 +# +# Unique index not specified in the same order as in table +# + +create table t1( + id integer not null auto_increment, + month integer not null, + year integer not null, + code varchar( 2) not null, + primary key ( id), + unique idx_t1( month, code, year) +) engine=ndb; + +INSERT INTO t1 (month, year, code) VALUES (4,2004,'12'); +INSERT INTO t1 (month, year, code) VALUES (5,2004,'12'); + +select * from t1 where code = '12' and month = 4 and year = 2004 ; + +drop table t1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index 310c16de3d8..611df3d84e9 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -564,22 +564,51 @@ select count(*) from t1; --error 1062 insert into t1 select * from t1 where b < 10 order by pk1; +DELETE FROM t1 WHERE pk1=2; begin; ---error 1031 -INSERT IGNORE INTO t1 VALUES(1,2,3); -commit; -select * from t1 where pk1=1; +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; +rollback; ---error 1031 -INSERT IGNORE INTO t1 VALUES(1,2,3); -select * from t1 where pk1=1; +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; -REPLACE INTO t1 values(1, 2, 3); +REPLACE INTO t1 values(1, 78, 3); select * from t1 where pk1=1; ---error 1031 -INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; -select * from t1 where pk1=1; +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79; +select * from t1 where pk1 < 4 order by pk1; + +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c; +select * from t1 where pk1 < 4 order by pk1; + +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; + +DROP TABLE t1; + +# +# Bug #6331: problem with 'insert ignore' +# + +CREATE TABLE t1(a INT) ENGINE=ndb; +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 SELECT a FROM t1; +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; DROP TABLE t1; diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test new file mode 100644 index 00000000000..d413453fb0e --- /dev/null +++ b/mysql-test/t/ndb_restore.test @@ -0,0 +1,209 @@ +-- source include/have_ndb.inc + +--disable_warnings +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +--enable_warnings + +CREATE TABLE `t1` ( + `capgoaledatta` smallint(5) unsigned NOT NULL auto_increment, + `goaledatta` char(2) NOT NULL default '', + `maturegarbagefa` varchar(32) NOT NULL default '', + PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt'); + +CREATE TABLE `t2` ( + `capgotod` smallint(5) unsigned NOT NULL auto_increment, + `gotod` smallint(5) unsigned NOT NULL default '0', + `goaledatta` char(2) default NULL, + `maturegarbagefa` varchar(32) default NULL, + `descrpooppo` varchar(64) default NULL, + `svcutonsa` varchar(64) NOT NULL default '', + PRIMARY KEY (`capgotod`), + KEY `i_quadaddsvr` (`gotod`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); + +CREATE TABLE `t3` ( + `CapGoaledatta` smallint(5) unsigned NOT NULL default '0', + `capgotod` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`capgotod`,`CapGoaledatta`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3); + +CREATE TABLE `t4` ( + `capfa` bigint(20) unsigned NOT NULL auto_increment, + `realm` varchar(32) NOT NULL default '', + `authpwchap` varchar(32) default NULL, + `fa` varchar(32) NOT NULL default '', + `payyingatta` tinyint(4) NOT NULL default '0', + `status` char(1) default NULL, + PRIMARY KEY (`fa`,`realm`), + KEY `capfa` (`capfa`), + KEY `i_quadentity` (`fa`,`realm`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL); + +CREATE TABLE `t5` ( + `capfa` bigint(20) unsigned NOT NULL default '0', + `gotod` smallint(5) unsigned NOT NULL default '0', + `orderutonsa` varchar(64) NOT NULL default '', + PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,''); + +CREATE TABLE `t6` ( + `capfa_parent` bigint(20) unsigned NOT NULL default '0', + `capfa_child` bigint(20) unsigned NOT NULL default '0', + `relatta` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0); + +CREATE TABLE `t7` ( + `dardpo` char(15) NOT NULL default '', + `dardtestard` tinyint(3) unsigned NOT NULL default '0', + `FastFA` char(5) NOT NULL default '', + `FastCode` char(6) NOT NULL default '', + `Fastca` char(1) NOT NULL default '', + `Fastmag` char(1) NOT NULL default '', + `Beareratta` char(2) NOT NULL default '', + PRIMARY KEY (`dardpo`,`dardtestard`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3'); + +CREATE TABLE `t8` ( + `kattjame` varchar(32) NOT NULL default '', + `realm` varchar(32) NOT NULL default '', + `realm_entered` varchar(32) NOT NULL default '', + `maturegarbagefa` varchar(32) NOT NULL default '', + `hunderaaarbagefa_parent` varchar(32) NOT NULL default '', + `kattjame_entered` varchar(32) NOT NULL default '', + `hunderaaarbagefa` varchar(32) NOT NULL default '', + `gest` varchar(16) default NULL, + `hassetino` varchar(16) NOT NULL default '', + `aaaproxysessfa` varchar(255) default NULL, + `autologonallowed` char(1) default NULL, + `squardporoot` varchar(15) NOT NULL default '', + `naspo` varchar(15) default NULL, + `beareratta` char(2) default NULL, + `fastCode` varchar(6) default NULL, + `fastFA` varchar(5) default NULL, + `fastca` char(1) default NULL, + `fastmag` char(1) default NULL, + `lastupdate` datetime default NULL, + `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', + `accthassetitime` int(10) unsigned default NULL, + `acctoutputoctets` bigint(20) unsigned default NULL, + `acctinputoctets` bigint(20) unsigned default NULL, + PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`), + KEY `squardporoot` (`squardporoot`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565); + +CREATE TABLE `t9` ( + `kattjame` varchar(32) NOT NULL default '', + `kattjame_entered` varchar(32) NOT NULL default '', + `realm` varchar(32) NOT NULL default '', + `realm_entered` varchar(32) NOT NULL default '', + `maturegarbagefa` varchar(32) NOT NULL default '', + `hunderaaarbagefa` varchar(32) NOT NULL default '', + `hunderaaarbagefa_parent` varchar(32) NOT NULL default '', + `gest` varchar(16) default NULL, + `hassetino` varchar(16) NOT NULL default '', + `squardporoot` varchar(15) NOT NULL default '', + `naspo` varchar(15) default NULL, + `beareratta` char(2) default NULL, + `fastCode` varchar(6) default NULL, + `fastFA` varchar(5) default NULL, + `fastca` char(1) default NULL, + `fastmag` char(1) default NULL, + `lastupdate` datetime default NULL, + `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', + `accthassetitime` int(10) unsigned default NULL, + `actcoutpuocttets` bigint(20) unsigned default NULL, + `actinputocctets` bigint(20) unsigned default NULL, + `terminateraste` tinyint(3) unsigned default NULL, + PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`) +) ENGINE=myisam DEFAULT CHARSET=latin1; +INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3); + +create table t1_c engine=ndbcluster as select * from t1; +create table t2_c engine=ndbcluster as select * from t2; +create table t3_c engine=ndbcluster as select * from t3; +create table t4_c engine=ndbcluster as select * from t4; +create table t5_c engine=ndbcluster as select * from t5; +create table t6_c engine=ndbcluster as select * from t6; +create table t7_c engine=ndbcluster as select * from t7; +create table t8_c engine=ndbcluster as select * from t8; +create table t9_c engine=ndbcluster as select * from t9; + + +--exec $NDB_MGM --no-defaults -e "start backup" >> $NDB_TOOLS_OUTPUT +drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT + +show tables; + + +select count(*) from t1; +select count(*) from t1_c; +select count(*) + from (select * from t1 union + select * from t1_c) a; + +select count(*) from t2; +select count(*) from t2_c; +select count(*) + from (select * from t2 union + select * from t2_c) a; + +select count(*) from t3; +select count(*) from t3_c; +select count(*) + from (select * from t3 union + select * from t3_c) a; + +select count(*) from t4; +select count(*) from t4_c; +select count(*) + from (select * from t4 union + select * from t4_c) a; + +select count(*) from t5; +select count(*) from t5_c; +select count(*) + from (select * from t5 union + select * from t5_c) a; + +select count(*) from t6; +select count(*) from t6_c; +select count(*) + from (select * from t6 union + select * from t6_c) a; + +select count(*) from t7; +select count(*) from t7_c; +select count(*) + from (select * from t7 union + select * from t7_c) a; + +select count(*) from t8; +select count(*) from t8_c; +select count(*) + from (select * from t8 union + select * from t8_c) a; + +select count(*) from t9; +select count(*) from t9_c; +select count(*) + from (select * from t9 union + select * from t9_c) a; + +--disable_warnings +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +--enable_warnings diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test new file mode 100644 index 00000000000..3b0e84e2344 --- /dev/null +++ b/mysql-test/t/ndb_update.test @@ -0,0 +1,22 @@ +-- source include/have_ndb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# Basic test of INSERT in NDB +# + +# +# Create a normal table with primary key +# +CREATE TABLE t1 ( + pk1 INT NOT NULL PRIMARY KEY, + b INT NOT NULL, + c INT NOT NULL +) ENGINE=ndbcluster; + +INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3); +UPDATE t1 set b = c; +select * from t1 order by pk1; diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index 7d30fd06ba7..9ddef252d67 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -119,3 +119,70 @@ alter table t1 change i i int not null; explain select * from t1 where i=2 or i is null; drop table t1; +# +# NULL has its own type BINARY(0) by default. +# But NULL should be weaker than a constant +# when mixing charsets/collations +# +set names latin2; +# Check that result type is taken from a non-null string +create table t1 select + null as c00, + if(1, null, 'string') as c01, + if(0, null, 'string') as c02, + ifnull(null, 'string') as c03, + ifnull('string', null) as c04, + case when 0 then null else 'string' end as c05, + case when 1 then null else 'string' end as c06, + coalesce(null, 'string') as c07, + coalesce('string', null) as c08, + least('string',null) as c09, + least(null, 'string') as c10, + greatest('string',null) as c11, + greatest(null, 'string') as c12, + nullif('string', null) as c13, + nullif(null, 'string') as c14, + trim('string' from null) as c15, + trim(null from 'string') as c16, + substring_index('string', null, 1) as c17, + substring_index(null, 'string', 1) as c18, + elt(1, null, 'string') as c19, + elt(1, 'string', null) as c20, + concat('string', null) as c21, + concat(null, 'string') as c22, + concat_ws('sep', 'string', null) as c23, + concat_ws('sep', null, 'string') as c24, + concat_ws(null, 'string', 'string') as c25, + make_set(3, 'string', null) as c26, + make_set(3, null, 'string') as c27, + export_set(3, null, 'off', 'sep') as c29, + export_set(3, 'on', null, 'sep') as c30, + export_set(3, 'on', 'off', null) as c31, + replace(null, 'from', 'to') as c32, + replace('str', null, 'to') as c33, + replace('str', 'from', null) as c34, + insert('str', 1, 2, null) as c35, + insert(null, 1, 2, 'str') as c36, + lpad('str', 10, null) as c37, + rpad(null, 10, 'str') as c38; + +show create table t1; +drop table t1; + +# +# Check that comparison is done according to +# non-null string collation, i.e. case insensitively, +# rather than according to NULL's collation, i.e. case sensitively +# +-- in field +select + case 'str' when 'STR' then 'str' when null then 'null' end as c01, + case 'str' when null then 'null' when 'STR' then 'str' end as c02, + field(null, 'str1', 'str2') as c03, + field('str1','STR1', null) as c04, + field('str1', null, 'STR1') as c05, + 'string' in ('STRING', null) as c08, + 'string' in (null, 'STRING') as c09; + +# Restore charset to the default value. +set names latin1; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 39612f680f3..912c9fb9bec 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -9,9 +9,9 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; -grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; connect (con1,localhost,ssl_user1,,); connect (con2,localhost,ssl_user2,,); diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 988c106bf21..c6a77c71b2f 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -500,3 +500,47 @@ insert into t1 set a = concat(repeat('x', 19), 'aa'); set max_sort_length=20; select a from t1 order by a; drop table t1; + +# +# Bug #7331 +# + +create table t1 ( + `sid` decimal(8,0) default null, + `wnid` varchar(11) not null default '', + key `wnid14` (`wnid`(4)), + key `wnid` (`wnid`) +) engine=myisam default charset=latin1; + +insert into t1 (`sid`, `wnid`) values +('10100','01019000000'),('37986','01019000000'),('37987','01019010000'), +('39560','01019090000'),('37989','01019000000'),('37990','01019011000'), +('37991','01019011000'),('37992','01019019000'),('37993','01019030000'), +('37994','01019090000'),('475','02070000000'),('25253','02071100000'), +('25255','02071100000'),('25256','02071110000'),('25258','02071130000'), +('25259','02071190000'),('25260','02071200000'),('25261','02071210000'), +('25262','02071290000'),('25263','02071300000'),('25264','02071310000'), +('25265','02071310000'),('25266','02071320000'),('25267','02071320000'), +('25269','02071330000'),('25270','02071340000'),('25271','02071350000'), +('25272','02071360000'),('25273','02071370000'),('25281','02071391000'), +('25282','02071391000'),('25283','02071399000'),('25284','02071400000'), +('25285','02071410000'),('25286','02071410000'),('25287','02071420000'), +('25288','02071420000'),('25291','02071430000'),('25290','02071440000'), +('25292','02071450000'),('25293','02071460000'),('25294','02071470000'), +('25295','02071491000'),('25296','02071491000'),('25297','02071499000'); + +explain select * from t1 where wnid like '0101%' order by wnid; + +select * from t1 where wnid like '0101%' order by wnid; + +drop table t1; + +# +# Bug #7672 - a wrong result for a select query in braces followed by order by +# + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (2), (1), (1), (2), (1); +SELECT a FROM t1 ORDER BY a; +(SELECT a FROM t1) ORDER BY a; +DROP TABLE t1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 978ce2bc2c3..92bf4ece4e3 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -110,10 +110,6 @@ set @fvar= 123.4567; --error 1064 prepare stmt1 from @fvar; -set @str1 = 'select ?'; -set @str2 = convert(@str1 using ucs2); -prepare stmt1 from @str2; -execute stmt1 using @ivar; drop table t1,t2; # @@ -462,3 +458,30 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +# +# Bug#6297 "prepared statement, wrong handling of <parameter> IS NULL" +# Test that placeholders work with IS NULL/IS NOT NULL clauses. +# +prepare stmt from "select ? is null, ? is not null, ?"; +select @no_such_var is null, @no_such_var is not null, @no_such_var; +execute stmt using @no_such_var, @no_such_var, @no_such_var; +set @var='abc'; +select @var is null, @var is not null, @var; +execute stmt using @var, @var, @var; +set @var=null; +select @var is null, @var is not null, @var; +execute stmt using @var, @var, @var; + +# +# Bug#6873 "PS, having with subquery, crash during execute" +# check that if we modify having subtree, we update JOIN->having pointer +# +create table t1 (pnum char(3)); +create table t2 (pnum char(3)); +prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)"; +execute stmt; +execute stmt; +execute stmt; +deallocate prepare stmt; +drop table t1, t2; + diff --git a/mysql-test/t/ps_10nestset.test b/mysql-test/t/ps_10nestset.test index d2adaca689e..53e84f7a47d 100644 --- a/mysql-test/t/ps_10nestset.test +++ b/mysql-test/t/ps_10nestset.test @@ -61,12 +61,11 @@ while ($1) select * from t1; -# Waiting for the resolution of bug#6138 -# # Now, increase salary to a multiple of 50 -# prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; -# set @arg_round= 50; -# execute st_round using @arg_round, @arg_round; -# -# select * from t1; +# Now, increase salary to a multiple of 50 (checks for bug#6138) +prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; +set @arg_round= 50; +execute st_round using @arg_round, @arg_round; + +select * from t1; drop table t1; diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 9e4acc2bf24..b3ce6d7fd82 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -8,7 +8,12 @@ # NOTE: PLEASE SEE THE DETAILED DESCRIPTION AT THE BOTTOM OF THIS FILE # BEFORE ADDING NEW TEST CASES HERE !!! -use test; +--disable_warnings +drop table if exists t5, t6, t7, t8; +drop database if exists mysqltest ; +drop database if exists client_test_db; +--enable_warnings + --disable_query_log select '------ basic tests ------' as test_sequence ; --enable_query_log @@ -290,12 +295,14 @@ execute stmt4; prepare stmt4 from ' show table status from test like ''t2%'' '; # egalize date and time values --replace_column 12 # 13 # 14 # +--replace_result 2147483647 64424509439 # Bug#4288 : prepared statement 'show table status ..', wrong output on execute execute stmt4; # try the same with the big table prepare stmt4 from ' show table status from test like ''t9%'' '; # egalize date and time values --replace_column 12 # 13 # 14 # +--replace_result 2147483647 4294967295 # Bug#4288 execute stmt4; prepare stmt4 from ' show status like ''Threads_running'' '; @@ -311,7 +318,7 @@ prepare stmt4 from ' show engine bdb logs '; execute stmt4; --enable_result_log prepare stmt4 from ' show full processlist '; ---replace_column 1 number +--replace_column 1 number 6 time 3 localhost execute stmt4; prepare stmt4 from ' show grants for user '; --error 1295 @@ -590,12 +597,10 @@ rename table new_t2 to t2; drop table t2; ## RENAME more than on TABLE within one statement # cases derived from client_test.c: test_rename() ---disable_warnings -drop table if exists t5, t6, t7, t8 ; ---enable_warnings prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; -# rename must fail, tc does not exist +# rename must fail, t7 does not exist +--replace_result \\ / --error 1017 execute stmt1 ; create table t7 (a int) ; @@ -864,15 +869,23 @@ select '------ grant/revoke/drop affects a parallel session test ------' --error 1141 show grants for second_user@localhost ; ## create a new user account by using GRANT statements on t9 -grant usage on test.* to second_user@localhost +create database mysqltest; +# create the tables (t1 and t9) used in many tests +use mysqltest; +--disable_query_log +--source include/ps_create.inc +--source include/ps_renew.inc +--enable_query_log +eval use $DB; +grant usage on mysqltest.* to second_user@localhost identified by 'looser' ; -grant select on test.t9 to second_user@localhost +grant select on mysqltest.t9 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; #### establish a second session to the new user account -connect (con3,localhost,second_user,looser,test); +connect (con3,localhost,second_user,looser,mysqltest); ## switch to the second session connection con3; # Who am I ? @@ -890,10 +903,10 @@ select a as my_col from t1; #### give access rights to t1 and drop table t9 ## switch back to the first session connection default; -grant select on test.t1 to second_user@localhost +grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; -drop table t9 ; +drop table mysqltest.t9 ; show grants for second_user@localhost ; @@ -912,7 +925,7 @@ execute s_t9 ; #### revoke the access rights to t1 ## switch back to the first session connection default; -revoke all privileges on test.t1 from second_user@localhost +revoke all privileges on mysqltest.t1 from second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; @@ -937,8 +950,8 @@ commit ; --error 1141 show grants for second_user@localhost ; - -drop table t1 ; +drop table t1,t9 ; +drop database mysqltest; ##### RULES OF THUMB TO PRESERVE THE SYSTEMATICS OF THE PS TEST CASES ##### diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test index af669a26400..b558f2f3c21 100644 --- a/mysql-test/t/ps_7ndb.test +++ b/mysql-test/t/ps_7ndb.test @@ -12,365 +12,11 @@ use test; -- source include/have_ndb.inc let $type= 'NDB' ; ---disable_warnings -drop table if exists t1, t9 ; ---enable_warnings -eval create table t1 -( - a int not null, b varchar(30), - primary key(a) -) engine = $type ; - ---disable_warnings -drop table if exists t9; ---enable_warnings -# The used table type doesn't support BLOB/TEXT columns. -# (The server would send error 1163 .) -# So we use char(100) instead. -eval create table t9 -( - c1 tinyint not null, c2 smallint, c3 mediumint, c4 int, - c5 integer, c6 bigint, c7 float, c8 double, - c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), - c13 date, c14 datetime, c15 timestamp(14), c16 time, - c17 year, c18 bit, c19 bool, c20 char, - c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), - c25 char(100), c26 char(100), c27 char(100), c28 char(100), - c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), - c32 set('monday', 'tuesday', 'wednesday'), - primary key(c1) -) engine = $type ; +-- source include/ps_create.inc -- source include/ps_renew.inc -- source include/ps_query.inc -# The following line is deactivated, because the ndb storage engine is not able -# to do primary key column updates . -#-- source include/ps_modify.inc -# let's include all statements which will work ---disable_query_log -select '------ delete tests ------' as test_sequence ; ---enable_query_log ---source include/ps_renew.inc - -## delete without parameter -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2 order by b; -# delete with row not found -execute stmt1; - -## delete with one parameter in the where clause -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; - -## truncate a table ---error 1295 -prepare stmt1 from 'truncate table t1' ; - - ---disable_query_log -select '------ update tests ------' as test_sequence ; ---enable_query_log ---source include/ps_renew.inc - -## update without parameter -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -# dummy update -execute stmt1; -select a,b from t1 where a=2; - -## update with one parameter in the set clause -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; - -## update with one parameter in the where cause -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -update t1 set b='two' where a=@arg00; -# row not found in update -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; - -## update on primary key column (two parameters) -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -# dummy update -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -# deactivated primary key column update -# execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -set @arg00=NULL; -set @arg01=2; -# deactivated primary key column update -# execute stmt1 using @arg00, @arg01; -select a,b from t1 order by a; -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; - -## update with subquery and several parameters -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; ---disable_warnings -drop table if exists t2; ---enable_warnings -# t2 will be of table type 'MYISAM' -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -# deactivated primary key column update -# execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; ---disable_info -select a,b from t1 where a = @arg00 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; ---disable_info -select a,b from t1 order by a; -drop table t2 ; -# t2 is now of table type '$type' -# The test battery for table type 'MERGE' gets here only a 'MYISAM' table -eval create table t2 -( - a int not null, b varchar(30), - primary key(a) -) engine = $type ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -# deactivated primary key column update -# execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; ---disable_info -select a,b from t1 where a = @arg00 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; ---disable_info -select a,b from t1 order by a ; -drop table t2 ; - -## update with parameters in limit -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -# currently (May 2004, Version 4.1) it is impossible --- error 1064 -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; - ---disable_query_log -select '------ insert tests ------' as test_sequence ; ---enable_query_log ---source include/ps_renew.inc - -## insert without parameter -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; - -## insert with one parameter in values part -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -# the second insert fails, because the first column is primary key ---error 1062 -execute stmt1 using @arg00; -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; - -## insert with two parameter in values part -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -# cases derived from client_test.c: test_null() -set @NULL= null ; -set @arg00= 'abc' ; -# execute must fail, because first column is primary key (-> not null) ---error 1048 -execute stmt1 using @NULL, @NULL ; ---error 1048 -execute stmt1 using @NULL, @NULL ; ---error 1048 -execute stmt1 using @NULL, @arg00 ; ---error 1048 -execute stmt1 using @NULL, @arg00 ; -let $1 = 2; -while ($1) -{ - eval set @arg01= 10000 + $1 ; - execute stmt1 using @arg01, @arg00 ; - dec $1; -} -select * from t1 where a > 10000 order by a ; -delete from t1 where a > 10000 ; -let $1 = 2; -while ($1) -{ - eval set @arg01= 10000 + $1 ; - execute stmt1 using @arg01, @NULL ; - dec $1; -} -select * from t1 where a > 10000 order by a ; -delete from t1 where a > 10000 ; -let $1 = 10; -while ($1) -{ - eval set @arg01= 10000 + $1 ; - execute stmt1 using @arg01, @arg01 ; - dec $1; -} -select * from t1 where a > 10000 order by a ; -delete from t1 where a > 10000 ; - - -## insert with two rows in values part -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) order by a ; - -## insert with two parameter in the set part -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; - -## insert with parameters in the ON DUPLICATE KEY part -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -# There is no primary key collision, so there will be no key column update -# If a key column update would be necessary occurs BUG#4312 -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -set @arg00=81 ; -set @arg01=1 ; -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @arg00, @arg01; - -## insert, autoincrement column and ' SELECT LAST_INSERT_ID() ' -# cases derived from client_test.c: test_bug3117() ---disable_warnings -drop table if exists t2 ; ---enable_warnings -# The test battery for table type 'MERGE' gets here only a 'MYISAM' table -eval create table t2 (id int auto_increment primary key) -ENGINE= $type ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -insert into t2 values (NULL) ; -execute stmt1 ; -drop table t2 ; - -## many parameters -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; - -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -# deactivated, activate when BUG#4312: is solved -# insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -# on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -delete from t1 where a >= 1000 ; - -## replace ---error 1295 -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; - -## multi table statements ---disable_query_log -select '------ multi table tests ------' as test_sequence ; ---enable_query_log -# cases derived from client_test.c: test_multi -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) - values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -let $1= 3 ; -while ($1) -{ - execute stmt_update using @arg00 ; - execute stmt_delete ; - execute stmt_select1 ; - execute stmt_select2 ; - set @arg00= @arg00 + 1 ; - dec $1 ; -} - +-- source include/ps_modify.inc -- source include/ps_modify1.inc -- source include/ps_conv.inc diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 66e9f31823a..d570073b1d2 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -561,6 +561,17 @@ unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +# +# hiding real table stored in query cache by temporary table +# +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +drop table t1; +drop table t1; # # Test character set related variables: diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index cd6620f7126..44f55da5722 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -431,3 +431,17 @@ select count(*) from t1 where x = 18446744073709551601; drop table t1; +# +# Bug #6045: Binary Comparison regression in MySQL 4.1 +# Binary searches didn't use a case insensitive index. +# +set names latin1; +create table t1 (a char(10), b text, key (a)) character set latin1; +INSERT INTO t1 (a) VALUES +('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb'); +# all these three can be optimized +explain select * from t1 where a='aaa'; +explain select * from t1 where a=binary 'aaa'; +explain select * from t1 where a='aaa' collate latin1_bin; +# this one cannot: +explain select * from t1 where a='aaa' collate latin1_german1_ci; diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 2e0ba2fff25..835af92186f 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -98,7 +98,7 @@ wait_for_slave_to_stop; # The following test can't be done because the result of Pos will differ # on different computers -# --replace_result 9306 9999 3334 9999 3335 9999 +# --replace_result $MASTER_MYPORT MASTER_PORT # show slave status; set global sql_slave_skip_counter=1; diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test index 9b9f53a94de..3f7eabfa434 100644 --- a/mysql-test/t/rpl_charset.test +++ b/mysql-test/t/rpl_charset.test @@ -154,9 +154,9 @@ select hex(c1), hex(c2) from t1; stop slave; delete from t1; -change master to master_log_pos=5801; -start slave until master_log_file='master-bin.000001', master_log_pos=5937; -# Slave is supposed to stop _after_ the INSERT, even though 5937 is +change master to master_log_pos=5847; +start slave until master_log_file='master-bin.000001', master_log_pos=5983; +# Slave is supposed to stop _after_ the INSERT, even though 5983 is # the position of the beginning of the INSERT; after SET slave is not # supposed to increment position. wait_for_slave_to_stop; @@ -169,3 +169,16 @@ select hex(c1), hex(c2) from t1; connection master; drop table t1; sync_slave_with_master; + +# +# BUG#6676: Derivation of variables must be correct on slave +# +connection master; +create table `t1` ( + `pk` varchar(10) not null default '', + primary key (`pk`) +) engine=myisam default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_create_database-master.opt b/mysql-test/t/rpl_create_database-master.opt new file mode 100644 index 00000000000..85660a17140 --- /dev/null +++ b/mysql-test/t/rpl_create_database-master.opt @@ -0,0 +1 @@ +--binlog-do-db=mysqltest_sisyfos --binlog-do-db=mysqltest_prometheus diff --git a/mysql-test/t/rpl_create_database-slave.opt b/mysql-test/t/rpl_create_database-slave.opt new file mode 100644 index 00000000000..96d630c9229 --- /dev/null +++ b/mysql-test/t/rpl_create_database-slave.opt @@ -0,0 +1 @@ +--replicate-do-db=mysqltest_sisyfos --replicate-do-db=mysqltest_prometheus diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/t/rpl_create_database.test new file mode 100644 index 00000000000..7ed0d5dbdbb --- /dev/null +++ b/mysql-test/t/rpl_create_database.test @@ -0,0 +1,70 @@ +# +# Tests for replication of statements that manipulate databases. +# +# For this test file, we have a number of databases. All databases +# with "greek" names will be replicated on the slave, while other names +# (e.g., american) will not be replicated. +# + +source include/master-slave.inc; + +# Bug#6391 (binlog-do-db rules ignored) +# In this case, 'mysqltest_bob' should not be replicated to the slave. +--disable_warnings +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; +sync_slave_with_master; +# This database is not replicated +DROP DATABASE IF EXISTS mysqltest_bob; +--enable_warnings + +connection master; +CREATE DATABASE mysqltest_prometheus; +CREATE DATABASE mysqltest_sisyfos; +CREATE DATABASE mysqltest_bob; + +USE mysqltest_sisyfos; +# These should be replicated +CREATE TABLE t1 (b int); +INSERT INTO t1 VALUES(1); + +USE mysqltest_bob; +# These should *not* be replicated +CREATE TABLE t2 (b int); +INSERT INTO t2 VALUES(2); + +# Current database is now 'mysqltest_bob' +# The following should be replicated +ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; + +USE mysqltest_sisyfos; +# The following should *not* be replicated +ALTER DATABASE mysqltest_bob CHARACTER SET latin1; + +SHOW DATABASES; +sync_slave_with_master; +SHOW DATABASES; + +connection master; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +USE mysqltest_prometheus; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +CREATE DATABASE mysqltest_sisyfos; +USE mysqltest_sisyfos; +CREATE TABLE t2 (a INT); +let $VERSION=`select version()`; +--replace_result $VERSION VERSION +SHOW BINLOG EVENTS; +SHOW DATABASES; +sync_slave_with_master; +SHOW DATABASES; +SHOW CREATE TABLE mysqltest_prometheus.t1; +SHOW CREATE TABLE mysqltest_sisyfos.t2; + +connection master; +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test index 23848720107..ad2ce29c610 100644 --- a/mysql-test/t/rpl_delete_all.test +++ b/mysql-test/t/rpl_delete_all.test @@ -6,7 +6,7 @@ connection master; drop database if exists mysqltest; sync_slave_with_master; # can't read dir ---replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" +--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ / --error 12 show tables from mysqltest; diff --git a/mysql-test/t/rpl_drop_temp-slave.opt b/mysql-test/t/rpl_drop_temp-slave.opt new file mode 100644 index 00000000000..2f9244c65ff --- /dev/null +++ b/mysql-test/t/rpl_drop_temp-slave.opt @@ -0,0 +1,2 @@ +--replicate-ignore-table=mysqltest.t2 + diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/t/rpl_drop_temp.test new file mode 100644 index 00000000000..73d691d9d90 --- /dev/null +++ b/mysql-test/t/rpl_drop_temp.test @@ -0,0 +1,13 @@ +source include/master-slave.inc; +--disable_warnings +create database if not exists mysqltest; +--enable_warnings + +create temporary table mysqltest.t1 (n int); +create temporary table mysqltest.t2 (n int); +sync_slave_with_master; +connection master; +disconnect master; +connection slave; +--real_sleep 3; # time for DROP to be written +show status like 'Slave_open_temp_tables'; diff --git a/mysql-test/t/rpl_failed_optimize-master.opt b/mysql-test/t/rpl_failed_optimize-master.opt new file mode 100644 index 00000000000..3f82baff598 --- /dev/null +++ b/mysql-test/t/rpl_failed_optimize-master.opt @@ -0,0 +1 @@ +--loose-innodb-lock-wait-timeout=1 diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/t/rpl_failed_optimize.test new file mode 100644 index 00000000000..d245d1bacbb --- /dev/null +++ b/mysql-test/t/rpl_failed_optimize.test @@ -0,0 +1,18 @@ +source include/have_innodb.inc; +source include/master-slave.inc; + +# +# BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log" +# Replication should work when OPTIMIZE TABLE timeouts, and +# when OPTIMIZE TABLE is executed on a non-existing table +# + +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES (1); + +connection master1; +OPTIMIZE TABLE t1; + +OPTIMIZE TABLE non_existing; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test index 4c27c03af60..a4506e32963 100644 --- a/mysql-test/t/rpl_insert_id.test +++ b/mysql-test/t/rpl_insert_id.test @@ -61,3 +61,19 @@ drop table t2; save_master_pos; connection slave; sync_with_master; + +# +# Bug#8412: Error codes reported in binary log for CHARACTER SET, +# FOREIGN_KEY_CHECKS +# +connection master; +SET TIMESTAMP=1000000000; +CREATE TABLE t1 ( a INT UNIQUE ); +SET FOREIGN_KEY_CHECKS=0; +--error 1062 +INSERT INTO t1 VALUES (1),(1); +sync_slave_with_master; + + + + diff --git a/mysql-test/t/rpl_insert_ignore-slave.opt b/mysql-test/t/rpl_insert_ignore-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_insert_ignore-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test new file mode 100644 index 00000000000..58eaa287817 --- /dev/null +++ b/mysql-test/t/rpl_insert_ignore.test @@ -0,0 +1,71 @@ +# Testcase for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB" +# The bug was that if on master, INSERT IGNORE ignored some +# rows, and the table was InnoDB with auto_inc column, then on slave +# some rows received an auto_inc bigger than on master. +# Slave needs to be started with --innodb to store table in InnoDB. +# Same test for MyISAM (which had no bug). + +-- source include/have_innodb.inc + +-- source include/master-slave.inc + +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned, + unique (b) +) ENGINE=innodb; + +CREATE TABLE t2 ( + a int unsigned, # to force INSERT SELECT to have a certain order + b int unsigned +) ENGINE=innodb; + + +INSERT INTO t1 VALUES (NULL, 1); +INSERT INTO t1 VALUES (NULL, 2); +INSERT INTO t1 VALUES (NULL, 3); +INSERT INTO t1 VALUES (NULL, 4); + +# An alternation of values which will conflict in t1 and will not. + +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 5); +INSERT INTO t2 VALUES (4, 3); +INSERT INTO t2 VALUES (5, 4); +INSERT INTO t2 VALUES (6, 6); + +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; + +# Compare results + +SELECT * FROM t1 ORDER BY a; + +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; + +# Now do the same for MyISAM + +connection master; +drop table t1; +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned, + unique (b) +) ENGINE=myisam; + +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); + +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; + +SELECT * FROM t1 ORDER BY a; + +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; + +connection master; +drop table t1, t2; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_many_optimize.test b/mysql-test/t/rpl_many_optimize.test new file mode 100644 index 00000000000..525e23abe15 --- /dev/null +++ b/mysql-test/t/rpl_many_optimize.test @@ -0,0 +1,20 @@ +# Test for BUG#7658 "optimize crashes slave thread (1 in 1000)]" + +source include/master-slave.inc; + +create table t1 (a int not null auto_increment primary key, b int, key(b)); +INSERT INTO t1 (a) VALUES (1),(2); +# Now many OPTIMIZE to test if we crash (BUG#7658) +let $1=300; +disable_query_log; +disable_result_log; +while ($1) +{ + eval OPTIMIZE TABLE t1; + dec $1; +} +enable_result_log; +enable_query_log; +drop table t1; +# Bug was that slave segfaulted after ~ a hundred of OPTIMIZE (or ANALYZE) +sync_slave_with_master; diff --git a/mysql-test/t/rpl_multi_query.test b/mysql-test/t/rpl_multi_query.test new file mode 100644 index 00000000000..482a2679e7a --- /dev/null +++ b/mysql-test/t/rpl_multi_query.test @@ -0,0 +1,29 @@ +# Test for BUG#8436: verify that a multi-query (i.e. one query +# containing several queries (assuming client has +# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not +# one binlog event containing all queries) + +# PS doesn't support multi-statements +--disable_ps_protocol + +source include/master-slave.inc; +--disable_warnings +drop database if exists mysqltest; +--enable_warnings +create database mysqltest; + +delimiter /; +create table mysqltest.t1 ( n int); +insert into mysqltest.t1 values(1)/ +insert into mysqltest.t1 values(2); +insert into mysqltest.t1 values(3); +insert into mysqltest.t1 values(4); +insert into mysqltest.t1 values(5)/ +delimiter ;/ +sync_slave_with_master; +select * from mysqltest.t1; +connection master; +--replace_column 2 # 5 # +show binlog events from 79; +drop database mysqltest; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_multi_update2-slave.opt b/mysql-test/t/rpl_multi_update2-slave.opt new file mode 100644 index 00000000000..17d4171af0e --- /dev/null +++ b/mysql-test/t/rpl_multi_update2-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=nothing.sensible diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test new file mode 100644 index 00000000000..bba7700a88e --- /dev/null +++ b/mysql-test/t/rpl_multi_update2.test @@ -0,0 +1,33 @@ +# Let's verify that multi-update is not always skipped by slave if +# some replicate-* rules exist. +# (BUG#7011) + +source include/master-slave.inc; + +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned +) ENGINE=MyISAM; + +CREATE TABLE t2 ( + a int unsigned not null auto_increment primary key, + b int unsigned +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; + +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +save_master_pos; +connection slave; +sync_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; diff --git a/mysql-test/t/rpl_rewrite_db-slave.opt b/mysql-test/t/rpl_rewrite_db-slave.opt new file mode 100644 index 00000000000..a462ad19ba0 --- /dev/null +++ b/mysql-test/t/rpl_rewrite_db-slave.opt @@ -0,0 +1 @@ +"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1->test" diff --git a/mysql-test/t/rpl_rewrite_db.test b/mysql-test/t/rpl_rewrite_db.test new file mode 100644 index 00000000000..b6118854037 --- /dev/null +++ b/mysql-test/t/rpl_rewrite_db.test @@ -0,0 +1,77 @@ +source include/master-slave.inc; +--disable_warnings +drop database if exists mysqltest1; +--enable_warnings +create database mysqltest1; + +use mysqltest1; +create table t1 (a int); +insert into t1 values(9); +select * from mysqltest1.t1; +sync_slave_with_master; +show databases like 'mysqltest1'; # should be empty +select * from test.t1; +# cleanup +connection master; +drop table t1; +drop database mysqltest1; +sync_slave_with_master; + +# +# BUG#6353: +# Option --replicate-rewrite-db should work together with LOAD DATA INFILE +# + +connection slave; +--disable_warnings +drop database if exists rewrite; +--enable_warnings +create database rewrite; + +connection master; +use test; +create table t1 (a date, b date, c date not null, d date); +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +sync_slave_with_master; + +connection slave; +select * from rewrite.t1; + +connection master; +truncate table t1; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +sync_slave_with_master; + +connection slave; +select * from rewrite.t1; + +connection master; +drop table t1; +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +sync_slave_with_master; + +connection slave; +select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; + +connection master; +drop table t1; +create table t1 (a int, b char(10)); +load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +sync_slave_with_master; + +connection slave; +select * from rewrite.t1; + +connection master; +truncate table t1; +load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +sync_slave_with_master; + +connection slave; +# The empty line last comes from the end line field in the file +select * from rewrite.t1; + +connection master; +drop table t1; diff --git a/mysql-test/t/rpl_start_stop_slave.test b/mysql-test/t/rpl_start_stop_slave.test new file mode 100644 index 00000000000..903ff204194 --- /dev/null +++ b/mysql-test/t/rpl_start_stop_slave.test @@ -0,0 +1,34 @@ +source include/master-slave.inc; + +# +# Bug#6148 () +# +connection slave; +stop slave; + +# Let the master do lots of insertions +connection master; +create table t1(n int); +let $1=5000; +disable_query_log; +while ($1) +{ + eval insert into t1 values($1); + dec $1; +} +enable_query_log; +save_master_pos; + +connection slave; +start slave; +sleep 1; +stop slave io_thread; +start slave io_thread; +sync_with_master; + +connection master; +drop table t1; +save_master_pos; + +connection slave; +sync_with_master; diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_until.test index 5eaec0727b6..45b343ace14 100644 --- a/mysql-test/t/rpl_until.test +++ b/mysql-test/t/rpl_until.test @@ -43,7 +43,7 @@ show slave status; # try replicate all until second insert to t2; start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537; -sleep 2; +sleep 4; select * from t2; --replace_result $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 9 # 23 # 33 # diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 5bae44796dc..53f569c773e 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1757,6 +1757,15 @@ DO 1; DO benchmark(100,1+1),1,1; # +# Bug #6449: do default; +# + +--error 1064 +do default; +--error 1054 +do foobar; + +# # random in WHERE clause # @@ -1890,6 +1899,20 @@ select * from t2,t3 where t2.s = t3.s; drop table t1, t2, t3; # +# Bug #3759 +# Both queries should produce identical plans and results. +# +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +select * from t1 left join t2 on a=c where d in (4); +explain select * from t1 left join t2 on a=c where d = 4; +select * from t1 left join t2 on a=c where d = 4; +drop table t1, t2; + +# # Covering index is mentioned in EXPLAIN output for const tables (bug #5333) # @@ -1906,6 +1929,38 @@ INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; -EXPLAIN SELECT i FROM t1 WHERE i=1; +DROP TABLE t1; + +# +# Test case for bug 7520: a wrong cost of the index for a BLOB field +# + +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); + +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); + +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; + +DROP TABLE t1, t2; + + +# +# Test case for bug 7098: substitution of a constant for a string field +# + +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); + +SELECT * FROM t1 WHERE city='London'; +SELECT * FROM t1 WHERE city='london'; +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +SELECT * FROM t1 WHERE city='London' AND city='london'; +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; DROP TABLE t1; + diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index e51dd2442b9..91879015b51 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -181,3 +181,13 @@ SELECT FOUND_ROWS(); SELECT SQL_CALC_FOUND_ROWS 'foo' UNION SELECT 'bar' LIMIT 0; SELECT FOUND_ROWS(); + +# +# Bug #7945: group by + distinct with constant expression + limit +# + +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5); +SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2; +SELECT FOUND_ROWS(); +DROP TABLE t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 681127eab5e..cd8d4dba6ab 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -21,7 +21,8 @@ check table t1 changed; check table t1 medium; check table t1 extended; show index from t1; -!$1062 insert into t1 values (5,5,5); +--error 1062 +insert into t1 values (5,5,5); optimize table t1; optimize table t1; drop table t1; @@ -227,37 +228,37 @@ CREATE TABLE t3 ( insert into t1 values (1),(2); insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # 10 # show table status; delete from t1; delete from t2; delete from t3; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # 10 # show table status; drop table t1, t2, t3; @@ -320,3 +321,35 @@ flush privileges; #--replace_column 7 # 8 # 9 # #show table status from `ä` LIKE 'ä'; #drop database `ä`; + +# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was +# specified during table creation, but not otherwise. (Bug #7235) +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; +# Test that when an index is created with the default key algorithm and +# altered to another storage engine, it gets the default key algorithm +# for that storage engine, but when it is specified, the specified type is +# preserved. +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/t/skip_name_resolve-master.opt b/mysql-test/t/skip_name_resolve-master.opt new file mode 100644 index 00000000000..ab6ca1731f5 --- /dev/null +++ b/mysql-test/t/skip_name_resolve-master.opt @@ -0,0 +1 @@ +--skip-name-resolve diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test new file mode 100644 index 00000000000..68dcf329427 --- /dev/null +++ b/mysql-test/t/skip_name_resolve.test @@ -0,0 +1,5 @@ +# Bug #8471: IP address with mask fail when skip-name-resolve is on +GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255'; +SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255'; +REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; +DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test index 63a5d6d3671..f841d36e837 100644 --- a/mysql-test/t/sql_mode.test +++ b/mysql-test/t/sql_mode.test @@ -30,6 +30,37 @@ show create table t1; drop table t1; # +# Check that a binary collation adds 'binary' +# suffix into a char() column definition in +# mysql40 and mysql2323 modes. This allows +# not to lose the column's case sensitivity +# when loading the dump in pre-4.1 servers. +# +# Thus, in 4.0 and 3.23 modes we dump: +# +# 'char(10) collate xxx_bin' as 'char(10) binary' +# 'binary(10)' as 'binary(10)' +# +# In mysql-4.1 these types are different, and they will +# be recreated differently. +# +# In mysqld-4.0 the the above two types were the same, +# so it will create a 'char(10) binary' column for both definitions. +# +CREATE TABLE t1 ( + a char(10), + b char(10) collate latin1_bin, + c binary(10) +) character set latin1; +set @@sql_mode=""; +show create table t1; +set @@sql_mode="mysql323"; +show create table t1; +set @@sql_mode="mysql40"; +show create table t1; +drop table t1; + +# # BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT # # Force the usage of the default diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 5e3aa4064e4..b1689e30959 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -543,8 +543,8 @@ drop table t1, t2; CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); --- error 1111 UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +select * from t1; drop table t1; #test of uncacheable subqueries @@ -689,12 +689,11 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); --- error 1111 UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); --- error 1111 UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -- error 1109 UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); +select * from t1; drop table t1; # @@ -912,7 +911,20 @@ create table t3 (a int); insert into t3 values (6),(7),(3); select * from t3 where a >= all (select b from t2); explain extended select * from t3 where a >= all (select b from t2); - +select * from t3 where a >= some (select b from t2); +explain extended select * from t3 where a >= some (select b from t2); +select * from t3 where a >= all (select b from t2 group by 1); +explain extended select * from t3 where a >= all (select b from t2 group by 1); +select * from t3 where a >= some (select b from t2 group by 1); +explain extended select * from t3 where a >= some (select b from t2 group by 1); +select * from t3 where NULL >= any (select b from t2); +explain extended select * from t3 where NULL >= any (select b from t2); +select * from t3 where NULL >= any (select b from t2 group by 1); +explain extended select * from t3 where NULL >= any (select b from t2 group by 1); +select * from t3 where NULL >= some (select b from t2); +explain extended select * from t3 where NULL >= some (select b from t2); +select * from t3 where NULL >= some (select b from t2 group by 1); +explain extended select * from t3 where NULL >= some (select b from t2 group by 1); # # optimized static ALL/ANY with grouping # @@ -1283,3 +1295,246 @@ INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,' SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; drop tables t1,t2; + +# +# Test for bug #6462. "Same request on same data returns different +# results." a.k.a. "Proper cleanup of subqueries is missing for +# SET and DO statements". +# +create table t1 (a int not null, b int not null, c int, primary key (a,b)); +insert into t1 values (1,1,1), (2,2,2), (3,3,3); +set @b:= 0; +# Let us check that subquery will use covering index +explain select sum(a) from t1 where b > @b; +# This should not crash -debug server due to failing assertion +set @a:= (select sum(a) from t1 where b > @b); +# And this should not falsely report index usage +explain select a from t1 where c=2; +# Same for DO statement +do @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +drop table t1; + +# +# Subselect in non-select command just after connection +# +connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); +connection root; +set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ; + +# +# primary query with temporary table and subquery with groupping +# +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5); +insert into t2 values (1,3),(2,1); +select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b; +drop table t1, t2; + +# +# subqueries with full text search +# +create table t1 (id int); +create table t2 (id int, body text, fulltext (body)); +insert into t1 values(1),(2),(3); +insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test'); +select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode)); +drop table t2,t1; + +# +# Equal operation under row and empty subquery +# +create table t1 (s1 int,s2 int); +insert into t1 values (20,15); +select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0)); +drop table t1; + +# +# ALL/ANY with NULL +# +create table t1 (s1 int); +insert into t1 values (1),(null); +select * from t1 where s1 < all (select s1 from t1); +select s1, s1 < all (select s1 from t1) from t1; +drop table t1; + +# +# reference on changable fields from subquery +# +CREATE TABLE t1 ( + Code char(3) NOT NULL default '', + Name char(52) NOT NULL default '', + Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', + Region char(26) NOT NULL default '', + SurfaceArea float(10,2) NOT NULL default '0.00', + IndepYear smallint(6) default NULL, + Population int(11) NOT NULL default '0', + LifeExpectancy float(3,1) default NULL, + GNP float(10,2) default NULL, + GNPOld float(10,2) default NULL, + LocalName char(45) NOT NULL default '', + GovernmentForm char(45) NOT NULL default '', + HeadOfState char(60) default NULL, + Capital int(11) default NULL, + Code2 char(2) NOT NULL default '' +) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); +INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); +/*!40000 ALTER TABLE t1 ENABLE KEYS */; +SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); +drop table t1; + +# +# Test for BUG#7885: Server crash when 'any' subselect compared to +# non-existant field. +# +create table t1 (a1 int); +create table t2 (b1 int); +--error 1054 +select * from t1 where a2 > any(select b1 from t2); +select * from t1 where a1 > any(select b1 from t2); +drop table t1,t2; + + +# +# Comparison subquery with * and row +# +create table t1 (a integer, b integer); +select (select * from t1) = (select 1,2); +select (select 1,2) = (select * from t1); +# queries whih can be converted to IN +select row(1,2) = ANY (select * from t1); +select row(1,2) != ALL (select * from t1); +drop table t1; + +# +# Comparison subquery and row with nested rows +# +create table t1 (a integer, b integer); +-- error 1241 +select row(1,(2,2)) in (select * from t1 ); +-- error 1241 +select row(1,(2,2)) = (select * from t1 ); +-- error 1241 +select (select * from t1) = row(1,(2,2)); +drop table t1; + +# +# Forward reference detection +# +create table t1 (a integer); +insert into t1 values (1); +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx ; +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +select 1 as xx, 1 = ALL ( select 1 from t1 where 1 = xx ); +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; +drop table t1; + +# Test for BUG#8218 + +CREATE TABLE t1 ( + categoryId int(11) NOT NULL, + courseId int(11) NOT NULL, + startDate datetime NOT NULL, + endDate datetime NOT NULL, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL, + attributes text NOT NULL +); +INSERT INTO t1 VALUES (1,41,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(1,86,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(1,87,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,52,'2004-03-15','2004-10-01','2004-03-15','2004-09-17',''), +(2,53,'2004-03-16','2004-10-01','2004-03-16','2004-09-17',''), +(2,88,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,89,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(3,51,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(5,12,'2004-02-18','2010-01-01','2004-02-18','2004-02-18',''); + +CREATE TABLE t2 ( + userId int(11) NOT NULL, + courseId int(11) NOT NULL, + date datetime NOT NULL +); +INSERT INTO t2 VALUES (5141,71,'2003-11-18'), +(5141,72,'2003-11-25'),(5141,41,'2004-08-06'), +(5141,52,'2004-08-06'),(5141,53,'2004-08-06'), +(5141,12,'2004-08-06'),(5141,86,'2004-10-21'), +(5141,87,'2004-10-21'),(5141,88,'2004-10-21'), +(5141,89,'2004-10-22'),(5141,51,'2004-10-26'); + + +CREATE TABLE t3 ( + groupId int(11) NOT NULL, + parentId int(11) NOT NULL, + startDate datetime NOT NULL, + endDate datetime NOT NULL, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL, + ordering int(11) +); +INSERT INTO t3 VALUES (12,9,'1000-01-01','3999-12-31','2004-01-29','2004-01-29',NULL); + +CREATE TABLE t4 ( + id int(11) NOT NULL, + groupTypeId int(11) NOT NULL, + groupKey varchar(50) NOT NULL, + name text, + ordering int(11), + description text, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL +); +INSERT INTO t4 VALUES (9,5,'stationer','stationer',0,'Stationer','2004-01-29','2004-01-29'), +(12,5,'group2','group2',0,'group2','2004-01-29','2004-01-29'); + +CREATE TABLE t5 ( + userId int(11) NOT NULL, + groupId int(11) NOT NULL, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL +); +INSERT INTO t5 VALUES (5141,12,'2004-08-06','2004-08-06'); + +select + count(distinct t2.userid) pass, + groupstuff.*, + count(t2.courseid) crse, + t1.categoryid, + t2.courseid, + date_format(date, '%b%y') as colhead +from t2 +join t1 on t2.courseid=t1.courseid +join +( + select + t5.userid, + parentid, + parentgroup, + childid, + groupname, + grouptypeid + from t5 + join + ( + select t4.id as parentid, + t4.name as parentgroup, + t4.id as childid, + t4.name as groupname, + t4.grouptypeid + from t4 + ) as gin on t5.groupid=gin.childid +) as groupstuff on t2.userid = groupstuff.userid +group by + groupstuff.groupname, colhead , t2.courseid; + +drop table if exists t1, t2, t3, t4, t5; + diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 5f4badb3624..5d796988178 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -125,3 +125,37 @@ INSERT INTO `t2` VALUES ('yy','xx'); SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit); drop table t1, t2; + +# +# possible early unlock +# +CREATE TABLE t1 ( + id INT NOT NULL auto_increment, + date1 DATE, coworkerid INT, + description VARCHAR(255), + sum_used DOUBLE, + sum_remaining DOUBLE, + comments VARCHAR(255), + PRIMARY KEY(id) +) engine=innodb; +insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'); +SELECT DISTINCT + (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, + (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven + FROM t1; +select * from t1; +drop table t1; + +# +# cleaning up of results of subselects (BUG#8125) +# +CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (1,1,1); +INSERT INTO t2 VALUES (1,1,1); +PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having +count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; +EXECUTE my_stmt; +EXECUTE my_stmt; +deallocate prepare my_stmt; +drop table t1,t2; diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index 6c44535e3b7..1539d210a3a 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -9,6 +9,7 @@ use test; # create system tables as in mysql-3.20 +--disable_warnings CREATE TABLE db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL, @@ -23,10 +24,12 @@ CREATE TABLE db ( KEY User (User) ) type=ISAM; +--enable-warnings INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y'); +--disable_warnings CREATE TABLE host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL, @@ -39,7 +42,9 @@ CREATE TABLE host ( PRIMARY KEY Host (Host,Db) ) type=ISAM; +--enable-warnings +--disable_warnings CREATE TABLE user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, @@ -56,6 +61,7 @@ CREATE TABLE user ( PRIMARY KEY Host (Host,User) ) type=ISAM; +--enable-warnings INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y'); INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N'); diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 2181d3eb74c..74276c7668c 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -20,8 +20,10 @@ create TEMPORARY TABLE t2 engine=heap select * from t1; create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap; # This should give errors -!$1050 CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); -!$1050 ALTER TABLE t1 RENAME t2; +--error 1050 +CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); +--error 1050 +ALTER TABLE t1 RENAME t2; select * from t2; alter table t2 add primary key (a,b); diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index ad8089e1a37..32ed359a2db 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -2,7 +2,7 @@ # Preparing playground --disable_warnings -drop table if exists t1; +drop table if exists t1, t2; --enable_warnings @@ -205,25 +205,81 @@ drop table t1; # even for unprivileged users. # +# Let us prepare playground delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; +create table t1 (a int, b datetime); +create table t2 (c int, d datetime); -grant usage on mysqltest.* to mysqltest_1@localhost; +grant all privileges on test.* to mysqltest_1@localhost; connect (tzuser, localhost, mysqltest_1,,); connection tzuser; show grants for current_user(); set time_zone= '+00:00'; set time_zone= 'Europe/Moscow'; select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +# Let us also check whenever multi-update works ok +update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') + where t1.a = t2.c and t2.d = (select max(d) from t2); # But still these two statements should not work: --error 1044 select * from mysql.time_zone_name; --error 1044 select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; +# +# Test for bug #6765 "Implicit access to time zone description tables +# requires privileges for them if some table or column level grants +# present" +# +connection default; +# Let use some table-level grants instead of db-level +# to make life more interesting +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; +grant all privileges on test.t1 to mysqltest_1@localhost; +grant all privileges on test.t2 to mysqltest_1@localhost; +# The test itself is almost the same as previous one +connect (tzuser2, localhost, mysqltest_1,,); +connection tzuser2; +show grants for current_user(); +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC'); +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') + where t1.a = t2.c and t2.d = (select max(d) from t2); +# Again these two statements should not work (but with different errors): +--error 1142 +select * from mysql.time_zone_name; +--error 1142 +select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; + +# Clean-up connection default; delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; +drop table t1, t2; + +# +# Test for bug #7705 "CONVERT_TZ() crashes with subquery/WHERE on index +# column". Queries in which one of time zone arguments of CONVERT_TZ() is +# determined as constant only at val() stage (not at fix_fields() stage), +# should not crash server. +# +select convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) from (select 'UTC' as custTimeZone) as tmp; + +# +# Test for bug #7899 "CREATE TABLE .. SELECT .. and CONVERT_TZ() function +# does not work well together". The following statement should return only +# one NULL row and not result of full join. +# +create table t1 select convert_tz(NULL, NULL, NULL); +select * from t1; +drop table t1; diff --git a/mysql-test/t/timezone3-master.opt b/mysql-test/t/timezone3-master.opt new file mode 100644 index 00000000000..6910e6e6e8d --- /dev/null +++ b/mysql-test/t/timezone3-master.opt @@ -0,0 +1 @@ +--timezone=:$MYSQL_TEST_DIR/std_data/Moscow_leap diff --git a/mysql-test/t/timezone3.test b/mysql-test/t/timezone3.test new file mode 100644 index 00000000000..8910783cd85 --- /dev/null +++ b/mysql-test/t/timezone3.test @@ -0,0 +1,59 @@ +# +# Test of handling time zone with leap seconds. +# +# This test should be run with TZ=:$MYSQL_TEST_DIR/std_data/Moscow_leap +# This implies that this test should be run only on systems that interpret +# characters after colon in TZ variable as path to zoneinfo file. +# +# Check that we have successfully set time zone with leap seconds. +--require r/have_moscow_leap_timezone.require +disable_query_log; +select from_unixtime(1072904422); +enable_query_log; + +# Initial clean-up +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Let us check behavior of conversion from broken-down representation +# to time_t representation, for normal, non-existent and ambigious dates +# (This check is similar to the one in timezone2.test in 4.1) +# +create table t1 (i int, c varchar(20)); +# Normal value without DST +insert into t1 values + (unix_timestamp("2004-01-01 00:00:00"), "2004-01-01 00:00:00"); +# Values around and in spring time-gap +insert into t1 values + (unix_timestamp("2004-03-28 01:59:59"), "2004-03-28 01:59:59"), + (unix_timestamp("2004-03-28 02:30:00"), "2004-03-28 02:30:00"), + (unix_timestamp("2004-03-28 03:00:00"), "2004-03-28 03:00:00"); +# Normal value with DST +insert into t1 values + (unix_timestamp('2004-05-01 00:00:00'),'2004-05-01 00:00:00'); +# Ambiguos values (also check for determenism) +insert into t1 values + (unix_timestamp('2004-10-31 01:00:00'),'2004-10-31 01:00:00'), + (unix_timestamp('2004-10-31 02:00:00'),'2004-10-31 02:00:00'), + (unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'), + (unix_timestamp('2004-10-31 04:00:00'),'2004-10-31 04:00:00'), + (unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'); +# Test of leap +insert into t1 values + (unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), + (unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); + +select i, from_unixtime(i), c from t1; +drop table t1; + +# +# Test for bug #6387 "Queried timestamp values do not match the +# inserted". my_gmt_sec() function was not working properly if we +# had time zone with leap seconds +# +create table t1 (ts timestamp); +insert into t1 values (19730101235900), (20040101235900); +select * from t1; +drop table t1; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index b67fa7a552d..f70193ddbe0 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -369,8 +369,8 @@ explain select * from t1 where txt='Chevy' or txt is NULL order by txt; select * from t1 where txt='Chevy' or txt is NULL order by txt; drop table t1; -CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); -INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d)); +INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,''); select max(i) from t1 where c = ''; drop table t1; diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 64420a85189..304ed19b971 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -107,3 +107,10 @@ SELECT * FROM t2; SELECT * FROM t3; DROP TABLE t1, t2, t3; + +# Test that setting YEAR to invalid string results in default value, not +# 2000. (Bug #6067) +CREATE TABLE t1 (y YEAR); +INSERT INTO t1 VALUES ('abc'); +SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 47866058524..a7eb78cb292 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -77,12 +77,27 @@ drop table t1; # warnings (for both strings and numbers) # create table t1 (t datetime); -insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +insert into t1 values (20030102030460),(20030102036301),(20030102240401), + (20030132030401),(20031302030401),(100001202030401); select * from t1; delete from t1; -insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +insert into t1 values + ("2003-01-02 03:04:60"),("2003-01-02 03:63:01"),("2003-01-02 24:04:01"), + ("2003-01-32 03:04:01"),("2003-13-02 03:04:01"), ("10000-12-02 03:04:00"); select * from t1; delete from t1; insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); select * from t1; drop table t1; + +# +# Test for bug #7297 "Two digit year should be interpreted correctly even +# with zero month and day" +# +create table t1 (dt datetime); +# These dates should be treated as dates in 21st century +insert into t1 values ("12-00-00"), ("00-00-00 01:00:00"); +# Zero dates are still special :/ +insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); +select * from t1; +drop table t1; diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index dc2e4d0f469..6b2183df069 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -72,3 +72,57 @@ CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci); INSERT INTO t1 VALUES ('ä'),('ö'),('ü'),('ß'); SELECT * FROM t1; DROP TABLE t1; + +# +# Bug #6379: ENUM values are incorrectly converted +# +# Check latin1 -> utf8 conversion +# +CREATE TABLE t1 ( + a ENUM('ä','ö','ü') character set utf8 default 'ü' +); +show create table t1; +insert into t1 values ('ä'), ('ö'), ('ü'); +select a from t1 order by a; +drop table t1; + +# +# Now check utf8 -> latin1 conversion +# This test emulates loading a script generated with mysqldump +# +set names utf8; +CREATE TABLE t1 ( + a ENUM('ä','ö','ü') character set latin1 default 'ü' +); +insert into t1 values ('ä'),('ö'),('ü'); +# Now check what has been loaded +set names latin1; +show create table t1; +select a from t1 order by a; +drop table t1; + +# +# Test bug where enum fields where extended for each ALTER TABLE +# + +create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin); +insert into t1 values ('Y'); +alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +--enable_metadata +select * from t1; +--disable_metadata +drop table t1; + +# +# Bug #6840 Default value is not checked in ALTER column SET DEFAULT 'x' +# +create table t1 (a enum('x','y') default 'x'); +--error 1067 +alter table t1 alter a set default 'z'; +drop table t1; + +create table t1 (a set('x','y') default 'x'); +--error 1067 +alter table t1 alter a set default 'z'; +drop table t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 216d5bbd286..6e991dc53d4 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -3,17 +3,23 @@ # Numeric floating point. --disable_warnings -drop table if exists t1; +drop table if exists t1,t2; --enable_warnings +--replace_result e-0 e- e+0 e+ SELECT 10,10.0,10.,.1e+2,100.0e-1; +--replace_result e-00 e-0 SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; +SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; +SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; +SELECT 2147483647E+02,21474836.47E+06; create table t1 (f1 float(24),f2 float(52)); show full columns from t1; insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); +--replace_result e-0 e- e+0 e+ select * from t1; drop table t1; @@ -80,6 +86,7 @@ drop table t1; # create table t1 (c20 char); insert into t1 values (5000.0); +insert into t1 values (0.5e4); drop table t1; # Errors @@ -90,3 +97,50 @@ create table t1 (f float(54)); # Should give an error drop table if exists t1; --enable_warnings +# Don't allow 'double unsigned' to be set to a negative value (Bug #7700) +create table t1 (d1 double, d2 double unsigned); +insert into t1 set d1 = -1.0; +update t1 set d2 = d1; +select * from t1; +drop table t1; + +# Ensure that maximum values as the result of number of decimals +# being specified in table schema are enforced (Bug #7361) +create table t1 (f float(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +select * from t1; +drop table if exists t1; +create table t1 (f double(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +select * from t1; +drop table if exists t1; + +# Check conversion of floats to character field (Bug #7774) +create table t1 (c char(20)); +insert into t1 values (5e-28); +select * from t1; +drop table t1; +create table t1 (c char(6)); +insert into t1 values (2e5),(2e6),(2e-4),(2e-5); +select * from t1; +drop table t1; + +# +# Test of comparison of integer with float-in-range (Bug #7840) +# This is needed because some ODBC applications (like Foxpro) uses +# floats for everything. +# + +CREATE TABLE t1 ( + reckey int unsigned NOT NULL, + recdesc varchar(50) NOT NULL, + PRIMARY KEY (reckey) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES (108, 'Has 108 as key'); +INSERT INTO t1 VALUES (109, 'Has 109 as key'); +select * from t1 where reckey=108; +select * from t1 where reckey=1.08E2; +select * from t1 where reckey=109; +select * from t1 where reckey=1.09E2; +drop table t1; diff --git a/mysql-test/t/type_ranges.test b/mysql-test/t/type_ranges.test index 09b5867e7a8..572dc0af313 100644 --- a/mysql-test/t/type_ranges.test +++ b/mysql-test/t/type_ranges.test @@ -135,7 +135,8 @@ drop table t1,t2; create table t1 (c int); insert into t1 values(1),(2); create table t2 select * from t1; -!$1060 create table t3 select * from t1, t2; # Should give an error +--error 1060 +create table t3 select * from t1, t2; # Should give an error create table t3 select t1.c AS c1, t2.c AS c2,1 as "const" from t1, t2; show full columns from t3; drop table t1,t2,t3; diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index e4aeecb2c79..b6410a9ea3d 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -23,6 +23,7 @@ create table t1 (s set ('a','A') character set latin1 collate latin1_bin); show create table t1; insert into t1 values ('a'),('a,A'),('A,a'),('A'); select s from t1 order by s; +select s from t1 order by concat(s); drop table t1; # @@ -34,4 +35,5 @@ INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss'); INSERT INTO t1 VALUES ('ä,ö,ü,ß'); INSERT INTO t1 VALUES ('ae,oe,ue,ss'); SELECT c FROM t1 ORDER BY c; +SELECT c FROM t1 ORDER BY concat(c); DROP TABLE t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index a8a0cf8703c..783e310f02d 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -286,3 +286,15 @@ insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00') ('b', '2004-02-01 00:00:00'); select max(t) from t1 group by a; drop table t1; + +# +# Test for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB +# mode". TIMESTAMP columns should be converted DATETIME columns in MAXDB +# mode regardless of whether a display width is given. +# +set sql_mode='maxdb'; +create table t1 (a timestamp, b timestamp(19)); +show create table t1; +# restore default mode +set sql_mode=''; +drop table t1; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 36027e8c4cb..82f26f63254 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -481,6 +481,10 @@ select count(*) from t1 where b=13 union select count(*) from t1 where a=7; show status like 'Slow_queries'; select count(*) from t1 where a=7 union select count(*) from t1 where b=13; show status like 'Slow_queries'; +# additional test for examined rows +flush status; +select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6); +show status like 'Slow_queries'; drop table t1; # @@ -652,5 +656,58 @@ create table t1 as (select b collate latin1_german1_ci from t2); show create table t1; drop table t1; +create table t1 as +(select a from t2) union +(select b from t2) union +(select 'c' collate latin1_german1_ci from t2); +show create table t1; +drop table t1; drop table t2; +# +# Bug 6931: Date Type column problem when using UNION-Table. +# +create table t1(a1 int, f1 char(10)); +create table t2 +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +union +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +order by f2, a1; +show columns from t2; +drop table t1, t2; + +create table t1 (f1 int); +create table t2 (f1 int, f2 int ,f3 date); +create table t3 (f1 int, f2 char(10)); +create table t4 +( + select t2.f3 as sdate + from t1 + left outer join t2 on (t1.f1 = t2.f1) + inner join t3 on (t2.f2 = t3.f1) + order by t1.f1, t3.f1, t2.f3 +) +union +( + select cast('2004-12-31' as date) as sdate + from t1 + left outer join t2 on (t1.f1 = t2.f1) + inner join t3 on (t2.f2 = t3.f1) + group by t1.f1 + order by t1.f1, t3.f1, t2.f3 +) +order by sdate; +show columns from t4; +drop table t1, t2, t3, t4; + +# +# Bug #2435 UNION with parentheses not supported +# +create table t1 (a int not null, b char (10) not null); +insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); +select * from ((select * from t1 limit 1)) a; +select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a; +select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a; +select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a; +select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a; +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index aeefa3c33f5..04192f25ac8 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -161,3 +161,21 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; +# +# Bug #6054 +# +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; + +# +# Bug #8057 +# +create table t1 (id int not null auto_increment primary key, id_str varchar(32)); +insert into t1 (id_str) values ("test"); +update t1 set id_str = concat(id_str, id) where id = last_insert_id(); +select * from t1; +drop table t1; diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index 601724e68c8..2f526dc9a46 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -84,7 +84,6 @@ select @a=_latin2'TEST' collate latin2_bin; set @a=_latin2'test' collate latin2_general_ci; select charset(@a),collation(@a),coercibility(@a); select @a=_latin2'TEST'; ---error 1267 select @a=_latin2'TEST' collate latin2_bin; # @@ -97,7 +96,6 @@ select collation(@a:=_latin2'test' collate latin2_bin); select coercibility(@a:=_latin2'test' collate latin2_bin); select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; select charset(@a),collation(@a),coercibility(@a); ---error 1267 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; # Check that user variables are binlogged correctly (BUG#3875) @@ -107,16 +105,20 @@ SET TIMESTAMP=10000; SET @`a b`='hello'; INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; -insert into t1 values (@var1); -create table t2 (c char(30)) charset=ucs2; -set @v=convert('abc' using ucs2); -insert into t2 values (@v); +SET @var2=char(ascii('a')); +insert into t1 values (@var1),(@var2); show binlog events from 79; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 -drop table t1, t2; +drop table t1; +# +# Bug #6321 strange error: +# string function FIELD(<uservariable content NULL>, ...) +# +set @var= NULL ; +select FIELD( @var,'1it','Hit') as my_column; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index fd6ab4d6405..f80ca6378a1 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -8,6 +8,7 @@ drop table if exists t1,t2; set @`test`=1,@TEST=3,@select=2,@t5=1.23456; select @test,@`select`,@TEST,@not_used; set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL; +--replace_result e-0 e- e+0 e+ select @test_int,@test_double,@test_string,@test_string2,@select; set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello"; select @test_int,@test_double,@test_string,@test_string2; @@ -70,7 +71,7 @@ show variables like 'concurrent_insert'; set global concurrent_insert=DEFAULT; show variables like 'concurrent_insert'; -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="INNODB"; +set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; show local variables like 'storage_engine'; show global variables like 'storage_engine'; set GLOBAL query_cache_size=100000; @@ -127,7 +128,7 @@ set max_join_size="hello"; --error 1286 set storage_engine=UNKNOWN_TABLE_TYPE; --error 1231 -set storage_engine=INNODB, big_tables=2; +set storage_engine=MERGE, big_tables=2; show local variables like 'storage_engine'; --error 1229 set SESSION query_cache_size=10000; @@ -354,3 +355,18 @@ create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3; show create table t1; drop table t1; + +# +# Bug #6993: myisam_data_pointer_size +# + +SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; +SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; + +# +# Bug #6958: negative arguments to integer options wrap around +# + +SET GLOBAL table_cache=-1; +SHOW VARIABLES LIKE 'table_cache'; +SET GLOBAL table_cache=DEFAULT; diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 4bd659606f6..23ab5aa1f05 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -7,6 +7,19 @@ drop table if exists t1, t2; SET SQL_WARNINGS=1; create table t1 (a int); +--error 1050 +create table t1 (a int); +show count(*) errors; +show errors; +show warnings; +--error 1115 +create table t2(a int) default charset qwerty; +show count(*) errors; +show errors; +--error 1064 +create table t (i); +show count(*) errors; +show errors; insert into t1 values (1); insert into t1 values ("hej"); insert into t1 values ("hej"),("då"); diff --git a/mysys/charset-def.c b/mysys/charset-def.c index 3dcd2a2d116..3278566788c 100644 --- a/mysys/charset-def.c +++ b/mysys/charset-def.c @@ -22,6 +22,8 @@ init_compiled_charsets() that only adds those that he wants */ +#ifdef HAVE_UCA_COLLATIONS + #ifdef HAVE_CHARSET_ucs2 extern CHARSET_INFO my_charset_ucs2_general_uca; extern CHARSET_INFO my_charset_ucs2_icelandic_uca_ci; @@ -62,6 +64,8 @@ extern CHARSET_INFO my_charset_utf8_roman_uca_ci; extern CHARSET_INFO my_charset_utf8_persian_uca_ci; #endif +#endif /* HAVE_UCA_COLLATIONS */ + my_bool init_compiled_charsets(myf flags __attribute__((unused))) { CHARSET_INFO *cs; @@ -113,6 +117,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) #ifdef HAVE_CHARSET_ucs2 add_compiled_collation(&my_charset_ucs2_general_ci); add_compiled_collation(&my_charset_ucs2_bin); +#ifdef HAVE_UCA_COLLATIONS add_compiled_collation(&my_charset_ucs2_general_uca); add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci); add_compiled_collation(&my_charset_ucs2_latvian_uca_ci); @@ -131,6 +136,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_ucs2_roman_uca_ci); add_compiled_collation(&my_charset_ucs2_persian_uca_ci); #endif +#endif #ifdef HAVE_CHARSET_ujis add_compiled_collation(&my_charset_ujis_japanese_ci); @@ -140,6 +146,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) #ifdef HAVE_CHARSET_utf8 add_compiled_collation(&my_charset_utf8_general_ci); add_compiled_collation(&my_charset_utf8_bin); +#ifdef HAVE_UCA_COLLATIONS add_compiled_collation(&my_charset_utf8_general_uca_ci); add_compiled_collation(&my_charset_utf8_icelandic_uca_ci); add_compiled_collation(&my_charset_utf8_latvian_uca_ci); @@ -158,6 +165,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_utf8_roman_uca_ci); add_compiled_collation(&my_charset_utf8_persian_uca_ci); #endif +#endif /* Copy compiled charsets */ for (cs=compiled_charsets; cs->name; cs++) diff --git a/mysys/charset.c b/mysys/charset.c index 1388fc40c6d..4b7ad3e59f4 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -64,7 +64,7 @@ static my_bool init_state_maps(CHARSET_INFO *cs) else if (my_mbcharlen(cs, i)>1) state_map[i]=(uchar) MY_LEX_IDENT; #endif - else if (!my_isgraph(cs,i)) + else if (my_isspace(cs,i)) state_map[i]=(uchar) MY_LEX_SKIP; else state_map[i]=(uchar) MY_LEX_CHAR; @@ -215,7 +215,7 @@ static int add_collation(CHARSET_INFO *cs) if (!strcmp(cs->csname,"ucs2") ) { -#ifdef HAVE_CHARSET_ucs2 +#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS) new->cset= my_charset_ucs2_general_uca.cset; new->coll= my_charset_ucs2_general_uca.coll; new->strxfrm_multiply= my_charset_ucs2_general_uca.strxfrm_multiply; @@ -228,6 +228,7 @@ static int add_collation(CHARSET_INFO *cs) } else { + uchar *sort_order= all_charsets[cs->number]->sort_order; simple_cs_init_functions(all_charsets[cs->number]); new->mbminlen= 1; new->mbmaxlen= 1; @@ -236,6 +237,16 @@ static int add_collation(CHARSET_INFO *cs) all_charsets[cs->number]->state |= MY_CS_LOADED; } all_charsets[cs->number]->state|= MY_CS_AVAILABLE; + + /* + Check if case sensitive sort order: A < a < B. + We need MY_CS_FLAG for regex library, and for + case sensitivity flag for 5.0 client protocol, + to support isCaseSensitive() method in JDBC driver + */ + if (sort_order && sort_order['A'] < sort_order['a'] && + sort_order['a'] < sort_order['B']) + all_charsets[cs->number]->state|= MY_CS_CSSORT; } } else @@ -519,7 +530,7 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags) { char index_file[FN_REFLEN]; strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); - my_error(EE_UNKNOWN_CHARSET, MYF(ME_BELL), cs_name, index_file); + my_error(EE_UNKNOWN_COLLATION, MYF(ME_BELL), cs_name, index_file); } return cs; @@ -570,6 +581,23 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, from--; continue; } + /* + If the next character appears to begin a multi-byte character, we + escape that first byte of that apparent multi-byte character. (The + character just looks like a multi-byte character -- if it were actually + a multi-byte character, it would have been passed through in the test + above.) + + Without this check, we can create a problem by converting an invalid + multi-byte character into a valid one. For example, 0xbf27 is not + a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \) + */ + if (use_mb_flag && (l= my_mbcharlen(charset_info, *from)) > 1) + { + *to++= '\\'; + *to++= *from; + continue; + } #endif switch (*from) { case 0: /* Must be escaped for 'mysql' */ diff --git a/mysys/default.c b/mysys/default.c index 792233ed10d..5f554ac36f6 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -60,20 +60,55 @@ DATADIR, NullS, }; -#define default_ext ".cnf" /* extension for config file */ #ifdef __WIN__ -#include <winbase.h> -#define windows_ext ".ini" +static const char *f_extensions[]= { ".ini", ".cnf", 0 }; +#else +static const char *f_extensions[]= { ".cnf", 0 }; #endif static int search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc, const char *dir, const char *config_file, - const char *ext, TYPELIB *group); + TYPELIB *group); + +static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, + const char *dir, const char *ext, + const char *config_file, + TYPELIB *group); static char *remove_end_comment(char *ptr); /* + Gets --defaults-file and --defaults-extra-file options from command line. + + SYNOPSIS + get_defaults_files() + argc Pointer to argc of original program + argv Pointer to argv of original program + defaults --defaults-file option + extra_defaults --defaults-extra-file option + + RETURN + defaults and extra_defaults will be set to appropriate items + of argv array, or to NULL if there are no such options +*/ + +void get_defaults_files(int argc, char **argv, + char **defaults, char **extra_defaults) +{ + *defaults=0; + *extra_defaults=0; + if (argc >= 2) + { + if (is_prefix(argv[1],"--defaults-file=")) + *defaults= argv[1]; + else if (is_prefix(argv[1],"--defaults-extra-file=")) + *extra_defaults= argv[1]; + } +} + + +/* Read options from configurations files SYNOPSIS @@ -106,7 +141,7 @@ static char *remove_end_comment(char *ptr); int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv) + int *argc, char ***argv) { DYNAMIC_ARRAY args; const char **dirs, *forced_default_file; @@ -115,7 +150,8 @@ int load_defaults(const char *conf_file, const char **groups, uint args_used=0; int error= 0; MEM_ROOT alloc; - char *ptr,**res; + char *ptr, **res; + DBUG_ENTER("load_defaults"); init_alloc_root(&alloc,512,0); @@ -137,21 +173,14 @@ int load_defaults(const char *conf_file, const char **groups, DBUG_RETURN(0); } - /* Check if we want to force the use a specific default file */ - forced_default_file=0; - if (*argc >= 2) - { - if (is_prefix(argv[0][1],"--defaults-file=")) - { - forced_default_file=strchr(argv[0][1],'=')+1; - args_used++; - } - else if (is_prefix(argv[0][1],"--defaults-extra-file=")) - { - defaults_extra_file=strchr(argv[0][1],'=')+1; - args_used++; - } - } + get_defaults_files(*argc, *argv, + (char **)&forced_default_file, &defaults_extra_file); + if (forced_default_file) + forced_default_file= strchr(forced_default_file,'=')+1; + if (defaults_extra_file) + defaults_extra_file= strchr(defaults_extra_file,'=')+1; + + args_used+= (forced_default_file ? 1 : 0) + (defaults_extra_file ? 1 : 0); group.count=0; group.name= "defaults"; @@ -163,8 +192,9 @@ int load_defaults(const char *conf_file, const char **groups, goto err; if (forced_default_file) { - if ((error= search_default_file(&args, &alloc, "", - forced_default_file, "", &group)) < 0) + if ((error= search_default_file_with_ext(&args, &alloc, "", "", + forced_default_file, + &group)) < 0) goto err; if (error > 0) { @@ -176,7 +206,7 @@ int load_defaults(const char *conf_file, const char **groups, else if (dirname_length(conf_file)) { if ((error= search_default_file(&args, &alloc, NullS, conf_file, - default_ext, &group)) < 0) + &group)) < 0) goto err; } else @@ -184,28 +214,30 @@ int load_defaults(const char *conf_file, const char **groups, #ifdef __WIN__ char system_dir[FN_REFLEN]; GetWindowsDirectory(system_dir,sizeof(system_dir)); - if ((search_default_file(&args, &alloc, system_dir, conf_file, - windows_ext, &group))) + if ((search_default_file(&args, &alloc, system_dir, conf_file, &group))) goto err; #endif #if defined(__EMX__) || defined(OS2) - if (getenv("ETC") && - (search_default_file(&args, &alloc, getenv("ETC"), conf_file, - default_ext, &group)) < 0) + { + const char *etc; + if ((etc= getenv("ETC")) && + (search_default_file(&args, &alloc, etc, conf_file, + &group)) < 0) goto err; + } #endif for (dirs=default_directories ; *dirs; dirs++) { if (**dirs) { if (search_default_file(&args, &alloc, *dirs, conf_file, - default_ext, &group) < 0) + &group) < 0) goto err; } else if (defaults_extra_file) { if (search_default_file(&args, &alloc, NullS, defaults_extra_file, - default_ext, &group) < 0) + &group) < 0) goto err; /* Fatal error */ } } @@ -269,11 +301,28 @@ void free_defaults(char **argv) } +static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, + const char *dir, + const char *config_file, TYPELIB *group) +{ + char **ext; + + for (ext= (char**) f_extensions; *ext; *ext++) + { + int error; + if ((error= search_default_file_with_ext(args, alloc, dir, *ext, + config_file, group)) < 0) + return error; + } + return 0; +} + + /* Open a configuration file (if exists) and read given options from it SYNOPSIS - search_default_file() + search_default_file_with_ext() args Store pointer to found options here alloc Allocate strings in this object dir directory to read @@ -288,9 +337,10 @@ void free_defaults(char **argv) 2 File is not a regular file (Warning) */ -static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, - const char *dir, const char *config_file, - const char *ext, TYPELIB *group) +static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, + const char *dir, const char *ext, + const char *config_file, + TYPELIB *group) { char name[FN_REFLEN+10],buff[4096],*ptr,*end,*value,*tmp; FILE *fp; @@ -484,10 +534,11 @@ static char *remove_end_comment(char *ptr) void print_defaults(const char *conf_file, const char **groups) { #ifdef __WIN__ - bool have_ext=fn_ext(conf_file)[0] != 0; + my_bool have_ext= fn_ext(conf_file)[0] != 0; #endif - char name[FN_REFLEN]; + char name[FN_REFLEN], **ext; const char **dirs; + puts("\nDefault options are read from the following files in the given order:"); if (dirname_length(conf_file)) @@ -496,27 +547,43 @@ void print_defaults(const char *conf_file, const char **groups) { #ifdef __WIN__ GetWindowsDirectory(name,sizeof(name)); - printf("%s\\%s%s ",name,conf_file,have_ext ? "" : windows_ext); + if (!have_ext) + { + for (ext= (char**) f_extensions; *ext; *ext++) + printf("%s\\%s%s ", name, conf_file, *ext); + } + else + printf("%s\\%s ", name, conf_file); #endif #if defined(__EMX__) || defined(OS2) - if (getenv("ETC")) - printf("%s\\%s%s ", getenv("ETC"), conf_file, default_ext); + { + const char *etc; + + if ((etc= getenv("ETC"))) + { + for (ext= (char**) f_extensions; *ext; *ext++) + printf("%s\\%s%s ", etc, conf_file, *ext); + } + } #endif for (dirs=default_directories ; *dirs; dirs++) { - const char *pos; - char *end; - if (**dirs) - pos= *dirs; - else if (defaults_extra_file) - pos= defaults_extra_file; - else - continue; - end=convert_dirname(name, pos, NullS); - if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ - *end++='.'; - strxmov(end,conf_file,default_ext," ",NullS); - fputs(name,stdout); + for (ext= (char**) f_extensions; *ext; *ext++) + { + const char *pos; + char *end; + if (**dirs) + pos= *dirs; + else if (defaults_extra_file) + pos= defaults_extra_file; + else + continue; + end= convert_dirname(name, pos, NullS); + if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ + *end++='.'; + strxmov(end, conf_file, *ext, " ", NullS); + fputs(name,stdout); + } } puts(""); } diff --git a/mysys/errors.c b/mysys/errors.c index 5401c2b3cc6..05436c9a212 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -49,6 +49,7 @@ const char * NEAR globerrs[GLOBERRS]= "Can't create symlink '%s' pointing at '%s' (Error %d)", "Error on realpath() on '%s' (Error %d)", "Can't sync file '%s' to disk (Errcode: %d)", + "Collation '%s' is not a compiled collation and is not specified in the '%s' file", }; void init_glob_errs(void) @@ -89,5 +90,6 @@ void init_glob_errs() EE(EE_CANT_SYMLINK)= "Can't create symlink '%s' pointing at '%s' (Error %d)"; EE(EE_REALPATH)= "Error on realpath() on '%s' (Error %d)"; EE(EE_SYNC)= "Can't sync file '%s' to disk (Errcode: %d)"; + EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file"; } #endif diff --git a/mysys/hash.c b/mysys/hash.c index d068299d44e..6091ef39a4e 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -122,13 +122,13 @@ void hash_free(HASH *hash) Delete all elements from the hash (the hash itself is to be reused). SYNOPSIS - hash_reset() + my_hash_reset() hash the hash to delete elements of */ -void hash_reset(HASH *hash) +void my_hash_reset(HASH *hash) { - DBUG_ENTER("hash_reset"); + DBUG_ENTER("my_hash_reset"); DBUG_PRINT("enter",("hash: 0x%lxd",hash)); hash_free_elements(hash); @@ -146,7 +146,7 @@ void hash_reset(HASH *hash) handle inline functions that are not defined as native types */ -inline char* +static inline char* hash_key(HASH *hash,const byte *record,uint *length,my_bool first) { if (hash->get_key) diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index f109df912f1..d80de3101be 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -70,9 +70,40 @@ static void my_aiowait(my_aio_result *result); #define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1)) #define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1)) + +/* + Setup internal pointers inside IO_CACHE + + SYNOPSIS + setup_io_cache() + info IO_CACHE handler + + NOTES + This is called on automaticly on init or reinit of IO_CACHE + It must be called externally if one moves or copies an IO_CACHE + object. +*/ + +void setup_io_cache(IO_CACHE* info) +{ + /* Ensure that my_b_tell() and my_b_bytes_in_cache works */ + if (info->type == WRITE_CACHE) + { + info->current_pos= &info->write_pos; + info->current_end= &info->write_end; + } + else + { + info->current_pos= &info->read_pos; + info->current_end= &info->read_end; + } +} + + static void -init_functions(IO_CACHE* info, enum cache_type type) +init_functions(IO_CACHE* info) { + enum cache_type type= info->type; switch (type) { case READ_NET: /* @@ -96,17 +127,7 @@ init_functions(IO_CACHE* info, enum cache_type type) info->write_function = _my_b_write; } - /* Ensure that my_b_tell() and my_b_bytes_in_cache works */ - if (type == WRITE_CACHE) - { - info->current_pos= &info->write_pos; - info->current_end= &info->write_end; - } - else - { - info->current_pos= &info->read_pos; - info->current_end= &info->read_end; - } + setup_io_cache(info); } @@ -236,7 +257,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, info->end_of_file= end_of_file; info->error=0; info->type= type; - init_functions(info,type); + init_functions(info); #ifdef HAVE_AIOWAIT if (use_async_io && ! my_disable_async_io) { @@ -358,7 +379,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, } info->type=type; info->error=0; - init_functions(info,type); + init_functions(info); #ifdef HAVE_AIOWAIT if (use_async_io && ! my_disable_async_io && diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 11aadbed6c1..9feaf8dcd57 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -352,6 +352,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, MYF(0)))) break; my_free_lock(keycache->block_mem, MYF(0)); + keycache->block_mem= 0; } if (blocks < 8) { @@ -1699,11 +1700,12 @@ byte *key_cache_read(KEY_CACHE *keycache, keycache_pthread_mutex_unlock(&keycache->cache_lock); goto no_key_cache; } - read_length= length > keycache->key_cache_block_size ? - keycache->key_cache_block_size : length; - KEYCACHE_DBUG_ASSERT(read_length > 0); offset= (uint) (filepos & (keycache->key_cache_block_size-1)); filepos-= offset; + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); + #ifndef THREAD if (block_length > keycache->key_cache_block_size || offset) return_buffer=0; @@ -1773,7 +1775,7 @@ byte *key_cache_read(KEY_CACHE *keycache, return (block->buffer); #endif buff+= read_length; - filepos+= read_length; + filepos+= read_length+offset; } while ((length-= read_length)); DBUG_RETURN(start); @@ -1835,12 +1837,12 @@ int key_cache_insert(KEY_CACHE *keycache, keycache_pthread_mutex_unlock(&keycache->cache_lock); DBUG_RETURN(0); } - read_length= length > keycache->key_cache_block_size ? - keycache->key_cache_block_size : length; - KEYCACHE_DBUG_ASSERT(read_length > 0); offset= (uint) (filepos & (keycache->key_cache_block_size-1)); /* Read data into key cache from buff in key_cache_block_size incr. */ filepos-= offset; + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); inc_counter_for_resize_op(keycache); keycache->global_cache_r_requests++; @@ -1882,7 +1884,7 @@ int key_cache_insert(KEY_CACHE *keycache, DBUG_RETURN(1); buff+= read_length; - filepos+= read_length; + filepos+= read_length+offset; } while ((length-= read_length)); } @@ -1959,12 +1961,12 @@ int key_cache_write(KEY_CACHE *keycache, keycache_pthread_mutex_unlock(&keycache->cache_lock); goto no_key_cache; } - read_length= length > keycache->key_cache_block_size ? - keycache->key_cache_block_size : length; - KEYCACHE_DBUG_ASSERT(read_length > 0); offset= (uint) (filepos & (keycache->key_cache_block_size-1)); /* Write data in key_cache_block_size increments */ filepos-= offset; + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); inc_counter_for_resize_op(keycache); keycache->global_cache_w_requests++; @@ -2032,7 +2034,7 @@ int key_cache_write(KEY_CACHE *keycache, next_block: buff+= read_length; - filepos+= read_length; + filepos+= read_length+offset; offset= 0; } while ((length-= read_length)); @@ -2443,6 +2445,41 @@ static int flush_all_key_blocks(KEY_CACHE *keycache) } +/* + Reset the counters of a key cache. + + SYNOPSIS + reset_key_cache_counters() + name the name of a key cache + key_cache pointer to the key kache to be reset + + DESCRIPTION + This procedure is used by process_key_caches() to reset the counters of all + currently used key caches, both the default one and the named ones. + + RETURN + 0 on success (always because it can't fail) +*/ + +int reset_key_cache_counters(const char *name, KEY_CACHE *key_cache) +{ + DBUG_ENTER("reset_key_cache_counters"); + if (!key_cache->key_cache_inited) + { + DBUG_PRINT("info", ("Key cache %s not initialized.", name)); + DBUG_RETURN(0); + } + DBUG_PRINT("info", ("Resetting counters for key cache %s.", name)); + + key_cache->global_blocks_changed= 0; /* Key_blocks_not_flushed */ + key_cache->global_cache_r_requests= 0; /* Key_read_requests */ + key_cache->global_cache_read= 0; /* Key_reads */ + key_cache->global_cache_w_requests= 0; /* Key_write_requests */ + key_cache->global_cache_write= 0; /* Key_writes */ + DBUG_RETURN(0); +} + + #ifndef DBUG_OFF /* Test if disk-cache is ok diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 20465f3d23b..38fef31fdd4 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -235,7 +235,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length, if (my_hash_insert(&hash->hash, (byte*) entry)) { /* This can only happen if hash got out of memory */ - my_delete((char*) entry, MYF(0)); + my_free((char*) entry, MYF(0)); error= 1; goto end; } @@ -275,7 +275,11 @@ static void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data) if (entry->data == old_data) { if (new_data == hash->default_value) + { + if ((*entry->prev= entry->next)) + entry->next->prev= entry->prev; hash_delete(&hash->hash, (byte*) entry); + } else entry->data= new_data; } @@ -309,7 +313,7 @@ void multi_keycache_free(void) Get a key cache to be used for a specific table. SYNOPSIS - multi_key_cache_get() + multi_key_cache_search() key key to find (usually table path) uint length Length of key. diff --git a/mysys/my_handler.c b/mysys/my_handler.c index 00f25924e69..5ee181ca78e 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -43,7 +43,7 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, return 0; if (skip_end_space && a_length != b_length) { - int swap= 0; + int swap= 1; /* We are using space compression. We have to check if longer key has next character < ' ', in which case it's less than the shorter @@ -62,7 +62,7 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } return 0; } diff --git a/mysys/my_init.c b/mysys/my_init.c index 0ef938b434c..bee485c3bed 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -42,8 +42,8 @@ static void netware_init(); #define netware_init() #endif - -my_bool my_init_done=0; +my_bool my_init_done= 0; +uint mysys_usage_id= 0; /* Incremented for each my_init() */ static ulong atoi_octal(const char *str) { @@ -51,7 +51,7 @@ static ulong atoi_octal(const char *str) while (*str && my_isspace(&my_charset_latin1, *str)) str++; str2int(str, - (*str == '0' ? 8 : 10), /* Octalt or decimalt */ + (*str == '0' ? 8 : 10), /* Octalt or decimalt */ 0, INT_MAX, &tmp); return (ulong) tmp; } @@ -74,6 +74,9 @@ my_bool my_init(void) if (my_init_done) return 0; my_init_done=1; + mysys_usage_id++; + my_umask= 0660; /* Default umask for new files */ + my_umask_dir= 0700; /* Default umask for new directories */ #if defined(THREAD) && defined(SAFE_MUTEX) safe_mutex_global_init(); /* Must be called early */ #endif @@ -142,6 +145,10 @@ void my_end(int infoflag) { #ifdef HAVE_GETRUSAGE struct rusage rus; +#ifdef HAVE_purify + /* Purify assumes that rus is uninitialized after getrusage call */ + bzero((char*) &rus, sizeof(rus)); +#endif if (!getrusage(RUSAGE_SELF, &rus)) fprintf(info_file,"\n\ User time %.2f, System time %.2f\n\ diff --git a/mysys/my_rename.c b/mysys/my_rename.c index d4f99e83247..b5d813ad787 100644 --- a/mysys/my_rename.c +++ b/mysys/my_rename.c @@ -45,7 +45,7 @@ int my_rename(const char *from, const char *to, myf MyFlags) } #endif #if defined(HAVE_RENAME) -#ifdef __WIN__ +#if defined(__WIN__) || defined(__NETWARE__) /* On windows we can't rename over an existing file: Remove any conflicting files: diff --git a/mysys/my_sleep.c b/mysys/my_sleep.c index 3de2d2abd13..31eaf7eeb96 100644 --- a/mysys/my_sleep.c +++ b/mysys/my_sleep.c @@ -23,6 +23,8 @@ void my_sleep(ulong m_seconds) { #ifdef __NETWARE__ delay(m_seconds/1000+1); +#elif defined(__WIN__) + Sleep(m_seconds/1000+1); /* Sleep() has millisecond arg */ #elif defined(OS2) DosSleep(m_seconds/1000+1); #elif defined(HAVE_SELECT) diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c index 045802c5e61..7be3fcd36f0 100644 --- a/mysys/my_symlink.c +++ b/mysys/my_symlink.c @@ -26,9 +26,11 @@ /* Reads the content of a symbolic link If the file is not a symbolic link, return the original file name in to. - Returns: 0 if table was a symlink, - 1 if table was a normal file - -1 on error. + + RETURN + 0 If filename was a symlink, (to will be set to value of symlink) + 1 If filename was a normal file (to will be set to filename) + -1 on error. */ int my_readlink(char *to, const char *filename, myf MyFlags) @@ -58,6 +60,7 @@ int my_readlink(char *to, const char *filename, myf MyFlags) } else to[length]=0; + DBUG_PRINT("exit" ,("result: %d", result)); DBUG_RETURN(result); #endif /* HAVE_READLINK */ } diff --git a/mysys/my_write.c b/mysys/my_write.c index 2df3a31e774..4e8369480b3 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -49,8 +49,7 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */ #endif if ((my_errno == ENOSPC || my_errno == EDQUOT) && - (MyFlags & MY_WAIT_IF_FULL) && - (uint) writenbytes != (uint) -1) + (MyFlags & MY_WAIT_IF_FULL)) { if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE)) my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH), diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index caef1caaf3d..19611a6027a 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -248,7 +248,7 @@ void thr_end_alarm(thr_alarm_t *alarmed) if (alarm_data->malloced) my_free((gptr) alarm_data,MYF(0)); found++; -#ifndef DBUG_OFF +#ifdef DBUG_OFF break; #endif } diff --git a/ndb/Makefile.am b/ndb/Makefile.am index 82f424fcfb4..32c821383e6 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -17,3 +17,13 @@ dist-hook: done; \ fi; \ done + +windoze: + for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done + +windoze-dsp: + +all-windoze-dsp: windoze + find . -name '*.dsp' | grep -v SCCS | xargs unix2dos + $(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw + tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp' | grep -v SCCS` diff --git a/ndb/config/make-win-dsw.sh b/ndb/config/make-win-dsw.sh new file mode 100755 index 00000000000..b0613620f8a --- /dev/null +++ b/ndb/config/make-win-dsw.sh @@ -0,0 +1,42 @@ + +cat <<EOF +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### +EOF + +for i in `find . -name '*.dsp' | grep -v SCCS` +do + name=`basename $i | sed 's/\.dsp//'` + cat<<EOF + +Project: "$name"="`echo $i | sed 's/\//\\\/g'`" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +EOF +done + +cat<<EOF +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + +EOF diff --git a/ndb/config/type_ndbapitest.mk.am b/ndb/config/type_ndbapitest.mk.am index f1fd8286337..392c4e9fc70 100644 --- a/ndb/config/type_ndbapitest.mk.am +++ b/ndb/config/type_ndbapitest.mk.am @@ -5,7 +5,7 @@ LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ -INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ +INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ -I$(top_srcdir)/ndb/include/ndbapi \ -I$(top_srcdir)/ndb/include/util \ diff --git a/ndb/config/type_ndbapitools.mk.am b/ndb/config/type_ndbapitools.mk.am index ed6d8699e05..d4eb090112d 100644 --- a/ndb/config/type_ndbapitools.mk.am +++ b/ndb/config/type_ndbapitools.mk.am @@ -11,4 +11,5 @@ INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include/util \ -I$(top_srcdir)/ndb/include/portlib \ -I$(top_srcdir)/ndb/test/include \ - -I$(top_srcdir)/ndb/include/mgmapi + -I$(top_srcdir)/ndb/include/mgmapi \ + -I$(top_srcdir)/ndb/include/kernel diff --git a/ndb/config/win-includes b/ndb/config/win-includes new file mode 100755 index 00000000000..fa5984fd25e --- /dev/null +++ b/ndb/config/win-includes @@ -0,0 +1,8 @@ +#!/bin/sh + +dst=$1 +shift + +out=`echo $* | sed 's/-I\([^ ]*\)/\/I "\1"/g'` +sed -e "s!@includes@!$out!g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/config/win-lib.am b/ndb/config/win-lib.am new file mode 100644 index 00000000000..05ac1ec8a40 --- /dev/null +++ b/ndb/config/win-lib.am @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="@name@" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=@name@ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "@name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:".\lib_release\@name@.lib" +@release_libs@ + +!ELSEIF "$(CFG)" == "@name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "debug" +# PROP Intermediate_Dir "debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:".\lib_debug\@name@.lib" +@debug_libs@ + +!ENDIF + +# Begin Target + +# Name "@name@ - Win32 Release" +# Name "@name@ - Win32 Debug" + +# Begin Group "Source Files" +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +@sources@ + +# End Group + +# End Target +# End Project diff --git a/ndb/config/win-libraries b/ndb/config/win-libraries new file mode 100755 index 00000000000..c7a6fb696ee --- /dev/null +++ b/ndb/config/win-libraries @@ -0,0 +1,56 @@ +#!/bin/sh + +dst=$1 +shift + +type=$1 +shift + +add_lib(){ + echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"` +} + +out_rel= +out_deb= +out_tls_rel= +out_tls_deb= +for i in $* +do +# mysql VC++ project files have for some unknown reason +# choosen NOT to put libdbug.lib in $(topdir)./dbug but rather in $(topdir) +# the same goes for mysys and strings + lib=$i + case $i in + *libdbug.a | *libmysys.a | *libmystrings.a) + lib=`echo $i | sed s'!dbug\/lib!!' | sed 's!mysys\/lib!!' | sed 's!strings\/libmy!!'` + echo "Changing from $i to $lib" + ;; + esac + + if [ `echo $i | grep -c gcc` -eq 0 ] + then + out_rel="${out_rel} `add_lib lib_release $lib`" + out_deb="${out_deb} `add_lib lib_debug $lib`" + out_tls_rel="${out_tls_rel} `add_lib lib_release $lib _tls`" + out_tls_deb="${out_tls_deb} `add_lib lib_debug $lib _tls`" + fi +done + +fix(){ + echo "# ADD BASE ${type}32 $*\n# ADD ${type}32 $*\n" +} + +if [ "$out_rel" ] +then + out_rel=`fix $out_rel` + out_deb=`fix $out_deb` + out_tls_rel=`fix $out_tls_rel` + out_tls_deb=`fix $out_tls_deb` +fi + +sed -e "s!@release_libs@!$out_rel!g" \ + -e "s!@debug_libs@!$out_deb!g" \ + -e "s!@tls_release_libs@!$out_tls_rel!g" \ + -e "s!@tls_debug_libs@!$out_tls_deb!g" \ + $dst > !tmp!$dst.$$ +mv !tmp!$dst.$$ $dst diff --git a/ndb/config/win-name b/ndb/config/win-name new file mode 100755 index 00000000000..036f2b9cc2e --- /dev/null +++ b/ndb/config/win-name @@ -0,0 +1,7 @@ +#!/bin/sh + +dst=$1 +shift + +sed -e "s/@name@/`echo $1 | sed 's/\.[l]*a//g'`/g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/config/win-prg.am b/ndb/config/win-prg.am new file mode 100644 index 00000000000..10a8cfbca02 --- /dev/null +++ b/ndb/config/win-prg.am @@ -0,0 +1,98 @@ +# Microsoft Developer Studio Project File - Name="mysqld" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=@name@ - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "@name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDB_WIN32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "NDB_WIN32" /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +@release_libs@ +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"release/@name@-opt.exe" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "@name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "debug" +# PROP Intermediate_Dir "debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "NDB_WIN32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "NDB_WIN32" /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /Fr /YX +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +@debug_libs@ +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"debug/@name@.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "@name@ - Win32 Release" +# Name "@name@ - Win32 Debug" + +@sources@ + +# End Target +# End Project diff --git a/ndb/config/win-sources b/ndb/config/win-sources new file mode 100755 index 00000000000..a383bb0e613 --- /dev/null +++ b/ndb/config/win-sources @@ -0,0 +1,8 @@ +#!/bin/sh + +dst=$1 +shift + +out=`echo $* | sed 's!\([^ ]*\)!# Begin Source File\\\nSOURCE=\1\\\n# End Source File\\\n!g'` +sed -e "s!@sources@!$out!g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am index 554b2fb256e..1399ce3b6a5 100644 --- a/ndb/docs/Makefile.am +++ b/ndb/docs/Makefile.am @@ -38,7 +38,7 @@ ndbapidoc: ndbapi.pdf ndbapi.pdf: $(noinst_HEADERS) @set -x; \ - export NDB_RELEASE=$(NDB_RELEASE) \ + export NDB_RELEASE=$(NDB_RELEASE); \ @RM@ -f ndbapi.pdf ndbapi.html; \ @RM@ -rf $(DOXYTMP) $(DOXYOUT); \ mkdir -p $(DOXYTMP) $(DOXYOUT); \ @@ -62,7 +62,7 @@ mgmapidoc: mgmapi.pdf mgmapi.pdf: $(noinst_HEADERS) @set -x; \ - export NDB_RELEASE=$(NDB_RELEASE) \ + export NDB_RELEASE=$(NDB_RELEASE); \ @RM@ -f mgmapi.pdf mgmapi.html; \ @RM@ -rf $(DOXYTMP) $(DOXYOUT); \ mkdir -p $(DOXYTMP) $(DOXYOUT); \ @@ -100,3 +100,5 @@ odbcdoc: DUMMY testdoc: DUMMY mkdir -p $(OUTDIR) cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test + +windoze-dsp: diff --git a/ndb/docs/wl2077.txt b/ndb/docs/wl2077.txt new file mode 100644 index 00000000000..f5b10bb702e --- /dev/null +++ b/ndb/docs/wl2077.txt @@ -0,0 +1,48 @@ + +100' * (select 1 from T1 (1M rows) where key = rand()); +1 host, 1 ndbd, api co-hosted +results in 1000 rows / sec + + wo/reset bounds w/ rb +4.1-read committed a) 4.9 b) 7.4 +4.1-read hold lock c) 4.7 d) 6.7 + +wl2077-read committed 6.4 (+30%) 10.8 (+45%) +wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) + +5.0-ndb batch read committed f) 50' (+680%) g) 50' (+360%) +5.0-ndb batch read hold lock h) 12' (+160%) i) 13' (+79%) + +shm-mem read committed (cmp. wl2077) a) 9.5' (+48%) b) 14' (+30%) + read hold lock c) 6.7' (+45%) d) 9.8' (+46%) + +-- Comparision e) shm +serial pk: 10.9' 20' (+83%) +batched (1000): 59' 62' (+5%) +serial uniq index: 8.4' 14' (+66%) +batched (1000): 33' 36' (+9%) +index range (1000): 186' + +---- + +load) testScanPerf -c 1 -d 1 T1 +a) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 0 T1 +b) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 1 T1 +c) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 0 T1 +d) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 1 T1 +e) testReadPerf -i 25 -c 0 -d 0 T1 +f) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 3 -q 0 -m 1000 -i 10 T1 +g) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 3 -q 1 -m 1000 -i 10 T1 + +--- music join 1db-co 2db-co + +4.1 13s 14s +4.1 wo/ blobs 1.7s 3.2s + +wl2077 12s 14s +wl2077 wo/ blobs 1.2s (-30%) 2.5s (-22%) + +pekka-blob-fix 1.3s + +shm 1.2s 2.0s +shm wo/ blobs 1.1s 2.0s diff --git a/ndb/home/bin/cvschk b/ndb/home/bin/cvschk deleted file mode 100755 index 4510cc30888..00000000000 --- a/ndb/home/bin/cvschk +++ /dev/null @@ -1,569 +0,0 @@ -#!/usr/bin/perl -w -# -# cvschk -- fast offline check for new files and modifications of files - -# cvschk : A perl program which checks the status of the CVS controlled -# files and gives an ASCII table sorted after the status of files. -# -# If you have used CVS, then you know that it is hard to -# get a good overview the CVS-status of the files in you -# directories. Any new files? Any files changes? -# cvschk will help the programmer get the overview in the -# situation, where we do not have access to the CVS repository. -# -# Note that the program does only local checks of the files -# If you have fast access to the CVS repositiory, then consider -# the cvsstat-program - which additionally can tell if other -# people have made newer versions of the files. -# -# The program requires Perl 5.004 (maybe previous versions also work). -# -# It is tuned to parse the output of cvs(1) version 1.9. -# Earlier and later versions may require modifications to the script. -# -# ** Note that the first line might be wrong depending ** -# ** on the location of your perl program. ** -# -# Sample output: -# The directory ./mytempdir is not under CVS control -# -# Changed files -# --------------- -# ./cvs2html -# ./cvschk -# ./cvsstat -# -# New files -# --------------- -# ./.#cvschk -# ./XX -# ./cvs2html.ok -# -# Deleted files -# --------------- -# (none) - -# Changelog: -# -# Ver Date Author Changelog -# --- ---------- -------------------- ------------------------------------- -# 1.12 2002-01-04 Michael Kohne Fixed a $foo=<> warning for -# 5.004_01 with defined($foo=<>) -# Added a --tabular|-t switch -# -# 1.11 2001-12-27 Michael Kohne Added cvsignore functionality -# Handling of 'dummy timestamp' -# Handling of 'Result of Merge' -# -# 1.10 2001-11-06 Michael Kohne Added -r and -l options -# -# 1.9 2001-08-03 Lars G. T. Jørgensen Hack to allow special entry-line -# -# 1.8 2001-06-07 Peter Toft Back to the same as 1.6 -# CVS is my friend -# -# 1.7 2001-06-04 Peter Toft Peter was very tired and -# applied a wrong patch - -# version 1.7 is crap -# -# 1.6 2000-12-17 Peter Toft Better description added -# -# 1.5 2000-11-04 Peter Toft URL of cvsstat changed -# -# 1.4 2000-09-20 Peter Toft Must show deleted files also -# as the default -# -# 1.3 2000-08-08 Ole Tange and Initial version -# Peter Toft -# ---- ---------- -------------------- ------------------------------------- -# -# ----------------------------------------------------------------------------- -# -# This program is protected by the GPL, and all modifications of -# general interest should be emailed to the maintainer (pto@sslug.dk). -# -# This program also uses code parts from cvsstat -# (same homepage as cvschk) -# -# Copyright 2000,2001 by Peter Toft <pto@sslug.dk> and Ole Tange <ole@tange.dk> -# as well as -# Lars G. T. Jørgensen <larsj@diku.dk> -# -# The URL of the home page of cvschk is shown below. - - -use Time::Local; -use strict; -use Getopt::Long; - -my $startdir = "."; - -my $debug = 0; -my (%files,%filesok,%seen,%skip); - - -# Michael Kohne 12/16/01 -# -# Simulation of .cvsignore as CVS does it... -# -# using .cvsignore handling makes cvschk take from 2 to 3 times -# longer to run over the same set of files. -# in my tests, disabling cvsignore altogether, cvschk takes .2 -# seconds on my working directory. Adding cvsignore,takes -# .4 seconds. -# Note that I do not use individual .cvsignore files - if there -# are a lot of them in your directory tree, it will add run time -# -# variables used for .cvsignore handling -my $initcvsignoreregex;# regex holding all startup cvsignore pattersn (no ()) -my $cvsignoreregex;# one regex holding all current cvsignore patterns -my $disable_cvsignore=0;# set to 1 to disable cvsignore emulation - # (available in case it's REALLY screwed up) -my $disable_ind_cvsignore=0;# set to 1 to disable finding .cvsignore files - # in each directory. -my $debug_cvsignore = 0; # For debugging .cvsignore problems - -my %mon; -@mon{qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)}= - 0..11; # Perl months are 0 .. 11 - -my ($version) = ('$Revision: 1.12 $ ' =~ /^\$\w+: (.*) \$ $/); -my $URL = "http://cvs.sslug.dk/cvs2html"; -my $version_line = "cvschk version $version (see $URL)\n"; - -my $opt_all; -my $restrict; -my $local; -my $tabular; - -my $opt_restrict; - -sub show_version {print $version_line} - -sub die_version {die $version_line} - -sub die_usage { - my $bundled = ($] > 5.00399 - ? "can be bundled" - : "can't be bundled, because your Perl is too old"); - die <<END_OF_USAGE; # Help in the style of GNU `ls --help' or `make --help' -Usage: $0 [OPTION]... - Show the CVS status of FILEs (the current directory by default), - traversing directories recursively and telling if new files exist - in the repository. -Options: - -a, --all Show all statistics, including the names of files that - are up to date, used tags, ignored patterns and more - -r, --restrict Don't show the names of the unknown files - (useful if you have many temporary files) - -t, --tabular Show one file per line, each preceeded with a status word, - Sorted by filename. - -l, --local Don't descend into sub-directories - -d, --debug Debug info - -h, --help Show this help end exit immediately - -V, --version Show the version line and exit immediately -The one-letter options $bundled. -END_OF_USAGE -} - -sub die_help {show_version; die_usage} - -# Let `-ar' mean `-a -r' and require `--all' (or -a) instead of `-all'. -if ($] > 5.00399) { # This requires 5.004, so silently skip it for older Perls. - eval {Getopt::Long::config("bundling")}; # avoid 5.003 compilation error - warn $@ if $@; # For Perl 5.004+ we do want to see any compilation error -} - - -GetOptions( "all|a" => \$opt_all, - "tabular|t" => \$tabular, - "restrict|r" => \$restrict, - "local|l" => \$local, - "help|h" => \&die_help, - "debug|d" => \$debug, - "version|V" => \&die_version, - ) or die_usage; - -sub cvs_changed_in_dir($); #define prototype (for recursion) - -# functions for .cvsignore handling - -# converts a given filename pattern -# (of the sort that sh(1) takes) to -# a perl regex of similar meaning. -# -# It works by doing the following: -# -# change: -# . to \. -# $ to \$ -# * to .* -# ? to . -# -sub fpat_to_regex($) -{ - my $fexp; - $fexp = shift; - $fexp =~ s/\./\\\./g;#change . to \. - $fexp =~ s/\$/\\\$/g;#change dollar sign to \dollar sign - $fexp =~ s/\*/.*/g;# change * to .* - $fexp =~ s/\?/./g; # change ? to . - return $fexp; -} - -# copy the input list to one single regex, -# items seperated by | symbols. -# return the regex string -sub do_regex_convert -{ - my $rx = ""; - my $first = 1;#true for first element only - - - # convert each element of cvsignore into a regex - # this makes the patterns usable in perl - my $cp; - foreach $cp (@_) { - if (not $first) { $rx = $rx . "|"; } - if ($first) { $first = 0; } - $rx = $rx . fpat_to_regex($cp); - } - - return $rx; -} - -# first parameter is a reference to the array -# to be loaded -# the rest of the parameters are just items -# that need to be loaded into the array. -# Note that if a ! is found, the list is -# emptied, then further items are added. -# returns true if a ! was found -sub load_list_from_list -{ - my $arref = shift;# get reference to array from front - my $item; - my $ret=0;#false means no ! found - - chomp @_;#kill newlines - foreach $item (@_) { - $item =~ s/^\s*(.*?)\s*$/$1/;#kill leading/trailing whitespace - if ($item) { # empty string is false - push @$arref,$item; - } - if ($item eq "!") { - @$arref = ();# '!' causes list to clear - $ret = 1;# ! found - } - } - - return $ret; -} - -# loads the given list with lines from the -# specified file. Note that if a '!' is found -# all prior patterns are removed from the list -# before the following patterns are loaded -# first param is the filename, -# second param is a reference to an array -# that the data is to go into -# returns true if a ! was found -sub load_list_from_file -{ - my @inlist; - my $fname = shift;#filename to read from - #if (not -e $fname) { return; } - my $arref = shift;#array to store into - open CVSIGNORE,"$fname" or return;#file might not exist, that's OK - @inlist = <CVSIGNORE>; - close CVSIGNORE; - return load_list_from_list($arref,@inlist); -} - -# loads $cvsignoreregex from -# $initcvsignoreregex and the .cvsignore file -# in the local directory -sub load_cvsignore -{ - if ($disable_ind_cvsignore) {return;}#don't look for local .cvsignore files - if ($disable_cvsignore) {return;}#don't do anything - - my $dir = shift; - my @cvsignore; - - # bang will be true if a ! was found. In such cases, I need - # to not use the pre-exisitng regex list. - my $bang = load_list_from_file("$dir/.cvsignore",\@cvsignore); - - # if we get a local cvsignore list, then... - my $rx = do_regex_convert(@cvsignore); - if ($rx) { - $cvsignoreregex = "("; - if (not $bang) {$cvsignoreregex = $cvsignoreregex . $initcvsignoreregex . "|";} - $cvsignoreregex = $cvsignoreregex . $rx . ")"; - } else { - if ($bang) {$cvsignoreregex = "";} - else {$cvsignoreregex = "(" . $initcvsignoreregex . ")";} - } - - if ($debug_cvsignore) {print $dir,":",$cvsignoreregex, "\n";} -} - - -# loads all of the cvsignore patterns that -# can be loaded at script startup -sub load_initial_cvsignore() -{ - #load the default patterns - # (taken from http://www.gnu.org/manual/cvs-1.9/html_node/cvs_141.html#IDX399) - # - # this gives you the patterns that cvs normally starts with - my @initcvsignore; - push @initcvsignore,("RCS"); - push @initcvsignore,("SCCS"); - push @initcvsignore,("CVS"); - push @initcvsignore,("CVS.adm"); - push @initcvsignore,("RCSLOG"); - push @initcvsignore,("cvslog.*"); - push @initcvsignore,("tags"); - push @initcvsignore,("TAGS"); - push @initcvsignore,(".make.state"); - push @initcvsignore,(".nse_depinfo"); - push @initcvsignore,("*~"); - push @initcvsignore,("\#*"); - push @initcvsignore,(".\#*"); - push @initcvsignore,("\,*"); - push @initcvsignore,("_\$\*"); - push @initcvsignore,("*\$"); - push @initcvsignore,("*.old"); - push @initcvsignore,("*.bak"); - push @initcvsignore,("*.BAK"); - push @initcvsignore,("*.orig"); - push @initcvsignore,("*.rej"); - push @initcvsignore,(".del-*"); - push @initcvsignore,("*.a"); - push @initcvsignore,("*.olb"); - push @initcvsignore,("*.o"); - push @initcvsignore,("*.obj"); - push @initcvsignore,("*.so"); - push @initcvsignore,("*.exe"); - push @initcvsignore,("*.Z"); - push @initcvsignore,("*.elc"); - push @initcvsignore,("*.ln"); - push @initcvsignore,("core"); - - - # now, load (in proper order!) - # each of the possible cvsignore files - - # there are 4 possible .cvsignore files: - - # $CVSROOT/CVSROOT/cvsignore - # ~/.cvsignore - # $CVSIGNORE environment variable - # .cvsignore in current directory - - # The first (CVSROOT/cvsignore) would require calling cvs, so - # we won't do that one. - # The last (.cvsignore in current directory) is done - # for each directory. It's handled in the load_cvsignore routine. - - # ~/.cvsignore - my @inlist; - my $item; - my $HOME=$ENV{"HOME"}; - if (not $HOME) {$HOME = ".";} - load_list_from_file("$HOME/.cvsignore",\@initcvsignore); - - # $CVSIGNORE environment variable - my $igstr = $ENV{"CVSIGNORE"}; # get env var - if ($igstr) { - my @iglist = split(/\s+/, $igstr); #if it exists, convert to list - load_list_from_list(\@initcvsignore,@iglist); - } - - # now that @initcvsignore is setup, - # turn it into a regex string - $initcvsignoreregex = do_regex_convert(@initcvsignore); - - # now preset the cvsignore regex string to match - # @initcvsignore. That way, if we aren't using local - # cvsignore files, we do nothing. - $cvsignoreregex = "(" . $initcvsignoreregex . ")"; -} -# routine to see if the given name is in the cvsignore regex -# returns true if it is, false if it's not -sub ignore_file($) -{ - #allow user to disable the cvsignore stuff - if ($disable_cvsignore) {return 0;} - if (not $cvsignoreregex) {return 0;}# if regex is empty, nothing matches the regex - my $filename = shift; - - if ($debug_cvsignore) {print "ignore_file:",$filename,"\n";} - - if ($filename =~ $cvsignoreregex) { - if ($debug_cvsignore) {print $filename," matches\n";} - return 1; - } - - if ($debug_cvsignore) {print $filename," doesn't match\n";} - return 0; -} - -sub cvs_changed_in_dir($) { - my $dir = shift; - - my ($line,$filename,$version,$mtime,$date, - $dir_filename,$cvstime,@subdirs, - @new_in_dir,$i); - - # Examine status of files in CVS/Entries - if(not open(ENTRIES,"$dir/CVS/Entries")) { - if ($tabular) { - push @{$files{Unknown}}, $dir; - } - else { - warn "The directory $dir is not under CVS control\n"; - } - } else { - load_cvsignore($dir);#load up proper cvsignore for given directory - - while(defined ($line=<ENTRIES>)) { - # Parse CVS/Entries-line - $line=~m!^/(.*)/(.*)/(.*)/.*/! or do { - $debug and warn("Skipping entry-line $line"); - next; - }; - ($filename,$version,$date) = ($1,$2,$3); - $dir_filename=$dir."/".$filename; - - # Mark this file as seen - $seen{$dir_filename}=1; - - # if not exists: Deleted - if(not -e $dir_filename) { - push @{$files{Deleted}}, $dir_filename; next; - } - # if dir: save name for recursion - -d $dir_filename and do { - push @subdirs, $dir_filename; next; - }; - - # modification time of $dir_filename - $mtime= (stat $dir_filename)[9]; - - - if($date eq "dummy timestamp") { - # dummy timestamp means it's new to the repository. - push @{$files{Changed}}, $dir_filename; - if ($debug) { - print "$dir_filename is changed\n"; - } - } - elsif($date eq "Result of merge") { - # result of merge means it's changed, then updated. - push @{$files{Changed}}, $dir_filename; - if ($debug) { - print "$dir_filename is changed\n"; - } - } - elsif(not - $date=~/... (...)\s+(\d+)\s+(\d+):(\d+):(\d+) (\d{4})/) - { - #bogus entry in Entires - warn "Warning: $dir_filename -> '$date' ". - "not in ctime(3) format\n"; - } else { - $cvstime=timegm($5,$4,$3,$2,$mon{$1},$6); - if($cvstime != $mtime) { - push @{$files{Changed}}, $dir_filename; - if ($debug) { - print "$dir_filename is changed\n"; - } - } else { - push @{$files{Unchanged}}, $dir_filename; - if ($debug) { - print "$dir_filename is Unchanged\n"; - } - } - } - } - close ENTRIES; - - # Locate any new files/dirs - if(not opendir(D,$dir)) { - warn("Cannot open $dir"); - @new_in_dir= (); - } else { - @skip{qw(. .. CVS)}=1..3; # Filenames that that we want to ignore - #(note: these are exact filenames) - @new_in_dir= - (grep { not $seen{$_} } # files we have not already processed - map { $dir."/".$_ } # map from file to dir/file - grep { not ignore_file($_) } # ignore files in the cvsignore list - grep { not $skip{$_} } # skip files to be ignored - readdir(D)); - closedir(D); - } - - # Remember new files (actually non-directories) - push @{$files{New}}, grep { not -d $_ } @new_in_dir; - if ($debug) { print "@{$files{New}} are new in $dir\n"; } - - # Remember new subdirs - push @subdirs, grep { -d $_ } @new_in_dir; - - # Recurse all subdirs - if (not $local) { - for $i (@subdirs) { cvs_changed_in_dir($i); } - } - } -} - -sub print_status() -{ - my $k; - my %show_these_states = ("Changed" => 1); - if(not $restrict) { - $show_these_states{"New"} = 1; - $show_these_states{"Deleted"} = 1; - } - - if($opt_all) { $show_these_states{"Unchanged"} = 1; } - - if ($tabular) { - my %allfiles; # key: filesname, value: state - my ($file, $state, $statefiles); - - $show_these_states{"Unknown"} = 1; - while (($state, $statefiles) = each %files) { - for my $f (@{$statefiles}) { - $allfiles{$f} = $state; - } - } - for $file (sort keys %allfiles) { - $state = $allfiles{$file}; - printf("%-10s %s\n", $state, $file) if $show_these_states{$state}; - } - } - else { - print "\n"; - for $k (keys %show_these_states) { - if(not $files{$k} or not @{$files{$k}}) { - # no files - $files{$k}=["(none)"]; - } - print("$k files\n", - "---------------\n", - map { "$_\n" } sort @{$files{$k}}); - print "\n"; - } - } -} - -load_initial_cvsignore(); -if ($debug_cvsignore) {print "initial regex:",$cvsignoreregex,"\n";} -cvs_changed_in_dir($startdir); -print_status(); - diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 7b3f80b5560..ef4e9552566 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -2,11 +2,13 @@ include $(top_srcdir)/ndb/config/common.mk.am ndbinclude_HEADERS = \ +ndb_init.h \ ndb_types.h \ ndb_version.h ndbapiinclude_HEADERS = \ ndbapi/ndbapi_limits.h \ +ndbapi/ndb_opt_defaults.h \ ndbapi/Ndb.hpp \ ndbapi/NdbApi.hpp \ ndbapi/NdbConnection.hpp \ @@ -29,16 +31,18 @@ ndbapi/ndberror.h mgmapiinclude_HEADERS = \ mgmapi/mgmapi.h \ -mgmapi/mgmapi_debug.h +mgmapi/mgmapi_debug.h \ +mgmapi/mgmapi_config_parameters.h \ +mgmapi/mgmapi_config_parameters_debug.h noinst_HEADERS = \ ndb_global.h \ -ndb_net.h \ -mgmapi/mgmapi_config_parameters.h \ -mgmapi/mgmapi_config_parameters_debug.h +ndb_net.h EXTRA_DIST = debugger editline kernel logger mgmcommon \ portlib transporter util dist-hook: -rm -rf `find $(distdir) -type d -name SCCS` + +windoze-dsp: diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp index 686989089ae..ddf21b79f5f 100644 --- a/ndb/include/debugger/EventLogger.hpp +++ b/ndb/include/debugger/EventLogger.hpp @@ -48,6 +48,10 @@ public: static const EventRepLogLevelMatrix matrix[]; static const Uint32 matrixSize; + static int event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity); }; /** diff --git a/ndb/include/debugger/GrepError.hpp b/ndb/include/debugger/GrepError.hpp index ab6a7b272a5..beedbd95c80 100644 --- a/ndb/include/debugger/GrepError.hpp +++ b/ndb/include/debugger/GrepError.hpp @@ -24,8 +24,8 @@ */ class GrepError { public: - enum Code { - NO_ERROR = 0, + enum GE_Code { + GE_NO_ERROR = 0, SUBSCRIPTION_ID_NOMEM = 1, SUBSCRIPTION_ID_NOT_FOUND = 2, SUBSCRIPTION_ID_NOT_UNIQUE = 3, @@ -82,12 +82,12 @@ public: }; struct ErrorDescription { - Code errCode; + GE_Code errCode; const char * name; }; static const ErrorDescription errorDescriptions[]; static const Uint32 noOfErrorDescs; - static const char * getErrorDesc(GrepError::Code err); + static const char * getErrorDesc(GrepError::GE_Code err); }; diff --git a/ndb/include/kernel/AttributeHeader.hpp b/ndb/include/kernel/AttributeHeader.hpp index b807b4ef4f1..ed9085301be 100644 --- a/ndb/include/kernel/AttributeHeader.hpp +++ b/ndb/include/kernel/AttributeHeader.hpp @@ -17,7 +17,6 @@ #ifndef ATTRIBUTE_HEADER #define ATTRIBUTE_HEADER -#include <new> /** * @class AttributeHeader * @brief Header passed in front of every attribute value in AttrInfo signal diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 467f0604edd..3c2f349e0e1 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -73,7 +73,7 @@ public: /** * Note level is valid as 0-15 */ - void setLogLevel(EventCategory ec, Uint32 level = 7); + int setLogLevel(EventCategory ec, Uint32 level = 7); /** * Get the loglevel (0-15) for a category @@ -89,7 +89,7 @@ public: return memcmp(this, &l, sizeof(* this)) == 0; } - LogLevel& operator=(const class EventSubscribeReq & req); + LogLevel& operator=(const struct EventSubscribeReq & req); private: /** @@ -119,10 +119,14 @@ LogLevel::clear(){ } inline -void +int LogLevel::setLogLevel(EventCategory ec, Uint32 level){ - assert(ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES); - logLevelData[ec] = (Uint8)level; + if (ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES) + { + logLevelData[ec] = (Uint8)level; + return 0; + } + return 1; } inline diff --git a/ndb/include/kernel/ndb_limits.h b/ndb/include/kernel/ndb_limits.h index 88fcff22da7..48a56c019bb 100644 --- a/ndb/include/kernel/ndb_limits.h +++ b/ndb/include/kernel/ndb_limits.h @@ -117,4 +117,9 @@ */ #define NDB_BLOB_HEAD_SIZE 2 /* sizeof(NdbBlob::Head) >> 2 */ +/* + * Long signals + */ +#define NDB_SECTION_SEGMENT_SZ 60 + #endif diff --git a/ndb/include/kernel/signaldata/AlterIndx.hpp b/ndb/include/kernel/signaldata/AlterIndx.hpp index 1f464ded010..f5ad835b6f3 100644 --- a/ndb/include/kernel/signaldata/AlterIndx.hpp +++ b/ndb/include/kernel/signaldata/AlterIndx.hpp @@ -181,6 +181,7 @@ public: enum ErrorCode { NoError = 0, Busy = 701, + NotMaster = 702, IndexNotFound = 4243, IndexExists = 4244, BadRequestType = 4247, @@ -200,8 +201,10 @@ private: //Uint32 m_indexVersion; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // if NotMaster + }; public: AlterIndxConf* getConf() { return &m_conf; diff --git a/ndb/include/kernel/signaldata/ArbitSignalData.hpp b/ndb/include/kernel/signaldata/ArbitSignalData.hpp index f255b8dcbbe..34b73644a13 100644 --- a/ndb/include/kernel/signaldata/ArbitSignalData.hpp +++ b/ndb/include/kernel/signaldata/ArbitSignalData.hpp @@ -94,13 +94,14 @@ public: // arbitration result LoseNodes = 41, // lose on ndb node count - WinGroups = 42, // we win, no need for arbitration - LoseGroups = 43, // we lose, missing node group - Partitioning = 44, // possible network partitioning - WinChoose = 45, // positive reply - LoseChoose = 46, // negative reply - LoseNorun = 47, // arbitrator required but not running - LoseNocfg = 48, // arbitrator required but none configured + WinNodes = 42, // win on ndb node count + WinGroups = 43, // we win, no need for arbitration + LoseGroups = 44, // we lose, missing node group + Partitioning = 45, // possible network partitioning + WinChoose = 46, // positive reply + LoseChoose = 47, // negative reply + LoseNorun = 48, // arbitrator required but not running + LoseNocfg = 49, // arbitrator required but none configured // general error codes ErrTicket = 91, // invalid arbitrator-ticket diff --git a/ndb/include/kernel/signaldata/BackupImpl.hpp b/ndb/include/kernel/signaldata/BackupImpl.hpp index 1872069daa7..2ac91570aad 100644 --- a/ndb/include/kernel/signaldata/BackupImpl.hpp +++ b/ndb/include/kernel/signaldata/BackupImpl.hpp @@ -78,15 +78,15 @@ public: STATIC_CONST( SignalLength = 3 ); enum ErrorCode { - Undefined = 200, - FailedToAllocateBuffers = 202, - FailedToSetupFsBuffers = 203, - FailedToAllocateTables = 204, - FailedInsertFileHeader = 205, - FailedInsertTableList = 206, - FailedAllocateTableMem = 207, - FailedToAllocateFileRecord = 208, - FailedToAllocateAttributeRecord = 209 + Undefined = 1340, + FailedToAllocateBuffers = 1342, + FailedToSetupFsBuffers = 1343, + FailedToAllocateTables = 1344, + FailedInsertFileHeader = 1345, + FailedInsertTableList = 1346, + FailedAllocateTableMem = 1347, + FailedToAllocateFileRecord = 1348, + FailedToAllocateAttributeRecord = 1349 }; private: Uint32 backupId; diff --git a/ndb/include/kernel/signaldata/BackupSignalData.hpp b/ndb/include/kernel/signaldata/BackupSignalData.hpp index 42eb8464d53..fb018026a49 100644 --- a/ndb/include/kernel/signaldata/BackupSignalData.hpp +++ b/ndb/include/kernel/signaldata/BackupSignalData.hpp @@ -119,12 +119,13 @@ public: private: enum ErrorCodes { - Undefined = 100, - IAmNotMaster = 101, - OutOfBackupRecord = 102, - OutOfResources = 103, - SequenceFailure = 104, - BackupDefinitionNotImplemented = 105 + Undefined = 1300, + IAmNotMaster = 1301, + OutOfBackupRecord = 1302, + OutOfResources = 1303, + SequenceFailure = 1304, + BackupDefinitionNotImplemented = 1305, + CannotBackupDiskless = 1306 }; Uint32 senderData; Uint32 errorCode; @@ -232,13 +233,13 @@ public: STATIC_CONST( SignalLength = 3 ); enum RequestType { - ClientAbort = 1, - BackupComplete = 2, - BackupFailure = 3, // General backup failure coordinator -> slave - LogBufferFull = 4, // slave -> coordinator - FileOrScanError = 5, // slave -> coordinator - BackupFailureDueToNodeFail = 6, // slave -> slave - OkToClean = 7 // master -> slave + ClientAbort = 1321, + BackupComplete = 1322, + BackupFailure = 1323, // General backup failure coordinator -> slave + LogBufferFull = 1324, // slave -> coordinator + FileOrScanError = 1325, // slave -> coordinator + BackupFailureDueToNodeFail = 1326, // slave -> slave + OkToClean = 1327 // master -> slave }; private: Uint32 requestType; diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp index 29dfaeb79a6..a6ea84c5ea0 100644 --- a/ndb/include/kernel/signaldata/BuildIndx.hpp +++ b/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -234,6 +234,7 @@ public: enum ErrorCode { NoError = 0, Busy = 701, + NotMaster = 702, BadRequestType = 4247, InvalidPrimaryTable = 4249, InvalidIndexType = 4250, @@ -241,9 +242,8 @@ public: AllocationFailure = 4252, InternalError = 4346 }; - STATIC_CONST( SignalLength = BuildIndxConf::SignalLength + 1 ); + STATIC_CONST( SignalLength = BuildIndxConf::SignalLength + 2 ); -private: //Uint32 m_userRef; //Uint32 m_connectionPtr; //Uint32 m_requestInfo; @@ -252,6 +252,7 @@ private: //Uint32 m_indexId; BuildIndxConf m_conf; Uint32 m_errorCode; + Uint32 masterNodeId; public: BuildIndxConf* getConf() { diff --git a/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp index 65a07c122a2..e911fa36ce6 100644 --- a/ndb/include/kernel/signaldata/CreateEvnt.hpp +++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp @@ -475,14 +475,14 @@ struct CreateEvntRef { } }; inline bool CreateEvntRef::isTemporary() const -{ return (errorCode & CreateEvntRef::Temporary) > 0; }; +{ return (errorCode & CreateEvntRef::Temporary) > 0; } inline void CreateEvntRef::setTemporary() -{ errorCode |= CreateEvntRef::Temporary; }; +{ errorCode |= CreateEvntRef::Temporary; } inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec) { return (CreateEvntRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); } inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec) { return (CreateEvntRef::ErrorCode) - ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }; + ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); } #endif diff --git a/ndb/include/kernel/signaldata/CreateIndx.hpp b/ndb/include/kernel/signaldata/CreateIndx.hpp index 3e277b38dea..5563f80a555 100644 --- a/ndb/include/kernel/signaldata/CreateIndx.hpp +++ b/ndb/include/kernel/signaldata/CreateIndx.hpp @@ -184,7 +184,7 @@ public: /** * CreateIndxRef. */ -class CreateIndxRef { +struct CreateIndxRef { friend bool printCREATE_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); public: @@ -210,7 +210,6 @@ public: InvalidAttributeOrder = 4255 }; -private: CreateIndxConf m_conf; //Uint32 m_userRef; //Uint32 m_connectionPtr; @@ -221,8 +220,10 @@ private: //Uint32 m_indexVersion; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // If NotMaster + }; public: CreateIndxConf* getConf() { return &m_conf; diff --git a/ndb/include/kernel/signaldata/CreateTrig.hpp b/ndb/include/kernel/signaldata/CreateTrig.hpp index a8de9e50dd4..62627256dcf 100644 --- a/ndb/include/kernel/signaldata/CreateTrig.hpp +++ b/ndb/include/kernel/signaldata/CreateTrig.hpp @@ -288,6 +288,7 @@ public: enum ErrorCode { NoError = 0, Busy = 701, + NotMaster = 702, TriggerNameTooLong = 4236, TooManyTriggers = 4237, TriggerNotFound = 4238, @@ -310,8 +311,10 @@ private: //Uint32 m_triggerInfo; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // When NotMaster + }; public: CreateTrigConf* getConf() { return &m_conf; diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 6b4a3f34553..a2f9fcc9799 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -51,7 +51,6 @@ class DictTabInfo { friend class Trix; friend class DbUtil; // API - friend class Table; friend class NdbSchemaOp; /** @@ -303,15 +302,19 @@ public: ExtBigunsigned = NdbSqlUtil::Type::Bigunsigned, ExtFloat = NdbSqlUtil::Type::Float, ExtDouble = NdbSqlUtil::Type::Double, - ExtDecimal = NdbSqlUtil::Type::Decimal, + ExtOlddecimal = NdbSqlUtil::Type::Olddecimal, + ExtOlddecimalunsigned = NdbSqlUtil::Type::Olddecimalunsigned, ExtChar = NdbSqlUtil::Type::Char, ExtVarchar = NdbSqlUtil::Type::Varchar, ExtBinary = NdbSqlUtil::Type::Binary, ExtVarbinary = NdbSqlUtil::Type::Varbinary, ExtDatetime = NdbSqlUtil::Type::Datetime, - ExtTimespec = NdbSqlUtil::Type::Timespec, + ExtDate = NdbSqlUtil::Type::Date, ExtBlob = NdbSqlUtil::Type::Blob, - ExtText = NdbSqlUtil::Type::Text + ExtText = NdbSqlUtil::Type::Text, + ExtTime = NdbSqlUtil::Type::Time, + ExtYear = NdbSqlUtil::Type::Year, + ExtTimestamp = NdbSqlUtil::Type::Timestamp }; // Attribute data interpretation @@ -409,9 +412,20 @@ public: AttributeSize = DictTabInfo::a64Bit; AttributeArraySize = AttributeExtLength; return true; - case DictTabInfo::ExtDecimal: - // not yet implemented anywhere - break; + case DictTabInfo::ExtOlddecimal: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = + (1 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) * + AttributeExtLength; + return true; + case DictTabInfo::ExtOlddecimalunsigned: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = + (0 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) * + AttributeExtLength; + return true; case DictTabInfo::ExtChar: case DictTabInfo::ExtBinary: AttributeType = DictTabInfo::StringType; @@ -429,10 +443,10 @@ public: AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 8 * AttributeExtLength; return true; - case DictTabInfo::ExtTimespec: + case DictTabInfo::ExtDate: AttributeType = DictTabInfo::StringType; AttributeSize = DictTabInfo::an8Bit; - AttributeArraySize = 12 * AttributeExtLength; + AttributeArraySize = 3 * AttributeExtLength; return true; case DictTabInfo::ExtBlob: case DictTabInfo::ExtText: @@ -441,6 +455,21 @@ public: // head + inline part [ attr precision lower half ] AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + (AttributeExtPrecision & 0xFFFF); return true; + case DictTabInfo::ExtTime: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 3 * AttributeExtLength; + return true; + case DictTabInfo::ExtYear: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 1 * AttributeExtLength; + return true; + case DictTabInfo::ExtTimestamp: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 4 * AttributeExtLength; + return true; }; return false; } diff --git a/ndb/include/kernel/signaldata/DropIndx.hpp b/ndb/include/kernel/signaldata/DropIndx.hpp index 0c0cf31aec8..fd2ea7f0b7b 100644 --- a/ndb/include/kernel/signaldata/DropIndx.hpp +++ b/ndb/include/kernel/signaldata/DropIndx.hpp @@ -160,7 +160,7 @@ public: /** * DropIndxRef. */ -class DropIndxRef { +struct DropIndxRef { friend bool printDROP_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); public: @@ -168,6 +168,7 @@ public: NoError = 0, InvalidIndexVersion = 241, Busy = 701, + NotMaster = 702, IndexNotFound = 4243, BadRequestType = 4247, InvalidName = 4248, @@ -175,7 +176,6 @@ public: }; STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 ); -private: DropIndxConf m_conf; //Uint32 m_userRef; //Uint32 m_connectionPtr; @@ -185,8 +185,10 @@ private: //Uint32 m_indexVersion; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; + }; public: DropIndxConf* getConf() { return &m_conf; diff --git a/ndb/include/kernel/signaldata/FsCloseReq.hpp b/ndb/include/kernel/signaldata/FsCloseReq.hpp index c42afa143e6..10d094fb30b 100644 --- a/ndb/include/kernel/signaldata/FsCloseReq.hpp +++ b/ndb/include/kernel/signaldata/FsCloseReq.hpp @@ -75,7 +75,7 @@ inline void FsCloseReq::setRemoveFileFlag(UintR & fileflag, bool removefile){ // ASSERT_BOOL(removefile, "FsCloseReq::setRemoveFileFlag"); - if (removefile == true) + if (removefile) fileflag = 1; else fileflag = 0; diff --git a/ndb/include/kernel/signaldata/PackedSignal.hpp b/ndb/include/kernel/signaldata/PackedSignal.hpp index 057bb39b25a..ea0ff6db526 100644 --- a/ndb/include/kernel/signaldata/PackedSignal.hpp +++ b/ndb/include/kernel/signaldata/PackedSignal.hpp @@ -38,6 +38,6 @@ class PackedSignal { }; inline -Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; }; +Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; } #endif diff --git a/ndb/include/kernel/signaldata/RepImpl.hpp b/ndb/include/kernel/signaldata/RepImpl.hpp index affffe46f9c..0de1389a4a9 100644 --- a/ndb/include/kernel/signaldata/RepImpl.hpp +++ b/ndb/include/kernel/signaldata/RepImpl.hpp @@ -93,7 +93,7 @@ public: Uint32 subscriptionId; Uint32 subscriptionKey; Uint32 senderNodeId; - GrepError::Code err; + GrepError::GE_Code err; }; class RepGetGciReq @@ -151,7 +151,7 @@ public: Uint32 lastPSGCI; Uint32 firstSSGCI; Uint32 lastSSGCI; - GrepError::Code err; + GrepError::GE_Code err; }; class RepGetGciBufferReq { @@ -213,7 +213,7 @@ public: Uint32 lastSSGCI; Uint32 currentGCIBuffer; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepInsertGciBufferReq @@ -252,7 +252,7 @@ public: Uint32 nodeGrp; Uint32 tableId; Uint32 force; - GrepError::Code err; + GrepError::GE_Code err; }; class RepInsertGciBufferConf @@ -310,7 +310,7 @@ public: Uint32 lastGCI; Uint32 currentGCI; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepClearPSGciBufferConf @@ -367,7 +367,7 @@ public: Uint32 lastGCI; Uint32 currentGCI; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepClearSSGciBufferConf diff --git a/ndb/include/kernel/signaldata/SumaImpl.hpp b/ndb/include/kernel/signaldata/SumaImpl.hpp index 089132cd9aa..89ade067dcd 100644 --- a/ndb/include/kernel/signaldata/SumaImpl.hpp +++ b/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -159,12 +159,12 @@ public: Uint32 subscriberRef; }; inline bool SubStartRef::isTemporary() const -{ return (errorCode & SubStartRef::Temporary) > 0; }; +{ return (errorCode & SubStartRef::Temporary) > 0; } inline void SubStartRef::setTemporary() -{ errorCode |= SubStartRef::Temporary; }; +{ errorCode |= SubStartRef::Temporary; } inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec) { return (SubStartRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); } class SubStartConf { /** @@ -239,12 +239,12 @@ public: }; }; inline bool SubStopRef::isTemporary() const -{ return (errorCode & SubStopRef::Temporary) > 0; }; +{ return (errorCode & SubStopRef::Temporary) > 0; } inline void SubStopRef::setTemporary() -{ errorCode |= SubStopRef::Temporary; }; +{ errorCode |= SubStopRef::Temporary; } inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec) { return (SubStopRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); } class SubStopConf { /** @@ -515,12 +515,12 @@ public: }; }; inline bool SubRemoveRef::isTemporary() const -{ return (err & SubRemoveRef::Temporary) > 0; }; +{ return (err & SubRemoveRef::Temporary) > 0; } inline void SubRemoveRef::setTemporary() -{ err |= SubRemoveRef::Temporary; }; +{ err |= SubRemoveRef::Temporary; } inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec) { return (SubRemoveRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); } class SubRemoveConf { /** diff --git a/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp index c1e861c5dff..c132b19c50a 100644 --- a/ndb/include/kernel/signaldata/TupFrag.hpp +++ b/ndb/include/kernel/signaldata/TupFrag.hpp @@ -132,9 +132,10 @@ class TupAddAttrConf { friend class Dblqh; friend class Dbtup; public: - STATIC_CONST( SignalLength = 1 ); + STATIC_CONST( SignalLength = 2 ); private: Uint32 userPtr; + Uint32 lastAttr; // bool: got last attr and closed frag op }; class TupAddAttrRef { @@ -171,9 +172,10 @@ class TuxAddAttrConf { friend class Dblqh; friend class Dbtux; public: - STATIC_CONST( SignalLength = 1 ); + STATIC_CONST( SignalLength = 2 ); private: Uint32 userPtr; + Uint32 lastAttr; // bool: got last attr and closed frag op }; class TuxAddAttrRef { diff --git a/ndb/include/kernel/signaldata/UtilLock.hpp b/ndb/include/kernel/signaldata/UtilLock.hpp index 1cac467daa0..318024fd706 100644 --- a/ndb/include/kernel/signaldata/UtilLock.hpp +++ b/ndb/include/kernel/signaldata/UtilLock.hpp @@ -39,7 +39,7 @@ public: enum RequestInfo { TryLock = 1 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -63,7 +63,7 @@ class UtilLockConf { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -95,7 +95,7 @@ public: LockAlreadyHeld = 4 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -119,7 +119,7 @@ class UtilUnlockReq { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -143,7 +143,7 @@ class UtilUnlockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -171,7 +171,7 @@ public: NoSuchLock = 1, NotLockOwner = 2 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -200,7 +200,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -229,7 +229,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -251,7 +251,7 @@ class UtilCreateLockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -275,7 +275,7 @@ class UtilDestroyLockReq { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -303,7 +303,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -325,7 +325,7 @@ class UtilDestroyLockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp index ca4bd4c0668..7df6ad864e5 100644 --- a/ndb/include/logger/LogHandler.hpp +++ b/ndb/include/logger/LogHandler.hpp @@ -19,7 +19,6 @@ #include "Logger.hpp" - /** * This class is the base class for all log handlers. A log handler is * responsible for formatting and writing log messages to a specific output. @@ -68,7 +67,8 @@ public: /** * Append a log message to the output stream/file whatever. * append() will call writeHeader(), writeMessage() and writeFooter() for - * a child class and in that order. + * a child class and in that order. Append checks for repeated messages. + * append_impl() does not check for repeats. * * @param pCategory the category/name to tag the log entry with. * @param level the log level. @@ -76,6 +76,8 @@ public: */ void append(const char* pCategory, Logger::LoggerLevel level, const char* pMsg); + void append_impl(const char* pCategory, Logger::LoggerLevel level, + const char* pMsg); /** * Returns a default formatted header. It currently has the @@ -112,14 +114,6 @@ public: void setDateTimeFormat(const char* pFormat); /** - * Returns a string date and time string. - * - * @param pStr a string. - * @return a string with date and time. - */ - char* getTimeAsString(char* pStr) const; - - /** * Returns the error code. */ int getErrorCode() const; @@ -185,6 +179,15 @@ protected: virtual void writeFooter() = 0; private: + /** + * Returns a string date and time string. + * @note does not update time, uses m_now as time + * @param pStr a string. + * @return a string with date and time. + */ + char* getTimeAsString(char* pStr) const; + time_t m_now; + /** Prohibit */ LogHandler(const LogHandler&); LogHandler* operator = (const LogHandler&); @@ -192,6 +195,14 @@ private: const char* m_pDateTimeFormat; int m_errorCode; + + // for handling repeated messages + unsigned m_count_repeated_messages; + unsigned m_max_repeat_frequency; + time_t m_last_log_time; + char m_last_category[MAX_HEADER_LENGTH]; + char m_last_message[MAX_LOG_MESSAGE_SIZE]; + Logger::LoggerLevel m_last_level; }; #endif diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp index c6145f2091a..ee762098fb6 100644 --- a/ndb/include/logger/Logger.hpp +++ b/ndb/include/logger/Logger.hpp @@ -20,6 +20,8 @@ #include <ndb_global.h> #include <BaseString.hpp> +#define MAX_LOG_MESSAGE_SIZE 1024 + class LogHandler; class LogHandlerList; @@ -101,7 +103,7 @@ public: /** The log levels. NOTE: Could not use the name LogLevel since * it caused conflicts with another class. */ - enum LoggerLevel {LL_OFF, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR, + enum LoggerLevel {LL_ON, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR, LL_CRITICAL, LL_ALERT, LL_ALL}; /** diff --git a/ndb/include/logger/SysLogHandler.hpp b/ndb/include/logger/SysLogHandler.hpp index 4f13308d61b..0dfc1cb2d43 100644 --- a/ndb/include/logger/SysLogHandler.hpp +++ b/ndb/include/logger/SysLogHandler.hpp @@ -18,7 +18,9 @@ #define SYSLOGHANDLER_H #include "LogHandler.hpp" +#ifndef NDB_WIN32 #include <syslog.h> +#endif /** * Logs messages to syslog. The default identity is 'NDB'. @@ -62,7 +64,7 @@ public: * @param pIdentity a syslog identity. * @param facility syslog facility, defaults to LOG_USER */ - SysLogHandler(const char* pIdentity, int facility = LOG_USER); + SysLogHandler(const char* pIdentity, int facility); /** * Destructor. diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 6dcf58b44e2..fa0774afa06 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -49,6 +49,7 @@ * @{ */ +#include <ndb_types.h> #include "mgmapi_config_parameters.h" #ifdef __cplusplus @@ -244,7 +245,9 @@ extern "C" { * Log severities (used to filter the cluster log) */ enum ndb_mgm_clusterlog_level { - NDB_MGM_CLUSTERLOG_OFF = 0, /*< Cluster log off*/ + NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL = -1, + /* must range from 0 and up, indexes into an array */ + NDB_MGM_CLUSTERLOG_ON = 0, /*< Cluster log on*/ NDB_MGM_CLUSTERLOG_DEBUG = 1, /*< Used in NDB Cluster *< developement */ @@ -264,7 +267,8 @@ extern "C" { *< corrected immediately, *< such as a corrupted system */ - NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities on*/ + /* must be next number, works as bound in loop */ + NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities */ }; /** @@ -356,11 +360,28 @@ extern "C" { /** * Create a handle to a management server * - * @return A management handle<br> - * or NULL if no management handle could be created. + * @return A management handle<br> + * or NULL if no management handle could be created. */ NdbMgmHandle ndb_mgm_create_handle(); + /** + * Set connecst string to management server + * + * @param handle Management handle + * @param connect_string Connect string to the management server, + * + * @return -1 on error. + */ + int ndb_mgm_set_connectstring(NdbMgmHandle handle, + const char *connect_string); + + int ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid); + int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle); + int ndb_mgm_get_connected_port(NdbMgmHandle handle); + const char *ndb_mgm_get_connected_host(NdbMgmHandle handle); + const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz); + /** * Destroy a management server handle * @@ -378,11 +399,10 @@ extern "C" { * Connect to a management server * * @param handle Management handle. - * @param mgmsrv Hostname and port of the management server, - * "hostname:port". * @return -1 on error. */ - int ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv); + int ndb_mgm_connect(NdbMgmHandle handle, int no_retries, + int retry_delay_in_seconds, int verbose); /** * Disconnect from a management server @@ -565,11 +585,13 @@ extern "C" { * * @param handle NDB management handle. * @param level A cluster log level to filter. + * @param enable set 1=enable 0=disable * @param reply Reply message. * @return -1 on error. */ int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, enum ndb_mgm_clusterlog_level level, + int enable, struct ndb_mgm_reply* reply); /** @@ -605,6 +627,11 @@ extern "C" { int level, struct ndb_mgm_reply* reply); + ndb_mgm_clusterlog_level + ndb_mgm_match_clusterlog_level(const char * name); + const char * + ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level); + /** * Set log category and levels for the Node * @@ -641,11 +668,15 @@ extern "C" { * Start backup * * @param handle NDB management handle. + * @param wait_completed 0=don't wait for confirmation + 1=wait for backup started + 2=wait for backup completed * @param backup_id Backup id is returned from function. * @param reply Reply message. * @return -1 on error. */ - int ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* backup_id, + int ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, + unsigned int* backup_id, struct ndb_mgm_reply* reply); /** @@ -709,9 +740,7 @@ extern "C" { void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *); int ndb_mgm_alloc_nodeid(NdbMgmHandle handle, - unsigned version, - unsigned *pnodeid, - int nodetype); + unsigned version, int nodetype); /** * Config iterator */ @@ -730,9 +759,11 @@ extern "C" { int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*, int param, unsigned * value); int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*, - int param, unsigned long long * value); + int param, Uint64 * value); int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*, int param, const char ** value); + int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **); + int ndb_mgm_check_connection(NdbMgmHandle handle); #ifdef __cplusplus } #endif diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 6a0cd376355..8a04ee2fe37 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -110,6 +110,7 @@ #define CFG_CONNECTION_SERVER_PORT 406 #define CFG_CONNECTION_HOSTNAME_1 407 #define CFG_CONNECTION_HOSTNAME_2 408 +#define CFG_CONNECTION_GROUP 409 #define CFG_TCP_SERVER 452 #define CFG_TCP_SEND_BUFFER_SIZE 454 @@ -120,6 +121,7 @@ #define CFG_SHM_CHECKSUM 501 #define CFG_SHM_KEY 502 #define CFG_SHM_BUFFER_MEM 503 +#define CFG_SHM_SIGNUM 504 #define CFG_SCI_HOST1_ID_0 550 #define CFG_SCI_HOST1_ID_1 551 diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp index 6c32255e921..be6d656e1a5 100644 --- a/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -20,7 +20,6 @@ #include <ndb_types.h> #include <mgmapi.h> #include <BaseString.hpp> -#include <LocalConfig.hpp> /** * @class ConfigRetriever @@ -28,10 +27,11 @@ */ class ConfigRetriever { public: - ConfigRetriever(LocalConfig &local_config, Uint32 version, Uint32 nodeType); + ConfigRetriever(const char * _connect_string, + Uint32 version, Uint32 nodeType); ~ConfigRetriever(); - int do_connect(int exit_on_connect_failure= false); + int do_connect(int no_retries, int retry_delay_in_seconds, int verbose); /** * Get configuration for current node. @@ -46,12 +46,16 @@ public: */ struct ndb_mgm_configuration * getConfig(); + void resetError(); + int hasError(); const char * getErrorString(); /** * @return Node id of this node (as stated in local config or connectString) */ - Uint32 allocNodeId(); + Uint32 allocNodeId(int no_retries, int retry_delay_in_seconds); + + int setNodeId(Uint32 nodeid); /** * Get config using socket @@ -68,22 +72,27 @@ public: */ bool verifyConfig(const struct ndb_mgm_configuration *, Uint32 nodeid); - Uint32 get_mgmd_port() const {return m_mgmd_port;}; - const char *get_mgmd_host() const {return m_mgmd_host;}; + Uint32 get_mgmd_port() const; + const char *get_mgmd_host() const; + const char *get_connectstring(char *buf, int buf_sz) const; + + Uint32 get_configuration_nodeid() const; private: BaseString errorString; enum ErrorType { - CR_ERROR = 0, - CR_RETRY = 1 + CR_NO_ERROR = 0, + CR_ERROR = 1, + CR_RETRY = 2 }; ErrorType latestErrorType; void setError(ErrorType, const char * errorMsg); - struct LocalConfig& _localConfig; - Uint32 _ownNodeId; + Uint32 _ownNodeId; + /* Uint32 m_mgmd_port; const char *m_mgmd_host; + */ Uint32 m_version; Uint32 m_node_type; diff --git a/ndb/include/mgmcommon/IPCConfig.hpp b/ndb/include/mgmcommon/IPCConfig.hpp index ebe65b53b59..1e23cdf9807 100644 --- a/ndb/include/mgmcommon/IPCConfig.hpp +++ b/ndb/include/mgmcommon/IPCConfig.hpp @@ -59,7 +59,7 @@ public: void print() const { props->print(); } static Uint32 configureTransporters(Uint32 nodeId, - const class ndb_mgm_configuration &, + const struct ndb_mgm_configuration &, class TransporterRegistry &); private: diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h deleted file mode 100644 index 09559f6ddff..00000000000 --- a/ndb/include/ndb_global.h +++ /dev/null @@ -1,115 +0,0 @@ - -#ifndef NDBGLOBAL_H -#define NDBGLOBAL_H - -#include <my_global.h> - -/** signal & SIG_PIPE */ -#include <my_alarm.h> - -#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) -#define NDB_WIN32 -#else -#undef NDB_WIN32 -#endif - -#ifdef _AIX -#undef _H_STRINGS -#endif -#include <m_string.h> -#include <m_ctype.h> -#include <ndb_types.h> -#include <ctype.h> -#ifdef HAVE_STDARG_H -#include <stdarg.h> -#endif -#ifdef TIME_WITH_SYS_TIME -#include <time.h> -#endif -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#endif -#include <sys/param.h> -#ifdef HAVE_SYS_STAT_H - #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE) - #undef _INCLUDE_AES_SOURCE - #include <sys/stat.h> - #define _INCLUDE_AES_SOURCE - #else - #include <sys/stat.h> - #endif -#endif -#include <sys/resource.h> -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif -#ifdef HAVE_SYS_MMAN_H -#include <sys/mman.h> -#endif - -#ifdef NDB_WIN32 -#include <winsock2.h> -#include <ws2tcpip.h> - -#define DIR_SEPARATOR "\\" -#define PATH_MAX 256 - -#pragma warning(disable: 4503 4786) -#else - -#define DIR_SEPARATOR "/" - -#endif - -static const char table_name_separator = '/'; - -#if defined(_AIX) || defined(NDB_VC98) -#define STATIC_CONST(x) enum { x } -#else -#define STATIC_CONST(x) static const Uint32 x -#endif - -#ifdef __cplusplus -#include <new> -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include <assert.h> - -/* call in main() - does not return on error */ -extern int ndb_init(void); -extern void ndb_end(int); - -#ifndef HAVE_STRDUP -extern char * strdup(const char *s); -#endif - -#ifndef HAVE_STRLCPY -extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); -#endif - -#ifndef HAVE_STRLCAT -extern size_t strlcat (char *dst, const char *src, size_t dst_sz); -#endif - -#ifndef HAVE_STRCASECMP -extern int strcasecmp(const char *s1, const char *s2); -extern int strncasecmp(const char *s1, const char *s2, size_t n); -#endif - -#ifdef SCO - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - -#endif /* SCO */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in new file mode 100644 index 00000000000..eadd5e37b9b --- /dev/null +++ b/ndb/include/ndb_global.h.in @@ -0,0 +1,162 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef NDBGLOBAL_H +#define NDBGLOBAL_H + +#include <ndb_types.h> + +#define NDB_PORT "@ndb_port@" +#define NDB_TCP_BASE_PORT "@ndb_port_base@" + +#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) +#define NDB_WIN32 +#include <winsock2.h> +#define PATH_MAX 256 +#define DIR_SEPARATOR "\\" +#define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster" +#define HAVE_STRCASECMP +#define strcasecmp _strcmpi +#pragma warning(disable: 4503 4786) +typedef unsigned __int64 Uint64; +typedef signed __int64 Int64; +#else +#undef NDB_WIN32 +#define DIR_SEPARATOR "/" +typedef unsigned long long Uint64; +typedef signed long long Int64; +#endif + +#include <my_global.h> + +typedef signed char Int8; +typedef unsigned char Uint8; +typedef signed short Int16; +typedef unsigned short Uint16; +typedef signed int Int32; +typedef unsigned int Uint32; + +typedef unsigned int UintR; + +#ifdef __SIZE_TYPE__ +typedef __SIZE_TYPE__ UintPtr; +#elif SIZEOF_CHARP == 4 +typedef Uint32 UintPtr; +#elif SIZEOF_CHARP == 8 +typedef Uint64 UintPtr; +#else +#error "Unknown size of (char *)" +#endif + +#if ! (SIZEOF_CHAR == 1) +#error "Invalid define for Uint8" +#endif + +#if ! (SIZEOF_INT == 4) +#error "Invalid define for Uint32" +#endif + +#if ! (SIZEOF_LONG_LONG == 8) +#error "Invalid define for Uint64" +#endif + +#include <my_alarm.h> + +#ifdef _AIX +#undef _H_STRINGS +#endif +#include <m_string.h> +#include <m_ctype.h> +#include <ctype.h> + +#ifdef HAVE_STDARG_H +#include <stdarg.h> +#endif + +#ifdef TIME_WITH_SYS_TIME +#include <time.h> +#endif + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif + +#ifdef HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif + +#ifdef HAVE_SYS_STAT_H + #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE) + #undef _INCLUDE_AES_SOURCE + #include <sys/stat.h> + #define _INCLUDE_AES_SOURCE + #else + #include <sys/stat.h> + #endif +#endif + +#ifdef HAVE_SYS_RESOURCE_H +#include <sys/resource.h> +#endif + +#ifdef HAVE_SYS_WAIT_H +#include <sys/wait.h> +#endif + +#ifdef HAVE_SYS_MMAN_H +#include <sys/mman.h> +#endif + +#ifndef HAVE_STRDUP +extern char * strdup(const char *s); +#endif + +#ifndef HAVE_STRCASECMP +extern int strcasecmp(const char *s1, const char *s2); +extern int strncasecmp(const char *s1, const char *s2, size_t n); +#endif + +static const char table_name_separator = '/'; + +#if defined(_AIX) || defined(WIN32) || defined(NDB_VC98) +#define STATIC_CONST(x) enum { x } +#else +#define STATIC_CONST(x) static const Uint32 x +#endif + +#ifdef __cplusplus +inline void* operator new(size_t, void* __p) { return __p; } +inline void* operator new[](size_t, void* __p) { return __p; } +extern "C" { +#endif + +#include <assert.h> + +#ifdef __cplusplus +} +#endif + +#include "ndb_init.h" + +#ifdef SCO + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +#endif /* SCO */ + +#endif diff --git a/ndb/include/ndb_init.h b/ndb/include/ndb_init.h new file mode 100644 index 00000000000..0ff53e6a2af --- /dev/null +++ b/ndb/include/ndb_init.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2003 MySQL 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 */ + + +#ifndef NDB_INIT_H +#define NDB_INIT_H + +#ifdef __cplusplus +extern "C" { +#endif +/* call in main() - does not return on error */ +extern int ndb_init(void); +extern void ndb_end(int); +#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index a2988dbae78..6cf9bb40d7f 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -21,34 +21,6 @@ #ifndef NDB_TYPES_H #define NDB_TYPES_H -typedef char Int8; -typedef unsigned char Uint8; -typedef short Int16; -typedef unsigned short Uint16; -typedef int Int32; -typedef unsigned int Uint32; - -typedef unsigned int UintR; - -#ifdef __SIZE_TYPE__ -typedef __SIZE_TYPE__ UintPtr; -#else -#include <ndb_global.h> -#ifdef HAVE_STDINT_H -#include <stdint.h> -#endif -#ifdef HAVE_INTTYPES_H -#include <inttypes.h> -#endif -typedef uintptr_t UintPtr; -#endif - -#if defined(WIN32) || defined(NDB_WIN32) -typedef unsigned __int64 Uint64; -typedef __int64 Int64; -#else -typedef unsigned long long Uint64; -typedef long long Int64; -#endif +#include "ndb_global.h" #endif diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h.in index 56362020ebf..d7f43eae40a 100644 --- a/ndb/include/ndb_version.h +++ b/ndb/include/ndb_version.h.in @@ -20,14 +20,25 @@ #include <ndb_global.h> #include <version.h> +/* NDB build version */ +#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@ + +/* NDB major version */ +#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@ + +/* NDB minor version */ +#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@ + +/* NDB status version */ +#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@" + + #define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) #define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) #define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS)) -#define NDB_VERSION_TAG_STRING "$Name: $" - #define NDB_VERSION ndbGetOwnVersion() /** diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 5ec09269695..766409d64e2 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -901,23 +901,6 @@ typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*); NDB_MAX_SCHEMA_NAME_SIZE + \ NDB_MAX_TAB_NAME_SIZE*2 -#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL -class NdbWaiter { -public: - NdbWaiter(); - ~NdbWaiter(); - - void wait(int waitTime); - void nodeFail(Uint32 node); - void signal(Uint32 state); - - Uint32 m_node; - Uint32 m_state; - void * m_mutex; - struct NdbCondition * m_condition; -}; -#endif - /** * @class Ndb * @brief Represents the NDB kernel and is the main class of the NDB API. @@ -1199,39 +1182,6 @@ public: const char * keyData = 0, Uint32 keyLen = 0); -#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL - /** - * This method is a modification of Ndb::startTransaction, - * in which we use only the first two chars of keyData to - * select transaction coordinator. - * This is referred to as a distribution group. - * There are two ways to use the method: - * - In the first, the two characters are used directly as - * the distribution key, and - * - in the second the distribution is calculated as: - * (10 * (char[0] - 0x30) + (char[1] - 0x30)). - * Thus, in the second way, the two ASCII digits '78' - * will provide the distribution key = 78. - * - * @note Transaction priorities are not yet supported. - * - * @param aPrio Priority of the transaction.<br> - * Priority 0 is the highest priority and is used for short transactions - * with requirements on low delay.<br> - * Priority 1 is a medium priority for short transactions.<br> - * Priority 2 is a medium priority for long transactions.<br> - * Priority 3 is a low priority for long transactions. - * @param keyData is a string of which the two first characters - * is used to compute which fragement the data is stored in. - * @param type is the type of distribution group.<br> - * 0 means direct usage of the two characters, and<br> - * 1 means the ASCII digit variant. - * @return NdbConnection, or NULL if it failed. - */ - NdbConnection* startTransactionDGroup(Uint32 aPrio, - const char * keyData, int type); -#endif - /** * When a transactions is completed, the transaction has to be closed. * @@ -1586,9 +1536,6 @@ private: /****************************************************************************** * These are the private variables in this class. *****************************************************************************/ - NdbObjectIdMap* theNdbObjectIdMap; - Ndb_cluster_connection *m_ndb_cluster_connection; - NdbConnection** thePreparedTransactionsArray; NdbConnection** theSentTransactionsArray; NdbConnection** theCompletedTransactionsArray; @@ -1602,8 +1549,6 @@ private: Uint32 theNextConnectNode; - NdbWaiter theWaiter; - bool fullyQualifiedNames; // Ndb database name. @@ -1637,10 +1582,6 @@ private: Uint32 theMyRef; // My block reference Uint32 theNode; // The node number of our node - Uint32 theNoOfDBnodes; // The number of DB nodes - Uint32 * theDBnodes; // The node number of the DB nodes - Uint8 *the_release_ind;// 1 indicates to release all connections to node - Uint64 the_last_check_time; Uint64 theFirstTransId; @@ -1663,39 +1604,6 @@ private: InitConfigError } theInitState; - // Ensure good distribution of connects - Uint32 theCurrentConnectIndex; - Uint32 theCurrentConnectCounter; - - /** - * Computes fragement id for primary key - * - * Note that keydata has to be "shaped" as it is being sent in KEYINFO - */ - Uint32 computeFragmentId(const char * keyData, Uint32 keyLen); - Uint32 getFragmentId(Uint32 hashValue); - - /** - * Make a guess to which node is the primary for the fragment - */ - Uint32 guessPrimaryNode(Uint32 fragmentId); - - /** - * Structure containing values for guessing primary node - */ - struct StartTransactionNodeSelectionData { - StartTransactionNodeSelectionData(): - fragment2PrimaryNodeMap(0) {}; - Uint32 kValue; - Uint32 hashValueMask; - Uint32 hashpointerValue; - Uint32 noOfFragments; - Uint32 * fragment2PrimaryNodeMap; - - void init(Uint32 noOfNodes, Uint32 nodeIds[]); - void release(); - } startTransactionNodeSelectionData; - NdbApiSignal* theCommitAckSignal; diff --git a/ndb/include/ndbapi/NdbApi.hpp b/ndb/include/ndbapi/NdbApi.hpp index add733cccd7..ae7025f560a 100644 --- a/ndb/include/ndbapi/NdbApi.hpp +++ b/ndb/include/ndbapi/NdbApi.hpp @@ -17,6 +17,8 @@ #ifndef NdbApi_H #define NdbApi_H +#include "ndb_init.h" +#include "ndb_cluster_connection.hpp" #include "ndbapi_limits.h" #include "Ndb.hpp" #include "NdbConnection.hpp" diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp index 5df61a0806c..b145c69b04b 100644 --- a/ndb/include/ndbapi/NdbBlob.hpp +++ b/ndb/include/ndbapi/NdbBlob.hpp @@ -36,7 +36,7 @@ class NdbColumnImpl; * Blob data is stored in 2 places: * * - "header" and "inline bytes" stored in the blob attribute - * - "blob parts" stored in a separate table NDB$BLOB_<t>_<v>_<c> + * - "blob parts" stored in a separate table NDB$BLOB_<tid>_<cid> * * Inline and part sizes can be set via NdbDictionary::Column methods * when the table is created. @@ -74,23 +74,21 @@ class NdbColumnImpl; * NdbBlob methods return -1 on error and 0 on success, and use output * parameters when necessary. * - * Notes: - * - table and its blob part tables are not created atomically - * - scan must use the "new" interface NdbScanOperation - * - to update a blob in a read op requires exclusive tuple lock - * - update op in scan must do its own getBlobHandle - * - delete creates implicit, not-accessible blob handles - * - NdbOperation::writeTuple does not support blobs - * - there is no support for an asynchronous interface + * Operation types: + * - insertTuple must use setValue if blob column is non-nullable + * - readTuple with exclusive lock can also update existing value + * - updateTuple can overwrite with setValue or update existing value + * - writeTuple always overwrites and must use setValue if non-nullable + * - deleteTuple creates implicit non-accessible blob handles + * - scan with exclusive lock can also update existing value + * - scan "lock takeover" update op must do its own getBlobHandle * * Bugs / limitations: - * - scan must use exclusive locking for now - * - * Todo: - * - add scan method hold-read-lock + return-keyinfo - * - check keyinfo length when setting keys - * - check allowed blob ops vs locking mode - * - overload control (too many pending ops) + * - lock mode upgrade should be handled automatically + * - lock mode vs allowed operation is not checked + * - too many pending blob ops can blow up i/o buffers + * - table and its blob part tables are not created atomically + * - there is no support for an asynchronous interface */ class NdbBlob { public: @@ -173,46 +171,23 @@ public: */ int readData(void* data, Uint32& bytes); /** - * Read at given position. Does not use or update current position. - */ - int readData(Uint64 pos, void* data, Uint32& bytes); - /** * Write at current position and set new position to first byte after * the data written. A write past blob end extends the blob value. */ int writeData(const void* data, Uint32 bytes); /** - * Write at given position. Does not use or update current position. - */ - int writeData(Uint64 pos, const void* data, Uint32 bytes); - /** * Return the blob column. */ const NdbDictionary::Column* getColumn(); /** * Get blob parts table name. Useful only to test programs. */ - STATIC_CONST( BlobTableNameSize = 40 ); static int getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName); /** * Return error object. The error may be blob specific (below) or may * be copied from a failed implicit operation. */ const NdbError& getNdbError() const; - // "Invalid blob attributes or invalid blob parts table" - STATIC_CONST( ErrTable = 4263 ); - // "Invalid usage of blob attribute" - STATIC_CONST( ErrUsage = 4264 ); - // "Method is not valid in current blob state" - STATIC_CONST( ErrState = 4265 ); - // "Invalid blob seek position" - STATIC_CONST( ErrSeek = 4266 ); - // "Corrupted blob value" - STATIC_CONST( ErrCorrupt = 4267 ); - // "Error in blob head update forced rollback of transaction" - STATIC_CONST( ErrAbort = 4268 ); - // "Unknown blob error" - STATIC_CONST( ErrUnknown = 4269 ); /** * Return info about all blobs in this operation. */ @@ -266,14 +241,17 @@ private: Buf(); ~Buf(); void alloc(unsigned n); + void copyfrom(const Buf& src); }; Buf theKeyBuf; Buf theAccessKeyBuf; Buf theHeadInlineBuf; + Buf theHeadInlineCopyBuf; // for writeTuple Buf thePartBuf; Head* theHead; char* theInlineData; NdbRecAttr* theHeadInlineRecAttr; + NdbOperation* theHeadInlineReadOp; bool theHeadInlineUpdateFlag; // length and read/write position int theNullFlag; @@ -294,6 +272,7 @@ private: bool isReadOp(); bool isInsertOp(); bool isUpdateOp(); + bool isWriteOp(); bool isDeleteOp(); bool isScanOp(); // computations @@ -309,12 +288,13 @@ private: void getHeadFromRecAttr(); int setHeadInlineValue(NdbOperation* anOp); // data operations - int readDataPrivate(Uint64 pos, char* buf, Uint32& bytes); - int writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes); + int readDataPrivate(char* buf, Uint32& bytes); + int writeDataPrivate(const char* buf, Uint32 bytes); int readParts(char* buf, Uint32 part, Uint32 count); int insertParts(const char* buf, Uint32 part, Uint32 count); int updateParts(const char* buf, Uint32 part, Uint32 count); int deleteParts(Uint32 part, Uint32 count); + int deletePartsUnknown(Uint32 part); // pending ops int executePendingBlobReads(); int executePendingBlobWrites(); diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index 92b940e96f7..53830dd93c5 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -50,7 +50,7 @@ enum AbortOption { TryCommit = 0, ///< <i>Missing explanation</i> #endif AbortOnError = 0, ///< Abort transaction on failed operation - IgnoreError = 2 ///< Transaction continues on failed operation + AO_IgnoreError = 2 ///< Transaction continues on failed operation }; typedef AbortOption CommitType; @@ -526,7 +526,7 @@ private: int sendCOMMIT(); // Send a TC_COMMITREQ signal; void setGCI(int GCI); // Set the global checkpoint identity - int OpCompleteFailure(Uint8 abortoption); + int OpCompleteFailure(Uint8 abortoption, bool setFailure = true); int OpCompleteSuccess(); void CompletedOperations(); // Move active ops to list of completed @@ -552,7 +552,7 @@ private: void setOperationErrorCode(int anErrorCode); // Indicate something went wrong in the definition phase - void setOperationErrorCodeAbort(int anErrorCode); + void setOperationErrorCodeAbort(int anErrorCode, int abortOption = -1); int checkMagicNumber(); // Verify correct object NdbOperation* getNdbOperation(const class NdbTableImpl* aTable, @@ -607,8 +607,8 @@ private: NdbOperation* theLastExecOpInList; // Last executing operation in list. - NdbOperation* theCompletedFirstOp; // First operation in completed - // operation list. + NdbOperation* theCompletedFirstOp; // First & last operation in completed + NdbOperation* theCompletedLastOp; // operation list. Uint32 theNoOfOpSent; // How many operations have been sent Uint32 theNoOfOpCompleted; // How many operations have completed @@ -687,6 +687,8 @@ private: void remove_list(NdbOperation*& head, NdbOperation*); void define_scan_op(NdbIndexScanOperation*); + + friend class HugoOperations; }; inline diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 51a6895648f..6aa675a2319 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -141,9 +141,9 @@ public: enum FragmentType { FragUndefined = 0, ///< Fragmentation type undefined or default FragSingle = 1, ///< Only one fragment - FragAllSmall = 2, ///< One fragment per node group - FragAllMedium = 3, ///< Default value. Two fragments per node group. - FragAllLarge = 4 ///< Eight fragments per node group. + FragAllSmall = 2, ///< One fragment per node, default + FragAllMedium = 3, ///< two fragments per node + FragAllLarge = 4 ///< Four fragments per node. }; }; @@ -179,15 +179,19 @@ public: Bigunsigned, ///< 64 Bit. 8 byte signed integer, can be used in array Float, ///< 32-bit float. 4 bytes float, can be used in array Double, ///< 64-bit float. 8 byte float, can be used in array - Decimal, ///< Precision, Scale are applicable + Olddecimal, ///< MySQL < 5.0 signed decimal, Precision, Scale Char, ///< Len. A fixed array of 1-byte chars Varchar, ///< Max len Binary, ///< Len Varbinary, ///< Max len Datetime, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes ) - Timespec, ///< Precision down to 1 nsec(sizeof(Datetime) == 12 bytes ) + Date, ///< Precision down to 1 day(sizeof(Date) == 4 bytes ) Blob, ///< Binary large object (see NdbBlob) - Text ///< Text blob + Text, ///< Text blob + Time = 25, ///< Time without date + Year = 26, ///< Year 1901-2155 (1 byte) + Timestamp = 27, ///< Unix time + Olddecimalunsigned = 28 }; /** @@ -273,25 +277,25 @@ public: /** * Set precision of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ void setPrecision(int); /** * Get precision of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ int getPrecision() const; /** * Set scale of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ void setScale(int); /** * Get scale of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ int getScale() const; @@ -369,7 +373,7 @@ public: */ bool getDistributionKey() const; /** @} *******************************************************************/ - + #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL void setTupleKey(bool); bool getTupleKey() const; @@ -490,6 +494,18 @@ public: * Get column definition via index in table. * @return null if none existing name */ + Column* getColumn(const int attributeId); + + /** + * Get column definition via name. + * @return null if none existing name + */ + Column* getColumn(const char * name); + + /** + * Get column definition via index in table. + * @return null if none existing name + */ const Column* getColumn(const int attributeId) const; /** @} *******************************************************************/ @@ -698,7 +714,7 @@ public: /** * Get a specific column in the index */ - const NdbDictionary::Column * getColumn(unsigned no) const ; + const Column * getColumn(unsigned no) const ; /** * Get a specific column name in the index @@ -970,13 +986,6 @@ public: */ const Table * getTable(const char * name); - /** - * Get table with given name for alteration. - * @param name Name of table to alter - * @return table if successful. NULL if undefined - */ - Table getTableForAlteration(const char * name); - #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** * Invalidate cached table object diff --git a/ndb/include/ndbapi/NdbIndexOperation.hpp b/ndb/include/ndbapi/NdbIndexOperation.hpp index 7612fe54d1b..1472f1b249e 100644 --- a/ndb/include/ndbapi/NdbIndexOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexOperation.hpp @@ -49,6 +49,9 @@ public: * @{ */ + /** insert is not allowed */ + int insertTuple(); + /** * Define the NdbIndexOperation to be a standard operation of type readTuple. * When calling NdbConnection::execute, this operation @@ -193,6 +196,7 @@ private: // Private attributes const NdbIndexImpl* m_theIndex; + const NdbTableImpl* m_thePrimaryTable; Uint32 m_theIndexDefined[NDB_MAX_ATTRIBUTES_IN_INDEX][3]; Uint32 m_theIndexLen; // Length of the index in words Uint32 m_theNoOfIndexDefined; // The number of index attributes diff --git a/ndb/include/ndbapi/NdbIndexScanOperation.hpp b/ndb/include/ndbapi/NdbIndexScanOperation.hpp index 66b3fc9d43b..a3388f62f58 100644 --- a/ndb/include/ndbapi/NdbIndexScanOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexScanOperation.hpp @@ -113,7 +113,7 @@ public: * Reset bounds and put operation in list that will be * sent on next execute */ - int reset_bounds(); + int reset_bounds(bool forceSend = false); bool getSorted() const { return m_ordered; } private: @@ -127,8 +127,8 @@ private: virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char*); void fix_get_values(); - int next_result_ordered(bool fetchAllowed); - int send_next_scan_ordered(Uint32 idx); + int next_result_ordered(bool fetchAllowed, bool forceSend = false); + int send_next_scan_ordered(Uint32 idx, bool forceSend = false); int compare(Uint32 key, Uint32 cols, const NdbReceiver*, const NdbReceiver*); Uint32 m_sort_columns; diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index 8e0294e41e6..46d4ddab0f5 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -918,6 +918,13 @@ protected: // Blobs in this operation NdbBlob* theBlobList; + /* + * Abort option per operation, used by blobs. Default -1. If set, + * overrides abort option on connection level. If set to IgnoreError, + * does not cause execute() to return failure. This is different from + * IgnoreError on connection level. + */ + Int8 m_abortOption; }; #ifdef NDB_NO_DROPPED_SIGNAL @@ -1160,5 +1167,3 @@ NdbOperation::setValue(Uint32 anAttrId, double aPar) } #endif - - diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index da03df13027..05635a99385 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -301,13 +301,6 @@ NdbRecAttr::arraySize() const } inline -Int64 -NdbRecAttr::int64_value() const -{ - return *(Int64*)theRef; -} - -inline Int32 NdbRecAttr::int32_value() const { @@ -329,13 +322,6 @@ NdbRecAttr::char_value() const } inline -Uint64 -NdbRecAttr::u_64_value() const -{ - return *(Uint64*)theRef; -} - -inline Uint32 NdbRecAttr::u_32_value() const { @@ -357,20 +343,6 @@ NdbRecAttr::u_char_value() const } inline -float -NdbRecAttr::float_value() const -{ - return *(float*)theRef; -} - -inline -double -NdbRecAttr::double_value() const -{ - return *(double*)theRef; -} - -inline void NdbRecAttr::release() { diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index b95313db274..af624f69bd3 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -19,7 +19,6 @@ #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface #include <ndb_types.h> -#include <ndb_global.h> class Ndb; class NdbConnection; @@ -131,7 +130,9 @@ int NdbReceiver::execTCOPCONF(Uint32 len){ Uint32 tmp = m_received_result_length; m_expected_result_length = len; +#ifdef assert assert(!(tmp && !len)); +#endif return ((bool)len ^ (bool)tmp ? 0 : 1); } diff --git a/ndb/include/ndbapi/NdbResultSet.hpp b/ndb/include/ndbapi/NdbResultSet.hpp index 478daf8aad2..dc0288a380c 100644 --- a/ndb/include/ndbapi/NdbResultSet.hpp +++ b/ndb/include/ndbapi/NdbResultSet.hpp @@ -89,17 +89,17 @@ public: * - 1: if there are no more tuples to scan. * - 2: if there are no more cached records in NdbApi */ - int nextResult(bool fetchAllowed = true); + int nextResult(bool fetchAllowed = true, bool forceSend = false); /** * Close result set (scan) */ - void close(); + void close(bool forceSend = false); /** * Restart */ - int restart(); + int restart(bool forceSend = false); /** * Transfer scan operation to an updating transaction. Use this function diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index 2e4d173ac75..f25f9405033 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -90,11 +90,11 @@ protected: NdbScanOperation(Ndb* aNdb); virtual ~NdbScanOperation(); - int nextResult(bool fetchAllowed = true); + int nextResult(bool fetchAllowed = true, bool forceSend = false); virtual void release(); - void closeScan(); - int close_impl(class TransporterFacade*); + void closeScan(bool forceSend = false); + int close_impl(class TransporterFacade*, bool forceSend = false); // Overloaded methods from NdbCursorOperation int executeCursor(int ProcessorId); @@ -103,6 +103,7 @@ protected: int init(const NdbTableImpl* tab, NdbConnection* myConnection); int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId); int doSend(int ProcessorId); + void checkForceSend(bool forceSend); virtual void setErrorCode(int aErrorCode); virtual void setErrorCodeAbort(int aErrorCode); @@ -127,18 +128,27 @@ protected: NdbReceiver** m_receivers; // All receivers Uint32* m_prepared_receivers; // These are to be sent - + + /** + * owned by API/user thread + */ Uint32 m_current_api_receiver; Uint32 m_api_receivers_count; NdbReceiver** m_api_receivers; // These are currently used by api + /** + * owned by receiver thread + */ Uint32 m_conf_receivers_count; // NOTE needs mutex to access NdbReceiver** m_conf_receivers; // receive thread puts them here + /** + * owned by receiver thread + */ Uint32 m_sent_receivers_count; // NOTE needs mutex to access NdbReceiver** m_sent_receivers; // receive thread puts them here - int send_next_scan(Uint32 cnt, bool close); + int send_next_scan(Uint32 cnt, bool close, bool forceSend = false); void receiver_delivered(NdbReceiver*); void receiver_completed(NdbReceiver*); void execCLOSE_SCAN_REP(); @@ -148,7 +158,7 @@ protected: Uint32 m_ordered; - int restart(); + int restart(bool forceSend = false); }; inline diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index f8e6f25ce73..0e559700716 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -18,30 +18,79 @@ #ifndef CLUSTER_CONNECTION_HPP #define CLUSTER_CONNECTION_HPP -class TransporterFacade; -class LocalConfig; -class ConfigRetriever; -class NdbThread; - -extern "C" { - void* run_ndb_cluster_connection_connect_thread(void*); -} - +/** + * @class Ndb_cluster_connection + * @brief Represents a connection to a cluster of storage nodes + * + * Always start your application program by creating a + * Ndb_cluster_connection object. Your application should contain + * only one Ndb_cluster_connection. Your application connects to + * a cluster management server when method connect() is called. + * With the method wait_until_ready() it is possible to wait + * for the connection to one or several storage nodes. + */ class Ndb_cluster_connection { public: + /** + * Create a connection to a cluster of storage nodes + * + * @param specify the connectstring for where to find the + * management server + */ Ndb_cluster_connection(const char * connect_string = 0); ~Ndb_cluster_connection(); - int connect(int reconnect= 0); + + /** + * Connect to a cluster management server + * + * @param no_retries specifies the number of retries to perform + * if the connect fails, negative number results in infinite + * number of retries + * @param retry_delay_in_seconds specifies how often retries should + * be performed + * @param verbose specifies if the method should print progess + * + * @return 0 if success, + * 1 if retriable error, + * -1 if non-retriable error + */ + int connect(int no_retries=0, int retry_delay_in_seconds=1, int verbose=0); + +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL int start_connect_thread(int (*connect_callback)(void)= 0); +#endif + + /** + * Wait until one or several storage nodes are connected + * + * @param time_out_for_first_alive number of seconds to wait until + * first alive node is detected + * @param timeout_after_first_alive number of seconds to wait after + * first alive node is detected + * + * @return 0 all nodes alive, + * > 0 at least one node alive, + * < 0 error + */ + int wait_until_ready(int timeout_for_first_alive, + int timeout_after_first_alive); + +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + const char *get_connectstring(char *buf, int buf_sz) const; + int get_connected_port() const; + const char *get_connected_host() const; + + void set_optimized_node_selection(int val); + + unsigned no_db_nodes(); +#endif + private: - friend void* run_ndb_cluster_connection_connect_thread(void*); - void connect_thread(); - char *m_connect_string; - TransporterFacade *m_facade; - LocalConfig *m_local_config; - ConfigRetriever *m_config_retriever; - NdbThread *m_connect_thread; - int (*m_connect_callback)(void); + friend class Ndb; + friend class NdbImpl; + friend class Ndb_cluster_connection_impl; + class Ndb_cluster_connection_impl & m_impl; + Ndb_cluster_connection(Ndb_cluster_connection_impl&); }; #endif diff --git a/ndb/src/common/editline/unix.h b/ndb/include/ndbapi/ndb_opt_defaults.h index 37f461b471d..63b673ed60d 100644 --- a/ndb/src/common/editline/unix.h +++ b/ndb/include/ndbapi/ndb_opt_defaults.h @@ -14,12 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Revision: 1.3 $ -** -** Editline system header file for Unix. -*/ +#ifndef NDB_OPT_DEFAULTS_H +#define NDB_OPT_DEFAULTS_H -#define CRLF "\r\n" +#ifdef SIGRTMIN +#define OPT_NDB_SHM_SIGNUM_DEFAULT SIGRTMIN+2 +#else +#define OPT_NDB_SHM_SIGNUM_DEFAULT 0 +#endif +#define OPT_NDB_SHM_DEFAULT 0 -#include <ndb_global.h> -#include <dirent.h> +#endif diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index 1cf2d9b342d..d1cb135b39d 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -22,12 +22,13 @@ #define NDB_MAX_DATABASE_NAME_SIZE 128 #define NDB_MAX_SCHEMA_NAME_SIZE 128 #define NDB_MAX_TAB_NAME_SIZE 128 -#define NDB_MAX_ATTRIBUTES_IN_TABLE 91 +#define NDB_MAX_ATTR_NAME_SIZE 32 +#define NDB_MAX_ATTRIBUTES_IN_TABLE 128 -#define NDB_MAX_TUPLE_SIZE_IN_WORDS 1023 +#define NDB_MAX_TUPLE_SIZE_IN_WORDS 2013 #define NDB_MAX_KEYSIZE_IN_WORDS 1023 -#define NDB_MAX_KEY_SIZE NDB_MAX_KEYSIZE_IN_WORDS*sizeof(Uint32) -#define NDB_MAX_TUPLE_SIZE NDB_MAX_TUPLE_SIZE_IN_WORDS*sizeof(uint32) +#define NDB_MAX_KEY_SIZE (NDB_MAX_KEYSIZE_IN_WORDS*4) +#define NDB_MAX_TUPLE_SIZE (NDB_MAX_TUPLE_SIZE_IN_WORDS*4) #define NDB_MAX_ACTIVE_EVENTS 100 #endif diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h index 5c2d85b82a6..ceb1881a4cc 100644 --- a/ndb/include/ndbapi/ndberror.h +++ b/ndb/include/ndbapi/ndberror.h @@ -46,7 +46,8 @@ typedef enum ndberror_cl_internal_error = 12, ndberror_cl_function_not_implemented = 13, ndberror_cl_unknown_error_code = 14, - ndberror_cl_node_shutdown = 15 + ndberror_cl_node_shutdown = 15, + ndberror_cl_configuration = 16 } ndberror_classification_enum; diff --git a/ndb/include/mgmcommon/NdbConfig.h b/ndb/include/portlib/NdbConfig.h index 1bca825ab8d..1bca825ab8d 100644 --- a/ndb/include/mgmcommon/NdbConfig.h +++ b/ndb/include/portlib/NdbConfig.h diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 4dc8435eef1..8138a2ef354 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -40,7 +40,7 @@ typedef int socklen_t; #define InetErrno (* inet_errno()) -#elif NDB_WIN32 +#elif defined NDB_WIN32 /** * Include files needed diff --git a/ndb/include/portlib/NdbThread.h b/ndb/include/portlib/NdbThread.h index 212f7de9384..e86deee4354 100644 --- a/ndb/include/portlib/NdbThread.h +++ b/ndb/include/portlib/NdbThread.h @@ -76,7 +76,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status); * * * status: exit code */ -void NdbThread_Exit(int status); +void NdbThread_Exit(void *status); /** * Set thread concurrency level diff --git a/ndb/include/portlib/PortDefs.h b/ndb/include/portlib/PortDefs.h index b61bb627e65..a115c60cfe1 100644 --- a/ndb/include/portlib/PortDefs.h +++ b/ndb/include/portlib/PortDefs.h @@ -22,55 +22,12 @@ $Id: PortDefs.h,v 1.5 2003/10/07 07:59:59 mikael Exp $ */ -#ifdef NDB_WIN32 -#include <time.h> - - -struct tms -{ - time_t tms_utime; /* user time */ - time_t tms_stime; /* system time */ - time_t tms_cutime; /* user time of children */ - time_t tms_cstime; /* system time of children */ -}; - -struct timespec -{ - long tv_sec; /* Seconds */ - long tv_nsec; /* Nanoseconds */ -}; - -#define strcasecmp(a,b) _strcmpi(a,b) - -/* Exports a WIN32 getopt function */ -extern int optind; -extern char *optarg; -int getopt(int, char **, char *opts); -#endif /* NDB_WIN32 */ #ifdef NDB_ALPHA #ifdef NDB_GCC /* only for NDB_ALPHA */ extern int gnuShouldNotUseRPCC(); #define RPCC() gnuShouldNotUseRPCC(); #else -#ifdef NDB_WIN32 -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - u_int64 __asm(char *, ...); - double __dasm(char *, ...); - float __fasm(char *, ...); - void _AcquireSpinLock(long *); - void _ReleaseSpinLock(long *); - int __ADD_ATOMIC_LONG2(void *, int); -#ifdef __cplusplus -}; -#endif /* __cplusplus */ -#pragma intrinsic (__asm, __dasm, __fasm) -#pragma intrinsic(_ReleaseSpinLock, _AcquireSpinLock) -#pragma intrinsic(__ADD_ATOMIC_LONG2) -#endif /* NDB_WIN32 */ - #define RPCC() ((int)__asm(" rpcc v0;")) #define MB() __asm(" mb;"); #define WMB() __asm(" wmb;"); diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp index a8da8068552..d4763ba4c37 100644 --- a/ndb/include/transporter/TransporterDefinitions.hpp +++ b/ndb/include/transporter/TransporterDefinitions.hpp @@ -68,6 +68,8 @@ struct TCP_TransporterConfiguration { */ struct SHM_TransporterConfiguration { Uint32 port; + const char *remoteHostName; + const char *localHostName; NodeId remoteNodeId; NodeId localNodeId; bool checksum; @@ -75,6 +77,7 @@ struct SHM_TransporterConfiguration { Uint32 shmKey; Uint32 shmSize; + int signum; }; /** diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index ac6291f9e57..7487d6b1e80 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -87,6 +87,7 @@ public: */ class TransporterRegistry { friend class OSE_Receiver; + friend class SHM_Transporter; friend class Transporter; friend class TransporterService; public: @@ -98,7 +99,12 @@ public: unsigned sizeOfLongSignalMemory = 100); bool init(NodeId localNodeId); - + + /** + * after a connect from client, perform connection using correct transporter + */ + bool connect_server(NDB_SOCKET_TYPE sockfd); + /** * Remove all transporters */ @@ -224,7 +230,7 @@ public: const char *m_interface; }; Vector<Transporter_interface> m_transporter_interface; - void add_transporter_interface(const char *interface, unsigned short port); + void add_transporter_interface(const char *interf, unsigned short port); protected: private: @@ -312,6 +318,8 @@ private: Uint32 poll_TCP(Uint32 timeOutMillis); Uint32 poll_SCI(Uint32 timeOutMillis); Uint32 poll_SHM(Uint32 timeOutMillis); + + int m_shm_own_pid; }; #endif // Define of TransporterRegistry_H diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index 066a24f294e..02a6a3b3e66 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -48,10 +48,10 @@ public: bool empty() const; /** @brief Convert to uppercase */ - void ndb_toupper(); + BaseString& ndb_toupper(); /** @brief Convert to lowercase */ - void ndb_tolower(); + BaseString& ndb_tolower(); /** @brief Assigns from a char * */ BaseString& assign(const char* s); @@ -206,16 +206,18 @@ BaseString::empty() const return m_len == 0; } -inline void +inline BaseString& BaseString::ndb_toupper() { for(unsigned i = 0; i < length(); i++) m_chr[i] = toupper(m_chr[i]); + return *this; } -inline void +inline BaseString& BaseString::ndb_tolower() { for(unsigned i = 0; i < length(); i++) m_chr[i] = tolower(m_chr[i]); + return *this; } inline bool diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index bb217adab5f..19aa604e4a1 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -105,6 +105,11 @@ public: static void bitXOR(unsigned size, Uint32 data[], const Uint32 data2[]); /** + * bitXORC - Bitwise (x ^ ~y) into first operand. + */ + static void bitXORC(unsigned size, Uint32 data[], const Uint32 data2[]); + + /** * contains - Check if all bits set in data2 are set in data */ static bool contains(unsigned size, Uint32 data[], const Uint32 data2[]); @@ -261,6 +266,14 @@ BitmaskImpl::bitXOR(unsigned size, Uint32 data[], const Uint32 data2[]) } } +inline void +BitmaskImpl::bitXORC(unsigned size, Uint32 data[], const Uint32 data2[]) +{ + for (unsigned i = 0; i < size; i++) { + data[i] ^= ~data2[i]; + } +} + inline bool BitmaskImpl::contains(unsigned size, Uint32 data[], const Uint32 data2[]) { @@ -452,6 +465,12 @@ public: BitmaskPOD<size>& bitXOR(const BitmaskPOD<size>& mask2); /** + * bitXORC - Bitwise (x ^ ~y) into first operand. + */ + static void bitXORC(Uint32 data[], const Uint32 data2[]); + BitmaskPOD<size>& bitXORC(const BitmaskPOD<size>& mask2); + + /** * contains - Check if all bits set in data2 (that) are also set in data (this) */ static bool contains(Uint32 data[], const Uint32 data2[]); @@ -713,6 +732,21 @@ BitmaskPOD<size>::bitXOR(const BitmaskPOD<size>& mask2) } template <unsigned size> +inline void +BitmaskPOD<size>::bitXORC(Uint32 data[], const Uint32 data2[]) +{ + BitmaskImpl::bitXORC(size,data, data2); +} + +template <unsigned size> +inline BitmaskPOD<size>& +BitmaskPOD<size>::bitXORC(const BitmaskPOD<size>& mask2) +{ + BitmaskPOD<size>::bitXORC(rep.data, mask2.rep.data); + return *this; +} + +template <unsigned size> char * BitmaskPOD<size>::getText(const Uint32 data[], char* buf) { diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index 3062d1e4e1b..5b27bd4e0c4 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -75,15 +75,19 @@ public: Bigunsigned, // 64 Bit Float, // 32-bit float Double, // 64-bit float - Decimal, // Precision, Scale + Olddecimal, // Precision, Scale Char, // Len Varchar, // Max len Binary, // Len Varbinary, // Max len Datetime, // Precision down to 1 sec (size 8 bytes) - Timespec, // Precision down to 1 nsec (size 12 bytes) + Date, // Precision down to 1 day (size 4 bytes) Blob, // Blob - Text // Text blob + Text, // Text blob + Time = 25, // Time without date + Year = 26, // Year (size 1 byte) + Timestamp = 27, // Unix seconds (uint32) + Olddecimalunsigned = 28 }; Enum m_typeId; Cmp* m_cmp; // comparison method @@ -106,6 +110,11 @@ public: static bool usable_in_hash_index(Uint32 typeId, const void* cs); static bool usable_in_ordered_index(Uint32 typeId, const void* cs); + /** + * Compare decimal numbers. + */ + static int cmp_olddecimal(const uchar* s1, const uchar* s2, unsigned n); + private: /** * List of all types. Must match Type::Enum. @@ -126,15 +135,19 @@ private: static Cmp cmpBigunsigned; static Cmp cmpFloat; static Cmp cmpDouble; - static Cmp cmpDecimal; + static Cmp cmpOlddecimal; static Cmp cmpChar; static Cmp cmpVarchar; static Cmp cmpBinary; static Cmp cmpVarbinary; static Cmp cmpDatetime; - static Cmp cmpTimespec; + static Cmp cmpDate; static Cmp cmpBlob; static Cmp cmpText; + static Cmp cmpTime; + static Cmp cmpYear; + static Cmp cmpTimestamp; + static Cmp cmpOlddecimalunsigned; }; #endif diff --git a/ndb/include/util/Parser.hpp b/ndb/include/util/Parser.hpp index 65cf24db633..c117498e1ba 100644 --- a/ndb/include/util/Parser.hpp +++ b/ndb/include/util/Parser.hpp @@ -23,7 +23,7 @@ #include "NdbOut.hpp" class ParserImpl; -template<class T> class ParserRow; +template<class T> struct ParserRow; //#define PARSER_DEBUG #ifdef PARSER_DEBUG @@ -130,11 +130,11 @@ public: * The void* equivalent implementation */ class ParserImpl { +public: class Dummy {}; typedef ParserRow<Dummy> DummyRow; typedef Parser<Dummy>::Context Context; - template<class T> friend class Parser; -private: + ParserImpl(const DummyRow rows[], class InputStream & in, bool b_cmd, bool b_empty, bool b_iarg); diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp index d5ebb16bb09..356f3406f38 100644 --- a/ndb/include/util/SimpleProperties.hpp +++ b/ndb/include/util/SimpleProperties.hpp @@ -38,20 +38,20 @@ public: /** * Value types */ - enum ValueType { + enum ValueType { Uint32Value = 0, StringValue = 1, BinaryValue = 2, InvalidValue = 3 - }; - + }; + /** * Struct for defining mapping to be used with unpack */ struct SP2StructMapping { Uint16 Key; Uint32 Offset; - SimpleProperties::ValueType Type; + ValueType Type; Uint32 minValue; Uint32 maxValue; Uint32 Length_Offset; // Offset used for looking up length of @@ -233,7 +233,7 @@ private: */ class SimplePropertiesSectionReader : public SimpleProperties::Reader { public: - SimplePropertiesSectionReader(class SegmentedSectionPtr &, + SimplePropertiesSectionReader(struct SegmentedSectionPtr &, class SectionSegmentPool &); virtual void reset(); @@ -248,8 +248,8 @@ private: Uint32 m_pos; Uint32 m_len; class SectionSegmentPool & m_pool; - class SectionSegment * m_head; - class SectionSegment * m_currentSegment; + struct SectionSegment * m_head; + struct SectionSegment * m_currentSegment; }; inline @@ -275,15 +275,15 @@ public: /** * This "unlinks" the writer from the memory */ - void getPtr(class SegmentedSectionPtr & dst); + void getPtr(struct SegmentedSectionPtr & dst); private: Int32 m_pos; Uint32 m_sz; class SectionSegmentPool & m_pool; - class SectionSegment * m_head; + struct SectionSegment * m_head; Uint32 m_prevPtrI; // Prev to m_currentSegment - class SectionSegment * m_currentSegment; + struct SectionSegment * m_currentSegment; }; #endif diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp index 3860b9ca84b..9d8af204391 100644 --- a/ndb/include/util/SocketServer.hpp +++ b/ndb/include/util/SocketServer.hpp @@ -37,7 +37,7 @@ public: public: virtual ~Session() {} virtual void runSession(){} - virtual void stopSession(){} + virtual void stopSession(){ m_stop = true; } protected: friend class SocketServer; friend void* sessionThread_C(void*); @@ -98,6 +98,8 @@ public: */ void stopSessions(bool wait = false); + void foreachSession(void (*f)(Session*, void*), void *data); + private: struct SessionInstance { Service * m_service; diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h new file mode 100644 index 00000000000..aa7a02f58ae --- /dev/null +++ b/ndb/include/util/ndb_opts.h @@ -0,0 +1,117 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef _NDB_OPTS_H +#define _NDB_OPTS_H + +#include <ndb_global.h> +#include <my_sys.h> +#include <my_getopt.h> +#include <mysql_version.h> +#include <ndb_version.h> +#include <ndb_opt_defaults.h> + +#define NDB_STD_OPTS_VARS \ +const char *opt_connect_str= 0;\ +my_bool opt_ndb_optimized_node_selection + +my_bool opt_ndb_shm; + +#define OPT_NDB_CONNECTSTRING 'c' + +#define NDB_STD_OPTS_COMMON \ + { "usage", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "help", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "version", 'V', "Output version information and exit.", 0, 0, 0, \ + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ + "Set connect string for connecting to ndb_mgmd. " \ + "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \ + "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ + { "ndb-shm", OPT_NDB_SHM,\ + "Allow optimizing using shared memory connections when available",\ + (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, 0,\ + GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\ + {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\ + "Select nodes for transactions in a more optimal way",\ + (gptr*) &opt_ndb_optimized_node_selection,\ + (gptr*) &opt_ndb_optimized_node_selection, 0,\ + GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\ + { "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } + +#ifndef DBUG_OFF +#define NDB_STD_OPTS(prog_name) \ + { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \ + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \ + NDB_STD_OPTS_COMMON +#else +#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON +#endif + +static void ndb_std_print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n", + MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} + +static void usage(); + +enum ndb_std_options { + OPT_NDB_SHM= 256, + OPT_NDB_SHM_SIGNUM, + OPT_NDB_OPTIMIZED_NODE_SELECTION, + NDB_STD_OPTIONS_LAST /* should always be last in this enum */ +}; + +static my_bool +ndb_std_get_one_option(int optid, + const struct my_option *opt __attribute__((unused)), + const char *argument) +{ + switch (optid) { + case '#': + if (argument) + { + DBUG_PUSH(argument); + } + break; + case 'V': + ndb_std_print_version(); + exit(0); + case '?': + usage(); + exit(0); + case OPT_NDB_SHM: + if (opt_ndb_shm) + { +#ifndef NDB_SHM_TRANSPORTER + printf("Warning: binary not compiled with shared memory support,\n" + "Tcp connections will now be used instead\n"); + opt_ndb_shm= 0; +#endif + } + break; + } + return 0; +} + +#endif /*_NDB_OPTS_H */ diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index bed43438e91..eb1cf1c6543 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -11,8 +11,23 @@ libndbclient_la_LIBADD = \ common/transporter/libtransporter.la \ common/debugger/libtrace.la \ common/debugger/signaldata/libsignaldataprint.la \ - common/mgmcommon/libmgmsrvcommon.la \ mgmapi/libmgmapi.la \ + common/mgmcommon/libmgmsrvcommon.la \ common/logger/liblogger.la \ common/portlib/libportlib.la \ common/util/libgeneral.la + +windoze-dsp: libndbclient.dsp + +libndbclient.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndblib_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ dummy.cpp + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(libndbclient_la_LIBADD) + @touch dummy.cpp diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am index 7fcf2cab636..0059f3fb210 100644 --- a/ndb/src/common/Makefile.am +++ b/ndb/src/common/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = portlib debugger util logger transporter mgmcommon editline +SUBDIRS = portlib debugger util logger transporter mgmcommon noinst_LTLIBRARIES = libcommon.la @@ -11,3 +11,5 @@ libcommon_la_LIBADD = \ portlib/libportlib.la \ logger/liblogger.la \ util/libgeneral.la + +windoze-dsp: diff --git a/ndb/src/common/Makefile_old b/ndb/src/common/Makefile_old deleted file mode 100644 index ebde75bf3ec..00000000000 --- a/ndb/src/common/Makefile_old +++ /dev/null @@ -1,15 +0,0 @@ -include .defs.mk - -LIB_DIRS := \ - portlib \ - debugger \ - util \ - logger - -ifneq ($(USE_EDITLINE), N) -LIB_DIRS += editline -endif - -DIRS := transporter mgmcommon - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 8a09be9a0a7..97945394690 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -421,6 +421,11 @@ EventLogger::getText(char * m_text, size_t m_text_len, "%sArbitration check lost - less than 1/2 nodes left", theNodeId); break; + case ArbitCode::WinNodes: + BaseString::snprintf(m_text, m_text_len, + "%sArbitration check won - all node groups and more than 1/2 nodes left", + theNodeId); + break; case ArbitCode::WinGroups: BaseString::snprintf(m_text, m_text_len, "%sArbitration check won - node group majority", @@ -1028,7 +1033,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, "Grep::SSCoord:Error code: %d Error message: %s" " (subId=%d,SubKey=%d)", err, - GrepError::getErrorDesc((GrepError::Code)err), + GrepError::getErrorDesc((GrepError::GE_Code)err), subId, subKey); break; @@ -1045,7 +1050,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubStartMetaRef: @@ -1061,7 +1066,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubStartDataRef: @@ -1076,7 +1081,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubSyncMetaRef: @@ -1091,7 +1096,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubSyncDataRef: @@ -1108,7 +1113,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subKey, gci, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubRemoveRef: @@ -1123,7 +1128,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err) + GrepError::getErrorDesc((GrepError::GE_Code)err) ); break; } @@ -1137,7 +1142,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, "Grep::PSCoord: Error code: %d Error Message: %s" " (subId=%d,SubKey=%d)", err, - GrepError::getErrorDesc((GrepError::Code)err), + GrepError::getErrorDesc((GrepError::GE_Code)err), subId, subKey); break; @@ -1154,7 +1159,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubStartMetaRef: @@ -1170,7 +1175,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubStartDataRef: @@ -1185,7 +1190,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubSyncMetaRef: @@ -1200,7 +1205,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubSyncDataRef: @@ -1217,7 +1222,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subKey, gci, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubRemoveRef: @@ -1232,7 +1237,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::Rep_Disconnect: @@ -1244,7 +1249,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, " Error code: %d Error Message: %s", nodeId, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } @@ -1275,10 +1280,10 @@ EventLogger::getText(char * m_text, size_t m_text_len, case EventReport::BackupCompleted: BaseString::snprintf(m_text, m_text_len, - "%sBackup %d started from node %d completed\n" - " StartGCP: %d StopGCP: %d\n" - " #Records: %d #LogRecords: %d\n" - " Data: %d bytes Log: %d bytes", + "%sBackup %u started from node %u completed\n" + " StartGCP: %u StopGCP: %u\n" + " #Records: %u #LogRecords: %u\n" + " Data: %u bytes Log: %u bytes", theNodeId, theData[2], refToNode(theData[1]), theData[3], theData[4], theData[6], theData[8], theData[5], theData[7]); @@ -1337,27 +1342,41 @@ operator<<(NdbOut& out, const LogLevel & ll) return out; } -void -EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId, - const LogLevel* ll) +int +EventLoggerBase::event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity) { - Uint32 threshold = 0; - Logger::LoggerLevel severity = Logger::LL_WARNING; - LogLevel::EventCategory cat= LogLevel::llInvalid; - for(unsigned i = 0; i<EventLoggerBase::matrixSize; i++){ if(EventLoggerBase::matrix[i].eventType == eventType){ cat = EventLoggerBase::matrix[i].eventCategory; threshold = EventLoggerBase::matrix[i].threshold; severity = EventLoggerBase::matrix[i].severity; - break; + return 0; } } + return 1; +} + +void +EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId, + const LogLevel* ll) +{ + Uint32 threshold = 0; + Logger::LoggerLevel severity = Logger::LL_WARNING; + LogLevel::EventCategory cat= LogLevel::llInvalid; + + DBUG_ENTER("EventLogger::log"); + DBUG_PRINT("enter",("eventType=%d, nodeid=%d", eventType, nodeId)); - if (cat == LogLevel::llInvalid) - return; + if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity)) + DBUG_VOID_RETURN; Uint32 set = ll?ll->getLogLevel(cat) : m_logLevel.getLogLevel(cat); + DBUG_PRINT("info",("threshold=%d, set=%d", threshold, set)); + if (ll) + DBUG_PRINT("info",("m_logLevel.getLogLevel=%d", m_logLevel.getLogLevel(cat))); if (threshold <= set){ switch (severity){ case Logger::LL_ALERT: @@ -1396,6 +1415,7 @@ EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId, break; } } // if (.. + DBUG_VOID_RETURN; } int diff --git a/ndb/src/common/debugger/GrepError.cpp b/ndb/src/common/debugger/GrepError.cpp index ec0c26a5855..20aeaa6dd77 100644 --- a/ndb/src/common/debugger/GrepError.cpp +++ b/ndb/src/common/debugger/GrepError.cpp @@ -21,7 +21,7 @@ */ const GrepError::ErrorDescription GrepError::errorDescriptions[] = { - { GrepError::NO_ERROR, + { GrepError::GE_NO_ERROR, "No error" }, { GrepError::SUBSCRIPTION_ID_NOMEM, "Not enough resources to allocate the subscription" }, @@ -119,7 +119,7 @@ GrepError::noOfErrorDescs = sizeof(GrepError::errorDescriptions) / * gets the corresponding error message to an err code */ const char * -GrepError::getErrorDesc(GrepError::Code err) { +GrepError::getErrorDesc(GrepError::GE_Code err) { for(Uint32 i = 0; i<noOfErrorDescs; i++){ if(err == errorDescriptions[i].errCode){ diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am index d0fb30717cd..e25a11c9bee 100644 --- a/ndb/src/common/debugger/Makefile.am +++ b/ndb/src/common/debugger/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtrace.dsp + +libtrace.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtrace_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/debugger/Makefile_old b/ndb/src/common/debugger/Makefile_old deleted file mode 100644 index ac3a4475a54..00000000000 --- a/ndb/src/common/debugger/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel -DIRS := signaldata - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := trace - -SOURCES = SignalLoggerManager.cpp DebuggerNames.cpp BlockNames.cpp LogLevel.cpp EventLogger.cpp GrepError.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp index 7e7bf87e2db..c6165532ddb 100644 --- a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp +++ b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp @@ -152,4 +152,4 @@ DictTabInfo::Attribute::init(){ AttributeExtLength = 0, AttributeAutoIncrement = false; memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0; -}; +} diff --git a/ndb/src/common/debugger/signaldata/FsCloseReq.cpp b/ndb/src/common/debugger/signaldata/FsCloseReq.cpp index 143250b7db1..df9f3cc9fbc 100644 --- a/ndb/src/common/debugger/signaldata/FsCloseReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsCloseReq.cpp @@ -31,7 +31,7 @@ printFSCLOSEREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv sig->userReference); fprintf(output, " Flags: H\'%.8x, ", sig->fileFlag); - if (sig->getRemoveFileFlag(sig->fileFlag) == true) + if (sig->getRemoveFileFlag(sig->fileFlag)) fprintf(output, "Remove file"); else fprintf(output, "Don't remove file"); diff --git a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp index 9b32fab87ba..a9f240d3cb4 100644 --- a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp @@ -31,7 +31,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData, fprintf(output, " UserReference: H\'%.8x", sig->userReference); fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag); - if (sig->getSyncFlag(sig->operationFlag) == true) + if (sig->getSyncFlag(sig->operationFlag)) fprintf(output, "Sync,"); else fprintf(output, "No sync,"); diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am index c855c5f8a18..9146d552568 100644 --- a/ndb/src/common/debugger/signaldata/Makefile.am +++ b/ndb/src/common/debugger/signaldata/Makefile.am @@ -32,3 +32,16 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% +windoze-dsp: libsignaldataprint.dsp + +libsignaldataprint.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/debugger/signaldata/Makefile_old b/ndb/src/common/debugger/signaldata/Makefile_old deleted file mode 100644 index bd00667b482..00000000000 --- a/ndb/src/common/debugger/signaldata/Makefile_old +++ /dev/null @@ -1,33 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := signaldataprint - -SOURCES = TcKeyReq.cpp TcKeyConf.cpp TcKeyRef.cpp \ - TcRollbackRep.cpp \ - TupKey.cpp TupCommit.cpp LqhKey.cpp \ - FsOpenReq.cpp FsCloseReq.cpp FsRef.cpp FsConf.cpp FsReadWriteReq.cpp\ - SignalDataPrint.cpp SignalNames.cpp \ - ContinueB.cpp DihContinueB.cpp NdbfsContinueB.cpp \ - CloseComReqConf.cpp PackedSignal.cpp PrepFailReqRef.cpp \ - GCPSave.cpp DictTabInfo.cpp \ - AlterTable.cpp AlterTab.cpp \ - CreateTrig.cpp AlterTrig.cpp DropTrig.cpp \ - FireTrigOrd.cpp TrigAttrInfo.cpp \ - CreateIndx.cpp AlterIndx.cpp DropIndx.cpp TcIndx.cpp \ - IndxKeyInfo.cpp IndxAttrInfo.cpp \ - FsAppendReq.cpp ScanTab.cpp \ - BackupImpl.cpp BackupSignalData.cpp \ - UtilSequence.cpp UtilPrepare.cpp UtilDelete.cpp UtilExecute.cpp \ - LqhFrag.cpp DropTab.cpp PrepDropTab.cpp LCP.cpp MasterLCP.cpp \ - CopyGCI.cpp SystemError.cpp StartRec.cpp NFCompleteRep.cpp \ - FailRep.cpp DisconnectRep.cpp SignalDroppedRep.cpp \ - SumaImpl.cpp NdbSttor.cpp CreateFragmentation.cpp \ - CntrStart.cpp ReadNodesConf.cpp \ - UtilLock.cpp TuxMaint.cpp TupAccess.cpp AccLock.cpp \ - LqhTrans.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp index 20f7ea99871..f2d6f2f104a 100644 --- a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp +++ b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp @@ -41,4 +41,4 @@ printNF_COMPLETE_REP(FILE * output, sig->from); return true; -}; +} diff --git a/ndb/src/common/debugger/signaldata/ScanTab.cpp b/ndb/src/common/debugger/signaldata/ScanTab.cpp index 72a4d9f94b9..0755ee0a856 100644 --- a/ndb/src/common/debugger/signaldata/ScanTab.cpp +++ b/ndb/src/common/debugger/signaldata/ScanTab.cpp @@ -30,13 +30,14 @@ printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv fprintf(output, " apiConnectPtr: H\'%.8x", sig->apiConnectPtr); fprintf(output, " requestInfo: H\'%.8x:\n", requestInfo); - fprintf(output, " Parallellism: %u, Batch: %u LockMode: %u, Keyinfo: %u Holdlock: %u, RangeScan: %u\n", + fprintf(output, " Parallellism: %u, Batch: %u LockMode: %u, Keyinfo: %u Holdlock: %u, RangeScan: %u ReadCommitted: %u\n", sig->getParallelism(requestInfo), sig->getScanBatch(requestInfo), sig->getLockMode(requestInfo), + sig->getKeyinfoFlag(requestInfo), sig->getHoldLockFlag(requestInfo), sig->getRangeScanFlag(requestInfo), - sig->getKeyinfoFlag(requestInfo)); + sig->getReadCommittedFlag(requestInfo)); Uint32 keyLen = (sig->attrLenKeyLen >> 16); Uint32 attrLen = (sig->attrLenKeyLen & 0xFFFF); diff --git a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp index 3314f0bd097..a4cee38e06f 100644 --- a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp +++ b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp @@ -16,65 +16,9 @@ -#include "GlobalSignalNumbers.h" -#include "signaldata/SignalDataPrint.hpp" -#include "signaldata/TcKeyReq.hpp" -#include "signaldata/TcKeyConf.hpp" -#include "signaldata/TcKeyRef.hpp" -#include "signaldata/LqhKey.hpp" -#include "signaldata/TupKey.hpp" -#include "signaldata/TupCommit.hpp" -#include "signaldata/FsOpenReq.hpp" -#include "signaldata/FsCloseReq.hpp" -#include "signaldata/FsReadWriteReq.hpp" -#include "signaldata/FsRef.hpp" -#include "signaldata/FsConf.hpp" -#include "signaldata/CloseComReqConf.hpp" -#include "signaldata/PackedSignal.hpp" -#include "signaldata/PrepFailReqRef.hpp" -#include "signaldata/DictTabInfo.hpp" -#include "signaldata/AlterTable.hpp" -#include "signaldata/AlterTab.hpp" -#include "signaldata/CreateTrig.hpp" -#include "signaldata/AlterTrig.hpp" -#include "signaldata/DropTrig.hpp" -#include "signaldata/FireTrigOrd.hpp" -#include "signaldata/TrigAttrInfo.hpp" -#include "signaldata/CreateIndx.hpp" -#include "signaldata/AlterIndx.hpp" -#include "signaldata/DropIndx.hpp" -#include "signaldata/TcIndx.hpp" -#include "signaldata/IndxKeyInfo.hpp" -#include "signaldata/IndxAttrInfo.hpp" -#include <signaldata/FsAppendReq.hpp> -#include <signaldata/BackupSignalData.hpp> -#include <signaldata/BackupImpl.hpp> -#include <signaldata/UtilSequence.hpp> -#include <signaldata/UtilPrepare.hpp> -#include <signaldata/UtilExecute.hpp> -#include <signaldata/ScanTab.hpp> -#include <signaldata/ScanFrag.hpp> -#include <signaldata/LqhFrag.hpp> -#include <signaldata/LqhTransConf.hpp> -#include <signaldata/DropTab.hpp> -#include <signaldata/PrepDropTab.hpp> -#include <signaldata/LCP.hpp> -#include <signaldata/MasterLCP.hpp> -#include <signaldata/CopyGCIReq.hpp> -#include <signaldata/SystemError.hpp> -#include <signaldata/StartRec.hpp> -#include <signaldata/NFCompleteRep.hpp> -#include <signaldata/SignalDroppedRep.hpp> -#include <signaldata/FailRep.hpp> -#include <signaldata/DisconnectRep.hpp> -#include <signaldata/SumaImpl.hpp> -#include <signaldata/NdbSttor.hpp> -#include <signaldata/CreateFragmentation.hpp> -#include <signaldata/UtilLock.hpp> -#include <signaldata/CntrStart.hpp> -#include <signaldata/ReadNodesConf.hpp> -#include <signaldata/TuxMaint.hpp> -#include <signaldata/AccLock.hpp> +#include <GlobalSignalNumbers.h> +#include <signaldata/SignalData.hpp> +#include <signaldata/SignalDataPrint.hpp> /** * This is the register @@ -254,9 +198,11 @@ SignalDataPrintFunctions[] = { ,{ 0, 0 } }; -template class Bitmask<1>; -template class Bitmask<2>; -template class Bitmask<4>; +#include <Bitmask.hpp> + template struct BitmaskPOD<1>; template struct BitmaskPOD<2>; template struct BitmaskPOD<4>; +template class Bitmask<1>; +template class Bitmask<2>; +template class Bitmask<4>; diff --git a/ndb/src/common/editline/MANIFEST b/ndb/src/common/editline/MANIFEST deleted file mode 100644 index dc8b4b36f88..00000000000 --- a/ndb/src/common/editline/MANIFEST +++ /dev/null @@ -1,15 +0,0 @@ -File Name Description --------------------------------------------------------- -README Release notes and copyright -MANIFEST This shipping list -Make.os9 OS-9 makefile -Makefile Unix makefile -complete.c Filename completion routines -editline.3 Manual page for editline library -editline.c Line-editing routines -editline_internal.h Internal library header file -os9.h OS-9-specific declarations -sysos9.c OS-9-specific routines -sysunix.c Unix-specific routines -testit.c Test driver -unix.h Unix-specific declarations diff --git a/ndb/src/common/editline/Makefile.am b/ndb/src/common/editline/Makefile.am deleted file mode 100644 index 4f53bdc6326..00000000000 --- a/ndb/src/common/editline/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ - -noinst_LIBRARIES = libeditline.a - -libeditline_a_SOURCES = complete.c editline.c sysunix.c - -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -DEFS = -DANSI_ARROWS -DHAVE_TCGETATTR -DSYS_UNIX - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/ndb/src/common/editline/Makefile_old b/ndb/src/common/editline/Makefile_old deleted file mode 100644 index 800df8f0f31..00000000000 --- a/ndb/src/common/editline/Makefile_old +++ /dev/null @@ -1,18 +0,0 @@ -include .defs.mk - -TYPE := - -ARCHIVE_TARGET := editline - -CFLAGS += -DANSI_ARROWS -DHAVE_TCGETATTR -DSYS_UNIX - -ifeq ($(NDB_OS), WIN32) -SOURCES = editline_win32.c -else -SOURCES = complete.c editline.c sysunix.c -endif - -DIRS := test - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/common/editline/README b/ndb/src/common/editline/README deleted file mode 100644 index 537c7bd8611..00000000000 --- a/ndb/src/common/editline/README +++ /dev/null @@ -1,53 +0,0 @@ --- -NOTE: This version has been modified by Ericsson/Alzato. Please -see the cvs changelog for more details. --- - -$Revision: 1.2 $ - -This is a line-editing library. It can be linked into almost any -program to provide command-line editing and recall. - -It is call-compatible with the FSF readline library, but it is a -fraction of the size (and offers fewer features). It does not use -standard I/O. It is distributed under a "C News-like" copyright. - -Configuration is done in the Makefile. Type "make testit" to get -a small slow shell for testing. - -This contains some changes since the posting to comp.sources.misc: - - Bugfix for completion on absolute pathnames. - - Better handling of M-n versus showing raw 8bit chars. - - Better signal handling. - - Now supports termios/termio/sgttyb ioctl's. - - Add M-m command to toggle how 8bit data is displayed. -The following changes, made since the last public release, come from -J.G. Vons <vons@cesar.crbca1.sinet.slb.com>: - - History-searching no longer redraws the line wrong - - Added ESC-ESC as synonym for ESC-? - - SIGQUIT (normally ^\) now sends a signal, not indicating EOF. - - Fixed some typo's and unclear wording in the manpage. - - Fixed completion when all entries shared a common prefix. - - Fixed some meta-char line-redrawing bugs. - -Enjoy, - Rich $alz - <rsalz@osf.org> - - Copyright 1992,1993 Simmule Turner and Rich Salz. All rights reserved. - - This software is not subject to any license of the American Telephone - and Telegraph Company or of the Regents of the University of California. - - Permission is granted to anyone to use this software for any purpose on - any computer system, and to alter it and redistribute it freely, subject - to the following restrictions: - 1. The authors are not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - 2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - 3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - 4. This notice may not be removed or altered. diff --git a/ndb/src/common/editline/complete.c b/ndb/src/common/editline/complete.c deleted file mode 100644 index d1f8b1d3ff4..00000000000 --- a/ndb/src/common/editline/complete.c +++ /dev/null @@ -1,211 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -/* -*- c-basic-offset: 4; -*- -** $Revision: 1.8 $ -** -** History and file completion functions for editline library. -*/ -#include "editline_internal.h" - - -/* -** strcmp-like sorting predicate for qsort. -*/ -static int -compare(const void *p1, const void *p2) -{ - const char **v1; - const char **v2; - - v1 = (const char **)p1; - v2 = (const char **)p2; - return strcmp(*v1, *v2); -} - -/* -** Fill in *avp with an array of names that match file, up to its length. -** Ignore . and .. . -*/ -static int -FindMatches(char *dir, char *file, char ***avp) -{ - char **av; - char **new; - char *p; - DIR *dp; - struct dirent *ep; - size_t ac; - size_t len; - - if ((dp = opendir(dir)) == NULL) - return 0; - - av = NULL; - ac = 0; - len = strlen(file); - while ((ep = readdir(dp)) != NULL) { - p = ep->d_name; - if (p[0] == '.' && (p[1] == '\0' || (p[1] == '.' && p[2] == '\0'))) - continue; - if (len && strncmp(p, file, len) != 0) - continue; - - if ((ac % MEM_INC) == 0) { - if ((new = malloc(sizeof(char*) * (ac + MEM_INC))) == NULL) - break; - if (ac) { - memcpy(new, av, ac * sizeof (char **)); - free(av); - } - *avp = av = new; - } - - if ((av[ac] = strdup(p)) == NULL) { - if (ac == 0) - free(av); - break; - } - ac++; - } - - /* Clean up and return. */ - (void)closedir(dp); - if (ac) - qsort(av, ac, sizeof (char **), compare); - return ac; -} - -/* -** Split a pathname into allocated directory and trailing filename parts. -*/ -static int -SplitPath(char *path, char **dirpart, char ** filepart) -{ - static char DOT[] = "."; - char *dpart; - char *fpart; - - if ((fpart = strrchr(path, '/')) == NULL) { - if ((dpart = strdup(DOT)) == NULL) - return -1; - if ((fpart = strdup(path)) == NULL) { - free(dpart); - return -1; - } - } - else { - if ((dpart = strdup(path)) == NULL) - return -1; - dpart[fpart - path + 1] = '\0'; - if ((fpart = strdup(++fpart)) == NULL) { - free(dpart); - return -1; - } - } - *dirpart = dpart; - *filepart = fpart; - return 0; -} - -/* -** Attempt to complete the pathname, returning an allocated copy. -** Fill in *unique if we completed it, or set it to 0 if ambiguous. -*/ -char * -rl_complete(char *pathname,int *unique) -{ - char **av; - char *dir; - char *file; - char *new; - char *p; - size_t ac; - size_t end; - size_t i; - size_t j; - size_t len; - size_t new_len; - size_t p_len; - - if (SplitPath(pathname, &dir, &file) < 0) - return NULL; - if ((ac = FindMatches(dir, file, &av)) == 0) { - free(dir); - free(file); - return NULL; - } - - p = NULL; - len = strlen(file); - if (ac == 1) { - /* Exactly one match -- finish it off. */ - *unique = 1; - j = strlen(av[0]) - len + 2; - p_len = sizeof(char) * (j + 1); - if ((p = malloc(p_len)) != NULL) { - memcpy(p, av[0] + len, j); - new_len = sizeof(char) * (strlen(dir) + strlen(av[0]) + 2); - new = malloc(new_len); - if(new != NULL) { - snprintf(new, new_len, "%s/%s", dir, av[0]); - rl_add_slash(new, p, p_len); - free(new); - } - } - } - else { - /* Find largest matching substring. */ - for (*unique = 0, i = len, end = strlen(av[0]); i < end; i++) - for (j = 1; j < ac; j++) - if (av[0][i] != av[j][i]) - goto breakout; -breakout: - if (i > len) { - j = i - len + 1; - if ((p = malloc(sizeof(char) * j)) != NULL) { - memcpy(p, av[0] + len, j); - p[j - 1] = '\0'; - } - } - } - - /* Clean up and return. */ - free(dir); - free(file); - for (i = 0; i < ac; i++) - free(av[i]); - free(av); - return p; -} - -/* -** Return all possible completions. -*/ -int -rl_list_possib(char *pathname, char ***avp) -{ - char *dir; - char *file; - int ac; - - if (SplitPath(pathname, &dir, &file) < 0) - return 0; - ac = FindMatches(dir, file, avp); - free(dir); - free(file); - return ac; -} diff --git a/ndb/src/common/editline/editline.3 b/ndb/src/common/editline/editline.3 deleted file mode 100644 index 159cc7f87bb..00000000000 --- a/ndb/src/common/editline/editline.3 +++ /dev/null @@ -1,178 +0,0 @@ -.\" $Revision: 1.1 $ -.TH EDITLINE 3 -.SH NAME -editline \- command-line editing library with history -.SH SYNOPSIS -.nf -.B "char *" -.B "readline(prompt)" -.B " char *prompt;" - -.B "void" -.B "add_history(line)" -.B " char *line;" -.fi -.SH DESCRIPTION -.I Editline -is a library that provides an line-editing interface with text recall. -It is intended to be compatible with the -.I readline -library provided by the Free Software Foundation, but much smaller. -The bulk of this manual page describes the user interface. -.PP -The -.I readline -routine returns a line of text with the trailing newline removed. -The data is returned in a buffer allocated with -.IR malloc (3), -so the space should be released with -.IR free (3) -when the calling program is done with it. -Before accepting input from the user, the specified -.I prompt -is displayed on the terminal. -.PP -The -.I add_history -routine makes a copy of the specified -.I line -and adds it to the internal history list. -.SS "User Interface" -A program that uses this library provides a simple emacs-like editing -interface to its users. -A line may be edited before it is sent to the calling program by typing either -control characters or escape sequences. -A control character, shown as a caret followed by a letter, is typed by -holding down the ``control'' key while the letter is typed. -For example, ``^A'' is a control-A. -An escape sequence is entered by typing the ``escape'' key followed by one or -more characters. -The escape key is abbreviated as ``ESC''. -Note that unlike control keys, case matters in escape sequences; ``ESC\ F'' -is not the same as ``ESC\ f''. -.PP -An editing command may be typed anywhere on the line, not just at the -beginning. -In addition, a return may also be typed anywhere on the line, not just at -the end. -.PP -Most editing commands may be given a repeat count, -.IR n , -where -.I n -is a number. -To enter a repeat count, type the escape key, the number, and then -the command to execute. -For example, ``ESC\ 4\ ^f'' moves forward four characters. -If a command may be given a repeat count then the text ``[n]'' is given at the -end of its description. -.PP -The following control characters are accepted: -.RS -.nf -.ta \w'ESC DEL 'u -^A Move to the beginning of the line -^B Move left (backwards) [n] -^D Delete character [n] -^E Move to end of line -^F Move right (forwards) [n] -^G Ring the bell -^H Delete character before cursor (backspace key) [n] -^I Complete filename (tab key); see below -^J Done with line (return key) -^K Kill to end of line (or column [n]) -^L Redisplay line -^M Done with line (alternate return key) -^N Get next line from history [n] -^P Get previous line from history [n] -^R Search backward (forward if [n]) through history for text; -\& prefixing the string with a caret (^) forces it to -\& match only at the beginning of a history line -^T Transpose characters -^V Insert next character, even if it is an edit command -^W Wipe to the mark -^X^X Exchange current location and mark -^Y Yank back last killed text -^[ Start an escape sequence (escape key) -^]c Move forward to next character ``c'' -^? Delete character before cursor (delete key) [n] -.fi -.RE -.PP -The following escape sequences are provided. -.RS -.nf -.ta \w'ESC DEL 'u -ESC\ ^H Delete previous word (backspace key) [n] -ESC\ DEL Delete previous word (delete key) [n] -ESC\ ESC Show possible completions; see below -ESC\ SP Set the mark (space key); see ^X^X and ^Y above -ESC\ . Get the last (or [n]'th) word from previous line -ESC\ ? Show possible completions; see below -ESC\ < Move to start of history -ESC\ > Move to end of history -ESC\ b Move backward a word [n] -ESC\ d Delete word under cursor [n] -ESC\ f Move forward a word [n] -ESC\ l Make word lowercase [n] -ESC\ m Toggle if 8bit chars display as themselves or with -\& an ``M\-'' prefix -ESC\ u Make word uppercase [n] -ESC\ y Yank back last killed text -ESC\ w Make area up to mark yankable -ESC\ nn Set repeat count to the number nn -ESC\ C Read from environment variable ``_C_'', where C is -\& an uppercase letter -.fi -.RE -.PP -The -.I editline -library has a small macro facility. -If you type the escape key followed by an uppercase letter, -.IR C , -then the contents of the environment variable -.I _C_ -are read in as if you had typed them at the keyboard. -For example, if the variable -.I _L_ -contains the following: -.RS -^A^Kecho '^V^[[H^V^[[2J'^M -.RE -Then typing ``ESC L'' will move to the beginning of the line, kill the -entire line, enter the echo command needed to clear the terminal (if your -terminal is like a VT-100), and send the line back to the shell. -.PP -The -.I editline -library also does filename completion. -Suppose the root directory has the following files in it: -.RS -.nf -.ta \w'core 'u -bin vmunix -core vmunix.old -.fi -.RE -If you type ``rm\ /v'' and then the tab key. -.I Editline -will then finish off as much of the name as possible by adding ``munix''. -Because the name is not unique, it will then beep. -If you type the escape key followed by either a question mark or another -escape, it will display the two choices. -If you then type a period and a tab, the library will finish off the filename -for you: -.RS -.nf -.RI "rm /v[TAB]" munix ".[TAB]" old -.fi -.RE -The tab key is shown by ``[TAB]'' and the automatically-entered text -is shown in italics. -.SH "BUGS AND LIMITATIONS" -Cannot handle lines more than 80 columns. -.SH AUTHORS -Simmule R. Turner <uunet.uu.net!capitol!sysgo!simmy> -and Rich $alz <rsalz@osf.org>. -Original manual page by DaviD W. Sanderson <dws@ssec.wisc.edu>. diff --git a/ndb/src/common/editline/editline.c b/ndb/src/common/editline/editline.c deleted file mode 100644 index 1e4c1ecba76..00000000000 --- a/ndb/src/common/editline/editline.c +++ /dev/null @@ -1,1514 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -/* -*- c-basic-offset: 4; -*- -** $Revision: 1.6 $ -** -** Main editing routines for editline library. -*/ -#include <ndb_global.h> - -#include "editline_internal.h" -#include <signal.h> - -/* -** Manifest constants. -*/ -#define SCREEN_WIDTH 80 -#define SCREEN_ROWS 24 -#define NO_ARG (-1) -#define DEL 127 -#define TAB '\t' -#define CTL(x) ((x) & 0x1F) -#define ISCTL(x) ((x) && (x) < ' ') -#define UNCTL(x) ((x) + 64) -#define META(x) ((x) | 0x80) -#define ISMETA(x) ((x) & 0x80) -#define UNMETA(x) ((x) & 0x7F) -#define MAPSIZE 32 -#define METAMAPSIZE 16 -#if !defined(HIST_SIZE) -#define HIST_SIZE 20 -#endif /* !defined(HIST_SIZE) */ - -/* -** Command status codes. -*/ -typedef enum _STATUS { - CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal -} STATUS; - -/* -** The type of case-changing to perform. -*/ -typedef enum _CASE { - TOupper, TOlower -} CASE; - -/* -** Key to command mapping. -*/ -typedef struct _KEYMAP { - char Key; - char Active; - STATUS (*Function)(); -} KEYMAP; - -/* -** Command history structure. -*/ -typedef struct _HISTORY { - int Size; - int Pos; - char *Lines[HIST_SIZE]; -} HISTORY; - -/* -** Globals. -*/ -int rl_eof; -int rl_erase; -int rl_intr; -int rl_kill; -int rl_quit; -#if defined(DO_SIGTSTP) -int rl_susp; -#endif /* defined(DO_SIGTSTP) */ - -static char NIL[] = ""; -static const char *Input = NIL; -static char *Line; -static const char *Prompt; -static char *Yanked; -static char *Screen; -static char NEWLINE[]= CRLF; -static HISTORY H; -static int Repeat; -static int End; -static int Mark; -static int OldPoint; -static int Point; -static int PushBack; -static int Pushed; -static int Signal; -static KEYMAP Map[MAPSIZE]; -static KEYMAP MetaMap[METAMAPSIZE]; -static size_t Length; -static size_t ScreenCount; -static size_t ScreenSize; -static char *backspace; -static int TTYwidth; -static int TTYrows; - -/* Display print 8-bit chars as `M-x' or as the actual 8-bit char? */ -int rl_meta_chars = 1; - -/* -** Declarations. -*/ -static char *editinput(); - -#if defined(USE_TERMCAP) -extern char *getenv(); -extern char *tgetstr(); -extern int tgetent(); -extern int tgetnum(); -#endif /* defined(USE_TERMCAP) */ - -/* -** TTY input/output functions. -*/ - -static void -TTYflush() -{ - if (ScreenCount) { - (void)write(1, Screen, ScreenCount); - ScreenCount = 0; - } -} - -static void -TTYput(const char c) -{ - Screen[ScreenCount] = c; - if (++ScreenCount >= ScreenSize - 1) { - ScreenSize += SCREEN_INC; - Screen = realloc(Screen, sizeof(char) * ScreenSize); - /* XXX what to do if realloc failes? */ - } -} - -static void -TTYputs(const char *p) -{ - while (*p) - TTYput(*p++); -} - -static void -TTYshow(char c) -{ - if (c == DEL) { - TTYput('^'); - TTYput('?'); - } - else if (c == TAB) { - /* XXX */ - } - else if (ISCTL(c)) { - TTYput('^'); - TTYput(UNCTL(c)); - } - else if (rl_meta_chars && ISMETA(c)) { - TTYput('M'); - TTYput('-'); - TTYput(UNMETA(c)); - } - else - TTYput(c); -} - -static void -TTYstring(char *p) -{ - while (*p) - TTYshow(*p++); -} - -static int -TTYget() -{ - char c; - - TTYflush(); - if (Pushed) { - Pushed = 0; - return PushBack; - } - if (*Input) - return *Input++; - return read(0, &c, (size_t)1) == 1 ? c : EOF; -} - -#define TTYback() (backspace ? TTYputs((const char *)backspace) : TTYput('\b')) - -static void -TTYbackn(int n) -{ - while (--n >= 0) - TTYback(); -} - -static void -TTYinfo() -{ - static int init; -#if defined(USE_TERMCAP) - char *term; - char buff[2048]; - char *bp; - char *p; -#endif /* defined(USE_TERMCAP) */ -#if defined(TIOCGWINSZ) - struct winsize W; -#endif /* defined(TIOCGWINSZ) */ - - if (init) { -#if defined(TIOCGWINSZ) - /* Perhaps we got resized. */ - if (ioctl(0, TIOCGWINSZ, &W) >= 0 - && W.ws_col > 0 && W.ws_row > 0) { - TTYwidth = (int)W.ws_col; - TTYrows = (int)W.ws_row; - } -#endif /* defined(TIOCGWINSZ) */ - return; - } - init++; - - TTYwidth = TTYrows = 0; -#if defined(USE_TERMCAP) - bp = &buff[0]; - if ((term = getenv("TERM")) == NULL) - term = "dumb"; - if (tgetent(buff, term) < 0) { - TTYwidth = SCREEN_WIDTH; - TTYrows = SCREEN_ROWS; - return; - } - p = tgetstr("le", &bp); - backspace = p ? strdup(p) : NULL; - TTYwidth = tgetnum("co"); - TTYrows = tgetnum("li"); -#endif /* defined(USE_TERMCAP) */ - -#if defined(TIOCGWINSZ) - if (ioctl(0, TIOCGWINSZ, &W) >= 0) { - TTYwidth = (int)W.ws_col; - TTYrows = (int)W.ws_row; - } -#endif /* defined(TIOCGWINSZ) */ - - if (TTYwidth <= 0 || TTYrows <= 0) { - TTYwidth = SCREEN_WIDTH; - TTYrows = SCREEN_ROWS; - } -} - - -/* -** Print an array of words in columns. -*/ -static void -columns(int ac, char **av) -{ - char *p; - int i; - int j; - int k; - int len; - int skip; - int longest; - int cols; - - /* Find longest name, determine column count from that. */ - for (longest = 0, i = 0; i < ac; i++) - if ((j = strlen((char *)av[i])) > longest) - longest = j; - cols = TTYwidth / (longest + 3); - - TTYputs((const char *)NEWLINE); - for (skip = ac / cols + 1, i = 0; i < skip; i++) { - for (j = i; j < ac; j += skip) { - for (p = av[j], len = strlen((char *)p), k = len; --k >= 0; p++) - TTYput(*p); - if (j + skip < ac) - while (++len < longest + 3) - TTYput(' '); - } - TTYputs((const char *)NEWLINE); - } -} - -static void -reposition() -{ - int i; - char *p; - - TTYput('\r'); - TTYputs((const char *)Prompt); - for (i = Point, p = Line; --i >= 0; p++) - TTYshow(*p); -} - -static void -left(STATUS Change) -{ - char c; - - TTYback(); - if (Point) { - c = Line[Point - 1]; - if (c == TAB) { - /* XXX */ - } - else if (ISCTL(c)) - TTYback(); - else if (rl_meta_chars && ISMETA(c)) { - TTYback(); - TTYback(); - } - } - if (Change == CSmove) - Point--; -} - -static void -right(STATUS Change) -{ - TTYshow(Line[Point]); - if (Change == CSmove) - Point++; -} - -static STATUS -ring_bell() -{ - TTYput('\07'); - TTYflush(); - return CSstay; -} - -static STATUS -do_macro(int c) -{ - char name[4]; - - name[0] = '_'; - name[1] = c; - name[2] = '_'; - name[3] = '\0'; - - if ((Input = (char *)getenv((char *)name)) == NULL) { - Input = NIL; - return ring_bell(); - } - return CSstay; -} - -static STATUS -do_forward(STATUS move) -{ - int i; - char *p; - - i = 0; - do { - p = &Line[Point]; - for ( ; Point < End && (*p == ' ' || !isalnum((int)*p)); Point++, p++) - if (move == CSmove) - right(CSstay); - - for (; Point < End && isalnum((int)*p); Point++, p++) - if (move == CSmove) - right(CSstay); - - if (Point == End) - break; - } while (++i < Repeat); - - return CSstay; -} - -static STATUS -do_case(CASE type) -{ - int i; - int end; - int count; - char *p; - - (void)do_forward(CSstay); - if (OldPoint != Point) { - if ((count = Point - OldPoint) < 0) - count = -count; - Point = OldPoint; - if ((end = Point + count) > End) - end = End; - for (i = Point, p = &Line[i]; i < end; i++, p++) { - if (type == TOupper) { - if (islower((int)*p)) - *p = toupper((int)*p); - } - else if (isupper((int)*p)) - *p = tolower((int)*p); - right(CSmove); - } - } - return CSstay; -} - -static STATUS -case_down_word() -{ - return do_case(TOlower); -} - -static STATUS -case_up_word() -{ - return do_case(TOupper); -} - -static void -ceol() -{ - int extras; - int i; - char *p; - - for (extras = 0, i = Point, p = &Line[i]; i <= End; i++, p++) { - TTYput(' '); - if (*p == TAB) { - /* XXX */ - } - else if (ISCTL(*p)) { - TTYput(' '); - extras++; - } - else if (rl_meta_chars && ISMETA(*p)) { - TTYput(' '); - TTYput(' '); - extras += 2; - } - } - - for (i += extras; i > Point; i--) - TTYback(); -} - -static void -clear_line() -{ - Point = -strlen(Prompt); - TTYput('\r'); - ceol(); - Point = 0; - End = 0; - Line[0] = '\0'; -} - -static STATUS -insert_string(char *p) -{ - size_t len; - int i; - char *new; - char *q; - - len = strlen((char *)p); - if (End + len >= Length) { - if ((new = malloc(sizeof(char) * (Length + len + MEM_INC))) == NULL) - return CSstay; - if (Length) { - memcpy(new, Line, Length); - free(Line); - } - Line = new; - Length += len + MEM_INC; - } - - for (q = &Line[Point], i = End - Point; --i >= 0; ) - q[len + i] = q[i]; - memcpy(&Line[Point], p, len); - End += len; - Line[End] = '\0'; - TTYstring(&Line[Point]); - Point += len; - - return Point == End ? CSstay : CSmove; -} - -static STATUS -redisplay() -{ - TTYputs((const char *)NEWLINE); - TTYputs((const char *)Prompt); - TTYstring(Line); - return CSmove; -} - -static STATUS -redisplay_no_nl() -{ - TTYput('\r'); - TTYputs((const char *)Prompt); - TTYstring(Line); - return CSmove; -} - -static STATUS -toggle_meta_mode() -{ - rl_meta_chars = !rl_meta_chars; - return redisplay(); -} - - -static char * -next_hist() -{ - return H.Pos >= H.Size - 1 ? NULL : H.Lines[++H.Pos]; -} - -static char * -prev_hist() -{ - return H.Pos == 0 ? NULL : H.Lines[--H.Pos]; -} - -static STATUS -do_insert_hist(char *p) -{ - if (p == NULL) - return ring_bell(); - Point = 0; - reposition(); - ceol(); - End = 0; - return insert_string(p); -} - -static STATUS -do_hist(char *(*move)()) -{ - char *p; - int i; - - i = 0; - do { - if ((p = (*move)()) == NULL) - return ring_bell(); - } while (++i < Repeat); - return do_insert_hist(p); -} - -static STATUS -h_next() -{ - return do_hist(next_hist); -} - -static STATUS -h_prev() -{ - return do_hist(prev_hist); -} - -static STATUS -h_first() -{ - return do_insert_hist(H.Lines[H.Pos = 0]); -} - -static STATUS -h_last() -{ - return do_insert_hist(H.Lines[H.Pos = H.Size - 1]); -} - -/* -** Return zero if pat appears as a substring in text. -*/ -static int -substrcmp(char *text, char *pat,int len) -{ - char c; - - if ((c = *pat) == '\0') - return *text == '\0'; - for ( ; *text; text++) - if (*text == c && strncmp(text, pat, len) == 0) - return 0; - return 1; -} - -static char * -search_hist(char *search,char *(*move)()) -{ - static char *old_search; - int len; - int pos; - int (*match)(); - char *pat; - - /* Save or get remembered search pattern. */ - if (search && *search) { - if (old_search) - free(old_search); - old_search = strdup(search); - } - else { - if (old_search == NULL || *old_search == '\0') - return NULL; - search = old_search; - } - - /* Set up pattern-finder. */ - if (*search == '^') { - match = strncmp; - pat = (char *)(search + 1); - } - else { - match = substrcmp; - pat = (char *)search; - } - len = strlen(pat); - - for (pos = H.Pos; (*move)() != NULL; ) - if ((*match)((char *)H.Lines[H.Pos], pat, len) == 0) - return H.Lines[H.Pos]; - H.Pos = pos; - return NULL; -} - -static STATUS -h_search() -{ - static int Searching; - const char *old_prompt; - char *(*move)(); - char *p; - - if (Searching) - return ring_bell(); - Searching = 1; - - clear_line(); - old_prompt = Prompt; - Prompt = "Search: "; - TTYputs((const char *)Prompt); - move = Repeat == NO_ARG ? prev_hist : next_hist; - p = editinput(); - Searching = 0; - if (p == NULL && Signal > 0) { - Signal = 0; - clear_line(); - Prompt = old_prompt; - return redisplay_no_nl(); - } - p = search_hist(p, move); - clear_line(); - Prompt = old_prompt; - if (p == NULL) { - (void)ring_bell(); - return redisplay_no_nl(); - } - return do_insert_hist(p); -} - -static STATUS -fd_char() -{ - int i; - - i = 0; - do { - if (Point >= End) - break; - right(CSmove); - } while (++i < Repeat); - return CSstay; -} - -static void -save_yank(int begin, int i) -{ - if (Yanked) { - free(Yanked); - Yanked = NULL; - } - - if (i < 1) - return; - - if ((Yanked = malloc(sizeof(char) * (i + 1))) != NULL) { - memcpy(Yanked, &Line[begin], i); - Yanked[i] = '\0'; - } -} - -static STATUS -delete_string(int count) -{ - int i; - char *p; - - if (count <= 0 || End == Point) - return ring_bell(); - - if (count == 1 && Point == End - 1) { - /* Optimize common case of delete at end of line. */ - End--; - p = &Line[Point]; - i = 1; - TTYput(' '); - if (*p == TAB) { - /* XXX */ - } - else if (ISCTL(*p)) { - i = 2; - TTYput(' '); - } - else if (rl_meta_chars && ISMETA(*p)) { - i = 3; - TTYput(' '); - TTYput(' '); - } - TTYbackn(i); - *p = '\0'; - return CSmove; - } - if (Point + count > End && (count = End - Point) <= 0) - return CSstay; - - if (count > 1) - save_yank(Point, count); - - ceol(); - for (p = &Line[Point], i = End - (Point + count) + 1; --i >= 0; p++) - p[0] = p[count]; - End -= count; - TTYstring(&Line[Point]); - return CSmove; -} - -static STATUS -bk_char() -{ - int i; - - i = 0; - do { - if (Point == 0) - break; - left(CSmove); - } while (++i < Repeat); - - return CSstay; -} - -static STATUS -bk_del_char() -{ - int i; - - i = 0; - do { - if (Point == 0) - break; - left(CSmove); - } while (++i < Repeat); - - return delete_string(i); -} - -static STATUS -kill_line() -{ - int i; - - if (Repeat != NO_ARG) { - if (Repeat < Point) { - i = Point; - Point = Repeat; - reposition(); - (void)delete_string(i - Point); - } - else if (Repeat > Point) { - right(CSmove); - (void)delete_string(Repeat - Point - 1); - } - return CSmove; - } - - save_yank(Point, End - Point); - ceol(); - Line[Point] = '\0'; - End = Point; - return CSstay; -} - -static STATUS -insert_char(int c) -{ - STATUS s; - char buff[2]; - char *p; - char *q; - int i; - - if (Repeat == NO_ARG || Repeat < 2) { - buff[0] = c; - buff[1] = '\0'; - return insert_string(buff); - } - - if ((p = malloc(sizeof(char) * (Repeat + 1))) == NULL) - return CSstay; - for (i = Repeat, q = p; --i >= 0; ) - *q++ = c; - *q = '\0'; - Repeat = 0; - s = insert_string(p); - free(p); - return s; -} - -static STATUS -meta() -{ - int c; - KEYMAP *kp; - - if ((c = TTYget()) == EOF) - return CSeof; -#if defined(ANSI_ARROWS) - /* Also include VT-100 arrows. */ - if (c == '[' || c == 'O') - switch ((int)(c = TTYget())) { - default: return ring_bell(); - case EOF: return CSeof; - case 'A': return h_prev(); - case 'B': return h_next(); - case 'C': return fd_char(); - case 'D': return bk_char(); - } -#endif /* defined(ANSI_ARROWS) */ - - if (isdigit(c)) { - for (Repeat = c - '0'; (c = TTYget()) != EOF && isdigit(c); ) - Repeat = Repeat * 10 + c - '0'; - Pushed = 1; - PushBack = c; - return CSstay; - } - - if (isupper(c)) - return do_macro(c); - for (OldPoint = Point, kp = MetaMap; kp < &MetaMap[METAMAPSIZE]; kp++) - if (kp->Key == c && kp->Active) - return (*kp->Function)(); - - return ring_bell(); -} - -static STATUS -emacs(int c) -{ - STATUS s; - KEYMAP *kp; - -#if 0 - /* This test makes it impossible to enter eight-bit characters when - * meta-char mode is enabled. */ - if (rl_meta_chars && ISMETA(c)) { - Pushed = 1; - PushBack = UNMETA(c); - return meta(); - } -#endif /* 0 */ - for (kp = Map; kp < &Map[MAPSIZE]; kp++) - if (kp->Key == c && kp->Active) - break; - s = kp < &Map[MAPSIZE] ? (*kp->Function)() : insert_char((int)c); - if (!Pushed) - /* No pushback means no repeat count; hacky, but true. */ - Repeat = NO_ARG; - return s; -} - -static STATUS -TTYspecial(int c) -{ - if (rl_meta_chars && ISMETA(c)) - return CSdispatch; - - if (c == rl_erase || c == DEL) - return bk_del_char(); - if (c == rl_kill) { - if (Point != 0) { - Point = 0; - reposition(); - } - Repeat = NO_ARG; - return kill_line(); - } - if (c == rl_eof && Point == 0 && End == 0) - return CSeof; - if (c == rl_intr) { - Signal = SIGINT; - return CSsignal; - } - if (c == rl_quit) { - Signal = SIGQUIT; - return CSsignal; - } -#if defined(DO_SIGTSTP) - if (c == rl_susp) { - Signal = SIGTSTP; - return CSsignal; - } -#endif /* defined(DO_SIGTSTP) */ - - return CSdispatch; -} - -static char * -editinput() -{ - int c; - - Repeat = NO_ARG; - OldPoint = Point = Mark = End = 0; - Line[0] = '\0'; - - Signal = -1; - while ((c = TTYget()) != EOF) - switch (TTYspecial(c)) { - case CSdone: - return Line; - case CSeof: - return NULL; - case CSsignal: - return (char *)""; - case CSmove: - reposition(); - break; - case CSdispatch: - switch (emacs(c)) { - case CSdone: - return Line; - case CSeof: - return NULL; - case CSsignal: - return (char *)""; - case CSmove: - reposition(); - break; - case CSdispatch: - case CSstay: - break; - } - break; - case CSstay: - break; - } - return NULL; -} - -static void -hist_add(char *p) -{ - int i; - - if ((p = strdup(p)) == NULL) - return; - if (H.Size < HIST_SIZE) - H.Lines[H.Size++] = p; - else { - free(H.Lines[0]); - for (i = 0; i < HIST_SIZE - 1; i++) - H.Lines[i] = H.Lines[i + 1]; - H.Lines[i] = p; - } - H.Pos = H.Size - 1; -} - -static char * -read_redirected() -{ - int size; - char *p; - char *line; - char *end; - - for (size = MEM_INC, p = line = malloc(sizeof(char) * size), end = p + size; ; p++) { - if (p == end) { - size += MEM_INC; - p = line = realloc(line, size); - end = p + size; - } - if (read(0, p, 1) <= 0) { - /* Ignore "incomplete" lines at EOF, just like we do for a tty. */ - free(line); - return NULL; - } - if (*p == '\n') - break; - } - *p = '\0'; - return line; -} - -/* -** For compatibility with FSF readline. -*/ -/* ARGSUSED0 */ -void -rl_reset_terminal(char *p) -{ - (void)p; /* Suppress warning */ -} - -void -rl_initialize() -{ -} - -int -rl_insert(int count, int c) -{ - if (count > 0) { - Repeat = count; - (void)insert_char(c); - (void)redisplay_no_nl(); - } - return 0; -} - -int (*rl_event_hook)(); - -int -rl_key_action(int c, char flag) -{ - KEYMAP *kp; - int size; - - (void)flag; /* Suppress warning */ - - if (ISMETA(c)) { - kp = MetaMap; - size = METAMAPSIZE; - } - else { - kp = Map; - size = MAPSIZE; - } - for ( ; --size >= 0; kp++) - if (kp->Key == c) { - kp->Active = c ? 1 : 0; - return 1; - } - return -1; -} - -char * -readline(const char *prompt) -{ - char *line; - int s; - - if (!isatty(0)) { - TTYflush(); - return read_redirected(); - } - - if (Line == NULL) { - Length = MEM_INC; - if ((Line = malloc(sizeof(char) * Length)) == NULL) - return NULL; - } - - TTYinfo(); - rl_ttyset(0); - hist_add(NIL); - ScreenSize = SCREEN_INC; - Screen = malloc(sizeof(char) * ScreenSize); - Prompt = prompt ? prompt : (char *)NIL; - TTYputs((const char *)Prompt); - if ((line = editinput()) != NULL) { - line = strdup(line); - TTYputs((const char *)NEWLINE); - TTYflush(); - } - rl_ttyset(1); - free(Screen); - free(H.Lines[--H.Size]); - if (Signal > 0) { - s = Signal; - Signal = 0; - (void)kill(getpid(), s); - } - return (char *)line; -} - -void -add_history(char *p) -{ - if (p == NULL || *p == '\0') - return; - -#if defined(UNIQUE_HISTORY) - if (H.Size && strcmp(p, H.Lines[H.Size - 1]) == 0) - return; -#endif /* defined(UNIQUE_HISTORY) */ - hist_add((char *)p); -} - - -static STATUS -beg_line() -{ - if (Point) { - Point = 0; - return CSmove; - } - return CSstay; -} - -static STATUS -del_char() -{ - return delete_string(Repeat == NO_ARG ? 1 : Repeat); -} - -static STATUS -end_line() -{ - if (Point != End) { - Point = End; - return CSmove; - } - return CSstay; -} - -/* -** Return allocated copy of word under cursor, moving cursor after the -** word. -*/ -static char * -find_word() -{ - static char SEPS[] = "\"#;&|^$=`'{}()<>\n\t "; - char *p; - char *new; - size_t len; - - /* Move forward to end of word. */ - p = &Line[Point]; - for ( ; Point < End && strchr(SEPS, (char)*p) == NULL; Point++, p++) - right(CSstay); - - /* Back up to beginning of word. */ - for (p = &Line[Point]; p > Line && strchr(SEPS, (char)p[-1]) == NULL; p--) - continue; - len = Point - (p - Line) + 1; - if ((new = malloc(sizeof(char) * len)) == NULL) - return NULL; - memcpy(new, p, len); - new[len - 1] = '\0'; - return new; -} - -static STATUS -c_complete() -{ - char *p; - char *word; - int unique; - - word = find_word(); - p = (char *)rl_complete((char *)word, &unique); - if (word) - free(word); - if (p && *p) { - (void)insert_string(p); - if (!unique) - (void)ring_bell(); - free(p); - return redisplay_no_nl(); - } - return ring_bell(); -} - -static STATUS -c_possible() -{ - char **av; - char *word; - int ac; - - word = find_word(); - ac = rl_list_possib((char *)word, (char ***)&av); - if (word) - free(word); - if (ac) { - columns(ac, av); - while (--ac >= 0) - free(av[ac]); - free(av); - return redisplay_no_nl(); - } - return ring_bell(); -} - -static STATUS -accept_line() -{ - Line[End] = '\0'; - return CSdone; -} - -static STATUS -transpose() -{ - char c; - - if (Point) { - if (Point == End) - left(CSmove); - c = Line[Point - 1]; - left(CSstay); - Line[Point - 1] = Line[Point]; - TTYshow(Line[Point - 1]); - Line[Point++] = c; - TTYshow(c); - } - return CSstay; -} - -static STATUS -quote() -{ - int c; - - return (c = TTYget()) == EOF ? CSeof : insert_char((int)c); -} - -static STATUS -wipe() -{ - int i; - - if (Mark > End) - return ring_bell(); - - if (Point > Mark) { - i = Point; - Point = Mark; - Mark = i; - reposition(); - } - - return delete_string(Mark - Point); -} - -static STATUS -mk_set() -{ - Mark = Point; - return CSstay; -} - -static STATUS -exchange() -{ - int c; - - if ((c = TTYget()) != CTL('X')) - return c == EOF ? CSeof : ring_bell(); - - if ((c = Mark) <= End) { - Mark = Point; - Point = c; - return CSmove; - } - return CSstay; -} - -static STATUS -yank() -{ - if (Yanked && *Yanked) - return insert_string(Yanked); - return CSstay; -} - -static STATUS -copy_region() -{ - if (Mark > End) - return ring_bell(); - - if (Point > Mark) - save_yank(Mark, Point - Mark); - else - save_yank(Point, Mark - Point); - - return CSstay; -} - -static STATUS -move_to_char() -{ - int c; - int i; - char *p; - - if ((c = TTYget()) == EOF) - return CSeof; - for (i = Point + 1, p = &Line[i]; i < End; i++, p++) - if (*p == c) { - Point = i; - return CSmove; - } - return CSstay; -} - -static STATUS -fd_word() -{ - return do_forward(CSmove); -} - -static STATUS -fd_kill_word() -{ - int i; - - (void)do_forward(CSstay); - if (OldPoint != Point) { - i = Point - OldPoint; - Point = OldPoint; - return delete_string(i); - } - return CSstay; -} - -static STATUS -bk_word() -{ - int i; - char *p; - - i = 0; - do { - for (p = &Line[Point]; p > Line && !isalnum((int)p[-1]); p--) - left(CSmove); - - for (; p > Line && p[-1] != ' ' && isalnum((int)p[-1]); p--) - left(CSmove); - - if (Point == 0) - break; - } while (++i < Repeat); - - return CSstay; -} - -static STATUS -bk_kill_word() -{ - (void)bk_word(); - if (OldPoint != Point) - return delete_string(OldPoint - Point); - return CSstay; -} - -static int -argify(char *line, char ***avp) -{ - char *c; - char **p; - char **new; - int ac; - int i; - - i = MEM_INC; - if ((*avp = p = malloc(sizeof(char*) * i))== NULL) - return 0; - - for (c = line; isspace((int)*c); c++) - continue; - if (*c == '\n' || *c == '\0') - return 0; - - for (ac = 0, p[ac++] = c; *c && *c != '\n'; ) { - if (isspace((int)*c)) { - *c++ = '\0'; - if (*c && *c != '\n') { - if (ac + 1 == i) { - new = malloc(sizeof(char*) * (i + MEM_INC)); - if (new == NULL) { - p[ac] = NULL; - return ac; - } - memcpy(new, p, i * sizeof (char **)); - i += MEM_INC; - free(p); - *avp = p = new; - } - p[ac++] = c; - } - } - else - c++; - } - *c = '\0'; - p[ac] = NULL; - return ac; -} - -static STATUS -last_argument() -{ - char **av; - char *p; - STATUS s; - int ac; - - if (H.Size == 1 || (p = H.Lines[H.Size - 2]) == NULL) - return ring_bell(); - - if ((p = strdup(p)) == NULL) - return CSstay; - ac = argify(p, &av); - - if (Repeat != NO_ARG) - s = Repeat < ac ? insert_string(av[Repeat]) : ring_bell(); - else - s = ac ? insert_string(av[ac - 1]) : CSstay; - - if (ac) - free(av); - free(p); - return s; -} - -static KEYMAP Map[MAPSIZE] = { - { CTL('@'), 1, ring_bell }, - { CTL('A'), 1, beg_line }, - { CTL('B'), 1, bk_char }, - { CTL('D'), 1, del_char }, - { CTL('E'), 1, end_line }, - { CTL('F'), 1, fd_char }, - { CTL('G'), 1, ring_bell }, - { CTL('H'), 1, bk_del_char }, - { CTL('I'), 1, c_complete }, - { CTL('J'), 1, accept_line }, - { CTL('K'), 1, kill_line }, - { CTL('L'), 1, redisplay }, - { CTL('M'), 1, accept_line }, - { CTL('N'), 1, h_next }, - { CTL('O'), 1, ring_bell }, - { CTL('P'), 1, h_prev }, - { CTL('Q'), 1, ring_bell }, - { CTL('R'), 1, h_search }, - { CTL('S'), 1, ring_bell }, - { CTL('T'), 1, transpose }, - { CTL('U'), 1, ring_bell }, - { CTL('V'), 1, quote }, - { CTL('W'), 1, wipe }, - { CTL('X'), 1, exchange }, - { CTL('Y'), 1, yank }, - { CTL('Z'), 1, ring_bell }, - { CTL('['), 1, meta }, - { CTL(']'), 1, move_to_char }, - { CTL('^'), 1, ring_bell }, - { CTL('_'), 1, ring_bell }, -}; - -static KEYMAP MetaMap[16]= { - { CTL('H'), 1, bk_kill_word }, - { CTL('['), 1, c_possible }, - { DEL, 1, bk_kill_word }, - { ' ', 1, mk_set }, - { '.', 1, last_argument }, - { '<', 1, h_first }, - { '>', 1, h_last }, - { '?', 1, c_possible }, - { 'b', 1, bk_word }, - { 'd', 1, fd_kill_word }, - { 'f', 1, fd_word }, - { 'l', 1, case_down_word }, - { 'm', 1, toggle_meta_mode}, - { 'u', 1, case_up_word }, - { 'y', 1, yank }, - { 'w', 1, copy_region }, -}; diff --git a/ndb/src/common/editline/sysunix.c b/ndb/src/common/editline/sysunix.c deleted file mode 100644 index 000bca78dfc..00000000000 --- a/ndb/src/common/editline/sysunix.c +++ /dev/null @@ -1,143 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -/* $Revision: 1.4 $ -** -** Unix system-dependant routines for editline library. -*/ -#include "editline_internal.h" - -#if defined(HAVE_TCGETATTR) -#include <termios.h> - -void -rl_ttyset(int Reset) -{ - static struct termios old; - struct termios new; - - if (Reset == 0) { - if (tcgetattr(0, &old) < 0) perror("tcgetattr"); - rl_erase = old.c_cc[VERASE]; - rl_kill = old.c_cc[VKILL]; - rl_eof = old.c_cc[VEOF]; - rl_intr = old.c_cc[VINTR]; - rl_quit = old.c_cc[VQUIT]; -#if defined(DO_SIGTSTP) - rl_susp = old.c_cc[VSUSP]; -#endif /* defined(DO_SIGTSTP) */ - - new = old; - new.c_lflag &= ~(ECHO | ICANON | ISIG); - new.c_iflag &= ~(ISTRIP | INPCK); - new.c_cc[VMIN] = 1; - new.c_cc[VTIME] = 0; - if (tcsetattr(0, TCSADRAIN, &new) < 0) perror("tcsetattr"); - } - else - (void)tcsetattr(0, TCSADRAIN, &old); -} - -#else -#if defined(HAVE_TERMIO) -#include <termio.h> - -void -rl_ttyset(int Reset) -{ - static struct termio old; - struct termio new; - - if (Reset == 0) { - (void)ioctl(0, TCGETA, &old); - rl_erase = old.c_cc[VERASE]; - rl_kill = old.c_cc[VKILL]; - rl_eof = old.c_cc[VEOF]; - rl_intr = old.c_cc[VINTR]; - rl_quit = old.c_cc[VQUIT]; -#if defined(DO_SIGTSTP) - rl_susp = old.c_cc[VSUSP]; -#endif /* defined(DO_SIGTSTP) */ - - new = old; - new.c_lflag &= ~(ECHO | ICANON | ISIG); - new.c_iflag &= ~(ISTRIP | INPCK); - new.c_cc[VMIN] = 1; - new.c_cc[VTIME] = 0; - (void)ioctl(0, TCSETAW, &new); - } - else - (void)ioctl(0, TCSETAW, &old); -} - -#else -#include <sgtty.h> - -void -rl_ttyset(int Reset) -{ - static struct sgttyb old_sgttyb; - static struct tchars old_tchars; - struct sgttyb new_sgttyb; - struct tchars new_tchars; -#if defined(DO_SIGTSTP) - struct ltchars old_ltchars; -#endif /* defined(DO_SIGTSTP) */ - - if (Reset == 0) { - (void)ioctl(0, TIOCGETP, &old_sgttyb); - rl_erase = old_sgttyb.sg_erase; - rl_kill = old_sgttyb.sg_kill; - - (void)ioctl(0, TIOCGETC, &old_tchars); - rl_eof = old_tchars.t_eofc; - rl_intr = old_tchars.t_intrc; - rl_quit = old_tchars.t_quitc; - -#if defined(DO_SIGTSTP) - (void)ioctl(0, TIOCGLTC, &old_ltchars); - rl_susp = old_ltchars.t_suspc; -#endif /* defined(DO_SIGTSTP) */ - - new_sgttyb = old_sgttyb; - new_sgttyb.sg_flags &= ~ECHO; - new_sgttyb.sg_flags |= RAW; -#if defined(PASS8) - new_sgttyb.sg_flags |= PASS8; -#endif /* defined(PASS8) */ - (void)ioctl(0, TIOCSETP, &new_sgttyb); - - new_tchars = old_tchars; - new_tchars.t_intrc = -1; - new_tchars.t_quitc = -1; - (void)ioctl(0, TIOCSETC, &new_tchars); - } - else { - (void)ioctl(0, TIOCSETP, &old_sgttyb); - (void)ioctl(0, TIOCSETC, &old_tchars); - } -} -#endif /* defined(HAVE_TERMIO) */ -#endif /* defined(HAVE_TCGETATTR) */ - -void -rl_add_slash(char *path, char *p, size_t p_len) -{ - struct stat Sb; - - if (stat(path, &Sb) >= 0) - (void)strlcat(p, S_ISDIR(Sb.st_mode) ? "/" : " ", p_len); -} diff --git a/ndb/src/common/editline/test/Makefile b/ndb/src/common/editline/test/Makefile deleted file mode 100644 index 20229d0aa62..00000000000 --- a/ndb/src/common/editline/test/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -include .defs.mk - -TYPE := util - -BIN_TARGET := editline_test -BIN_TARGET_ARCHIVES := editline - -SOURCES = testit.c - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/editline/test/testit.c b/ndb/src/common/editline/test/testit.c deleted file mode 100644 index 4058f8ae660..00000000000 --- a/ndb/src/common/editline/test/testit.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -/* -*- c-basic-offset: 4; -*- -** $Revision: 1.5 $ -** -** A "micro-shell" to test editline library. -** If given any arguments, commands aren't executed. -*/ -#include <ndb_global.h> -#include <editline/editline.h> - -int -main(int argc, char **argv) -{ - char *prompt; - char *p; - int doit; - - (void)argv; /* Suppress warning */ - - doit = argc == 1; - if ((prompt = getenv("TESTPROMPT")) == NULL) - prompt = "testit> "; - - while ((p = readline(prompt)) != NULL) { - (void)printf("\t\t\t|%s|\n", p); - if (doit) { - if (strncmp(p, "cd ", 3) == 0) { - if (chdir(&p[3]) < 0) - perror(&p[3]); - } else { - if (system(p) != 0) - perror(p); - } - } - add_history(p); - free(p); - } - - return 0; -} diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index 29172ff93ad..8678b999b6f 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -198,7 +198,7 @@ FileLogHandler::setFilename(const BaseString &filename) { m_pLogFile = new File_class(filename.c_str(), "a+"); open(); return true; -}; +} bool FileLogHandler::setMaxSize(const BaseString &size) { @@ -206,15 +206,15 @@ FileLogHandler::setMaxSize(const BaseString &size) { long val = strtol(size.c_str(), &end, 0); /* XXX */ if(size.c_str() == end) return false; - if(strncasecmp("M", end, 1) == 0) + if(end[0] == 'M') val *= 1024*1024; - if(strncasecmp("k", end, 1) == 0) + if(end[0] == 'k') val *= 1024; m_maxFileSize = val; return true; -}; +} bool FileLogHandler::setMaxFiles(const BaseString &files) { @@ -225,7 +225,7 @@ FileLogHandler::setMaxFiles(const BaseString &files) { m_maxNoFiles = val; return true; -}; +} bool FileLogHandler::checkParams() { diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index 4fab957fc50..ec4137297f1 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -24,7 +24,13 @@ LogHandler::LogHandler() : m_pDateTimeFormat("%d-%.2d-%.2d %.2d:%.2d:%.2d"), m_errorCode(0) -{ +{ + m_max_repeat_frequency= 3; // repeat messages maximum every 3 seconds + m_count_repeated_messages= 0; + m_last_category[0]= 0; + m_last_message[0]= 0; + m_last_log_time= 0; + m_now= 0; } LogHandler::~LogHandler() @@ -34,11 +40,53 @@ LogHandler::~LogHandler() void LogHandler::append(const char* pCategory, Logger::LoggerLevel level, const char* pMsg) -{ +{ + time_t now; + now= ::time((time_t*)NULL); + + if (level != m_last_level || + strcmp(pCategory, m_last_category) || + strcmp(pMsg, m_last_message)) + { + if (m_count_repeated_messages > 0) // print that message + append_impl(m_last_category, m_last_level, m_last_message); + + m_last_level= level; + strncpy(m_last_category, pCategory, sizeof(m_last_category)); + strncpy(m_last_message, pMsg, sizeof(m_last_message)); + } + else // repeated message + { + if (now < m_last_log_time+m_max_repeat_frequency) + { + m_count_repeated_messages++; + m_now= now; + return; + } + } + + m_now= now; + + append_impl(pCategory, level, pMsg); + m_last_log_time= now; +} + +void +LogHandler::append_impl(const char* pCategory, Logger::LoggerLevel level, + const char* pMsg) +{ writeHeader(pCategory, level); - writeMessage(pMsg); + if (m_count_repeated_messages <= 1) + writeMessage(pMsg); + else + { + BaseString str(pMsg); + str.appfmt(" - Repeated %d times", m_count_repeated_messages); + writeMessage(str.c_str()); + } + m_count_repeated_messages= 0; writeFooter(); -} +} const char* LogHandler::getDefaultHeader(char* pStr, const char* pCategory, @@ -76,12 +124,10 @@ char* LogHandler::getTimeAsString(char* pStr) const { struct tm* tm_now; - time_t now; - now = ::time((time_t*)NULL); #ifdef NDB_WIN32 - tm_now = localtime(&now); + tm_now = localtime(&m_now); #else - tm_now = ::localtime(&now); //uses the "current" timezone + tm_now = ::localtime(&m_now); //uses the "current" timezone #endif BaseString::snprintf(pStr, MAX_DATE_TIME_HEADER_LENGTH, @@ -117,10 +163,9 @@ LogHandler::parseParams(const BaseString &_params) { _params.split(v_args, ","); for(size_t i=0; i < v_args.size(); i++) { Vector<BaseString> v_param_value; - - v_args[i].split(v_param_value, "=", 2); - if(v_param_value.size() == 2 && - !setParam(v_param_value[0], v_param_value[1])) + if(v_args[i].split(v_param_value, "=", 2) != 2) + ret = false; + else if (!setParam(v_param_value[0], v_param_value[1])) ret = false; } diff --git a/ndb/src/common/logger/LogHandlerList.hpp b/ndb/src/common/logger/LogHandlerList.hpp index 7c001a28a76..21344023560 100644 --- a/ndb/src/common/logger/LogHandlerList.hpp +++ b/ndb/src/common/logger/LogHandlerList.hpp @@ -18,6 +18,7 @@ #define LOGHANDLERLIST_H class LogHandler; +#include <ndb_global.h> /** * Provides a simple linked list of log handlers. diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 00a2fae67bc..7f18f5bd3ec 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -30,7 +30,7 @@ // // PUBLIC // -const char* Logger::LoggerLevelNames[] = { "OFF ", +const char* Logger::LoggerLevelNames[] = { "ON ", "DEBUG ", "INFO ", "WARNING ", @@ -46,7 +46,9 @@ Logger::Logger() : m_pSyslogHandler(NULL) { m_pHandlerList = new LogHandlerList(); - m_logLevels[LL_INFO] = true; + disable(LL_ALL); + enable(LL_ON); + enable(LL_INFO); } Logger::~Logger() @@ -169,10 +171,13 @@ Logger::addHandler(const BaseString &logstring) { size_t i; Vector<BaseString> logdest; Vector<LogHandler *>loghandlers; + DBUG_ENTER("Logger::addHandler"); logstring.split(logdest, ";"); for(i = 0; i < logdest.size(); i++) { + DBUG_PRINT("info",("adding: %s",logdest[i].c_str())); + Vector<BaseString> v_type_args; logdest[i].split(v_type_args, ":", 2); @@ -183,24 +188,28 @@ Logger::addHandler(const BaseString &logstring) { LogHandler *handler = NULL; - if(type == "SYSLOG") { +#ifndef NDB_WIN32 + if(type == "SYSLOG") + { handler = new SysLogHandler(); - } else if(type == "FILE") + } else +#endif + if(type == "FILE") handler = new FileLogHandler(); else if(type == "CONSOLE") handler = new ConsoleLogHandler(); - + if(handler == NULL) - return false; + DBUG_RETURN(false); if(!handler->parseParams(params)) - return false; + DBUG_RETURN(false); loghandlers.push_back(handler); } for(i = 0; i < loghandlers.size(); i++) addHandler(loghandlers[i]); - return true; /* @todo handle errors */ + DBUG_RETURN(true); /* @todo handle errors */ } bool @@ -224,6 +233,13 @@ Logger::removeAllHandlers() bool Logger::isEnable(LoggerLevel logLevel) const { + if (logLevel == LL_ALL) + { + for (unsigned i = 1; i < MAX_LOG_LEVELS; i++) + if (!m_logLevels[i]) + return false; + return true; + } return m_logLevels[logLevel]; } @@ -232,7 +248,7 @@ Logger::enable(LoggerLevel logLevel) { if (logLevel == LL_ALL) { - for (unsigned i = 1; i < MAX_LOG_LEVELS; i++) + for (unsigned i = 0; i < MAX_LOG_LEVELS; i++) { m_logLevels[i] = true; } @@ -334,16 +350,16 @@ Logger::debug(const char* pMsg, ...) const void Logger::log(LoggerLevel logLevel, const char* pMsg, va_list ap) const { - if (m_logLevels[LL_OFF] == false && m_logLevels[logLevel]) + if (m_logLevels[LL_ON] && m_logLevels[logLevel]) { LogHandler* pHandler = NULL; while ( (pHandler = m_pHandlerList->next()) != NULL) { - char buf[1024]; + char buf[MAX_LOG_MESSAGE_SIZE]; BaseString::vsnprintf(buf, sizeof(buf), pMsg, ap); pHandler->append(m_pCategory, logLevel, buf); } - } + } } // diff --git a/ndb/src/common/logger/Makefile.am b/ndb/src/common/logger/Makefile.am index 0a48214c37c..0af21f9fbde 100644 --- a/ndb/src/common/logger/Makefile.am +++ b/ndb/src/common/logger/Makefile.am @@ -1,11 +1,25 @@ noinst_LTLIBRARIES = liblogger.la -liblogger_la_SOURCES = Logger.cpp LogHandlerList.cpp LogHandler.cpp \ - ConsoleLogHandler.cpp FileLogHandler.cpp SysLogHandler.cpp +SOURCE_WIN = Logger.cpp LogHandlerList.cpp LogHandler.cpp \ + ConsoleLogHandler.cpp FileLogHandler.cpp +liblogger_la_SOURCES = $(SOURCE_WIN) SysLogHandler.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% +windoze-dsp: liblogger.dsp + +liblogger.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(SOURCE_WIN) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/logger/Makefile_old b/ndb/src/common/logger/Makefile_old deleted file mode 100644 index 994eb86ba35..00000000000 --- a/ndb/src/common/logger/Makefile_old +++ /dev/null @@ -1,27 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := logger - -DIRS := loggertest - -SOURCES := Logger.cpp LogHandlerList.cpp LogHandler.cpp \ - ConsoleLogHandler.cpp FileLogHandler.cpp - -ifeq ($(NDB_OS), OSE) -NO_SYSLOG := Y -endif - -ifeq ($(NDB_OS), WIN32) -NO_SYSLOG := Y -endif - -ifneq ($(NO_SYSLOG), Y) -SOURCES += SysLogHandler.cpp -endif - -include $(NDB_TOP)/Epilogue.mk - - diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index d8417ac146a..fd04ad393eb 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -20,7 +20,6 @@ #include <ConfigRetriever.hpp> #include <SocketServer.hpp> -#include "LocalConfig.hpp" #include <NdbSleep.h> #include <NdbOut.hpp> @@ -45,90 +44,67 @@ //**************************************************************************** //**************************************************************************** -ConfigRetriever::ConfigRetriever(LocalConfig &local_config, +ConfigRetriever::ConfigRetriever(const char * _connect_string, Uint32 version, Uint32 node_type) - : _localConfig(local_config) { - m_handle= 0; m_version = version; m_node_type = node_type; - _ownNodeId = _localConfig._ownNodeId; -} + _ownNodeId= 0; + + m_handle= ndb_mgm_create_handle(); + + if (m_handle == 0) { + setError(CR_ERROR, "Unable to allocate mgm handle"); + return; + } -ConfigRetriever::~ConfigRetriever(){ + if (ndb_mgm_set_connectstring(m_handle, _connect_string)) + { + setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); + return; + } + resetError(); +} +ConfigRetriever::~ConfigRetriever() +{ if (m_handle) { ndb_mgm_disconnect(m_handle); ndb_mgm_destroy_handle(&m_handle); } } +Uint32 +ConfigRetriever::get_configuration_nodeid() const +{ + return ndb_mgm_get_configuration_nodeid(m_handle); +} + +Uint32 ConfigRetriever::get_mgmd_port() const +{ + return ndb_mgm_get_connected_port(m_handle); +} + +const char *ConfigRetriever::get_mgmd_host() const +{ + return ndb_mgm_get_connected_host(m_handle); +} + +const char *ConfigRetriever::get_connectstring(char *buf, int buf_sz) const +{ + return ndb_mgm_get_connectstring(m_handle, buf, buf_sz); +} //**************************************************************************** //**************************************************************************** int -ConfigRetriever::do_connect(int exit_on_connect_failure){ - - m_mgmd_port= 0; - m_mgmd_host= 0; - - if(!m_handle) - m_handle= ndb_mgm_create_handle(); - - if (m_handle == 0) { - setError(CR_ERROR, "Unable to allocate mgm handle"); - return -1; - } - - int retry = 1; - int retry_max = 12; // Max number of retry attempts - int retry_interval= 5; // Seconds between each retry - while(retry < retry_max){ - Uint32 type = CR_ERROR; - BaseString tmp; - for (unsigned int i = 0; i<_localConfig.ids.size(); i++){ - MgmtSrvrId * m = &_localConfig.ids[i]; - DBUG_PRINT("info",("trying %s:%d", - m->name.c_str(), - m->port)); - switch(m->type){ - case MgmId_TCP: - tmp.assfmt("%s:%d", m->name.c_str(), m->port); - if (ndb_mgm_connect(m_handle, tmp.c_str()) == 0) { - m_mgmd_port= m->port; - m_mgmd_host= m->name.c_str(); - DBUG_PRINT("info",("connected to ndb_mgmd at %s:%d", - m_mgmd_host, - m_mgmd_port)); - return 0; - } - setError(CR_RETRY, ndb_mgm_get_latest_error_desc(m_handle)); - case MgmId_File: - break; - } - } - if(latestErrorType == CR_RETRY){ - DBUG_PRINT("info",("CR_RETRY")); - if (exit_on_connect_failure) - return 1; - REPORT_WARNING("Failed to retrieve cluster configuration"); - ndbout << "(Cause of failure: " << getErrorString() << ")" << endl; - ndbout << "Attempt " << retry << " of " << retry_max << ". " - << "Trying again in "<< retry_interval <<" seconds..." - << endl << endl; - NdbSleep_SecSleep(retry_interval); - } else { - break; - } - retry++; - } - - ndb_mgm_destroy_handle(&m_handle); - m_handle= 0; - m_mgmd_port= 0; - m_mgmd_host= 0; - return -1; +ConfigRetriever::do_connect(int no_retries, + int retry_delay_in_seconds, int verbose) +{ + return + (ndb_mgm_connect(m_handle,no_retries,retry_delay_in_seconds,verbose)==0) ? + 0 : -1; } //**************************************************************************** @@ -140,22 +116,9 @@ ConfigRetriever::getConfig() { struct ndb_mgm_configuration * p = 0; - if(m_handle != 0){ + if(m_handle != 0) p = getConfig(m_handle); - } else { - for (unsigned int i = 0; i<_localConfig.ids.size(); i++){ - MgmtSrvrId * m = &_localConfig.ids[i]; - switch(m->type){ - case MgmId_File: - p = getConfig(m->name.c_str()); - break; - case MgmId_TCP: - break; - } - if(p) - break; - } - } + if(p == 0) return 0; @@ -178,9 +141,10 @@ ConfigRetriever::getConfig(NdbMgmHandle m_handle){ return conf; } - + ndb_mgm_configuration * ConfigRetriever::getConfig(const char * filename){ +#ifndef NDB_WIN32 struct stat sbuf; const int res = stat(filename, &sbuf); @@ -217,8 +181,10 @@ ConfigRetriever::getConfig(const char * filename){ return 0; } delete [] buf2; - return (ndb_mgm_configuration*)cvf.m_cfg; +#else + return 0; +#endif } void @@ -227,6 +193,16 @@ ConfigRetriever::setError(ErrorType et, const char * s){ latestErrorType = et; } +void +ConfigRetriever::resetError(){ + setError(CR_NO_ERROR,0); +} + +int +ConfigRetriever::hasError() +{ + return latestErrorType != CR_NO_ERROR; +} const char * ConfigRetriever::getErrorString(){ @@ -238,7 +214,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 char buf[255]; ndb_mgm_configuration_iterator * it; - it = ndb_mgm_create_configuration_iterator((struct ndb_mgm_configuration *)conf, CFG_SECTION_NODE); + it = ndb_mgm_create_configuration_iterator((struct ndb_mgm_configuration *)conf, + CFG_SECTION_NODE); if(it == 0){ BaseString::snprintf(buf, 255, "Unable to create config iterator"); @@ -284,8 +261,14 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 } if(_type != m_node_type){ - BaseString::snprintf(buf, 255, "Supplied node type(%d) and config node type(%d) " - " don't match", m_node_type, _type); + const char *type_s, *alias_s, *type_s2, *alias_s2; + alias_s= ndb_mgm_get_node_type_alias_string((enum ndb_mgm_node_type)m_node_type, + &type_s); + alias_s2= ndb_mgm_get_node_type_alias_string((enum ndb_mgm_node_type)_type, + &type_s2); + BaseString::snprintf(buf, 255, "This node type %s(%s) and config " + "node type %s(%s) don't match for nodeid %d", + alias_s, type_s, alias_s2, type_s2, nodeid); setError(CR_ERROR, buf); return false; } @@ -333,17 +316,30 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 return true; } +int +ConfigRetriever::setNodeId(Uint32 nodeid) +{ + return ndb_mgm_set_configuration_nodeid(m_handle, nodeid); +} + Uint32 -ConfigRetriever::allocNodeId(){ - unsigned nodeid= _ownNodeId; - - if(m_handle != 0){ - int res= ndb_mgm_alloc_nodeid(m_handle, m_version, &nodeid, m_node_type); - if(res != 0) { - setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); - return 0; +ConfigRetriever::allocNodeId(int no_retries, int retry_delay_in_seconds) +{ + _ownNodeId= 0; + if(m_handle != 0) + { + while (1) + { + int res= ndb_mgm_alloc_nodeid(m_handle, m_version, m_node_type); + if(res >= 0) + return _ownNodeId= (Uint32)res; + if (no_retries == 0) + break; + no_retries--; + NdbSleep_SecSleep(retry_delay_in_seconds); } - } - - return _ownNodeId= nodeid; + setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); + } else + setError(CR_ERROR, "management server handle not initialized"); + return 0; } diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp index 780504d2c62..86791490863 100644 --- a/ndb/src/common/mgmcommon/IPCConfig.cpp +++ b/ndb/src/common/mgmcommon/IPCConfig.cpp @@ -14,7 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "IPCConfig.hpp" +#include <ndb_global.h> +#include <ndb_opt_defaults.h> +#include <IPCConfig.hpp> #include <NdbOut.hpp> #include <NdbHost.h> @@ -381,8 +383,15 @@ IPCConfig::configureTransporters(Uint32 nodeId, if(iter.get(CFG_SHM_KEY, &conf.shmKey)) break; if(iter.get(CFG_SHM_BUFFER_MEM, &conf.shmSize)) break; - + { + Uint32 tmp; + if(iter.get(CFG_SHM_SIGNUM, &tmp)) break; + conf.signum= tmp; + } + conf.port= server_port; + conf.localHostName = localHostName; + conf.remoteHostName = remoteHostName; if(!tr.createTransporter(&conf)){ DBUG_PRINT("error", ("Failed to create SHM Transporter from %d to %d", diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index ed6a526eb47..104bf0b29f2 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -1,17 +1,28 @@ noinst_LTLIBRARIES = libmgmsrvcommon.la libmgmsrvcommon_la_SOURCES = \ - LocalConfig.cpp \ ConfigRetriever.cpp \ - IPCConfig.cpp NdbConfig.c + IPCConfig.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi -I$(top_srcdir)/ndb/src/mgmsrv -DEFS_LOC = -DNDB_BASE_PORT="\"@ndb_port_base@\"" - include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libmgmsrvcommon.dsp + +libmgmsrvcommon.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmsrvcommon_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/mgmcommon/Makefile_old b/ndb/src/common/mgmcommon/Makefile_old deleted file mode 100644 index c7bfda7e3bf..00000000000 --- a/ndb/src/common/mgmcommon/Makefile_old +++ /dev/null @@ -1,29 +0,0 @@ -include .defs.mk - -TYPE := ndbapi mgmapiclient - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := mgmsrvcommon - -# Removed temporary -DIRS := printConfig - -SOURCES = \ - LocalConfig.cpp \ - Config.cpp \ - ConfigInfo.cpp \ - ConfigRetriever.cpp \ - InitConfigFileParser.cpp \ - IPCConfig.cpp - -SOURCES.c = NdbConfig.c - -CFLAGS_IPCConfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) - -include $(NDB_TOP)/Epilogue.mk - - - - - - diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index 6f3a3fe01a9..99138a7414e 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -5,7 +5,8 @@ noinst_LTLIBRARIES = libportlib.la libportlib_la_SOURCES = \ NdbCondition.c NdbMutex.c NdbSleep.c NdbTick.c \ NdbEnv.c NdbThread.c NdbHost.c NdbTCP.cpp \ - NdbDaemon.c NdbMem.c + NdbDaemon.c NdbMem.c \ + NdbConfig.c include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am @@ -16,3 +17,27 @@ PortLibTest_SOURCES = NdbPortLibTest.cpp munmaptest_SOURCES = munmaptest.cpp # Don't update the files from bitkeeper +WIN_src = win32/NdbCondition.c \ + win32/NdbDaemon.c \ + win32/NdbEnv.c \ + win32/NdbHost.c \ + win32/NdbMem.c \ + win32/NdbMutex.c \ + win32/NdbSleep.c \ + win32/NdbTCP.c \ + win32/NdbThread.c \ + win32/NdbTick.c + +windoze-dsp: libportlib.dsp + +libportlib.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(WIN_src) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/portlib/Makefile_old b/ndb/src/common/portlib/Makefile_old deleted file mode 100644 index 48f4929a839..00000000000 --- a/ndb/src/common/portlib/Makefile_old +++ /dev/null @@ -1,21 +0,0 @@ -include .defs.mk - -DIRS := - -ifeq ($(NDB_OS), SOFTOSE) -DIRS += ose -else -ifeq ($(NDB_OS), OSE) -DIRS += ose -else -ifeq ($(NDB_OS), WIN32) -DIRS += win32 -else -DIRS += unix -endif -endif -endif - - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/portlib/NdbConfig.c index e92f8fa8392..b275143646f 100644 --- a/ndb/src/common/mgmcommon/NdbConfig.c +++ b/ndb/src/common/portlib/NdbConfig.c @@ -18,6 +18,7 @@ #include <NdbConfig.h> #include <NdbEnv.h> #include <NdbMem.h> +#include <basestring_vsnprintf.h> static const char *datadir_path= 0; @@ -48,7 +49,7 @@ NdbConfig_AllocHomePath(int _len) const char *path= NdbConfig_get_path(&path_len); int len= _len+path_len; char *buf= NdbMem_Allocate(len); - snprintf(buf, len, "%s%s", path, DIR_SEPARATOR); + basestring_snprintf(buf, len, "%s%s", path, DIR_SEPARATOR); return buf; } @@ -67,19 +68,19 @@ NdbConfig_NdbCfgName(int with_ndb_home){ len= strlen(buf); } else buf= NdbMem_Allocate(128); - snprintf(buf+len, 128, "Ndb.cfg"); + basestring_snprintf(buf+len, 128, "Ndb.cfg"); return buf; } static char *get_prefix_buf(int len, int node_id) { - char tmp_buf[sizeof("ndb_pid#########")+1]; + char tmp_buf[sizeof("ndb_pid#############")+1]; char *buf; if (node_id > 0) - snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id); + basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id); else - snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid()); + basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid()); tmp_buf[sizeof(tmp_buf)-1]= 0; buf= NdbConfig_AllocHomePath(len+strlen(tmp_buf)); @@ -91,7 +92,7 @@ char* NdbConfig_ErrorFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_error.log"); + basestring_snprintf(buf+len, 128, "_error.log"); return buf; } @@ -99,7 +100,7 @@ char* NdbConfig_ClusterLogFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_cluster.log"); + basestring_snprintf(buf+len, 128, "_cluster.log"); return buf; } @@ -107,7 +108,7 @@ char* NdbConfig_SignalLogFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_signal.log"); + basestring_snprintf(buf+len, 128, "_signal.log"); return buf; } @@ -115,7 +116,7 @@ char* NdbConfig_TraceFileName(int node_id, int file_no){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_trace.log.%u", file_no); + basestring_snprintf(buf+len, 128, "_trace.log.%u", file_no); return buf; } @@ -123,7 +124,7 @@ char* NdbConfig_NextTraceFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_trace.log.next"); + basestring_snprintf(buf+len, 128, "_trace.log.next"); return buf; } @@ -131,7 +132,7 @@ char* NdbConfig_PidFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, ".pid"); + basestring_snprintf(buf+len, 128, ".pid"); return buf; } @@ -139,6 +140,6 @@ char* NdbConfig_StdoutFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_out.log"); + basestring_snprintf(buf+len, 128, "_out.log"); return buf; } diff --git a/ndb/src/common/portlib/NdbDaemon.c b/ndb/src/common/portlib/NdbDaemon.c index c73b5927ff4..3f1c1998501 100644 --- a/ndb/src/common/portlib/NdbDaemon.c +++ b/ndb/src/common/portlib/NdbDaemon.c @@ -55,18 +55,21 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) "%s: lseek failed: %s", lockfile, strerror(errno)); return -1; } +#ifdef F_TLOCK /* Test for lock before becoming daemon */ - if (lockf(lockfd, F_TEST, 0) == -1) { - if (errno == EACCES || errno == EAGAIN) { /* results may vary */ + if (lockf(lockfd, F_TLOCK, 0) == -1) + { + if (errno == EACCES || errno == EAGAIN) { /* results may vary */ snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, - "%s: already locked by pid=%ld", lockfile, NdbDaemon_DaemonPid); + "%s: already locked by pid=%ld", lockfile, NdbDaemon_DaemonPid); return -1; } NdbDaemon_ErrorCode = errno; snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, - "%s: lock test failed: %s", lockfile, strerror(errno)); + "%s: lock test failed: %s", lockfile, strerror(errno)); return -1; } +#endif /* Test open log file before becoming daemon */ if (logfile != NULL) { logfd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0644); @@ -77,6 +80,15 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) return -1; } } +#ifdef F_TLOCK + if (lockf(lockfd, F_ULOCK, 0) == -1) + { + snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, + "%s: fail to unlock", lockfile); + return -1; + } +#endif + /* Fork */ n = fork(); if (n == -1) { diff --git a/ndb/src/common/portlib/NdbPortLibTest.cpp b/ndb/src/common/portlib/NdbPortLibTest.cpp index 55b9ccec5f2..d7892411851 100644 --- a/ndb/src/common/portlib/NdbPortLibTest.cpp +++ b/ndb/src/common/portlib/NdbPortLibTest.cpp @@ -54,10 +54,7 @@ extern "C" void* thread1func(void* arg) if (arg1 != 7) fail("TEST1", "Wrong arg"); - NdbThread_Exit(returnvalue); - - return NULL; - + return returnvalue; } // test 2 variables and funcs @@ -80,10 +77,7 @@ extern "C" void* test2func(void* arg) fail("TEST2", "Failed to unlock mutex"); int returnvalue = arg1; - NdbThread_Exit(returnvalue); - - return NULL; - + return returnvalue; } @@ -129,8 +123,7 @@ extern "C" void* testfunc(void* arg) } while(tmpVar<100); - NdbThread_Exit(0); - return NULL; + return 0; } extern "C" void* testTryLockfunc(void* arg) @@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg) } while(tmpVar<100); - NdbThread_Exit(0); - return NULL; + return 0; } diff --git a/ndb/src/common/portlib/NdbTCP.cpp b/ndb/src/common/portlib/NdbTCP.cpp index 35b0c8c21e4..a63f5a7ba27 100644 --- a/ndb/src/common/portlib/NdbTCP.cpp +++ b/ndb/src/common/portlib/NdbTCP.cpp @@ -22,7 +22,7 @@ extern "C" int Ndb_getInAddr(struct in_addr * dst, const char *address) { - DBUG_ENTER("Ndb_getInAddr"); + // DBUG_ENTER("Ndb_getInAddr"); { int tmp_errno; struct hostent tmp_hostent, *hp; @@ -33,7 +33,7 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { { memcpy(dst, hp->h_addr, min(sizeof(*dst), (size_t) hp->h_length)); my_gethostbyname_r_free(); - DBUG_RETURN(0); + return 0; //DBUG_RETURN(0); } my_gethostbyname_r_free(); } @@ -47,11 +47,11 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { #endif ) { - DBUG_RETURN(0); + return 0; //DBUG_RETURN(0); } - DBUG_PRINT("error",("inet_addr(%s) - %d - %s", - address, errno, strerror(errno))); - DBUG_RETURN(-1); + // DBUG_PRINT("error",("inet_addr(%s) - %d - %s", + // address, errno, strerror(errno))); + return -1; //DBUG_RETURN(-1); } #if 0 diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index 69e39994a9c..aaee9b45069 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -17,19 +17,51 @@ #include <ndb_global.h> #include <NdbThread.h> -#include <pthread.h> +#include <my_pthread.h> #include <NdbMem.h> #define MAX_THREAD_NAME 16 /*#define USE_PTHREAD_EXTRAS*/ +#ifdef NDB_SHM_TRANSPORTER +int g_ndb_shm_signum= 0; +#endif + struct NdbThread { pthread_t thread; char thread_name[MAX_THREAD_NAME]; + NDB_THREAD_FUNC * func; + void * object; }; +static +void* +ndb_thread_wrapper(void* _ss){ + my_thread_init(); + { + DBUG_ENTER("ndb_thread_wrapper"); +#ifdef NDB_SHM_TRANSPORTER + if (g_ndb_shm_signum) + { + sigset_t mask; + DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); + sigemptyset(&mask); + sigaddset(&mask, g_ndb_shm_signum); + pthread_sigmask(SIG_BLOCK, &mask, 0); + } +#endif + { + void *ret; + struct NdbThread * ss = (struct NdbThread *)_ss; + ret= (* ss->func)(ss->object); + NdbThread_Exit(ret); + } + /* will never be reached */ + DBUG_RETURN(0); + } +} struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, @@ -54,7 +86,11 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, strnmov(tmpThread->thread_name,p_thread_name,sizeof(tmpThread->thread_name)); pthread_attr_init(&thread_attr); +#if (SIZEOF_CHARP == 8) + pthread_attr_setstacksize(&thread_attr, 2*thread_stack_size); +#else pthread_attr_setstacksize(&thread_attr, thread_stack_size); +#endif #ifdef USE_PTHREAD_EXTRAS /* Guard stack overflow with a 2k databuffer */ pthread_attr_setguardsize(&thread_attr, 2048); @@ -63,10 +99,12 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, #ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */ pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); #endif + tmpThread->func= p_thread_func; + tmpThread->object= p_thread_arg; result = pthread_create(&tmpThread->thread, &thread_attr, - p_thread_func, - p_thread_arg); + ndb_thread_wrapper, + tmpThread); assert(result==0); pthread_attr_destroy(&thread_attr); @@ -99,9 +137,10 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) } -void NdbThread_Exit(int status) +void NdbThread_Exit(void *status) { - pthread_exit(&status); + my_thread_end(); + pthread_exit(status); } diff --git a/ndb/src/common/portlib/old_dirs/unix/Makefile_old b/ndb/src/common/portlib/old_dirs/unix/Makefile_old deleted file mode 100644 index 452196d9f08..00000000000 --- a/ndb/src/common/portlib/old_dirs/unix/Makefile_old +++ /dev/null @@ -1,27 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := portlib - -SOURCES.c = NdbCondition.c \ - NdbMutex.c \ - NdbSleep.c \ - NdbTick.c \ - NdbEnv.c \ - NdbThread.c \ - NdbHost.c \ - NdbTCP.c \ - NdbDaemon.c - -ifeq ($(NDB_OS), SOFTOSE) - SOURCES += NdbMem_SoftOse.cpp -else - SOURCES.c += NdbMem.c -endif - -include $(NDB_TOP)/Epilogue.mk - -testNdbDaemon: NdbDaemon.c - $(CC) -o $@ NdbDaemon.c $(CCFLAGS) -DNDB_DAEMON_TEST -L$(NDB_TOP)/lib diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c new file mode 100644 index 00000000000..4046db1d60a --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -0,0 +1,178 @@ +/* Copyright (C) 2003 MySQL 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 */ + + +#include <ndb_global.h> +#include "NdbCondition.h" +#include <NdbMutex.h> + +struct NdbCondition +{ + long nWaiters; + NdbMutex* pNdbMutexWaitersLock; + HANDLE hSemaphore; + HANDLE hEventWaitersDone; + int bWasBroadcast; +}; + + +struct NdbCondition* +NdbCondition_Create(void) +{ + int result = 0; + struct NdbCondition* pNdbCondition = (struct NdbCondition*)malloc(sizeof(struct NdbCondition)); + if(!pNdbCondition) + return 0; + + pNdbCondition->nWaiters = 0; + pNdbCondition->bWasBroadcast = 0; + if(!(pNdbCondition->hSemaphore = CreateSemaphore(0, 0, MAXLONG, 0))) + result = -1; + else if(!(pNdbCondition->pNdbMutexWaitersLock = NdbMutex_Create())) + result = -1; + else if(!(pNdbCondition->hEventWaitersDone = CreateEvent(0, 0, 0, 0))) + result = -1; + + assert(!result); + return pNdbCondition; +} + + +int +NdbCondition_Wait(struct NdbCondition* p_cond, + NdbMutex* p_mutex) +{ + int result; + int bLastWaiter; + if(!p_cond || !p_mutex) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters++; + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(NdbMutex_Unlock(p_mutex)) + return -1; + result = WaitForSingleObject (p_cond->hSemaphore, INFINITE); + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters--; + bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(result==WAIT_OBJECT_0 && bLastWaiter) + SetEvent(p_cond->hEventWaitersDone); + + NdbMutex_Lock(p_mutex); + return result; +} + + +int +NdbCondition_WaitTimeout(struct NdbCondition* p_cond, + NdbMutex* p_mutex, + int msecs) +{ + int result; + int bLastWaiter; + if (!p_cond || !p_mutex) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters++; + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + if(msecs<0) + msecs = 0; + + if(NdbMutex_Unlock(p_mutex)) + return -1; + result = WaitForSingleObject(p_cond->hSemaphore, msecs); + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters--; + bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(result!=WAIT_OBJECT_0) + result = -1; + + if(bLastWaiter) + SetEvent(p_cond->hEventWaitersDone); + + NdbMutex_Lock(p_mutex); + return result; +} + + +int +NdbCondition_Signal(struct NdbCondition* p_cond) +{ + int bHaveWaiters; + if(!p_cond) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + bHaveWaiters = (p_cond->nWaiters > 0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(bHaveWaiters) + return (ReleaseSemaphore(p_cond->hSemaphore, 1, 0) ? 0 : -1); + else + return 0; +} + + +int NdbCondition_Broadcast(struct NdbCondition* p_cond) +{ + int bHaveWaiters; + int result = 0; + if(!p_cond) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + bHaveWaiters = 0; + if(p_cond->nWaiters > 0) + { + p_cond->bWasBroadcast = !0; + bHaveWaiters = 1; + } + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + if(bHaveWaiters) + { + if(!ReleaseSemaphore(p_cond->hSemaphore, p_cond->nWaiters, 0)) + result = -1; + else if(WaitForSingleObject (p_cond->hEventWaitersDone, INFINITE) != WAIT_OBJECT_0) + result = -1; + p_cond->bWasBroadcast = 0; + } + return result; +} + + +int NdbCondition_Destroy(struct NdbCondition* p_cond) +{ + int result; + if(!p_cond) + return 1; + + CloseHandle(p_cond->hEventWaitersDone); + NdbMutex_Destroy(p_cond->pNdbMutexWaitersLock); + result = (CloseHandle(p_cond->hSemaphore) ? 0 : -1); + + free(p_cond); + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c new file mode 100644 index 00000000000..b96d4c20260 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbDaemon.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include "NdbDaemon.h" + +#define NdbDaemon_ErrorSize 500 +long NdbDaemon_DaemonPid; +int NdbDaemon_ErrorCode; +char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; + +int +NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) +{ + // XXX do something + return 0; +} + +#ifdef NDB_DAEMON_TEST + +int +main() +{ + if (NdbDaemon_Make("test.pid", "test.log", 0) == -1) { + fprintf(stderr, "NdbDaemon_Make: %s\n", NdbDaemon_ErrorText); + return 1; + } + sleep(10); + return 0; +} + +#endif diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/win32/NdbEnv.c new file mode 100644 index 00000000000..f42e685fe15 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbEnv.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include <ndb_global.h> +#include "NdbEnv.h" + +const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen) +{ + char* p = NULL; + p = getenv(name); + + if (p != NULL && buf != NULL){ + strncpy(buf, p, buflen); + buf[buflen-1] = 0; + } + return p; +} + diff --git a/ndb/src/common/editline/editline_internal.h b/ndb/src/common/portlib/win32/NdbHost.c index 5ed2b32a873..7df96c45991 100644 --- a/ndb/src/common/editline/editline_internal.h +++ b/ndb/src/common/portlib/win32/NdbHost.c @@ -14,33 +14,39 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Revision: 1.2 $ -** -** Internal header file for editline library. -*/ #include <ndb_global.h> - -#if defined(SYS_UNIX) -#include "unix.h" -#endif /* defined(SYS_UNIX) */ - -#define MEM_INC 64 -#define SCREEN_INC 256 - -/* -** Variables and routines internal to this package. -*/ -extern int rl_eof; -extern int rl_erase; -extern int rl_intr; -extern int rl_kill; -extern int rl_quit; -#if defined(DO_SIGTSTP) -extern int rl_susp; -#endif /* defined(DO_SIGTSTP) */ -extern char *rl_complete(); -extern int rl_list_possib(); -extern void rl_ttyset(); -extern void rl_add_slash(); +#include "NdbHost.h" + + +int NdbHost_GetHostName(char* buf) +{ + /* We must initialize TCP/IP if we want to call gethostname */ + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD( 2, 0 ); + err = WSAStartup( wVersionRequested, &wsaData ); + if ( err != 0 ) { + /** + * Tell the user that we couldn't find a usable + * WinSock DLL. + */ + return -1; + } + + /* Get host name */ + if(gethostname(buf, MAXHOSTNAMELEN)) + { + return -1; + } + return 0; +} + + +int NdbHost_GetProcessId(void) +{ + return _getpid(); +} diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c new file mode 100644 index 00000000000..313ca9dff66 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -0,0 +1,283 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include <ndb_global.h> +#include "NdbMem.h" + +#if 0 +struct AWEINFO +{ + SIZE_T dwSizeInBytesRequested; + ULONG_PTR nNumberOfPagesRequested; + ULONG_PTR nNumberOfPagesActual; + ULONG_PTR nNumberOfPagesFreed; + ULONG_PTR* pnPhysicalMemoryPageArray; + void* pRegionReserved; +}; + +const size_t cNdbMem_nMaxAWEinfo = 256; +size_t gNdbMem_nAWEinfo = 0; + +struct AWEINFO* gNdbMem_pAWEinfo = 0; + + +void ShowLastError(const char* szContext, const char* szFunction) +{ + DWORD dwError = GetLastError(); + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dwError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR)&lpMsgBuf, + 0, + NULL + ); + printf("%s : %s failed : %lu : %s\n", szContext, szFunction, dwError, (char*)lpMsgBuf); + LocalFree(lpMsgBuf); +} + + + +void NdbMem_Create() +{ + // Address Windowing Extensions + struct PRIVINFO + { + DWORD Count; + LUID_AND_ATTRIBUTES Privilege[1]; + } Info; + + HANDLE hProcess = GetCurrentProcess(); + HANDLE hToken; + if(!OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken)) + { + ShowLastError("NdbMem_Create", "OpenProcessToken"); + } + + Info.Count = 1; + Info.Privilege[0].Attributes = SE_PRIVILEGE_ENABLED; + if(!LookupPrivilegeValue(0, SE_LOCK_MEMORY_NAME, &(Info.Privilege[0].Luid))) + { + ShowLastError("NdbMem_Create", "LookupPrivilegeValue"); + } + + if(!AdjustTokenPrivileges(hToken, FALSE, (PTOKEN_PRIVILEGES)&Info, 0, 0, 0)) + { + ShowLastError("NdbMem_Create", "AdjustTokenPrivileges"); + } + + if(!CloseHandle(hToken)) + { + ShowLastError("NdbMem_Create", "CloseHandle"); + } + + return; +} + +void NdbMem_Destroy() +{ + /* Do nothing */ + return; +} + +void* NdbMem_Allocate(size_t size) +{ + // Address Windowing Extensions + struct AWEINFO* pAWEinfo; + HANDLE hProcess; + SYSTEM_INFO sysinfo; + + if(!gNdbMem_pAWEinfo) + { + gNdbMem_pAWEinfo = VirtualAlloc(0, + sizeof(struct AWEINFO)*cNdbMem_nMaxAWEinfo, + MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); + } + + assert(gNdbMem_nAWEinfo < cNdbMem_nMaxAWEinfo); + pAWEinfo = gNdbMem_pAWEinfo+gNdbMem_nAWEinfo++; + + hProcess = GetCurrentProcess(); + GetSystemInfo(&sysinfo); + pAWEinfo->nNumberOfPagesRequested = (size+sysinfo.dwPageSize-1)/sysinfo.dwPageSize; + pAWEinfo->pnPhysicalMemoryPageArray = VirtualAlloc(0, + sizeof(ULONG_PTR)*pAWEinfo->nNumberOfPagesRequested, + MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); + pAWEinfo->nNumberOfPagesActual = pAWEinfo->nNumberOfPagesRequested; + if(!AllocateUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesActual), pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Allocate", "AllocateUserPhysicalPages"); + return 0; + } + if(pAWEinfo->nNumberOfPagesRequested != pAWEinfo->nNumberOfPagesActual) + { + ShowLastError("NdbMem_Allocate", "nNumberOfPagesRequested != nNumberOfPagesActual"); + return 0; + } + + pAWEinfo->dwSizeInBytesRequested = size; + pAWEinfo->pRegionReserved = VirtualAlloc(0, pAWEinfo->dwSizeInBytesRequested, MEM_RESERVE | MEM_PHYSICAL, PAGE_READWRITE); + if(!pAWEinfo->pRegionReserved) + { + ShowLastError("NdbMem_Allocate", "VirtualAlloc"); + return 0; + } + + if(!MapUserPhysicalPages(pAWEinfo->pRegionReserved, pAWEinfo->nNumberOfPagesActual, pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Allocate", "MapUserPhysicalPages"); + return 0; + } + + /* + printf("allocate AWE memory: %lu bytes, %lu pages, address %lx\n", + pAWEinfo->dwSizeInBytesRequested, + pAWEinfo->nNumberOfPagesActual, + pAWEinfo->pRegionReserved); + */ + return pAWEinfo->pRegionReserved; +} + + +void* NdbMem_AllocateAlign(size_t size, size_t alignment) +{ + /* + return (void*)memalign(alignment, size); + TEMP fix + */ + return NdbMem_Allocate(size); +} + + +void NdbMem_Free(void* ptr) +{ + // VirtualFree(ptr, 0, MEM_DECOMMIT|MEM_RELEASE); + + // Address Windowing Extensions + struct AWEINFO* pAWEinfo = 0; + size_t i; + HANDLE hProcess; + + for(i=0; i<gNdbMem_nAWEinfo; ++i) + { + if(ptr==gNdbMem_pAWEinfo[i].pRegionReserved) + { + pAWEinfo = gNdbMem_pAWEinfo+i; + } + } + if(!pAWEinfo) + { + ShowLastError("NdbMem_Free", "ptr is not AWE memory"); + } + + hProcess = GetCurrentProcess(); + if(!MapUserPhysicalPages(ptr, pAWEinfo->nNumberOfPagesActual, 0)) + { + ShowLastError("NdbMem_Free", "MapUserPhysicalPages"); + } + + if(!VirtualFree(ptr, 0, MEM_RELEASE)) + { + ShowLastError("NdbMem_Free", "VirtualFree"); + } + + pAWEinfo->nNumberOfPagesFreed = pAWEinfo->nNumberOfPagesActual; + if(!FreeUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesFreed), pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Free", "FreeUserPhysicalPages"); + } + + VirtualFree(pAWEinfo->pnPhysicalMemoryPageArray, 0, MEM_DECOMMIT|MEM_RELEASE); +} + + +int NdbMem_MemLockAll() +{ + /* + HANDLE hProcess = GetCurrentProcess(); + SIZE_T nMinimumWorkingSetSize; + SIZE_T nMaximumWorkingSetSize; + GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize); + ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl; + + SetProcessWorkingSetSize(hProcess, 50000000, 100000000); + + GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize); + ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl; + */ + return -1; +} + +int NdbMem_MemUnlockAll() +{ + //VirtualUnlock(); + return -1; +} + +#endif + +void NdbMem_Create() +{ + /* Do nothing */ + return; +} + +void NdbMem_Destroy() +{ + /* Do nothing */ + return; +} + + +void* NdbMem_Allocate(size_t size) +{ + void* mem_allocated; + assert(size > 0); + mem_allocated= (void*)malloc(size); + return mem_allocated; +} + +void* NdbMem_AllocateAlign(size_t size, size_t alignment) +{ + (void)alignment; /* remove warning for unused parameter */ + /* + return (void*)memalign(alignment, size); + TEMP fix + */ + return (void*)malloc(size); +} + + +void NdbMem_Free(void* ptr) +{ + free(ptr); +} + + +int NdbMem_MemLockAll() +{ + return 0; +} + +int NdbMem_MemUnlockAll() +{ + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c new file mode 100644 index 00000000000..e6d1f081e9a --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -0,0 +1,73 @@ +/* Copyright (C) 2003 MySQL 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 */ + + +#include <ndb_global.h> +#include "NdbMutex.h" + +NdbMutex* NdbMutex_Create(void) +{ + NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex)); + if(!pNdbMutex) + return 0; + + InitializeCriticalSection(pNdbMutex); + return pNdbMutex; +} + + +int NdbMutex_Destroy(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + DeleteCriticalSection(p_mutex); + free(p_mutex); + return 0; +} + + +int NdbMutex_Lock(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + EnterCriticalSection (p_mutex); + return 0; +} + + +int NdbMutex_Unlock(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + LeaveCriticalSection(p_mutex); + return 0; +} + + +int NdbMutex_Trylock(NdbMutex* p_mutex) +{ + int result = -1; + if(p_mutex) + { + result = NdbMutex_Lock(p_mutex); + //(TryEnterCriticalSection(p_mutex) ? 0 : -1); + } + return result; +} + diff --git a/ndb/src/common/editline/editline_win32.c b/ndb/src/common/portlib/win32/NdbSleep.c index 5083edb7fae..8f5bdc49acd 100644 --- a/ndb/src/common/editline/editline_win32.c +++ b/ndb/src/common/portlib/win32/NdbSleep.c @@ -14,19 +14,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #include <ndb_global.h> +#include "NdbSleep.h" - -char* readline(const char* prompt) +int +NdbSleep_MilliSleep(int milliseconds) { - char* szBuf; - printf(prompt); - szBuf = (char*)malloc(256); - return gets(szBuf); + Sleep(milliseconds); + return 0; } -void add_history(char* pch) +int +NdbSleep_SecSleep(int seconds) { + return NdbSleep_MilliSleep(seconds*1000); } diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/win32/NdbTCP.c new file mode 100644 index 00000000000..b936cd2db6c --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbTCP.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include <ndb_global.h> +#include "NdbTCP.h" + +int +Ndb_getInAddr(struct in_addr * dst, const char *address) +{ + struct hostent * hostPtr; + + /* Try it as aaa.bbb.ccc.ddd. */ + dst->s_addr = inet_addr(address); + if (dst->s_addr != -1) { + return 0; + } + + hostPtr = gethostbyname(address); + if (hostPtr != NULL) { + dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; + return 0; + } + + return -1; +} + diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c new file mode 100644 index 00000000000..98db0d5c287 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -0,0 +1,114 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include <ndb_global.h> +#include "NdbThread.h" +#include <process.h> + +#define MAX_THREAD_NAME 16 + +typedef unsigned (WINAPI* NDB_WIN32_THREAD_FUNC)(void*); + + +struct NdbThread +{ + HANDLE hThread; + unsigned nThreadId; + char thread_name[MAX_THREAD_NAME]; +}; + + +struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, + NDB_THREAD_ARG *p_thread_arg, + const NDB_THREAD_STACKSIZE thread_stack_size, + const char* p_thread_name, + NDB_THREAD_PRIO thread_prio) +{ + struct NdbThread* tmpThread; + unsigned initflag; + int nPriority = 0; + + if(!p_thread_func) + return 0; + + tmpThread = (struct NdbThread*)malloc(sizeof(struct NdbThread)); + if(!tmpThread) + return 0; + + strncpy((char*)&tmpThread->thread_name, p_thread_name, MAX_THREAD_NAME); + + switch(thread_prio) + { + case NDB_THREAD_PRIO_HIGHEST: nPriority=THREAD_PRIORITY_HIGHEST; break; + case NDB_THREAD_PRIO_HIGH: nPriority=THREAD_PRIORITY_ABOVE_NORMAL; break; + case NDB_THREAD_PRIO_MEAN: nPriority=THREAD_PRIORITY_NORMAL; break; + case NDB_THREAD_PRIO_LOW: nPriority=THREAD_PRIORITY_BELOW_NORMAL; break; + case NDB_THREAD_PRIO_LOWEST: nPriority=THREAD_PRIORITY_LOWEST; break; + } + initflag = (nPriority ? CREATE_SUSPENDED : 0); + + tmpThread->hThread = (HANDLE)_beginthreadex(0, thread_stack_size, + (NDB_WIN32_THREAD_FUNC)p_thread_func, p_thread_arg, + initflag, &tmpThread->nThreadId); + + if(nPriority && tmpThread->hThread) + { + SetThreadPriority(tmpThread->hThread, nPriority); + ResumeThread (tmpThread->hThread); + } + + assert(tmpThread->hThread); + return tmpThread; +} + + +void NdbThread_Destroy(struct NdbThread** p_thread) +{ + CloseHandle((*p_thread)->hThread); + (*p_thread)->hThread = 0; + free(*p_thread); + *p_thread = 0; +} + + +int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) +{ + void *local_status = 0; + if (status == 0) + status = &local_status; + + if(WaitForSingleObject(p_wait_thread->hThread, INFINITE) == WAIT_OBJECT_0 + && GetExitCodeThread(p_wait_thread->hThread, (LPDWORD)status)) + { + CloseHandle(p_wait_thread->hThread); + p_wait_thread->hThread = 0; + return 0; + } + return -1; +} + + +void NdbThread_Exit(int status) +{ + _endthreadex((DWORD) status); +} + + +int NdbThread_SetConcurrencyLevel(int level) +{ + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/win32/NdbTick.c new file mode 100644 index 00000000000..4430cbf419b --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbTick.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include <ndb_global.h> +#include "NdbTick.h" +//#include <windows.h> + +/* +#define FILETIME_PER_MICROSEC 10 +#define FILETIME_PER_MILLISEC 10000 +#define FILETIME_PER_SEC 10000000 + + +NDB_TICKS NdbTick_CurrentMillisecond(void) +{ + ULONGLONG ullTime; + GetSystemTimeAsFileTime((LPFILETIME)&ullTime); + return (ullTime / FILETIME_PER_MILLISEC); +} + +int +NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros) +{ + ULONGLONG ullTime; + GetSystemTimeAsFileTime((LPFILETIME)&ullTime); + *secs = (ullTime / FILETIME_PER_SEC); + *micros = (Uint32)((ullTime % FILETIME_PER_SEC) / FILETIME_PER_MICROSEC); + return 0; +} +*/ + + +NDB_TICKS NdbTick_CurrentMillisecond(void) +{ + LARGE_INTEGER liCount, liFreq; + QueryPerformanceCounter(&liCount); + QueryPerformanceFrequency(&liFreq); + return (liCount.QuadPart*1000) / liFreq.QuadPart; +} + +int +NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros) +{ + LARGE_INTEGER liCount, liFreq; + QueryPerformanceCounter(&liCount); + QueryPerformanceFrequency(&liFreq); + *secs = liCount.QuadPart / liFreq.QuadPart; + liCount.QuadPart -= *secs * liFreq.QuadPart; + *micros = (liCount.QuadPart*1000000) / liFreq.QuadPart; + return 0; +} diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am index 9d91a210d46..b902012e56d 100644 --- a/ndb/src/common/transporter/Makefile.am +++ b/ndb/src/common/transporter/Makefile.am @@ -13,10 +13,24 @@ EXTRA_libtransporter_la_SOURCES = SHM_Transporter.cpp SHM_Transporter.unix.cpp S libtransporter_la_LIBADD = @ndb_transporter_opt_objs@ libtransporter_la_DEPENDENCIES = @ndb_transporter_opt_objs@ -INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/include/transporter @NDB_SCI_INCLUDES@ +INCLUDES_LOC = -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/include/debugger -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/include/transporter @NDB_SCI_INCLUDES@ include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtransporter.dsp + +libtransporter.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtransporter_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/transporter/Makefile_old b/ndb/src/common/transporter/Makefile_old deleted file mode 100644 index 372bf640566..00000000000 --- a/ndb/src/common/transporter/Makefile_old +++ /dev/null @@ -1,43 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := transporter -DIRS := basictest perftest - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - Transporter.cpp \ - SendBuffer.cpp \ - TCP_Transporter.cpp \ - TransporterRegistry.cpp \ - Packer.cpp - -DIRS := basictest perftest - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ - -I$(call fixpath,$(NDB_TOP)/include/transporter) - - -ifeq ($(NDB_SHM), Y) -SOURCES += SHM_Transporter.cpp -ifeq ($(NDB_OS), WIN32) -SOURCES += SHM_Transporter.win32.cpp -else -SOURCES += SHM_Transporter.unix.cpp -endif -endif - -ifeq ($(NDB_SCI), Y) -SOURCES += SCI_Transporter.cpp -endif - -ifneq ($(findstring OSE, $(NDB_OS)),) - SOURCES += OSE_Transporter.cpp - SOURCES += OSE_Receiver.cpp -endif - - - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp index 73fbb064599..e7807c972b1 100644 --- a/ndb/src/common/transporter/SCI_Transporter.cpp +++ b/ndb/src/common/transporter/SCI_Transporter.cpp @@ -44,7 +44,8 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg, bool chksm, bool signalId, Uint32 reportFreq) : - Transporter(t_reg, lHostName, rHostName, r_port, _localNodeId, + Transporter(t_reg, tt_SCI_TRANSPORTER, + lHostName, rHostName, r_port, _localNodeId, _remoteNodeId, 0, false, chksm, signalId) { DBUG_ENTER("SCI_Transporter::SCI_Transporter"); diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index ab161d8c18c..eed3ad77be6 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -26,6 +26,8 @@ #include <InputStream.hpp> #include <OutputStream.hpp> +extern int g_ndb_shm_signum; + SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, @@ -36,7 +38,8 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, bool signalId, key_t _shmKey, Uint32 _shmSize) : - Transporter(t_reg, lHostName, rHostName, r_port, lNodeId, rNodeId, + Transporter(t_reg, tt_SHM_TRANSPORTER, + lHostName, rHostName, r_port, lNodeId, rNodeId, 0, false, checksum, signalId), shmKey(_shmKey), shmSize(_shmSize) @@ -52,6 +55,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, #ifdef DEBUG_TRANSPORTER printf("shm key (%d - %d) = %d\n", lNodeId, rNodeId, shmKey); #endif + m_signal_threshold = 4096; } SHM_Transporter::~SHM_Transporter(){ @@ -60,7 +64,9 @@ SHM_Transporter::~SHM_Transporter(){ bool SHM_Transporter::initTransporter(){ - return true; + if (g_ndb_shm_signum) + return true; + return false; } void @@ -182,42 +188,6 @@ SHM_Transporter::setupBuffers(){ #endif } -#if 0 -SendStatus -SHM_Transporter::prepareSend(const SignalHeader * const signalHeader, - Uint8 prio, - const Uint32 * const signalData, - const LinearSegmentPtr ptr[3], - bool force){ - - if(isConnected()){ - - const Uint32 lenBytes = m_packer.getMessageLength(signalHeader, ptr); - - Uint32 * insertPtr = (Uint32 *)writer->getWritePtr(lenBytes); - - if(insertPtr != 0){ - - m_packer.pack(insertPtr, prio, signalHeader, signalData, ptr); - - /** - * Do funky membar stuff - */ - - writer->updateWritePtr(lenBytes); - return SEND_OK; - - } else { - // NdbSleep_MilliSleep(3); - //goto tryagain; - return SEND_BUFFER_FULL; - } - } - return SEND_DISCONNECTED; -} -#endif - - bool SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) { @@ -247,10 +217,18 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to client - s_output.println("shm server 1 ok"); - + s_output.println("shm server 1 ok: %d", + m_transporter_registry.m_shm_own_pid); + // Wait for ok from client - if (s_input.gets(buf, 256) == 0) { + if (s_input.gets(buf, 256) == 0) + { + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(false); + } + + if(sscanf(buf, "shm client 1 ok: %d", &m_remote_pid) != 1) + { NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); } @@ -281,6 +259,9 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) SocketOutputStream s_output(sockfd); char buf[256]; +#if 1 +#endif + // Wait for server to create and attach if (s_input.gets(buf, 256) == 0) { NDB_CLOSE_SOCKET(sockfd); @@ -289,6 +270,12 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) DBUG_RETURN(false); } + if(sscanf(buf, "shm server 1 ok: %d", &m_remote_pid) != 1) + { + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(false); + } + // Create if(!_shmSegCreated){ if (!ndb_shm_get()) { @@ -313,10 +300,11 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to server - s_output.println("shm client 1 ok"); - + s_output.println("shm client 1 ok: %d", + m_transporter_registry.m_shm_own_pid); + int r= connect_common(sockfd); - + if (r) { // Wait for ok from server if (s_input.gets(buf, 256) == 0) { @@ -344,18 +332,33 @@ SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd) return false; } - if(!setupBuffersDone) { + if(!setupBuffersDone) + { setupBuffers(); setupBuffersDone=true; } - if(setupBuffersDone) { + if(setupBuffersDone) + { NdbSleep_MilliSleep(m_timeOutMillis); if(*serverStatusFlag == 1 && *clientStatusFlag == 1) + { + m_last_signal = 0; return true; + } } DBUG_PRINT("error", ("Failed to set up buffers to node %d", remoteNodeId)); return false; } + +void +SHM_Transporter::doSend() +{ + if(m_last_signal) + { + m_last_signal = 0; + kill(m_remote_pid, g_ndb_shm_signum); + } +} diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp index 27692209ffe..b501f652168 100644 --- a/ndb/src/common/transporter/SHM_Transporter.hpp +++ b/ndb/src/common/transporter/SHM_Transporter.hpp @@ -47,18 +47,25 @@ public: * SHM destructor */ virtual ~SHM_Transporter(); - + /** * Do initialization */ bool initTransporter(); - - Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio){ + + Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio) + { return (Uint32 *)writer->getWritePtr(lenBytes); } - void updateWritePtr(Uint32 lenBytes, Uint32 prio){ + void updateWritePtr(Uint32 lenBytes, Uint32 prio) + { writer->updateWritePtr(lenBytes); + m_last_signal += lenBytes; + if(m_last_signal >= m_signal_threshold) + { + doSend(); + } } void getReceivePtr(Uint32 ** ptr, Uint32 ** eod){ @@ -123,28 +130,36 @@ protected: */ void setupBuffers(); + /** + * doSend (i.e signal receiver) + */ + void doSend(); + int m_remote_pid; + Uint32 m_last_signal; + Uint32 m_signal_threshold; + private: bool _shmSegCreated; bool _attached; bool m_connected; - + key_t shmKey; volatile Uint32 * serverStatusFlag; volatile Uint32 * clientStatusFlag; bool setupBuffersDone; - + #ifdef NDB_WIN32 HANDLE hFileMapping; #else int shmId; #endif - + int shmSize; char * shmBuf; - + SHM_Reader * reader; SHM_Writer * writer; - + /** * @return - True if the reader has data to read on its segment. */ diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 524ecd653e0..a629b620157 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -72,7 +72,8 @@ TCP_Transporter::TCP_Transporter(TransporterRegistry &t_reg, NodeId rNodeId, bool chksm, bool signalId, Uint32 _reportFreq) : - Transporter(t_reg, lHostName, rHostName, r_port, lNodeId, rNodeId, + Transporter(t_reg, tt_TCP_TRANSPORTER, + lHostName, rHostName, r_port, lNodeId, rNodeId, 0, false, chksm, signalId), m_sendBuffer(sendBufSize) { diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index e68bc86718e..b84f8f6fb5e 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -24,7 +24,11 @@ #include <InputStream.hpp> #include <OutputStream.hpp> +#include <EventLogger.hpp> +extern EventLogger g_eventLogger; + Transporter::Transporter(TransporterRegistry &t_reg, + TransporterType _type, const char *lHostName, const char *rHostName, int r_port, @@ -35,8 +39,10 @@ Transporter::Transporter(TransporterRegistry &t_reg, : m_r_port(r_port), remoteNodeId(rNodeId), localNodeId(lNodeId), isServer(lNodeId < rNodeId), m_packer(_signalId, _checksum), + m_type(_type), m_transporter_registry(t_reg) { + DBUG_ENTER("Transporter::Transporter"); if (rHostName && strlen(rHostName) > 0){ strncpy(remoteHostName, rHostName, sizeof(remoteHostName)); Ndb_getInAddr(&remoteHostAddress, rHostName); @@ -55,6 +61,11 @@ Transporter::Transporter(TransporterRegistry &t_reg, if (strlen(lHostName) > 0) Ndb_getInAddr(&localHostAddress, lHostName); + DBUG_PRINT("info",("rId=%d lId=%d isServer=%d rHost=%s lHost=%s r_port=%d", + remoteNodeId, localNodeId, isServer, + remoteHostName, localHostName, + r_port)); + byteOrder = _byteorder; compressionUsed = _compression; checksumUsed = _checksum; @@ -67,7 +78,9 @@ Transporter::Transporter(TransporterRegistry &t_reg, m_socket_client= 0; else m_socket_client= new SocketClient(remoteHostName, r_port, - new SocketAuthSimple("ndbd", "ndbd passwd")); + new SocketAuthSimple("ndbd", + "ndbd passwd")); + DBUG_VOID_RETURN; } Transporter::~Transporter(){ @@ -77,8 +90,13 @@ Transporter::~Transporter(){ bool Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { + // all initial negotiation is done in TransporterRegistry::connect_server + DBUG_ENTER("Transporter::connect_server"); + if(m_connected) - return true; // TODO assert(0); + { + DBUG_RETURN(true); // TODO assert(0); + } bool res = connect_server_impl(sockfd); if(res){ @@ -86,7 +104,7 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { m_errorCount = 0; } - return res; + DBUG_RETURN(res); } bool @@ -95,30 +113,63 @@ Transporter::connect_client() { return true; NDB_SOCKET_TYPE sockfd = m_socket_client->connect(); - if (sockfd < 0) + if (sockfd == NDB_INVALID_SOCKET) return false; - // send info about own id + DBUG_ENTER("Transporter::connect_client"); + + // send info about own id + // send info about own transporter type SocketOutputStream s_output(sockfd); - s_output.println("%d", localNodeId); + s_output.println("%d %d", localNodeId, m_type); // get remote id - int nodeId; + int nodeId, remote_transporter_type= -1; SocketInputStream s_input(sockfd); char buf[256]; if (s_input.gets(buf, 256) == 0) { NDB_CLOSE_SOCKET(sockfd); - return false; + DBUG_RETURN(false); } - if (sscanf(buf, "%d", &nodeId) != 1) { + + int r= sscanf(buf, "%d %d", &nodeId, &remote_transporter_type); + switch (r) { + case 2: + break; + case 1: + // we're running version prior to 4.1.9 + // ok, but with no checks on transporter configuration compatability + break; + default: NDB_CLOSE_SOCKET(sockfd); - return false; + DBUG_RETURN(false); } + + DBUG_PRINT("info", ("nodeId=%d remote_transporter_type=%d", + nodeId, remote_transporter_type)); + + if (remote_transporter_type != -1) + { + if (remote_transporter_type != m_type) + { + DBUG_PRINT("error", ("Transporter types mismatch this=%d remote=%d", + m_type, remote_transporter_type)); + NDB_CLOSE_SOCKET(sockfd); + g_eventLogger.error("Incompatible configuration: transporter type " + "mismatch with node %d", nodeId); + DBUG_RETURN(false); + } + } + else if (m_type == tt_SHM_TRANSPORTER) + { + g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId); + } + bool res = connect_client_impl(sockfd); if(res){ m_connected = true; m_errorCount = 0; } - return res; + DBUG_RETURN(res); } void diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp index 9a39f8788bc..baff6d53dd8 100644 --- a/ndb/src/common/transporter/Transporter.hpp +++ b/ndb/src/common/transporter/Transporter.hpp @@ -71,6 +71,7 @@ public: protected: Transporter(TransporterRegistry &, + TransporterType, const char *lHostName, const char *rHostName, int r_port, @@ -127,6 +128,7 @@ protected: protected: bool m_connected; // Are we connected + TransporterType m_type; TransporterRegistry &m_transporter_registry; void *get_callback_obj() { return m_transporter_registry.callbackObj; }; @@ -149,7 +151,7 @@ Transporter::getRemoteNodeId() const { inline NodeId Transporter::getLocalNodeId() const { - return remoteNodeId; + return localNodeId; } inline diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index cacbbed00f1..439730435ec 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -38,6 +38,7 @@ #ifdef NDB_SHM_TRANSPORTER #include "SHM_Transporter.hpp" +extern int g_ndb_shm_signum; #endif #include "TransporterCallback.hpp" @@ -47,6 +48,9 @@ #include <InputStream.hpp> #include <OutputStream.hpp> +#include <EventLogger.hpp> +extern EventLogger g_eventLogger; + SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) { DBUG_ENTER("SocketServer::Session * TransporterService::newSession"); @@ -55,49 +59,10 @@ SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) DBUG_RETURN(0); } + if (!m_transporter_registry->connect_server(sockfd)) { - // read node id from client - int nodeId; - SocketInputStream s_input(sockfd); - char buf[256]; - if (s_input.gets(buf, 256) == 0) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Could not get node id from client")); - DBUG_RETURN(0); - } - if (sscanf(buf, "%d", &nodeId) != 1) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Error in node id from client")); - DBUG_RETURN(0); - } - - //check that nodeid is valid and that there is an allocated transporter - if ( nodeId < 0 || nodeId >= (int)m_transporter_registry->maxTransporters) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Node id out of range from client")); - DBUG_RETURN(0); - } - if (m_transporter_registry->theTransporters[nodeId] == 0) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("No transporter for this node id from client")); - DBUG_RETURN(0); - } - - //check that the transporter should be connected - if (m_transporter_registry->performStates[nodeId] != TransporterRegistry::CONNECTING) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Transporter in wrong state for this node id from client")); - DBUG_RETURN(0); - } - - Transporter *t= m_transporter_registry->theTransporters[nodeId]; - - // send info about own id (just as response to acknowledge connection) - SocketOutputStream s_output(sockfd); - s_output.println("%d", t->getLocalNodeId()); - - // setup transporter (transporter responsible for closing sockfd) - t->connect_server(sockfd); + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(0); } DBUG_RETURN(0); @@ -184,13 +149,98 @@ TransporterRegistry::disconnectAll(){ bool TransporterRegistry::init(NodeId nodeId) { + DBUG_ENTER("TransporterRegistry::init"); nodeIdSpecified = true; localNodeId = nodeId; DEBUG("TransporterRegistry started node: " << localNodeId); - // return allocateLongSignalMemoryPool(nLargeSegments); - return true; + DBUG_RETURN(true); +} + +bool +TransporterRegistry::connect_server(NDB_SOCKET_TYPE sockfd) +{ + DBUG_ENTER("TransporterRegistry::connect_server"); + + // read node id from client + // read transporter type + int nodeId, remote_transporter_type= -1; + SocketInputStream s_input(sockfd); + char buf[256]; + if (s_input.gets(buf, 256) == 0) { + DBUG_PRINT("error", ("Could not get node id from client")); + DBUG_RETURN(false); + } + int r= sscanf(buf, "%d %d", &nodeId, &remote_transporter_type); + switch (r) { + case 2: + break; + case 1: + // we're running version prior to 4.1.9 + // ok, but with no checks on transporter configuration compatability + break; + default: + DBUG_PRINT("error", ("Error in node id from client")); + DBUG_RETURN(false); + } + + DBUG_PRINT("info", ("nodeId=%d remote_transporter_type=%d", + nodeId,remote_transporter_type)); + + //check that nodeid is valid and that there is an allocated transporter + if ( nodeId < 0 || nodeId >= (int)maxTransporters) { + DBUG_PRINT("error", ("Node id out of range from client")); + DBUG_RETURN(false); + } + if (theTransporters[nodeId] == 0) { + DBUG_PRINT("error", ("No transporter for this node id from client")); + DBUG_RETURN(false); + } + + //check that the transporter should be connected + if (performStates[nodeId] != TransporterRegistry::CONNECTING) { + DBUG_PRINT("error", ("Transporter in wrong state for this node id from client")); + DBUG_RETURN(false); + } + + Transporter *t= theTransporters[nodeId]; + + // send info about own id (just as response to acknowledge connection) + // send info on own transporter type + SocketOutputStream s_output(sockfd); + s_output.println("%d %d", t->getLocalNodeId(), t->m_type); + + if (remote_transporter_type != -1) + { + if (remote_transporter_type != t->m_type) + { + DBUG_PRINT("error", ("Transporter types mismatch this=%d remote=%d", + t->m_type, remote_transporter_type)); + g_eventLogger.error("Incompatible configuration: Transporter type " + "mismatch with node %d", nodeId); + + // wait for socket close for 1 second to let message arrive at client + { + fd_set a_set; + FD_ZERO(&a_set); + FD_SET(sockfd, &a_set); + struct timeval timeout; + timeout.tv_sec = 1; timeout.tv_usec = 0; + select(sockfd+1, &a_set, 0, 0, &timeout); + } + DBUG_RETURN(false); + } + } + else if (t->m_type == tt_SHM_TRANSPORTER) + { + g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId); + } + + // setup transporter (transporter responsible for closing sockfd) + t->connect_server(sockfd); + + DBUG_RETURN(true); } bool @@ -344,6 +394,7 @@ TransporterRegistry::createTransporter(SCI_TransporterConfiguration *config) { bool TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { + DBUG_ENTER("TransporterRegistry::createTransporter SHM"); #ifdef NDB_SHM_TRANSPORTER if(!nodeIdSpecified){ init(config->localNodeId); @@ -352,12 +403,28 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { if(config->localNodeId != localNodeId) return false; + if (!g_ndb_shm_signum) { + g_ndb_shm_signum= config->signum; + DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); + /** + * Make sure to block g_ndb_shm_signum + * TransporterRegistry::init is run from "main" thread + */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, g_ndb_shm_signum); + pthread_sigmask(SIG_BLOCK, &mask, 0); + } + + if(config->signum != g_ndb_shm_signum) + return false; + if(theTransporters[config->remoteNodeId] != NULL) return false; SHM_Transporter * t = new SHM_Transporter(*this, - "localhost", - "localhost", + config->localHostName, + config->remoteHostName, config->port, localNodeId, config->remoteNodeId, @@ -381,9 +448,9 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { nTransporters++; nSHMTransporters++; - return true; + DBUG_RETURN(true); #else - return false; + DBUG_RETURN(false); #endif } @@ -467,8 +534,9 @@ TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, Transporter *t = theTransporters[nodeId]; if(t != NULL && (((ioStates[nodeId] != HaltOutput) && (ioStates[nodeId] != HaltIO)) || - (signalHeader->theReceiversBlockNumber == 252))) { - + ((signalHeader->theReceiversBlockNumber == 252) || + (signalHeader->theReceiversBlockNumber == 4002)))) { + if(t->isConnected()){ Uint32 lenBytes = t->m_packer.getMessageLength(signalHeader, ptr); if(lenBytes <= MAX_MESSAGE_SIZE){ @@ -538,8 +606,9 @@ TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, Transporter *t = theTransporters[nodeId]; if(t != NULL && (((ioStates[nodeId] != HaltOutput) && (ioStates[nodeId] != HaltIO)) || - (signalHeader->theReceiversBlockNumber == 252))) { - + ((signalHeader->theReceiversBlockNumber == 252)|| + (signalHeader->theReceiversBlockNumber == 4002)))) { + if(t->isConnected()){ Uint32 lenBytes = t->m_packer.getMessageLength(signalHeader, ptr); if(lenBytes <= MAX_MESSAGE_SIZE){ @@ -550,7 +619,7 @@ TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, return SEND_OK; } - + /** * @note: on linux/i386 the granularity is 10ms * so sleepTime = 2 generates a 10 ms sleep. @@ -620,11 +689,28 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ return retVal; #endif - if((nSHMTransporters+nSCITransporters) > 0) + if((nSCITransporters) > 0) + { timeOutMillis=0; + } + +#ifdef NDB_SHM_TRANSPORTER + if(nSHMTransporters > 0) + { + Uint32 res = poll_SHM(0); + if(res) + { + retVal |= res; + timeOutMillis = 0; + } + } +#endif + #ifdef NDB_TCP_TRANSPORTER - if(nTCPTransporters > 0) + if(nTCPTransporters > 0 || retVal == 0) + { retVal |= poll_TCP(timeOutMillis); + } else tcpReadSelectReply = 0; #endif @@ -633,8 +719,11 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ retVal |= poll_SCI(timeOutMillis); #endif #ifdef NDB_SHM_TRANSPORTER - if(nSHMTransporters > 0) - retVal |= poll_SHM(timeOutMillis); + if(nSHMTransporters > 0 && retVal == 0) + { + int res = poll_SHM(0); + retVal |= res; + } #endif return retVal; } @@ -642,8 +731,8 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ #ifdef NDB_SCI_TRANSPORTER Uint32 -TransporterRegistry::poll_SCI(Uint32 timeOutMillis){ - +TransporterRegistry::poll_SCI(Uint32 timeOutMillis) +{ for (int i=0; i<nSCITransporters; i++) { SCI_Transporter * t = theSCITransporters[i]; if (t->isConnected()) { @@ -657,73 +746,29 @@ TransporterRegistry::poll_SCI(Uint32 timeOutMillis){ #ifdef NDB_SHM_TRANSPORTER +static int g_shm_counter = 0; Uint32 TransporterRegistry::poll_SHM(Uint32 timeOutMillis) { - for(int j=0; j < 20; j++) - for (int i=0; i<nSHMTransporters; i++) { - SHM_Transporter * t = theSHMTransporters[i]; - if (t->isConnected()) { - if(t->hasDataToRead()) { - return 1; - } - } - } - /** - * @note: granularity of linux/i386 timer is not good enough. - * Can't sleep if using SHM as it is now. - */ - /* - if(timeOutMillis > 0) - NdbSleep_MilliSleep(timeOutMillis); - else - NdbSleep_MilliSleep(1); - */ - return 0; -#if 0 - NDB_TICKS startTime = NdbTick_CurrentMillisecond(); - for(int i=0; i<100; i++) { + for(int j=0; j < 100; j++) + { for (int i=0; i<nSHMTransporters; i++) { SHM_Transporter * t = theSHMTransporters[i]; if (t->isConnected()) { - if(t->hasDataToRead()){ + if(t->hasDataToRead()) { return 1; } - else - continue; } - else - continue; } - - if(NdbTick_CurrentMillisecond() > (startTime +timeOutMillis)) - return 0; } - NdbSleep_MilliSleep(5); return 0; - -#endif -#if 0 - - for(int j=0; j < 100; j++) { - for (int i=0; i<nSHMTransporters; i++) { - SHM_Transporter * t = theSHMTransporters[i]; - if (t->isConnected()) { - if(t->hasDataToRead()) - return 1; - } - } - } - return 0; -#endif } - - #endif #ifdef NDB_OSE_TRANSPORTER Uint32 -TransporterRegistry::poll_OSE(Uint32 timeOutMillis){ +TransporterRegistry::poll_OSE(Uint32 timeOutMillis) +{ if(theOSEReceiver != NULL){ return theOSEReceiver->doReceive(timeOutMillis); } @@ -734,18 +779,18 @@ TransporterRegistry::poll_OSE(Uint32 timeOutMillis){ #ifdef NDB_TCP_TRANSPORTER Uint32 -TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ - - if (nTCPTransporters == 0){ +TransporterRegistry::poll_TCP(Uint32 timeOutMillis) +{ + if (false && nTCPTransporters == 0) + { tcpReadSelectReply = 0; return 0; } struct timeval timeout; #ifdef NDB_OSE - // Return directly if there are no TCP transporters configured - + if(timeOutMillis <= 1){ timeout.tv_sec = 0; timeout.tv_usec = 1025; @@ -758,7 +803,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ timeout.tv_usec = (timeOutMillis % 1000) * 1000; #endif - NDB_SOCKET_TYPE maxSocketValue = 0; + NDB_SOCKET_TYPE maxSocketValue = -1; // Needed for TCP/IP connections // The read- and writeset are used by select @@ -786,23 +831,29 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ maxSocketValue++; tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout); + if(false && tcpReadSelectReply == -1 && errno == EINTR) + ndbout_c("woke-up by signal"); + #ifdef NDB_WIN32 if(tcpReadSelectReply == SOCKET_ERROR) { NdbSleep_MilliSleep(timeOutMillis); } #endif - + return tcpReadSelectReply; } #endif void -TransporterRegistry::performReceive(){ +TransporterRegistry::performReceive() +{ #ifdef NDB_OSE_TRANSPORTER - if(theOSEReceiver != 0){ - while(theOSEReceiver->hasData()){ + if(theOSEReceiver != 0) + { + while(theOSEReceiver->hasData()) + { NodeId remoteNodeId; Uint32 * readPtr; Uint32 sz = theOSEReceiver->getReceiveData(&remoteNodeId, &readPtr); @@ -825,16 +876,20 @@ TransporterRegistry::performReceive(){ #endif #ifdef NDB_TCP_TRANSPORTER - if(tcpReadSelectReply > 0){ - for (int i=0; i<nTCPTransporters; i++) { + if(tcpReadSelectReply > 0) + { + for (int i=0; i<nTCPTransporters; i++) + { checkJobBuffer(); TCP_Transporter *t = theTCPTransporters[i]; const NodeId nodeId = t->getRemoteNodeId(); const NDB_SOCKET_TYPE socket = t->getSocket(); if(is_connected(nodeId)){ - if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) { + if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) + { const int receiveSize = t->doReceive(); - if(receiveSize > 0){ + if(receiveSize > 0) + { Uint32 * ptr; Uint32 sz = t->getReceiveData(&ptr); Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]); @@ -845,142 +900,165 @@ TransporterRegistry::performReceive(){ } } #endif - - + #ifdef NDB_SCI_TRANSPORTER //performReceive //do prepareReceive on the SCI transporters (prepareReceive(t,,,,)) - for (int i=0; i<nSCITransporters; i++) { - checkJobBuffer(); - SCI_Transporter *t = theSCITransporters[i]; - const NodeId nodeId = t->getRemoteNodeId(); - if(is_connected(nodeId)){ - if(t->isConnected() && t->checkConnected()){ - Uint32 * readPtr, * eodPtr; - t->getReceivePtr(&readPtr, &eodPtr); - Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); - t->updateReceivePtr(newPtr); - } - } - } + for (int i=0; i<nSCITransporters; i++) + { + checkJobBuffer(); + SCI_Transporter *t = theSCITransporters[i]; + const NodeId nodeId = t->getRemoteNodeId(); + if(is_connected(nodeId)) + { + if(t->isConnected() && t->checkConnected()) + { + Uint32 * readPtr, * eodPtr; + t->getReceivePtr(&readPtr, &eodPtr); + Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); + t->updateReceivePtr(newPtr); + } + } + } #endif #ifdef NDB_SHM_TRANSPORTER - for (int i=0; i<nSHMTransporters; i++) { - checkJobBuffer(); - SHM_Transporter *t = theSHMTransporters[i]; - const NodeId nodeId = t->getRemoteNodeId(); - if(is_connected(nodeId)){ - if(t->isConnected() && t->checkConnected()){ - Uint32 * readPtr, * eodPtr; - t->getReceivePtr(&readPtr, &eodPtr); - Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); - t->updateReceivePtr(newPtr); - } - } - } + for (int i=0; i<nSHMTransporters; i++) + { + checkJobBuffer(); + SHM_Transporter *t = theSHMTransporters[i]; + const NodeId nodeId = t->getRemoteNodeId(); + if(is_connected(nodeId)){ + if(t->isConnected() && t->checkConnected()) + { + Uint32 * readPtr, * eodPtr; + t->getReceivePtr(&readPtr, &eodPtr); + Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); + t->updateReceivePtr(newPtr); + } + } + } #endif } static int x = 0; void -TransporterRegistry::performSend(){ - int i; - sendCounter = 1; - +TransporterRegistry::performSend() +{ + int i; + sendCounter = 1; + #ifdef NDB_OSE_TRANSPORTER - for (int i = 0; i < nOSETransporters; i++){ - OSE_Transporter *t = theOSETransporters[i]; - if((is_connected(t->getRemoteNodeId()) && - (t->isConnected())) { - t->doSend(); - }//if - }//for + for (int i = 0; i < nOSETransporters; i++) + { + OSE_Transporter *t = theOSETransporters[i]; + if(is_connected(t->getRemoteNodeId()) &&& (t->isConnected())) + { + t->doSend(); + }//if + }//for #endif - + #ifdef NDB_TCP_TRANSPORTER #ifdef NDB_OSE + { + int maxSocketValue = 0; + + // Needed for TCP/IP connections + // The writeset are used by select + fd_set writeset; + FD_ZERO(&writeset); + + // Prepare for sending and receiving + for (i = 0; i < nTCPTransporters; i++) { + TCP_Transporter * t = theTCPTransporters[i]; + + // If the transporter is connected + if ((t->hasDataToSend()) && (t->isConnected())) { + const int socket = t->getSocket(); + // Find the highest socket value. It will be used by select + if (socket > maxSocketValue) { + maxSocketValue = socket; + }//if + FD_SET(socket, &writeset); + }//if + }//for + + // The highest socket value plus one + if(maxSocketValue == 0) + return; + + maxSocketValue++; + struct timeval timeout = { 0, 1025 }; + Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout); + + if (tmp == 0) { - int maxSocketValue = 0; - - // Needed for TCP/IP connections - // The writeset are used by select - fd_set writeset; - FD_ZERO(&writeset); - - // Prepare for sending and receiving - for (i = 0; i < nTCPTransporters; i++) { - TCP_Transporter * t = theTCPTransporters[i]; - - // If the transporter is connected - if ((t->hasDataToSend()) && (t->isConnected())) { - const int socket = t->getSocket(); - // Find the highest socket value. It will be used by select - if (socket > maxSocketValue) { - maxSocketValue = socket; - }//if - FD_SET(socket, &writeset); - }//if - }//for - - // The highest socket value plus one - if(maxSocketValue == 0) - return; - - maxSocketValue++; - struct timeval timeout = { 0, 1025 }; - Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout); - - if (tmp == 0) { - return; - }//if - for (i = 0; i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - const NodeId nodeId = t->getRemoteNodeId(); - const int socket = t->getSocket(); - if(is_connected(nodeId)){ - if(t->isConnected() && FD_ISSET(socket, &writeset)) { - t->doSend(); - }//if - }//if - }//for + return; + }//if + for (i = 0; i < nTCPTransporters; i++) { + TCP_Transporter *t = theTCPTransporters[i]; + const NodeId nodeId = t->getRemoteNodeId(); + const int socket = t->getSocket(); + if(is_connected(nodeId)){ + if(t->isConnected() && FD_ISSET(socket, &writeset)) { + t->doSend(); + }//if + }//if + }//for } #endif #ifdef NDB_TCP_TRANSPORTER - for (i = x; i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - if (t && - (t->hasDataToSend()) && - (t->isConnected()) && - (is_connected(t->getRemoteNodeId()))) { - t->doSend(); - }//if - }//for - for (i = 0; i < x && i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - if (t && - (t->hasDataToSend()) && - (t->isConnected()) && - (is_connected(t->getRemoteNodeId()))) { - t->doSend(); - }//if - }//for - x++; - if (x == nTCPTransporters) x = 0; + for (i = x; i < nTCPTransporters; i++) + { + TCP_Transporter *t = theTCPTransporters[i]; + if (t && t->hasDataToSend() && t->isConnected() && + is_connected(t->getRemoteNodeId())) + { + t->doSend(); + } + } + for (i = 0; i < x && i < nTCPTransporters; i++) + { + TCP_Transporter *t = theTCPTransporters[i]; + if (t && t->hasDataToSend() && t->isConnected() && + is_connected(t->getRemoteNodeId())) + { + t->doSend(); + } + } + x++; + if (x == nTCPTransporters) x = 0; #endif #endif #ifdef NDB_SCI_TRANSPORTER - //scroll through the SCI transporters, - // get each transporter, check if connected, send data - for (i=0; i<nSCITransporters; i++) { - SCI_Transporter *t = theSCITransporters[i]; - const NodeId nodeId = t->getRemoteNodeId(); - - if(is_connected(nodeId)){ - if(t->isConnected() && t->hasDataToSend()) { - t->doSend(); - } //if + //scroll through the SCI transporters, + // get each transporter, check if connected, send data + for (i=0; i<nSCITransporters; i++) { + SCI_Transporter *t = theSCITransporters[i]; + const NodeId nodeId = t->getRemoteNodeId(); + + if(is_connected(nodeId)) + { + if(t->isConnected() && t->hasDataToSend()) { + t->doSend(); } //if - } //if + } //if + } +#endif + +#ifdef NDB_SHM_TRANSPORTER + for (i=0; i<nSHMTransporters; i++) + { + SHM_Transporter *t = theSHMTransporters[i]; + const NodeId nodeId = t->getRemoteNodeId(); + if(is_connected(nodeId)) + { + if(t->isConnected()) + { + t->doSend(); + } + } + } #endif } @@ -1026,11 +1104,8 @@ TransporterRegistry::setIOState(NodeId nodeId, IOState state) { static void * run_start_clients_C(void * me) { - my_thread_init(); ((TransporterRegistry*) me)->start_clients_thread(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } // Run by kernel thread @@ -1167,31 +1242,31 @@ TransporterRegistry::stop_clients() } void -TransporterRegistry::add_transporter_interface(const char *interface, unsigned short port) +TransporterRegistry::add_transporter_interface(const char *interf, unsigned short port) { DBUG_ENTER("TransporterRegistry::add_transporter_interface"); - DBUG_PRINT("enter",("interface=%s, port= %d", interface, port)); - if (interface && strlen(interface) == 0) - interface= 0; + DBUG_PRINT("enter",("interface=%s, port= %d", interf, port)); + if (interf && strlen(interf) == 0) + interf= 0; for (unsigned i= 0; i < m_transporter_interface.size(); i++) { Transporter_interface &tmp= m_transporter_interface[i]; if (port != tmp.m_service_port) continue; - if (interface != 0 && tmp.m_interface != 0 && - strcmp(interface, tmp.m_interface) == 0) + if (interf != 0 && tmp.m_interface != 0 && + strcmp(interf, tmp.m_interface) == 0) { DBUG_VOID_RETURN; // found match, no need to insert } - if (interface == 0 && tmp.m_interface == 0) + if (interf == 0 && tmp.m_interface == 0) { DBUG_VOID_RETURN; // found match, no need to insert } } Transporter_interface t; t.m_service_port= port; - t.m_interface= interface; + t.m_interface= interf; m_transporter_interface.push_back(t); DBUG_PRINT("exit",("interface and port added")); DBUG_VOID_RETURN; @@ -1200,7 +1275,7 @@ TransporterRegistry::add_transporter_interface(const char *interface, unsigned s bool TransporterRegistry::start_service(SocketServer& socket_server) { - if (m_transporter_interface.size() > 0 && nodeIdSpecified != true) + if (m_transporter_interface.size() > 0 && !nodeIdSpecified) { ndbout_c("TransporterRegistry::startReceiving: localNodeId not specified"); return false; @@ -1230,9 +1305,19 @@ TransporterRegistry::start_service(SocketServer& socket_server) return true; } +#ifdef NDB_SHM_TRANSPORTER +static +RETSIGTYPE +shm_sig_handler(int signo) +{ + g_shm_counter++; +} +#endif + void TransporterRegistry::startReceiving() { + DBUG_ENTER("TransporterRegistry::startReceiving"); #ifdef NDB_OSE_TRANSPORTER if(theOSEReceiver != NULL){ theOSEReceiver->createPhantom(); @@ -1248,6 +1333,37 @@ TransporterRegistry::startReceiving() for(int i = 0; i<nTCPTransporters; i++) theTCPTransporters[i]->theReceiverPid = theReceiverPid; #endif + +#ifdef NDB_SHM_TRANSPORTER + m_shm_own_pid = getpid(); + if (g_ndb_shm_signum) + { + DBUG_PRINT("info",("Install signal handler for signum %d", + g_ndb_shm_signum)); + struct sigaction sa; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, g_ndb_shm_signum); + pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0); + sa.sa_handler = shm_sig_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + int ret; + while((ret = sigaction(g_ndb_shm_signum, &sa, 0)) == -1 && errno == EINTR); + if(ret != 0) + { + DBUG_PRINT("error",("Install failed")); + g_eventLogger.error("Failed to install signal handler for" + " SHM transporter errno: %d (%s)", errno, +#ifdef HAVE_STRERROR + strerror(errno) +#else + "" +#endif + ); + } + } +#endif // NDB_SHM_TRANSPORTER + DBUG_VOID_RETURN; } void diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index f3faa8c4f7f..937b8c0fa59 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -19,6 +19,7 @@ #include <File.hpp> #include <NdbOut.hpp> +#include <my_dir.h> // // PUBLIC @@ -28,9 +29,12 @@ bool File_class::exists(const char* aFileName) { bool rc = true; - +#ifdef USE_MY_STAT_STRUCT + struct my_stat stmp; +#else struct stat stmp; - if (::stat(aFileName, &stmp) != 0) +#endif + if (my_stat(aFileName, &stmp, MYF(0)) != 0) { rc = false; } diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index 0235adae7c9..a62c8186174 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -7,8 +7,8 @@ libgeneral_la_SOURCES = \ SocketServer.cpp SocketClient.cpp SocketAuthenticator.cpp\ OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \ NdbSqlUtil.cpp new.cpp \ - uucode.c random.c getarg.c version.c \ - strdup.c strlcat.c strlcpy.c \ + uucode.c random.c version.c \ + strdup.c \ ConfigValues.cpp ndb_init.c basestring_vsnprintf.c include $(top_srcdir)/ndb/config/common.mk.am @@ -16,3 +16,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libgeneral.dsp + +libgeneral.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libgeneral_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/util/Makefile_old b/ndb/src/common/util/Makefile_old deleted file mode 100644 index 65093396246..00000000000 --- a/ndb/src/common/util/Makefile_old +++ /dev/null @@ -1,28 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := general - -SOURCES = File.cpp md5_hash.cpp Properties.cpp socket_io.cpp \ - SimpleProperties.cpp Parser.cpp InputStream.cpp SocketServer.cpp \ - OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \ - NdbSqlUtil.cpp ConfigValues.cpp new.cpp - -SOURCES.c = uucode.c random.c getarg.c version.c - -ifeq ($(NDB_OS), OSE) - SOURCES += NdbErrHnd.cpp -endif -ifeq ($(NDB_OS), OSE) - SOURCES += NdbErrHnd.cpp -endif - SOURCES.c += strdup.c strlcat.c strlcpy.c - -DIRS := testSimpleProperties testProperties testConfigValues - -include $(NDB_TOP)/Epilogue.mk - -testNdbSqlUtil: NdbSqlUtil.cpp - $(CC) -o $@ NdbSqlUtil.cpp $(CCFLAGS) -DNDB_SQL_UTIL_TEST -L$(NDB_TOP)/lib -lportlib -lgeneral diff --git a/ndb/src/common/util/NdbOut.cpp b/ndb/src/common/util/NdbOut.cpp index fa74cb364f3..e20119a7987 100644 --- a/ndb/src/common/util/NdbOut.cpp +++ b/ndb/src/common/util/NdbOut.cpp @@ -54,7 +54,7 @@ NdbOut& NdbOut::operator<<(unsigned long int v) { return *this << (Uint64) v; } NdbOut& -NdbOut::operator<<(const char* val){ m_out->print("%s", val); return * this; } +NdbOut::operator<<(const char* val){ m_out->print("%s", val ? val : "(null)"); return * this; } NdbOut& NdbOut::operator<<(const void* val){ m_out->print("%p", val); return * this; } NdbOut& diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 6e4e5919e43..c4114ad5ffa 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -76,93 +76,121 @@ NdbSqlUtil::char_like(const char* s1, unsigned n1, const NdbSqlUtil::Type NdbSqlUtil::m_typeList[] = { - { + { // 0 Type::Undefined, NULL }, - { + { // 1 Type::Tinyint, cmpTinyint }, - { + { // 2 Type::Tinyunsigned, cmpTinyunsigned }, - { + { // 3 Type::Smallint, cmpSmallint }, - { + { // 4 Type::Smallunsigned, cmpSmallunsigned }, - { + { // 5 Type::Mediumint, cmpMediumint }, - { + { // 6 Type::Mediumunsigned, cmpMediumunsigned }, - { + { // 7 Type::Int, cmpInt }, - { + { // 8 Type::Unsigned, cmpUnsigned }, - { + { // 9 Type::Bigint, cmpBigint }, - { + { // 10 Type::Bigunsigned, cmpBigunsigned }, - { + { // 11 Type::Float, cmpFloat }, - { + { // 12 Type::Double, cmpDouble }, - { - Type::Decimal, - NULL // cmpDecimal + { // 13 + Type::Olddecimal, + cmpOlddecimal }, - { + { // 14 Type::Char, cmpChar }, - { + { // 15 Type::Varchar, cmpVarchar }, - { + { // 16 Type::Binary, cmpBinary }, - { + { // 17 Type::Varbinary, cmpVarbinary }, - { + { // 18 Type::Datetime, cmpDatetime }, - { - Type::Timespec, - cmpTimespec + { // 19 + Type::Date, + cmpDate }, - { + { // 20 Type::Blob, cmpBlob }, - { + { // 21 Type::Text, cmpText + }, + { // 22 + Type::Undefined, // 5.0 Bit + NULL + }, + { // 23 + Type::Undefined, // 5.0 Longvarchar + NULL + }, + { // 24 + Type::Undefined, // 5.0 Longvarbinary + NULL + }, + { // 25 + Type::Time, + cmpTime + }, + { // 26 + Type::Year, + cmpYear + }, + { // 27 + Type::Timestamp, + cmpTimestamp + }, + { // 28 + Type::Olddecimalunsigned, + cmpOlddecimalunsigned } }; @@ -387,15 +415,57 @@ NdbSqlUtil::cmpDouble(const void* info, const Uint32* p1, const Uint32* p2, Uint } int -NdbSqlUtil::cmpDecimal(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +NdbSqlUtil::cmp_olddecimal(const uchar* s1, const uchar* s2, unsigned n) { - assert(full >= size && size > 0); - // not used by MySQL or NDB - assert(false); + int sgn = +1; + unsigned i = 0; + while (i < n) { + int c1 = s1[i]; + int c2 = s2[i]; + if (c1 == c2) { + if (c1 == '-') + sgn = -1; + } else if (c1 == '-') { + return -1; + } else if (c2 == '-') { + return +1; + } else if (c1 < c2) { + return -1 * sgn; + } else { + return +1 * sgn; + } + i++; + } return 0; } int +NdbSqlUtil::cmpOlddecimal(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + if (full == size) { + union { const Uint32* p; const uchar* v; } u1, u2; + u1.p = p1; + u2.p = p2; + return cmp_olddecimal(u1.v, u2.v, full << 2); + } + return CmpUnknown; +} + +int +NdbSqlUtil::cmpOlddecimalunsigned(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + if (full == size) { + union { const Uint32* p; const uchar* v; } u1, u2; + u1.p = p1; + u2.p = p2; + return cmp_olddecimal(u1.v, u2.v, full << 2); + } + return CmpUnknown; +} + +int NdbSqlUtil::cmpChar(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) { // collation does not work on prefix for some charsets @@ -469,56 +539,78 @@ int NdbSqlUtil::cmpDatetime(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) { assert(full >= size && size > 0); - /* - * Datetime is CC YY MM DD hh mm ss \0 - * - * Not used via MySQL. - */ - union { const Uint32* p; const unsigned char* v; } u1, u2; - u1.p = p1; - u2.p = p2; - // no format check - int k = memcmp(u1.v, u2.v, 4); - if (k != 0) - return k < 0 ? -1 : +1; if (size >= 2) { - k = memcmp(u1.v + 4, u2.v + 4, 4); - return k < 0 ? -1 : k > 0 ? +1 : 0; + union { Uint32 p[2]; Int64 v; } u1, u2; + u1.p[0] = p1[0]; + u1.p[1] = p1[1]; + u2.p[0] = p2[0]; + u2.p[1] = p2[1]; + if (u1.v < u2.v) + return -1; + if (u1.v > u2.v) + return +1; + return 0; } return CmpUnknown; } int -NdbSqlUtil::cmpTimespec(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) { +#ifdef ndb_date_is_4_byte_native_int + assert(full >= size && size > 0); + union { Uint32 p[2]; Int32 v; } u1, u2; + u1.p[0] = p1[0]; + u2.p[0] = p2[0]; + if (u1.v < u2.v) + return -1; + if (u1.v > u2.v) + return +1; + return 0; +#else assert(full >= size && size > 0); - /* - * Timespec is CC YY MM DD hh mm ss \0 NN NN NN NN - * - * Not used via MySQL. - */ union { const Uint32* p; const unsigned char* v; } u1, u2; u1.p = p1; u2.p = p2; - // no format check - int k = memcmp(u1.v, u2.v, 4); - if (k != 0) - return k < 0 ? -1 : +1; - if (size >= 2) { - k = memcmp(u1.v + 4, u2.v + 4, 4); - if (k != 0) - return k < 0 ? -1 : +1; - if (size >= 3) { - Uint32 n1 = *(const Uint32*)(u1.v + 8); - Uint32 n2 = *(const Uint32*)(u2.v + 8); - if (n1 < n2) - return -1; - if (n2 > n1) - return +1; - return 0; - } - } - return CmpUnknown; +#ifdef ndb_date_sol9x86_cc_xO3_madness + // from Field_newdate::val_int + Uint64 j1 = uint3korr(u1.v); + Uint64 j2 = uint3korr(u2.v); + j1 = (j1 % 32L)+(j1 / 32L % 16L)*100L + (j1/(16L*32L))*10000L; + j2 = (j2 % 32L)+(j2 / 32L % 16L)*100L + (j2/(16L*32L))*10000L; + if (j1 < j2) + return -1; + if (j1 > j2) + return +1; + return 0; +#else + uint j1 = uint3korr(u1.v); + uint j2 = uint3korr(u2.v); + uint d1 = (j1 & 31); + uint d2 = (j2 & 31); + j1 = (j1 >> 5); + j2 = (j2 >> 5); + uint m1 = (j1 & 15); + uint m2 = (j2 & 15); + j1 = (j1 >> 4); + j2 = (j2 >> 4); + uint y1 = j1; + uint y2 = j2; + if (y1 < y2) + return -1; + if (y1 > y2) + return +1; + if (m1 < m2) + return -1; + if (m1 > m2) + return +1; + if (d1 < d2) + return -1; + if (d1 > d2) + return +1; + return 0; +#endif +#endif } int @@ -565,6 +657,51 @@ NdbSqlUtil::cmpText(const void* info, const Uint32* p1, const Uint32* p2, Uint32 return CmpUnknown; } +int +NdbSqlUtil::cmpTime(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + union { const Uint32* p; const unsigned char* v; } u1, u2; + u1.p = p1; + u2.p = p2; + // from Field_time::val_int + Int32 j1 = sint3korr(u1.v); + Int32 j2 = sint3korr(u2.v); + if (j1 < j2) + return -1; + if (j1 > j2) + return +1; + return 0; +} + +int +NdbSqlUtil::cmpYear(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + union { const Uint32* p; const unsigned char* v; } u1, u2; + u1.p = p1; + u2.p = p2; + if (u1.v[0] < u2.v[0]) + return -1; + if (u1.v[0] > u2.v[0]) + return +1; + return 0; +} + +int +NdbSqlUtil::cmpTimestamp(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + union { Uint32 p[1]; Uint32 v; } u1, u2; + u1.v = p1[0]; + u2.v = p2[0]; + if (u1.v < u2.v) + return -1; + if (u1.v > u2.v) + return +1; + return 0; +} + // check charset bool @@ -582,7 +719,7 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info) cs->cset != 0 && cs->coll != 0 && cs->coll->strnxfrm != 0 && - cs->strxfrm_multiply == 1; // current limitation + cs->strxfrm_multiply <= 1; // current limitation } break; case Type::Varchar: @@ -618,7 +755,7 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) cs->coll != 0 && cs->coll->strnxfrm != 0 && cs->coll->strnncollsp != 0 && - cs->strxfrm_multiply == 1; // current limitation + cs->strxfrm_multiply <= 1; // current limitation } break; case Type::Varchar: @@ -633,7 +770,7 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) cs->coll != 0 && cs->coll->strnxfrm != 0 && cs->coll->strnncollsp != 0 && - cs->strxfrm_multiply == 1; // current limitation + cs->strxfrm_multiply <= 1; // current limitation } break; default: diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 4443fd45bba..0edcda0e726 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -881,7 +881,7 @@ PropertiesImpl::unpack(const Uint32 * buf, Uint32 &bufLen, Properties * top, case PropertiesType_Properties: assert(0); } - if(res3 != true){ + if(!res3){ return false; } _items--; diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp index 50e60956b94..38df1417eb8 100644 --- a/ndb/src/common/util/SocketClient.cpp +++ b/ndb/src/common/util/SocketClient.cpp @@ -26,14 +26,14 @@ SocketClient::SocketClient(const char *server_name, unsigned short port, SocketA m_auth= sa; m_port= port; m_server_name= strdup(server_name); - m_sockfd= -1; + m_sockfd= NDB_INVALID_SOCKET; } SocketClient::~SocketClient() { if (m_server_name) free(m_server_name); - if (m_sockfd >= 0) + if (m_sockfd != NDB_INVALID_SOCKET) NDB_CLOSE_SOCKET(m_sockfd); if (m_auth) delete m_auth; @@ -42,7 +42,7 @@ SocketClient::~SocketClient() bool SocketClient::init() { - if (m_sockfd >= 0) + if (m_sockfd != NDB_INVALID_SOCKET) NDB_CLOSE_SOCKET(m_sockfd); memset(&m_servaddr, 0, sizeof(m_servaddr)); @@ -63,32 +63,32 @@ SocketClient::init() NDB_SOCKET_TYPE SocketClient::connect() { - if (m_sockfd < 0) + if (m_sockfd == NDB_INVALID_SOCKET) { if (!init()) { #ifdef VM_TRACE ndbout << "SocketClient::connect() failed " << m_server_name << " " << m_port << endl; #endif - return -1; + return NDB_INVALID_SOCKET; } } const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr)); if (r == -1) { NDB_CLOSE_SOCKET(m_sockfd); - m_sockfd= -1; - return -1; + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; } if (m_auth) { if (!m_auth->client_authenticate(m_sockfd)) { NDB_CLOSE_SOCKET(m_sockfd); - m_sockfd= -1; - return -1; + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; } } NDB_SOCKET_TYPE sockfd= m_sockfd; - m_sockfd= -1; + m_sockfd= NDB_INVALID_SOCKET; return sockfd; } diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index c3cffa1399b..da06389b5df 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -186,11 +186,7 @@ extern "C" void* socketServerThread_C(void* _ss){ SocketServer * ss = (SocketServer *)_ss; - - my_thread_init(); ss->doRun(); - my_thread_end(); - NdbThread_Exit(0); return 0; } @@ -259,6 +255,15 @@ transfer(NDB_SOCKET_TYPE sock){ } void +SocketServer::foreachSession(void (*func)(SocketServer::Session*, void *), void *data) +{ + for(int i = m_sessions.size() - 1; i >= 0; i--){ + (*func)(m_sessions[i].m_session, data); + } + checkSessions(); +} + +void SocketServer::checkSessions(){ for(int i = m_sessions.size() - 1; i >= 0; i--){ if(m_sessions[i].m_session->m_stopped){ @@ -278,8 +283,10 @@ void SocketServer::stopSessions(bool wait){ int i; for(i = m_sessions.size() - 1; i>=0; i--) - m_sessions[i].m_session->m_stop = true; - + { + m_sessions[i].m_session->stopSession(); + m_sessions[i].m_session->m_stop = true; // to make sure + } for(i = m_services.size() - 1; i>=0; i--) m_services[i].m_service->stopSessions(); @@ -298,11 +305,8 @@ void* sessionThread_C(void* _sc){ SocketServer::Session * si = (SocketServer::Session *)_sc; - my_thread_init(); if(!transfer(si->m_socket)){ si->m_stopped = true; - my_thread_end(); - NdbThread_Exit(0); return 0; } @@ -314,8 +318,6 @@ sessionThread_C(void* _sc){ } si->m_stopped = true; - my_thread_end(); - NdbThread_Exit(0); return 0; } diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index 10932226d18..58203e33bd1 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -18,6 +18,13 @@ #define _XOPEN_SOURCE 500 #include <stdio.h> #include <basestring_vsnprintf.h> +#include <my_config.h> + +#ifdef _WINDOWS +#define SNPRINTF_RETURN_TRUNC +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#endif int basestring_snprintf(char *str, size_t size, const char *format, ...) @@ -30,8 +37,33 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) return(ret); } +#ifdef SNPRINTF_RETURN_TRUNC +static char basestring_vsnprintf_buf[16*1024]; +#endif int basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) { - return(vsnprintf(str, size, format, ap)); + if (size == 0) + { +#ifdef SNPRINTF_RETURN_TRUNC + return vsnprintf(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); +#else + char buf[1]; + return vsnprintf(buf, 1, format, ap); +#endif + } + { + int ret= vsnprintf(str, size, format, ap); +#ifdef SNPRINTF_RETURN_TRUNC + if (ret == size-1 || ret == -1) + { + ret= vsnprintf(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); + } +#endif + return ret; + } } diff --git a/ndb/src/common/util/getarg.3 b/ndb/src/common/util/getarg.3 deleted file mode 100644 index 43aae5d7b31..00000000000 --- a/ndb/src/common/util/getarg.3 +++ /dev/null @@ -1,315 +0,0 @@ -.\" Copyright (c) 1999 Kungliga Tekniska Högskolan -.\" $KTH: getarg.3,v 1.1.4.1 2001/07/26 19:54:45 lha Exp $ -.Dd September 24, 1999 -.Dt GETARG 3 -.Os ROKEN -.Sh NAME -.Nm getarg , -.Nm arg_printusage -.Nd collect command line options -.Sh SYNOPSIS -.Fd #include <getarg.h> - -.Ft int -.Fn getarg "struct getargs *args" "size_t num_args" "int argc" "char **argv" "int *optind" - -.Ft void -.Fn arg_printusage "struct getargs *args" "size_t num_args" "const char *progname" "const char *extra_string" - -.Sh DESCRIPTION -.Fn getarg -collects any command line options given to a program in an easily used way. -.Fn arg_printusage -pretty-prints the available options, with a short help text. -.Pp -.Fa args -is the option specification to use, and it's an array of -.Fa struct getargs -elements. -.Fa num_args -is the size of -.Fa args -(in elements). -.Fa argc -and -.Fa argv -are the argument count and argument vector to extract option from. -.Fa optind -is a pointer to an integer where the index to the last processed -argument is stored, it must be initialised to the first index (minus -one) to process (normally 0) before the first call. -.Pp -.Fa arg_printusage -take the same -.Fa args -and -.Fa num_args -as getarg; -.Fa progname is the name of the program (to be used in the help text), and -.Fa extra_string -is a string to print after the actual options to indicate more -arguments. The usefulness of this function is realised only be people -who has used programs that has help strings that doesn't match what -the code does. -.Pp -The -.Fa getargs -struct has the following elements. - -.Bd -literal -struct getargs{ - const char *long_name; - char short_name; - enum { arg_integer, - arg_string, - arg_flag, - arg_negative_flag, - arg_strings, - arg_double, - arg_collect - } type; - void *value; - const char *help; - const char *arg_help; -}; -.Ed -.Pp -.Fa long_name -is the long name of the option, it can be -.Dv NULL , -if you don't want a long name. -.Fa short_name -is the characted to use as short option, it can be zero. If the option -has a value the -.Fa value -field gets filled in with that value interpreted as specified by the -.Fa type -field. -.Fa help -is a longer help string for the option as a whole, if it's -.Dv NULL -the help text for the option is omitted (but it's still displayed in -the synopsis). -.Fa arg_help -is a description of the argument, if -.Dv NULL -a default value will be used, depending on the type of the option: -.Pp -.Bl -hang -width arg_negative_flag -.It arg_integer -the argument is a signed integer, and -.Fa value -should point to an -.Fa int . -.It Fa arg_string -the argument is a string, and -.Fa value -should point to a -.Fa char* . -.It Fa arg_flag -the argument is a flag, and -.Fa value -should point to a -.Fa int . -It gets filled in with either zero or one, depending on how the option -is given, the normal case beeing one. Note that if the option isn't -given, the value isn't altered, so it should be initialised to some -useful default. -.It Fa arg_negative_flag -this is the same as -.Fa arg_flag -but it reverses the meaning of the flag (a given short option clears -the flag), and the synopsis of a long option is negated. -.It Fa arg_strings -the argument can be given multiple times, and the values are collected -in an array; -.Fa value -should be a pointer to a -.Fa struct getarg_strings -structure, which holds a length and a string pointer. -.It Fa arg_double -argument is a double precision floating point value, and -.Fa value -should point to a -.Fa double . -.It Fa arg_collect -allows more fine-grained control of the option parsing process. -.Fa value -should be a pointer to a -.Fa getarg_collect_info -structure: -.Bd -literal -typedef int (*getarg_collect_func)(int short_opt, - int argc, - char **argv, - int *optind, - int *optarg, - void *data); - -typedef struct getarg_collect_info { - getarg_collect_func func; - void *data; -} getarg_collect_info; -.Ed -.Pp -With the -.Fa func -member set to a function to call, and -.Fa data -to some application specific data. The parameters to the collect function are: -.Bl -inset -.It Fa short_flag -non-zero if this call is via a short option flag, zero otherwise -.It Fa argc , argv -the whole argument list -.It Fa optind -pointer to the index in argv where the flag is -.It Fa optarg -pointer to the index in argv[*optind] where the flag name starts -.It Fa data -application specific data -.El -.Pp -You can modify -.Fa *optind , -and -.Fa *optarg , -but to do this correct you (more or less) have to know about the inner -workings of getarg. - -You can skip parts of arguments by increasing -.Fa *optarg -(you could -implement the -.Fl z Ns Ar 3 -set of flags from -.Nm gzip -with this), or whole argument strings by increasing -.Fa *optind -(let's say you want a flag -.Fl c Ar x y z -to specify a coordinate); if you also have to set -.Fa *optarg -to a sane value. -.Pp -The collect function should return one of -.Dv ARG_ERR_NO_MATCH , ARG_ERR_BAD_ARG , ARG_ERR_NO_ARG -on error, zero otherwise. -.Pp -For your convenience there is a function, -.Fn getarg_optarg , -that returns the traditional argument string, and you pass it all -arguments, sans data, that where given to the collection function. -.Pp -Don't use this more this unless you absolutely have to. -.El -.Pp -Option parsing is similar to what -.Xr getopt -uses. Short options without arguments can be compressed -.Pf ( Fl xyz -is the same as -.Fl x y z ) , -and short -options with arguments take these as either the rest of the -argv-string or as the next option -.Pf ( Fl o Ns Ar foo , -or -.Fl o Ar foo ) . -.Pp -Long option names are prefixed with -- (double dash), and the value -with a = (equal), -.Fl -foo= Ns Ar bar . -Long option flags can either be specified as they are -.Pf ( Fl -help ) , -or with an (boolean parsable) option -.Pf ( Fl -help= Ns Ar yes , -.Fl -help= Ns Ar true , -or similar), or they can also be negated -.Pf ( Fl -no-help -is the same as -.Fl -help= Ns no ) , -and if you're really confused you can do it multiple times -.Pf ( Fl -no-no-help= Ns Ar false , -or even -.Fl -no-no-help= Ns Ar maybe ) . -.Sh EXAMPLE -.Bd -literal -#include <stdio.h> -#include <string.h> -#include <getarg.h> - -char *source = "Ouagadougou"; -char *destination; -int weight; -int include_catalog = 1; -int help_flag; - -struct getargs args[] = { - { "source", 's', arg_string, &source, - "source of shippment", "city" }, - { "destination", 'd', arg_string, &destination, - "destination of shippment", "city" }, - { "weight", 'w', arg_integer, &weight, - "weight of shippment", "tons" }, - { "catalog", 'c', arg_negative_flag, &include_catalog, - "include product catalog" }, - { "help", 'h', arg_flag, &help_flag } -}; - -int num_args = sizeof(args) / sizeof(args[0]); /* number of elements in args */ - -const char *progname = "ship++"; - -int -main(int argc, char **argv) -{ - int optind = 0; - if (getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, "stuff..."); - exit (1); - } - if (help_flag) { - arg_printusage(args, num_args, progname, "stuff..."); - exit (0); - } - if (destination == NULL) { - fprintf(stderr, "%s: must specify destination\n", progname); - exit(1); - } - if (strcmp(source, destination) == 0) { - fprintf(stderr, "%s: destination must be different from source\n"); - exit(1); - } - /* include more stuff here ... */ - exit(2); -} -.Ed -.Pp -The output help output from this program looks like this: -.Bd -literal -$ ship++ --help -Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city] - [--weight=tons] [-w tons] [--no-catalog] [-c] [--help] [-h] stuff... --s city, --source=city source of shippment --d city, --destination=city destination of shippment --w tons, --weight=tons weight of shippment --c, --no-catalog include product catalog -.Ed - -.Sh BUGS -It should be more flexible, so it would be possible to use other more -complicated option syntaxes, such as what -.Xr ps 1 , -and -.Xr tar 1 , -uses, or the AFS model where you can skip the flag names as long as -the options come in the correct order. -.Pp -Options with multiple arguments should be handled better. -.Pp -Should be integreated with SL. -.Pp -It's very confusing that the struct you pass in is called getargS. -.Sh SEE ALSO -.Xr getopt 3 diff --git a/ndb/src/common/util/getarg.3.ps b/ndb/src/common/util/getarg.3.ps deleted file mode 100644 index 146fb8e4961..00000000000 --- a/ndb/src/common/util/getarg.3.ps +++ /dev/null @@ -1,458 +0,0 @@ -%!PS-Adobe-3.0 -%%Creator: groff version 1.15 -%%CreationDate: Thu Nov 7 12:53:13 2002 -%%DocumentNeededResources: font Times-Roman -%%+ font Times-Bold -%%+ font Courier-Bold -%%+ font Courier-Oblique -%%+ font Symbol -%%+ font Courier -%%DocumentSuppliedResources: procset grops 1.15 0 -%%Pages: 4 -%%PageOrder: Ascend -%%Orientation: Portrait -%%EndComments -%%BeginProlog -%%BeginResource: procset grops 1.15 0 -/setpacking where{ -pop -currentpacking -true setpacking -}if -/grops 120 dict dup begin -/SC 32 def -/A/show load def -/B{0 SC 3 -1 roll widthshow}bind def -/C{0 exch ashow}bind def -/D{0 exch 0 SC 5 2 roll awidthshow}bind def -/E{0 rmoveto show}bind def -/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def -/G{0 rmoveto 0 exch ashow}bind def -/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/I{0 exch rmoveto show}bind def -/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def -/K{0 exch rmoveto 0 exch ashow}bind def -/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/M{rmoveto show}bind def -/N{rmoveto 0 SC 3 -1 roll widthshow}bind def -/O{rmoveto 0 exch ashow}bind def -/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/Q{moveto show}bind def -/R{moveto 0 SC 3 -1 roll widthshow}bind def -/S{moveto 0 exch ashow}bind def -/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/SF{ -findfont exch -[exch dup 0 exch 0 exch neg 0 0]makefont -dup setfont -[exch/setfont cvx]cvx bind def -}bind def -/MF{ -findfont -[5 2 roll -0 3 1 roll -neg 0 0]makefont -dup setfont -[exch/setfont cvx]cvx bind def -}bind def -/level0 0 def -/RES 0 def -/PL 0 def -/LS 0 def -/MANUAL{ -statusdict begin/manualfeed true store end -}bind def -/PLG{ -gsave newpath clippath pathbbox grestore -exch pop add exch pop -}bind def -/BP{ -/level0 save def -1 setlinecap -1 setlinejoin -72 RES div dup scale -LS{ -90 rotate -}{ -0 PL translate -}ifelse -1 -1 scale -}bind def -/EP{ -level0 restore -showpage -}bind def -/DA{ -newpath arcn stroke -}bind def -/SN{ -transform -.25 sub exch .25 sub exch -round .25 add exch round .25 add exch -itransform -}bind def -/DL{ -SN -moveto -SN -lineto stroke -}bind def -/DC{ -newpath 0 360 arc closepath -}bind def -/TM matrix def -/DE{ -TM currentmatrix pop -translate scale newpath 0 0 .5 0 360 arc closepath -TM setmatrix -}bind def -/RC/rcurveto load def -/RL/rlineto load def -/ST/stroke load def -/MT/moveto load def -/CL/closepath load def -/FL{ -currentgray exch setgray fill setgray -}bind def -/BL/fill load def -/LW/setlinewidth load def -/RE{ -findfont -dup maxlength 1 index/FontName known not{1 add}if dict begin -{ -1 index/FID ne{def}{pop pop}ifelse -}forall -/Encoding exch def -dup/FontName exch def -currentdict end definefont pop -}bind def -/DEFS 0 def -/EBEGIN{ -moveto -DEFS begin -}bind def -/EEND/end load def -/CNT 0 def -/level1 0 def -/PBEGIN{ -/level1 save def -translate -div 3 1 roll div exch scale -neg exch neg exch translate -0 setgray -0 setlinecap -1 setlinewidth -0 setlinejoin -10 setmiterlimit -[]0 setdash -/setstrokeadjust where{ -pop -false setstrokeadjust -}if -/setoverprint where{ -pop -false setoverprint -}if -newpath -/CNT countdictstack def -userdict begin -/showpage{}def -}bind def -/PEND{ -clear -countdictstack CNT sub{end}repeat -level1 restore -}bind def -end def -/setpacking where{ -pop -setpacking -}if -%%EndResource -%%IncludeResource: font Times-Roman -%%IncludeResource: font Times-Bold -%%IncludeResource: font Courier-Bold -%%IncludeResource: font Courier-Oblique -%%IncludeResource: font Symbol -%%IncludeResource: font Courier -grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 -def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron -/scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef -/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef -/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef -/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent -/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen -/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon -/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O -/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex -/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y -/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft -/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl -/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut -/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash -/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen -/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft -/logicalnot/minus/registered/macron/degree/plusminus/twosuperior -/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior -/ordmasculine/guilsinglright/onequarter/onehalf/threequarters -/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE -/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex -/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis -/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn -/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla -/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis -/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash -/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def -/Courier@0 ENC0/Courier RE/Courier-Oblique@0 ENC0/Courier-Oblique RE -/Courier-Bold@0 ENC0/Courier-Bold RE/Times-Bold@0 ENC0/Times-Bold RE -/Times-Roman@0 ENC0/Times-Roman RE -%%EndProlog -%%Page: 1 1 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F/F1 10/Times-Bold@0 SF -.2(NA)72 108 S(ME).2 E -/F2 10/Courier-Bold@0 SF(getarg)102 120 Q F0(,)A F2(arg_printusage)2.5 E -F0 2.5<ad63>2.5 G(ollect command line options)-2.5 E F1(SYNOPSIS)72 144 -Q F2(#include <getarg.h>)102 156 Q/F3 10/Courier-Oblique@0 SF(int)102 -186 Q F2(getarg)102 198 Q F0(\()A F3(struct getargs)A/F4 10/Symbol SF(*) -6 E F3(args)A F0(,)1.666 E F3(size_t num_args)4.166 E F0(,)1.666 E F3 -(int argc)4.166 E F0(,)1.666 E F3(char)4.166 E F4(**)6 E F3(argv)A F0(,) -1.666 E F3(int)151.666 210 Q F4(*)6 E F3(optind)A F0(\);)A F3(void)102 -240 Q F2(arg_printusage)102 252 Q F0(\()A F3(struct getargs)A F4(*)6 E -F3(args)A F0(,)1.666 E F3(size_t num_args)4.166 E F0(,)1.666 E F3 -(const char)4.166 E F4(*)6 E F3(progname)A F0(,)1.666 E F3(const char) -151.666 264 Q F4(*)6 E F3(extra_string)A F0(\);)A F1(DESCRIPTION)72 300 -Q F2(getarg)102 312 Q F0 2.721 1.666(\(\) c)D 6.053(ollects an)-1.666 F -8.553(yc)-.15 G 6.053(ommand line options gi)-8.553 F -.15(ve)-.25 G -8.552(nt).15 G 8.552(oap)-8.552 G 6.052(rogram in an easily used w) --8.552 F(ay)-.1 E(.)-.65 E F2(arg_printusage)102 324 Q F0 -3.332 1.666 -(\(\) p)D(retty-prints the a)-1.666 E -.25(va)-.2 G -(ilable options, with a short help te).25 E(xt.)-.15 E F3(args)102 342 Q -F0 .855(is the option speci\214cation to use, and it')3.355 F 3.356(sa) --.55 G 3.356(na)-3.356 G .856(rray of)-3.356 F F3 .856(struct getargs) -3.356 F F0(elements.)3.356 E F3(num_args)5.856 E F0(is)3.356 E .344 -(the size of)102 354 R F3(args)2.844 E F0 .344(\(in elements\).)2.844 F -F3(argc)5.344 E F0(and)2.844 E F3(argv)2.844 E F0 .344(are the ar)2.844 -F .344(gument count and ar)-.18 F .344(gument v)-.18 F .344(ector to e) --.15 F .343(xtract op-)-.15 F 1.127(tion from.)102 366 R F3(optind)6.127 -E F0 1.127(is a pointer to an inte)3.627 F 1.127(ger where the inde)-.15 -F 3.627(xt)-.15 G 3.628(ot)-3.627 G 1.128(he last processed ar)-3.628 F -1.128(gument is stored, it)-.18 F -(must be initialised to the \214rst inde)102 378 Q 2.5(x\()-.15 G -(minus one\) to process \(normally 0\) before the \214rst call.)-2.5 E -F3(arg_printusage)102 396 Q F0(tak)4.178 E 4.178(et)-.1 G 1.678(he same) --4.178 F F3(args)4.178 E F0(and)4.178 E F3(num_args)4.178 E F0 1.678 -(as getar)4.178 F(g;)-.18 E F3 1.677(progname is the name of)4.178 F -6.381(the program \(to be)102 408 R F0(progname0)12.381 E F3(0)12.381 E -F0(progname1)A F3(1)12.381 E F0(progname2)A F3(2)12.382 E F0(progname3)A -F3(3)12.382 E F0(progname4)A F3(4)102 420 Q F0(progname5)A F3 -(extra_string)3.404 E F0 .904 -(is a string to print after the actual options to indicate more ar)3.404 -F .904(guments. The)-.18 F .025(usefulness of this function is realised\ - only be people who has used programs that has help strings that doesn') -102 432 R(t)-.18 E(match what the code does.)102 444 Q(The)102 462 Q F3 -(getargs)2.5 E F0(struct has the follo)2.5 E(wing elements.)-.25 E/F5 10 -/Courier@0 SF(struct getargs{)102 504 Q(const char)126 516 Q F4(*)6 E F5 -(long_name;)A(char short_name;)126 528 Q(enum { arg_integer,)126 540 Q -(arg_string,)165 552 Q(arg_flag,)165 564 Q(arg_negative_flag,)165 576 Q -(arg_strings,)165 588 Q(arg_double,)165 600 Q(arg_collect)168 612 Q 6 -(}t)126 624 S(ype;)-6 E(void)126 636 Q F4(*)6 E F5(value;)A(const char) -126 648 Q F4(*)6 E F5(help;)A(const char)126 660 Q F4(*)6 E F5 -(arg_help;)A(};)102 672 Q F3(long_name)102 690 Q F0 .207 -(is the long name of the option, it can be)2.707 F F5(NULL)2.706 E F0 -2.706(,i)C 2.706(fy)-2.706 G .206(ou don')-2.706 F 2.706(tw)-.18 G .206 -(ant a long name.)-2.806 F F3(short_name)5.206 E F0 .397(is the charact\ -ed to use as short option, it can be zero. If the option has a v)102 702 -R .398(alue the)-.25 F F3(value)2.898 E F0 .398 -(\214eld gets \214lled in)2.898 F -.4(RO)77 750 S 152.325(KEN September) -.4 F(24, 1999)2.5 E(1)188.865 E EP -%%Page: 2 2 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F .737(with that v)102 96 R .737 -(alue interpreted as speci\214ed by the)-.25 F/F1 10/Courier-Oblique@0 -SF(type)3.237 E F0(\214eld.)3.237 E F1(help)5.737 E F0 .737 -(is a longer help string for the option as a)3.237 F 2.833 -(whole, if it')102 108 R(s)-.55 E/F2 10/Courier@0 SF(NULL)5.333 E F0 -2.833(the help te)5.333 F 2.833(xt for the option is omitted \(b)-.15 F -2.834(ut it')-.2 F 5.334(ss)-.55 G 2.834 -(till displayed in the synopsis\).)-5.334 F F1(arg_help)102 120 Q F0 -.391(is a description of the ar)2.891 F .391(gument, if)-.18 F F2(NULL) -2.891 E F0 2.891(ad)2.891 G(ef)-2.891 E .39(ault v)-.1 F .39 -(alue will be used, depending on the type of)-.25 F(the option:)102 132 -Q(ar)102 150 Q(g_inte)-.18 E 59.29(ger the)-.15 F(ar)2.5 E -(gument is a signed inte)-.18 E(ger)-.15 E 2.5(,a)-.4 G(nd)-2.5 E F1 -(value)2.5 E F0(should point to an)2.5 E F1(int)2.5 E F0(.)A F1 -(arg_string)102 168 Q F0(the ar)47 E(gument is a string, and)-.18 E F1 -(value)2.5 E F0(should point to a)2.5 E F1(char)2.5 E/F3 10/Symbol SF(*) -A F0(.)A F1(arg_flag)102 186 Q F0 .4(the ar)59 F .4 -(gument is a \215ag, and)-.18 F F1(value)2.9 E F0 .4(should point to a) -2.9 F F1(int)2.9 E F0 2.9(.I)C 2.9(tg)-2.9 G .4 -(ets \214lled in with ei-)-2.9 F 1.154 -(ther zero or one, depending on ho)209 198 R 3.654(wt)-.25 G 1.153 -(he option is gi)-3.654 F -.15(ve)-.25 G 1.153 -(n, the normal case beeing).15 F .526(one. Note that if the option isn') -209 210 R 3.026(tg)-.18 G -2.15 -.25(iv e)-3.026 H .526(n, the v).25 F -.526(alue isn')-.25 F 3.026(ta)-.18 G .527(ltered, so it should be ini-) --3.026 F(tialised to some useful def)209 222 Q(ault.)-.1 E F1 -(arg_negative_flag)102 240 Q F0 .058(this is the same as)2.558 F F1 -(arg_flag)2.558 E F0 -.2(bu)2.558 G 2.558(ti).2 G 2.558(tr)-2.558 G --2.15 -.25(ev e)-2.558 H .057(rses the meaning of the \215ag \(a gi).25 -F -.15(ve)-.25 G 2.557(ns).15 G(hort)-2.557 E -(option clears the \215ag\), and the synopsis of a long option is ne)209 -252 Q -.05(ga)-.15 G(ted.).05 E F1(arg_strings)102 270 Q F0 .195(the ar) -41 F .195(gument can be gi)-.18 F -.15(ve)-.25 G 2.695(nm).15 G .195 -(ultiple times, and the v)-2.695 F .195 -(alues are collected in an array;)-.25 F F1(value)209 282 Q F0 .947 -(should be a pointer to a)3.447 F F1 .947(struct getarg_strings)3.447 F -F0 .947(structure, which)3.447 F(holds a length and a string pointer)209 -294 Q(.)-.55 E F1(arg_double)102 312 Q F0(ar)47 E .538 -(gument is a double precision \215oating point v)-.18 F .539(alue, and) --.25 F F1(value)3.039 E F0 .539(should point to a)3.039 F F1(double)209 -324 Q F0(.)A F1(arg_collect)102 342 Q F0(allo)41 E .345 -(ws more \214ne-grained control of the option parsing process.)-.25 F F1 -(value)5.344 E F0 .344(should be)2.844 F 2.5(ap)209 354 S(ointer to a) --2.5 E F1(getarg_collect_info)2.5 E F0(structure:)2.5 E F2 -(typedef int \()209 372 Q F3(*)A F2 -(getarg_collect_func\)\(int short_opt,)A(int argc,)407 384 Q(char)407 -396 Q F3(**)6 E F2(argv,)A(int)407 408 Q F3(*)6 E F2(optind,)A(int)407 -420 Q F3(*)6 E F2(optarg,)A(void)407 432 Q F3(*)6 E F2(data\);)A -(typedef struct getarg_collect_info {)209 456 Q -(getarg_collect_func func;)233 468 Q(void)233 480 Q F3(*)6 E F2(data;)A -6(}g)209 492 S(etarg_collect_info;)-6 E F0 -.4(Wi)209 510 S 1.018 -(th the).4 F F1(func)3.518 E F0 1.019 -(member set to a function to call, and)3.518 F F1(data)3.519 E F0 1.019 -(to some application)3.519 F -(speci\214c data. The parameters to the collect function are:)209 522 Q -F1(short_flag)209 540 Q F0 -(non-zero if this call is via a short option \215ag, zero otherwise)2.5 -E F1(argc)209 558 Q F0(,)A F1(argv)6 E F0(the whole ar)2.5 E -(gument list)-.18 E F1(optind)209 576 Q F0(pointer to the inde)2.5 E 2.5 -(xi)-.15 G 2.5(na)-2.5 G -.18(rg)-2.5 G 2.5(vw).18 G(here the \215ag is) --2.5 E F1(optarg)209 594 Q F0(pointer to the inde)2.5 E 2.5(xi)-.15 G -2.5(na)-2.5 G -.18(rg)-2.5 G(v[).18 E F3(*)A F0 -(optind] where the \215ag name starts)A F1(data)209 612 Q F0 -(application speci\214c data)2.5 E -1.1(Yo)209 630 S 3.915(uc)1.1 G -1.415(an modify)-3.915 F F3(*)3.915 E F1(optind)A F0 3.915(,a)C(nd) --3.915 E F3(*)3.915 E F1(optarg)A F0 3.915(,b)C 1.414 -(ut to do this correct you \(more or)-4.115 F(less\) ha)209 642 Q .3 --.15(ve t)-.2 H 2.5(ok).15 G(no)-2.5 E 2.5(wa)-.25 G(bout the inner w) --2.5 E(orkings of getar)-.1 E(g.)-.18 E -1.1(Yo)209 666 S 3.604(uc)1.1 G -1.104(an skip parts of ar)-3.604 F 1.105(guments by increasing)-.18 F F3 -(*)3.605 E F1(optarg)A F0 1.105(\(you could implement)3.605 F(the)209 -678 Q/F4 10/Courier-Bold@0 SF<ad7a>4.567 E F1(3)A F0 .401 -(set of \215ags from)2.901 F F4(gzip)2.9 E F0 .4 -(with this\), or whole ar)2.9 F .4(gument strings by increas-)-.18 F -(ing)209 690 Q F3(*)3.275 E F1(optind)A F0(\(let')3.275 E 3.276(ss)-.55 -G .776(ay you w)-3.276 F .776(ant a \215ag)-.1 F F4<ad63>4.942 E F1 -6.776(xyz)6.776 G F0 .776(to specify a coordinate\); if)-3.5 F -(you also ha)209 702 Q .3 -.15(ve t)-.2 H 2.5(os).15 G(et)-2.5 E F3(*) -2.5 E F1(optarg)A F0(to a sane v)2.5 E(alue.)-.25 E -.4(RO)77 750 S -152.325(KEN September).4 F(24, 1999)2.5 E(2)188.865 E EP -%%Page: 3 3 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F 9.449 -(The collect function should return one of)209 96 R/F1 10/Courier@0 SF -(ARG_ERR_NO_MATCH)11.948 E F0(,)A F1(ARG_ERR_BAD_ARG)209 108 Q F0(,)A F1 -(ARG_ERR_NO_ARG)6 E F0(on error)2.5 E 2.5(,z)-.4 G(ero otherwise.)-2.5 E --.15(Fo)209 126 S 4.042(ry).15 G 1.542(our con)-4.042 F -.15(ve)-.4 G -1.542(nience there is a function,).15 F/F2 10/Courier-Bold@0 SF -(getarg_optarg)4.042 E F0 1.542(\(\), that returns the)B 1.251 -(traditional ar)209 138 R 1.251(gument string, and you pass it all ar) --.18 F 1.251(guments, sans data, that where)-.18 F(gi)209 150 Q -.15(ve) --.25 G 2.5(nt).15 G 2.5(ot)-2.5 G(he collection function.)-2.5 E(Don') -209 168 Q 2.5(tu)-.18 G(se this more this unless you absolutely ha)-2.5 -E .3 -.15(ve t)-.2 H(o.).15 E .213(Option parsing is similar to what)102 -186 R F1(getopt)2.713 E F0 .214(uses. Short options without ar)2.714 F -.214(guments can be compressed \()-.18 F F2(\255xyz)1.666 E F0 .207 -(is the same as)102 198 R F2 1.873<ad7820ad7920ad7a>4.373 F F0 .207 -(\), and short options with ar)B .207(guments tak)-.18 F 2.706(et)-.1 G -.206(hese as either the rest of the ar)-2.706 F(gv-string)-.18 E -(or as the ne)102 210 Q(xt option \()-.15 E F2<ad6f>1.666 E/F3 10 -/Courier-Oblique@0 SF(foo)A F0 2.5(,o)C(r)-2.5 E F2<ad6f>4.166 E F3(foo) -6 E F0(\).)A .78(Long option names are pre\214x)102 228 R .781 -(ed with -- \(double dash\), and the v)-.15 F .781 -(alue with a = \(equal\),)-.25 F F2(\255-foo=)4.947 E F3(bar)A F0 3.281 -(.L)C(ong)-3.281 E 3.815 -(option \215ags can either be speci\214ed as the)102 240 R 6.315(ya)-.15 -G 3.815(re \()-6.315 F F2(\255-help)1.666 E F0 3.815 -(\), or with an \(boolean parsable\) option)B(\()102 252 Q F2 -(\255-help=)1.666 E F3(yes)A F0(,)A F2(\255-help=)5.659 E F3(true)A F0 -3.993(,o)C 3.993(rs)-3.993 G 1.493(imilar\), or the)-3.993 F 3.993(yc) --.15 G 1.493(an also be ne)-3.993 F -.05(ga)-.15 G 1.493(ted \().05 F F2 -(\255-no-help)1.666 E F0 1.493(is the same as)3.993 F F2(\255-help=) -103.666 264 Q F0 1.363(no\), and if you')B 1.362 -(re really confused you can do it multiple times \()-.5 F F2 -(\255-no-no-help=)1.666 E F3(false)A F0 3.862(,o)C(r)-3.862 E -2.15 -.25 -(ev e)102 276 T(n).25 E F2(\255-no-no-help=)4.166 E F3(maybe)A F0(\).)A -/F4 10/Times-Bold@0 SF(EXAMPLE)72 300 Q F1(#include <stdio.h>)102 330 Q -(#include <string.h>)102 342 Q(#include <getarg.h>)102 354 Q(char)102 -378 Q/F5 10/Symbol SF(*)6 E F1(source = "Ouagadougou";)A(char)102 390 Q -F5(*)6 E F1(destination;)A(int weight;)102 402 Q -(int include_catalog = 1;)102 414 Q(int help_flag;)102 426 Q -(struct getargs args[] = {)102 450 Q 6({")126 462 S 30(source", 's',)-6 -F 6(arg_string, &source,)6 F("source of shippment", "city" },)138 474 Q -6({")126 486 S(destination", 'd', arg_string,)-6 E(&destination,)12 E -("destination of shippment", "city" },)138 498 Q 6({")126 510 S 30 -(weight", 'w',)-6 F(arg_integer, &weight,)6 E -("weight of shippment", "tons" },)138 522 Q 6({")126 534 S 24 -(catalog", 'c',)-6 F(arg_negative_flag, &include_catalog,)6 E -("include product catalog" },)138 546 Q 6({")126 558 S 42(help", 'h',)-6 -F(arg_flag, &help_flag })6 E(};)102 570 Q -(int num_args = sizeof\(args\) / sizeof\(args[0]\); /)102 594 Q F5(*)A -F1(number of elements in args)6 E F5(*)6 E F1(/)A(const char)102 618 Q -F5(*)6 E F1(progname = "ship++";)A(int)102 642 Q(main\(int argc, char) -102 654 Q F5(**)6 E F1(argv\))A({)102 666 Q(int optind = 0;)126 678 Q -(if \(getarg\(args, num_args, argc, argv, &optind\)\) {)126 690 Q -(arg_printusage\(args, num_args, progname, "stuff..."\);)147 702 Q F0 --.4(RO)77 750 S 152.325(KEN September).4 F(24, 1999)2.5 E(3)188.865 E EP -%%Page: 4 4 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F/F1 10/Courier@0 SF(exit \(1\);)147 96 Q(})126 -108 Q(if \(help_flag\) {)126 120 Q -(arg_printusage\(args, num_args, progname, "stuff..."\);)147 132 Q -(exit \(0\);)147 144 Q(})126 156 Q(if \(destination == NULL\) {)126 168 -Q(fprintf\(stderr, "%s: must specify destination0, progname\);)147 180 Q -(exit\(1\);)147 192 Q(})126 204 Q -(if \(strcmp\(source, destination\) == 0\) {)126 216 Q -(fprintf\(stderr, "%s: destination must be different from source0\);)147 -228 Q(exit\(1\);)147 240 Q(})126 252 Q(/)126 264 Q/F2 10/Symbol SF(*)A -F1(include more stuff here ...)6 E F2(*)6 E F1(/)A(exit\(2\);)126 276 Q -(})102 288 Q F0(The output help output from this program looks lik)102 -306 Q 2.5(et)-.1 G(his:)-2.5 E F1 6($s)102 324 S(hip++ --help)-6 E -(Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city]) -102 336 Q -([--weight=tons] [-w tons] [--no-catalog] [-c] [--help] [-h] stuff...) -120 348 Q(-s city, --source=city)102 360 Q(source of shippment)36 E -(-d city, --destination=city destination of shippment)102 372 Q -(-w tons, --weight=tons)102 384 Q(weight of shippment)36 E -(-c, --no-catalog)102 396 Q(include product catalog)72 E/F3 10 -/Times-Bold@0 SF -.1(BU)72 432 S(GS).1 E F0 .9(It should be more \215e) -102 444 R .9(xible, so it w)-.15 F .901 -(ould be possible to use other more complicated option syntax)-.1 F .901 -(es, such as)-.15 F(what)102 456 Q F1(ps)3.167 E F0 .667(\(1\), and)B F1 -(tar)3.167 E F0 .666(\(1\), uses, or the AFS model where you can skip t\ -he \215ag names as long as the options)B(come in the correct order)102 -468 Q(.)-.55 E(Options with multiple ar)102 486 Q -(guments should be handled better)-.18 E(.)-.55 E(Should be inte)102 504 -Q(greated with SL.)-.15 E(It')102 522 Q 2.5(sv)-.55 G -(ery confusing that the struct you pass in is called getar)-2.65 E(gS.) --.18 E F3 1.666(SEE ALSO)72 546 R F1(getopt)102 558 Q F0(\(3\))A -.4(RO) -77 750 S 152.325(KEN September).4 F(24, 1999)2.5 E(4)188.865 E EP -%%Trailer -end -%%EOF diff --git a/ndb/src/common/util/md5-rfc1321.txt b/ndb/src/common/util/md5-rfc1321.txt deleted file mode 100644 index c9e09e00cce..00000000000 --- a/ndb/src/common/util/md5-rfc1321.txt +++ /dev/null @@ -1,1179 +0,0 @@ - - - - - - -Network Working Group R. Rivest -Request for Comments: 1321 MIT Laboratory for Computer Science - and RSA Data Security, Inc. - April 1992 - - - The MD5 Message-Digest Algorithm - -Status of this Memo - - This memo provides information for the Internet community. It does - not specify an Internet standard. Distribution of this memo is - unlimited. - -Acknowlegements - - We would like to thank Don Coppersmith, Burt Kaliski, Ralph Merkle, - David Chaum, and Noam Nisan for numerous helpful comments and - suggestions. - -Table of Contents - - 1. Executive Summary 1 - 2. Terminology and Notation 2 - 3. MD5 Algorithm Description 3 - 4. Summary 6 - 5. Differences Between MD4 and MD5 6 - References 7 - APPENDIX A - Reference Implementation 7 - Security Considerations 21 - Author's Address 21 - -1. Executive Summary - - This document describes the MD5 message-digest algorithm. The - algorithm takes as input a message of arbitrary length and produces - as output a 128-bit "fingerprint" or "message digest" of the input. - It is conjectured that it is computationally infeasible to produce - two messages having the same message digest, or to produce any - message having a given prespecified target message digest. The MD5 - algorithm is intended for digital signature applications, where a - large file must be "compressed" in a secure manner before being - encrypted with a private (secret) key under a public-key cryptosystem - such as RSA. - - - - - - - -Rivest [Page 1] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - The MD5 algorithm is designed to be quite fast on 32-bit machines. In - addition, the MD5 algorithm does not require any large substitution - tables; the algorithm can be coded quite compactly. - - The MD5 algorithm is an extension of the MD4 message-digest algorithm - 1,2]. MD5 is slightly slower than MD4, but is more "conservative" in - design. MD5 was designed because it was felt that MD4 was perhaps - being adopted for use more quickly than justified by the existing - critical review; because MD4 was designed to be exceptionally fast, - it is "at the edge" in terms of risking successful cryptanalytic - attack. MD5 backs off a bit, giving up a little in speed for a much - greater likelihood of ultimate security. It incorporates some - suggestions made by various reviewers, and contains additional - optimizations. The MD5 algorithm is being placed in the public domain - for review and possible adoption as a standard. - - For OSI-based applications, MD5's object identifier is - - md5 OBJECT IDENTIFIER ::= - iso(1) member-body(2) US(840) rsadsi(113549) digestAlgorithm(2) 5} - - In the X.509 type AlgorithmIdentifier [3], the parameters for MD5 - should have type NULL. - -2. Terminology and Notation - - In this document a "word" is a 32-bit quantity and a "byte" is an - eight-bit quantity. A sequence of bits can be interpreted in a - natural manner as a sequence of bytes, where each consecutive group - of eight bits is interpreted as a byte with the high-order (most - significant) bit of each byte listed first. Similarly, a sequence of - bytes can be interpreted as a sequence of 32-bit words, where each - consecutive group of four bytes is interpreted as a word with the - low-order (least significant) byte given first. - - Let x_i denote "x sub i". If the subscript is an expression, we - surround it in braces, as in x_{i+1}. Similarly, we use ^ for - superscripts (exponentiation), so that x^i denotes x to the i-th - power. - - Let the symbol "+" denote addition of words (i.e., modulo-2^32 - addition). Let X <<< s denote the 32-bit value obtained by circularly - shifting (rotating) X left by s bit positions. Let not(X) denote the - bit-wise complement of X, and let X v Y denote the bit-wise OR of X - and Y. Let X xor Y denote the bit-wise XOR of X and Y, and let XY - denote the bit-wise AND of X and Y. - - - - - -Rivest [Page 2] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -3. MD5 Algorithm Description - - We begin by supposing that we have a b-bit message as input, and that - we wish to find its message digest. Here b is an arbitrary - nonnegative integer; b may be zero, it need not be a multiple of - eight, and it may be arbitrarily large. We imagine the bits of the - message written down as follows: - - m_0 m_1 ... m_{b-1} - - The following five steps are performed to compute the message digest - of the message. - -3.1 Step 1. Append Padding Bits - - The message is "padded" (extended) so that its length (in bits) is - congruent to 448, modulo 512. That is, the message is extended so - that it is just 64 bits shy of being a multiple of 512 bits long. - Padding is always performed, even if the length of the message is - already congruent to 448, modulo 512. - - Padding is performed as follows: a single "1" bit is appended to the - message, and then "0" bits are appended so that the length in bits of - the padded message becomes congruent to 448, modulo 512. In all, at - least one bit and at most 512 bits are appended. - -3.2 Step 2. Append Length - - A 64-bit representation of b (the length of the message before the - padding bits were added) is appended to the result of the previous - step. In the unlikely event that b is greater than 2^64, then only - the low-order 64 bits of b are used. (These bits are appended as two - 32-bit words and appended low-order word first in accordance with the - previous conventions.) - - At this point the resulting message (after padding with bits and with - b) has a length that is an exact multiple of 512 bits. Equivalently, - this message has a length that is an exact multiple of 16 (32-bit) - words. Let M[0 ... N-1] denote the words of the resulting message, - where N is a multiple of 16. - -3.3 Step 3. Initialize MD Buffer - - A four-word buffer (A,B,C,D) is used to compute the message digest. - Here each of A, B, C, D is a 32-bit register. These registers are - initialized to the following values in hexadecimal, low-order bytes - first): - - - - -Rivest [Page 3] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - word A: 01 23 45 67 - word B: 89 ab cd ef - word C: fe dc ba 98 - word D: 76 54 32 10 - -3.4 Step 4. Process Message in 16-Word Blocks - - We first define four auxiliary functions that each take as input - three 32-bit words and produce as output one 32-bit word. - - F(X,Y,Z) = XY v not(X) Z - G(X,Y,Z) = XZ v Y not(Z) - H(X,Y,Z) = X xor Y xor Z - I(X,Y,Z) = Y xor (X v not(Z)) - - In each bit position F acts as a conditional: if X then Y else Z. - The function F could have been defined using + instead of v since XY - and not(X)Z will never have 1's in the same bit position.) It is - interesting to note that if the bits of X, Y, and Z are independent - and unbiased, the each bit of F(X,Y,Z) will be independent and - unbiased. - - The functions G, H, and I are similar to the function F, in that they - act in "bitwise parallel" to produce their output from the bits of X, - Y, and Z, in such a manner that if the corresponding bits of X, Y, - and Z are independent and unbiased, then each bit of G(X,Y,Z), - H(X,Y,Z), and I(X,Y,Z) will be independent and unbiased. Note that - the function H is the bit-wise "xor" or "parity" function of its - inputs. - - This step uses a 64-element table T[1 ... 64] constructed from the - sine function. Let T[i] denote the i-th element of the table, which - is equal to the integer part of 4294967296 times abs(sin(i)), where i - is in radians. The elements of the table are given in the appendix. - - Do the following: - - /* Process each 16-word block. */ - For i = 0 to N/16-1 do - - /* Copy block i into X. */ - For j = 0 to 15 do - Set X[j] to M[i*16+j]. - end /* of loop on j */ - - /* Save A as AA, B as BB, C as CC, and D as DD. */ - AA = A - BB = B - - - -Rivest [Page 4] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - CC = C - DD = D - - /* Round 1. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 0 7 1] [DABC 1 12 2] [CDAB 2 17 3] [BCDA 3 22 4] - [ABCD 4 7 5] [DABC 5 12 6] [CDAB 6 17 7] [BCDA 7 22 8] - [ABCD 8 7 9] [DABC 9 12 10] [CDAB 10 17 11] [BCDA 11 22 12] - [ABCD 12 7 13] [DABC 13 12 14] [CDAB 14 17 15] [BCDA 15 22 16] - - /* Round 2. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 1 5 17] [DABC 6 9 18] [CDAB 11 14 19] [BCDA 0 20 20] - [ABCD 5 5 21] [DABC 10 9 22] [CDAB 15 14 23] [BCDA 4 20 24] - [ABCD 9 5 25] [DABC 14 9 26] [CDAB 3 14 27] [BCDA 8 20 28] - [ABCD 13 5 29] [DABC 2 9 30] [CDAB 7 14 31] [BCDA 12 20 32] - - /* Round 3. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 5 4 33] [DABC 8 11 34] [CDAB 11 16 35] [BCDA 14 23 36] - [ABCD 1 4 37] [DABC 4 11 38] [CDAB 7 16 39] [BCDA 10 23 40] - [ABCD 13 4 41] [DABC 0 11 42] [CDAB 3 16 43] [BCDA 6 23 44] - [ABCD 9 4 45] [DABC 12 11 46] [CDAB 15 16 47] [BCDA 2 23 48] - - /* Round 4. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 0 6 49] [DABC 7 10 50] [CDAB 14 15 51] [BCDA 5 21 52] - [ABCD 12 6 53] [DABC 3 10 54] [CDAB 10 15 55] [BCDA 1 21 56] - [ABCD 8 6 57] [DABC 15 10 58] [CDAB 6 15 59] [BCDA 13 21 60] - [ABCD 4 6 61] [DABC 11 10 62] [CDAB 2 15 63] [BCDA 9 21 64] - - /* Then perform the following additions. (That is increment each - of the four registers by the value it had before this block - was started.) */ - A = A + AA - B = B + BB - C = C + CC - D = D + DD - - end /* of loop on i */ - - - -Rivest [Page 5] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -3.5 Step 5. Output - - The message digest produced as output is A, B, C, D. That is, we - begin with the low-order byte of A, and end with the high-order byte - of D. - - This completes the description of MD5. A reference implementation in - C is given in the appendix. - -4. Summary - - The MD5 message-digest algorithm is simple to implement, and provides - a "fingerprint" or message digest of a message of arbitrary length. - It is conjectured that the difficulty of coming up with two messages - having the same message digest is on the order of 2^64 operations, - and that the difficulty of coming up with any message having a given - message digest is on the order of 2^128 operations. The MD5 algorithm - has been carefully scrutinized for weaknesses. It is, however, a - relatively new algorithm and further security analysis is of course - justified, as is the case with any new proposal of this sort. - -5. Differences Between MD4 and MD5 - - The following are the differences between MD4 and MD5: - - 1. A fourth round has been added. - - 2. Each step now has a unique additive constant. - - 3. The function g in round 2 was changed from (XY v XZ v YZ) to - (XZ v Y not(Z)) to make g less symmetric. - - 4. Each step now adds in the result of the previous step. This - promotes a faster "avalanche effect". - - 5. The order in which input words are accessed in rounds 2 and - 3 is changed, to make these patterns less like each other. - - 6. The shift amounts in each round have been approximately - optimized, to yield a faster "avalanche effect." The shifts in - different rounds are distinct. - - - - - - - - - - -Rivest [Page 6] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -References - - [1] Rivest, R., "The MD4 Message Digest Algorithm", RFC 1320, MIT and - RSA Data Security, Inc., April 1992. - - [2] Rivest, R., "The MD4 message digest algorithm", in A.J. Menezes - and S.A. Vanstone, editors, Advances in Cryptology - CRYPTO '90 - Proceedings, pages 303-311, Springer-Verlag, 1991. - - [3] CCITT Recommendation X.509 (1988), "The Directory - - Authentication Framework." - -APPENDIX A - Reference Implementation - - This appendix contains the following files taken from RSAREF: A - Cryptographic Toolkit for Privacy-Enhanced Mail: - - global.h -- global header file - - md5.h -- header file for MD5 - - md5c.c -- source code for MD5 - - For more information on RSAREF, send email to <rsaref@rsa.com>. - - The appendix also includes the following file: - - mddriver.c -- test driver for MD2, MD4 and MD5 - - The driver compiles for MD5 by default but can compile for MD2 or MD4 - if the symbol MD is defined on the C compiler command line as 2 or 4. - - The implementation is portable and should work on many different - plaforms. However, it is not difficult to optimize the implementation - on particular platforms, an exercise left to the reader. For example, - on "little-endian" platforms where the lowest-addressed byte in a 32- - bit word is the least significant and there are no alignment - restrictions, the call to Decode in MD5Transform can be replaced with - a typecast. - -A.1 global.h - -/* GLOBAL.H - RSAREF types and constants - */ - -/* PROTOTYPES should be set to one if and only if the compiler supports - function argument prototyping. -The following makes PROTOTYPES default to 0 if it has not already - - - -Rivest [Page 7] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - been defined with C compiler flags. - */ -#ifndef PROTOTYPES -#define PROTOTYPES 0 -#endif - -/* POINTER defines a generic pointer type */ -typedef unsigned char *POINTER; - -/* UINT2 defines a two byte word */ -typedef unsigned short int UINT2; - -/* UINT4 defines a four byte word */ -typedef unsigned long int UINT4; - -/* PROTO_LIST is defined depending on how PROTOTYPES is defined above. -If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it - returns an empty list. - */ -#if PROTOTYPES -#define PROTO_LIST(list) list -#else -#define PROTO_LIST(list) () -#endif - -A.2 md5.h - -/* MD5.H - header file for MD5C.C - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - - - - -Rivest [Page 8] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -/* MD5 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} MD5_CTX; - -void MD5Init PROTO_LIST ((MD5_CTX *)); -void MD5Update PROTO_LIST - ((MD5_CTX *, unsigned char *, unsigned int)); -void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); - -A.3 md5c.c - -/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -#include "global.h" -#include "md5.h" - -/* Constants for MD5Transform routine. - */ - - - -Rivest [Page 9] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); -static void Encode PROTO_LIST - ((unsigned char *, UINT4 *, unsigned int)); -static void Decode PROTO_LIST - ((UINT4 *, unsigned char *, unsigned int)); -static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); -static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); - -static unsigned char PADDING[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G, H and I are basic MD5 functions. - */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits. - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. -Rotation is separate from addition to prevent recomputation. - */ -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - - - -Rivest [Page 10] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -/* MD5 initialization. Begins an MD5 operation, writing a new context. - */ -void MD5Init (context) -MD5_CTX *context; /* context */ -{ - context->count[0] = context->count[1] = 0; - /* Load magic initialization constants. -*/ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; -} - -/* MD5 block update operation. Continues an MD5 message-digest - operation, processing another message block, and updating the - context. - */ -void MD5Update (context, input, inputLen) -MD5_CTX *context; /* context */ -unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3)) - - - -Rivest [Page 11] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - < ((UINT4)inputLen << 3)) - context->count[1]++; - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible. -*/ - if (inputLen >= partLen) { - MD5_memcpy - ((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD5Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform (context->state, &input[i]); - - index = 0; - } - else - i = 0; - - /* Buffer remaining input */ - MD5_memcpy - ((POINTER)&context->buffer[index], (POINTER)&input[i], - inputLen-i); -} - -/* MD5 finalization. Ends an MD5 message-digest operation, writing the - the message digest and zeroizing the context. - */ -void MD5Final (digest, context) -unsigned char digest[16]; /* message digest */ -MD5_CTX *context; /* context */ -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64. -*/ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - MD5Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD5Update (context, bits, 8); - - - -Rivest [Page 12] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information. -*/ - MD5_memset ((POINTER)context, 0, sizeof (*context)); -} - -/* MD5 basic transformation. Transforms state based on block. - */ -static void MD5Transform (state, block) -UINT4 state[4]; -unsigned char block[64]; -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - - /* Round 1 */ - FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ - FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ - FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ - FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ - FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ - FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ - FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ - FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ - FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ - FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ - FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ - GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ - GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ - GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ - GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ - GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ - GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ - - - -Rivest [Page 13] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ - GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ - GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ - GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ - HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ - HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ - HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ - HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ - HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ - HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ - HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ - HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ - HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ - II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ - II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ - II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ - II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ - II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ - II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ - II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ - II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ - II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - - /* Zeroize sensitive information. - - - -Rivest [Page 14] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -*/ - MD5_memset ((POINTER)x, 0, sizeof (x)); -} - -/* Encodes input (UINT4) into output (unsigned char). Assumes len is - a multiple of 4. - */ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - -/* Decodes input (unsigned char) into output (UINT4). Assumes len is - a multiple of 4. - */ -static void Decode (output, input, len) -UINT4 *output; -unsigned char *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | - (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} - -/* Note: Replace "for loop" with standard memcpy if possible. - */ - -static void MD5_memcpy (output, input, len) -POINTER output; -POINTER input; -unsigned int len; -{ - unsigned int i; - - for (i = 0; i < len; i++) - - - -Rivest [Page 15] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - output[i] = input[i]; -} - -/* Note: Replace "for loop" with standard memset if possible. - */ -static void MD5_memset (output, value, len) -POINTER output; -int value; -unsigned int len; -{ - unsigned int i; - - for (i = 0; i < len; i++) - ((char *)output)[i] = (char)value; -} - -A.4 mddriver.c - -/* MDDRIVER.C - test driver for MD2, MD4 and MD5 - */ - -/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All -rights reserved. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -/* The following makes MD default to MD5 if it has not already been - defined with C compiler flags. - */ -#ifndef MD -#define MD MD5 -#endif - -#include <stdio.h> -#include <time.h> -#include <string.h> -#include "global.h" -#if MD == 2 -#include "md2.h" -#endif -#if MD == 4 - - - -Rivest [Page 16] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -#include "md4.h" -#endif -#if MD == 5 -#include "md5.h" -#endif - -/* Length of test block, number of test blocks. - */ -#define TEST_BLOCK_LEN 1000 -#define TEST_BLOCK_COUNT 1000 - -static void MDString PROTO_LIST ((char *)); -static void MDTimeTrial PROTO_LIST ((void)); -static void MDTestSuite PROTO_LIST ((void)); -static void MDFile PROTO_LIST ((char *)); -static void MDFilter PROTO_LIST ((void)); -static void MDPrint PROTO_LIST ((unsigned char [16])); - -#if MD == 2 -#define MD_CTX MD2_CTX -#define MDInit MD2Init -#define MDUpdate MD2Update -#define MDFinal MD2Final -#endif -#if MD == 4 -#define MD_CTX MD4_CTX -#define MDInit MD4Init -#define MDUpdate MD4Update -#define MDFinal MD4Final -#endif -#if MD == 5 -#define MD_CTX MD5_CTX -#define MDInit MD5Init -#define MDUpdate MD5Update -#define MDFinal MD5Final -#endif - -/* Main driver. - -Arguments (may be any combination): - -sstring - digests string - -t - runs time trial - -x - runs test script - filename - digests file - (none) - digests standard input - */ -int main (argc, argv) -int argc; - - - -Rivest [Page 17] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -char *argv[]; -{ - int i; - - if (argc > 1) - for (i = 1; i < argc; i++) - if (argv[i][0] == '-' && argv[i][1] == 's') - MDString (argv[i] + 2); - else if (strcmp (argv[i], "-t") == 0) - MDTimeTrial (); - else if (strcmp (argv[i], "-x") == 0) - MDTestSuite (); - else - MDFile (argv[i]); - else - MDFilter (); - - return (0); -} - -/* Digests a string and prints the result. - */ -static void MDString (string) -char *string; -{ - MD_CTX context; - unsigned char digest[16]; - unsigned int len = strlen (string); - - MDInit (&context); - MDUpdate (&context, string, len); - MDFinal (digest, &context); - - printf ("MD%d (\"%s\") = ", MD, string); - MDPrint (digest); - printf ("\n"); -} - -/* Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte - blocks. - */ -static void MDTimeTrial () -{ - MD_CTX context; - time_t endTime, startTime; - unsigned char block[TEST_BLOCK_LEN], digest[16]; - unsigned int i; - - - - -Rivest [Page 18] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - printf - ("MD%d time trial. Digesting %d %d-byte blocks ...", MD, - TEST_BLOCK_LEN, TEST_BLOCK_COUNT); - - /* Initialize block */ - for (i = 0; i < TEST_BLOCK_LEN; i++) - block[i] = (unsigned char)(i & 0xff); - - /* Start timer */ - time (&startTime); - - /* Digest blocks */ - MDInit (&context); - for (i = 0; i < TEST_BLOCK_COUNT; i++) - MDUpdate (&context, block, TEST_BLOCK_LEN); - MDFinal (digest, &context); - - /* Stop timer */ - time (&endTime); - - printf (" done\n"); - printf ("Digest = "); - MDPrint (digest); - printf ("\nTime = %ld seconds\n", (long)(endTime-startTime)); - printf - ("Speed = %ld bytes/second\n", - (long)TEST_BLOCK_LEN * (long)TEST_BLOCK_COUNT/(endTime-startTime)); -} - -/* Digests a reference suite of strings and prints the results. - */ -static void MDTestSuite () -{ - printf ("MD%d test suite:\n", MD); - - MDString (""); - MDString ("a"); - MDString ("abc"); - MDString ("message digest"); - MDString ("abcdefghijklmnopqrstuvwxyz"); - MDString - ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); - MDString - ("1234567890123456789012345678901234567890\ -1234567890123456789012345678901234567890"); -} - -/* Digests a file and prints the result. - - - -Rivest [Page 19] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - */ -static void MDFile (filename) -char *filename; -{ - FILE *file; - MD_CTX context; - int len; - unsigned char buffer[1024], digest[16]; - - if ((file = fopen (filename, "rb")) == NULL) - printf ("%s can't be opened\n", filename); - - else { - MDInit (&context); - while (len = fread (buffer, 1, 1024, file)) - MDUpdate (&context, buffer, len); - MDFinal (digest, &context); - - fclose (file); - - printf ("MD%d (%s) = ", MD, filename); - MDPrint (digest); - printf ("\n"); - } -} - -/* Digests the standard input and prints the result. - */ -static void MDFilter () -{ - MD_CTX context; - int len; - unsigned char buffer[16], digest[16]; - - MDInit (&context); - while (len = fread (buffer, 1, 16, stdin)) - MDUpdate (&context, buffer, len); - MDFinal (digest, &context); - - MDPrint (digest); - printf ("\n"); -} - -/* Prints a message digest in hexadecimal. - */ -static void MDPrint (digest) -unsigned char digest[16]; -{ - - - -Rivest [Page 20] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - unsigned int i; - - for (i = 0; i < 16; i++) - printf ("%02x", digest[i]); -} - -A.5 Test suite - - The MD5 test suite (driver option "-x") should print the following - results: - -MD5 test suite: -MD5 ("") = d41d8cd98f00b204e9800998ecf8427e -MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661 -MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72 -MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0 -MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b -MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = -d174ab98d277d9f5a5611c2c9f419d9f -MD5 ("123456789012345678901234567890123456789012345678901234567890123456 -78901234567890") = 57edf4a22be3c955ac49da2e2107b67a - -Security Considerations - - The level of security discussed in this memo is considered to be - sufficient for implementing very high security hybrid digital- - signature schemes based on MD5 and a public-key cryptosystem. - -Author's Address - - Ronald L. Rivest - Massachusetts Institute of Technology - Laboratory for Computer Science - NE43-324 - 545 Technology Square - Cambridge, MA 02139-1986 - - Phone: (617) 253-5880 - EMail: rivest@theory.lcs.mit.edu - - - - - - - - - - - - -Rivest [Page 21] - diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp index 6f4c7e63684..83a546de773 100644 --- a/ndb/src/common/util/socket_io.cpp +++ b/ndb/src/common/util/socket_io.cpp @@ -172,22 +172,21 @@ vprint_socket(NDB_SOCKET_TYPE socket, int timeout_millis, const char * fmt, va_list ap){ char buf[1000]; char *buf2 = buf; - size_t size = sizeof(buf); + size_t size; - if (fmt != 0) { + if (fmt != 0 && fmt[0] != 0) { size = BaseString::vsnprintf(buf, sizeof(buf), fmt, ap); /* Check if the output was truncated */ - if(size >= sizeof(buf)) { - buf2 = (char *)malloc(size+1); + if(size > sizeof(buf)) { + buf2 = (char *)malloc(size); if(buf2 == NULL) return -1; BaseString::vsnprintf(buf2, size, fmt, ap); - } else - size = sizeof(buf); + } } else - buf[0] = 0; + return 0; - int ret = write_socket(socket, timeout_millis, buf2, strlen(buf2)); + int ret = write_socket(socket, timeout_millis, buf2, size); if(buf2 != buf) free(buf2); return ret; @@ -199,23 +198,23 @@ vprintln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, const char * fmt, va_list ap){ char buf[1000]; char *buf2 = buf; - size_t size = sizeof(buf); + size_t size; - if (fmt != 0) { - size = BaseString::vsnprintf(buf, sizeof(buf), fmt, ap); + if (fmt != 0 && fmt[0] != 0) { + size = BaseString::vsnprintf(buf, sizeof(buf), fmt, ap)+1;// extra byte for '/n' /* Check if the output was truncated */ - if(size >= sizeof(buf)-1) { - buf2 = (char *)malloc(size+2); + if(size > sizeof(buf)) { + buf2 = (char *)malloc(size); if(buf2 == NULL) return -1; - BaseString::vsnprintf(buf2, size+1, fmt, ap); - } else - size = sizeof(buf); - } else - buf[0] = 0; - strlcat(buf2, "\n", size+2); + BaseString::vsnprintf(buf2, size, fmt, ap); + } + } else { + size = 1; + } + buf2[size-1]='\n'; - int ret = write_socket(socket, timeout_millis, buf2, strlen(buf2)); + int ret = write_socket(socket, timeout_millis, buf2, size); if(buf2 != buf) free(buf2); return ret; diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c index afe2306427e..d8f4d99bd28 100644 --- a/ndb/src/common/util/strdup.c +++ b/ndb/src/common/util/strdup.c @@ -21,8 +21,8 @@ char * strdup(const char *s){ void *p2; - p2 = malloc(strlen(s)+1); - strcpy(p2, s); + if ((p2 = malloc(strlen(s)+1))) + strcpy(p2, s); return p2; } #endif diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c deleted file mode 100644 index aa282abe48d..00000000000 --- a/ndb/src/common/util/strlcat.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1995 - 1999 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <ndb_global.h> - -/* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */ - - -#ifndef HAVE_STRLCAT - -size_t -strlcat (char *dst, const char *src, size_t dst_sz) -{ - size_t len = strlen(dst); - - return len + strlcpy (dst + len, src, dst_sz - len); -} -#endif diff --git a/ndb/src/common/util/strlcpy.c b/ndb/src/common/util/strlcpy.c deleted file mode 100644 index 97cff177d48..00000000000 --- a/ndb/src/common/util/strlcpy.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1995 - 1999 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <ndb_global.h> - -/* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */ - -#ifndef HAVE_STRLCPY - -size_t -strlcpy (char *dst, const char *src, size_t dst_sz) -{ - size_t n; - char *p; - - for (p = dst, n = 0; - n + 1 < dst_sz && *src != '\0'; - ++p, ++src, ++n) - *p = *src; - *p = '\0'; - if (*src == '\0') - return n; - else - return n + strlen (src); -} - -#endif diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index e2515b243b1..8cc6de0fc24 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -17,6 +17,9 @@ #include <ndb_global.h> #include <ndb_version.h> #include <version.h> +#include <basestring_vsnprintf.h> +#include <NdbEnv.h> +#include <NdbOut.hpp> Uint32 getMajor(Uint32 version) { return (version >> 16) & 0xFF; @@ -38,14 +41,14 @@ Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) { const char * getVersionString(Uint32 version, const char * status) { char buff[100]; if (status && status[0] != 0) - snprintf(buff, sizeof(buff), + basestring_snprintf(buff, sizeof(buff), "Version %d.%d.%d (%s)", getMajor(version), getMinor(version), getBuild(version), status); else - snprintf(buff, sizeof(buff), + basestring_snprintf(buff, sizeof(buff), "Version %d.%d.%d", getMajor(version), getMinor(version), @@ -67,18 +70,37 @@ struct NdbUpGradeCompatible { /*#define TEST_VERSION*/ +#define HAVE_NDB_SETVERSION +#ifdef HAVE_NDB_SETVERSION +Uint32 ndbOwnVersionTesting = 0; +void +ndbSetOwnVersion() { + char buf[256]; + if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) { + Uint32 _v1,_v2,_v3; + if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) { + ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3); + ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting); + } + } +} +#else +void ndbSetOwnVersion() {} +#endif + #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { + { MAKE_VERSION(4,1,10), MAKE_VERSION(4,1,9), UG_Exact }, + { MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact }, { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact }, { 0, 0, UG_Null } }; struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { + { MAKE_VERSION(3,5,4), MAKE_VERSION(3,5,3), UG_Exact }, { 0, 0, UG_Null } }; -void ndbSetOwnVersion() {} - #else /* testing purposes */ struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { @@ -99,19 +121,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { }; -Uint32 ndbOwnVersionTesting = 0; -void -ndbSetOwnVersion() { - char buf[256]; - if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) { - Uint32 _v1,_v2,_v3; - if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) { - ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3); - ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting); - } - } -} - #endif void ndbPrintVersion() @@ -125,13 +134,13 @@ void ndbPrintVersion() Uint32 ndbGetOwnVersion() { -#ifndef TEST_VERSION - return NDB_VERSION_D; -#else /* testing purposes */ +#ifdef HAVE_NDB_SETVERSION if (ndbOwnVersionTesting == 0) return NDB_VERSION_D; else return ndbOwnVersionTesting; +#else + return NDB_VERSION_D; #endif } diff --git a/ndb/src/cw/Makefile.am b/ndb/src/cw/Makefile.am index b530922a3a7..7348fc9eab6 100644 --- a/ndb/src/cw/Makefile.am +++ b/ndb/src/cw/Makefile.am @@ -1 +1,4 @@ SUBDIRS = cpcd + +windoze-dsp: + diff --git a/ndb/src/cw/Makefile_old b/ndb/src/cw/Makefile_old deleted file mode 100644 index e710c1e244d..00000000000 --- a/ndb/src/cw/Makefile_old +++ /dev/null @@ -1,6 +0,0 @@ -include .defs.mk - -DIRS := cpcd - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs b/ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs deleted file mode 100644 index 9f89a3282c5..00000000000 --- a/ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\<configuration>. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/ndb/src/cw/cpcc-win32/vb6/frmSplash.frm b/ndb/src/cw/cpcc-win32/vb6/frmSplash.frm deleted file mode 100644 index 56ccbd79876..00000000000 --- a/ndb/src/cw/cpcc-win32/vb6/frmSplash.frm +++ /dev/null @@ -1,159 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmSplash - BorderStyle = 3 'Fixed Dialog - ClientHeight = 4710 - ClientLeft = 45 - ClientTop = 45 - ClientWidth = 7455 - ControlBox = 0 'False - LinkTopic = "Form1" - MaxButton = 0 'False - MinButton = 0 'False - ScaleHeight = 4710 - ScaleWidth = 7455 - ShowInTaskbar = 0 'False - StartUpPosition = 2 'CenterScreen - Visible = 0 'False - Begin VB.Frame fraMainFrame - Height = 4590 - Left = 45 - TabIndex = 0 - Top = -15 - Width = 7380 - Begin VB.PictureBox picLogo - Height = 2385 - Left = 510 - Picture = "frmSplash.frx":0000 - ScaleHeight = 2325 - ScaleWidth = 1755 - TabIndex = 2 - Top = 855 - Width = 1815 - End - Begin VB.Label lblLicenseTo - Alignment = 1 'Right Justify - Caption = "LicenseTo" - Height = 255 - Left = 270 - TabIndex = 1 - Tag = "LicenseTo" - Top = 300 - Width = 6855 - End - Begin VB.Label lblProductName - AutoSize = -1 'True - Caption = "Product" - BeginProperty Font - Name = "MS Sans Serif" - Size = 29.25 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 720 - Left = 2670 - TabIndex = 9 - Tag = "Product" - Top = 1200 - Width = 2190 - End - Begin VB.Label lblCompanyProduct - AutoSize = -1 'True - Caption = "CompanyProduct" - BeginProperty Font - Name = "MS Sans Serif" - Size = 18 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 435 - Left = 2505 - TabIndex = 8 - Tag = "CompanyProduct" - Top = 765 - Width = 3000 - End - Begin VB.Label lblPlatform - Alignment = 1 'Right Justify - AutoSize = -1 'True - Caption = "Platform" - BeginProperty Font - Name = "MS Sans Serif" - Size = 13.5 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 360 - Left = 5865 - TabIndex = 7 - Tag = "Platform" - Top = 2400 - Width = 1140 - End - Begin VB.Label lblVersion - Alignment = 1 'Right Justify - AutoSize = -1 'True - Caption = "Version" - BeginProperty Font - Name = "MS Sans Serif" - Size = 12 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 300 - Left = 6075 - TabIndex = 6 - Tag = "Version" - Top = 2760 - Width = 930 - End - Begin VB.Label lblWarning - Caption = "Warning" - Height = 195 - Left = 300 - TabIndex = 3 - Tag = "Warning" - Top = 3720 - Width = 6855 - End - Begin VB.Label lblCompany - Caption = "Company" - Height = 255 - Left = 4710 - TabIndex = 5 - Tag = "Company" - Top = 3330 - Width = 2415 - End - Begin VB.Label lblCopyright - Caption = "Copyright" - Height = 255 - Left = 4710 - TabIndex = 4 - Tag = "Copyright" - Top = 3120 - Width = 2415 - End - End -End -Attribute VB_Name = "frmSplash" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Private Sub Form_Load() - lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision - lblProductName.Caption = App.Title -End Sub - diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am index 6af44a359fc..75f557b2af7 100644 --- a/ndb/src/cw/cpcd/Makefile.am +++ b/ndb/src/cw/cpcd/Makefile.am @@ -16,3 +16,5 @@ ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/src/cw/cpcd/Makefile_old b/ndb/src/cw/cpcd/Makefile_old deleted file mode 100644 index f214fb087d2..00000000000 --- a/ndb/src/cw/cpcd/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := util -BIN_TARGET := ndb_cpcd - -# Source files of non-templated classes (.cpp files) -SOURCES = main.cpp CPCD.cpp Process.cpp APIService.cpp Monitor.cpp common.cpp - -BIN_TARGET_LIBS += logger - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp index cb1c0c37183..53c0e4d5a64 100644 --- a/ndb/src/cw/cpcd/common.cpp +++ b/ndb/src/cw/cpcd/common.cpp @@ -96,66 +96,3 @@ insert_file(const char * filename, class Properties& p){ if(f) fclose(f); return res; } - -int -parse_config_file(struct getargs args[], int num_arg, const Properties& p){ - Properties::Iterator it(&p); - for(const char * name = it.first(); name != 0; name = it.next()){ - bool found = false; - for(int i = 0; i<num_arg; i++){ - if(strcmp(name, args[i].long_name) != 0) - continue; - - found = true; - - const char * tmp; - p.get(name, &tmp); - - int t = 1; - - switch(args[i].type){ - case arg_integer:{ - int val = atoi(tmp); - if(args[i].value){ - *((int*)args[i].value) = val; - } - } - break; - case arg_string: - if(args[i].value){ - *((const char**)args[i].value) = tmp; - } - break; - case arg_negative_flag: - t = 0; - case arg_flag: - if(args[i].value){ - if(!strcasecmp(tmp, "y") || - !strcasecmp(tmp, "on") || - !strcasecmp(tmp, "true") || - !strcasecmp(tmp, "1")){ - *((int*)args[i].value) = t; - } - if(!strcasecmp(tmp, "n") || - !strcasecmp(tmp, "off") || - !strcasecmp(tmp, "false") || - !strcasecmp(tmp, "0")){ - *((int*)args[i].value) = t; - } - } - t = 1; - break; - case arg_strings: - case arg_double: - case arg_collect: - case arg_counter: - break; - } - } - if(!found) { - printf("Unknown parameter: %s\n", name); - return 1; - } - } - return 0; -} diff --git a/ndb/src/cw/cpcd/common.hpp b/ndb/src/cw/cpcd/common.hpp index c3d87b8b9f5..4f5f702762f 100644 --- a/ndb/src/cw/cpcd/common.hpp +++ b/ndb/src/cw/cpcd/common.hpp @@ -19,7 +19,9 @@ #include <ndb_global.h> #include <logger/Logger.hpp> +#if 0 #include <getarg.h> +#endif extern int debug; @@ -30,6 +32,5 @@ int insert(const char * pair, class Properties & p); int insert_file(const char * filename, class Properties&); int insert_file(FILE *, class Properties&, bool break_on_empty = false); -int parse_config_file(struct getargs args[], int num_arg, const Properties& p); #endif /* ! __CPCD_COMMON_HPP_INCLUDED__ */ diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp index 207b81bfa89..25632f132e9 100644 --- a/ndb/src/cw/cpcd/main.cpp +++ b/ndb/src/cw/cpcd/main.cpp @@ -15,13 +15,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> /* Needed for mkdir(2) */ +#include <my_sys.h> +#include <my_getopt.h> +#include <mysql_version.h> +#include <ndb_version.h> #include "CPCD.hpp" #include "APIService.hpp" #include <NdbMain.h> #include <NdbSleep.h> #include <BaseString.hpp> -#include <getarg.h> #include <logger/Logger.hpp> #include <logger/FileLogHandler.hpp> #include <logger/SysLogHandler.hpp> @@ -29,28 +32,44 @@ #include "common.hpp" static const char *work_dir = CPCD_DEFAULT_WORK_DIR; -static int port = CPCD_DEFAULT_TCP_PORT; -static int use_syslog = 0; +static int port; +static int use_syslog; static const char *logfile = NULL; static const char *config_file = CPCD_DEFAULT_CONFIG_FILE; static const char *user = 0; -static struct getargs args[] = { - { "work-dir", 'w', arg_string, &work_dir, - "Work directory", "directory" }, - { "port", 'p', arg_integer, &port, - "TCP port to listen on", "port" }, - { "syslog", 'S', arg_flag, &use_syslog, - "Log events to syslog", NULL}, - { "logfile", 'L', arg_string, &logfile, - "File to log events to", "file"}, - { "debug", 'D', arg_flag, &debug, - "Enable debug mode", NULL}, - { "config", 'c', arg_string, &config_file, "Config file", NULL }, - { "user", 'u', arg_string, &user, "Run as user", NULL } +static struct my_option my_long_options[] = +{ + { "work-dir", 'w', "Work directory", + (gptr*) &work_dir, (gptr*) &work_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "port", 'p', "TCP port to listen on", + (gptr*) &port, (gptr*) &port, 0, + GET_INT, REQUIRED_ARG, CPCD_DEFAULT_TCP_PORT, 0, 0, 0, 0, 0 }, + { "syslog", 'S', "Log events to syslog", + (gptr*) &use_syslog, (gptr*) &use_syslog, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "logfile", 'L', "File to log events to", + (gptr*) &logfile, (gptr*) &logfile, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "debug", 'D', "Enable debug mode", + (gptr*) &debug, (gptr*) &debug, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "config", 'c', "Config file", + (gptr*) &config_file, (gptr*) &config_file, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "user", 'u', "Run as user", + (gptr*) &user, (gptr*) &user, 0, + GET_STR, REQUIRED_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 const int num_args = sizeof(args) / sizeof(args[0]); +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return 0; +} static CPCD * g_cpcd = 0; #if 0 @@ -59,23 +78,16 @@ extern "C" static void sig_child(int signo, siginfo_t*, void*); const char *progname = "ndb_cpcd"; -NDB_MAIN(ndb_cpcd){ - int optind = 0; - - if(getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, ""); - exit(1); - } - - Properties p; - insert_file(config_file, p); - if(parse_config_file(args, num_args, p)){ - ndbout_c("Invalid config file: %s", config_file); - exit(1); - } +int main(int argc, char** argv){ + int save_argc= argc; + char** save_argv= argv; + const char *load_default_groups[]= { "ndb_cpcd",0 }; + MY_INIT(argv[0]); - if(getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, ""); + load_defaults("ndb_cpcd",load_default_groups,&argc,&argv); + if (handle_options(&argc, &argv, my_long_options, get_one_option)) { + my_print_help(my_long_options); + my_print_variables(my_long_options); exit(1); } diff --git a/ndb/src/external/LINUX.x86/sci/include/list.h b/ndb/src/external/LINUX.x86/sci/include/list.h deleted file mode 100644 index 81c467a461b..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/list.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id: list.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - - -#ifndef _LIST_H -#define _LIST_H -#include "sci_types.h" - - -typedef struct ListElement *ListElement_t; -typedef struct List *List_t; - -struct ListElement { - void *element; - u_vkaddr_t key; - ListElement_t prev,next; -}; - -void *Get_Element(ListElement_t el); -void Set_Element(ListElement_t el,void *elptr,u_vkaddr_t key); -void Create_Element(ListElement_t *el); -void Destroy_Element(ListElement_t *el); -void Create_List(List_t *list); -void Destroy_List(List_t *list); -void Add_Element(List_t list,ListElement_t el); -void Remove_Element(List_t list,ListElement_t el); -ListElement_t Find_Element(List_t list,u_vkaddr_t key); -scibool List_Empty(List_t); -scibool List_Elements(List_t); -ListElement_t First_Element(List_t list); -ListElement_t Last_Element(List_t list); -ListElement_t Next_Element(ListElement_t el); - -#endif /* _LIST_H */ diff --git a/ndb/src/external/LINUX.x86/sci/include/os/inttypes.h b/ndb/src/external/LINUX.x86/sci/include/os/inttypes.h deleted file mode 100644 index b9e5a6cb19f..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/os/inttypes.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $Id: inttypes.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - -#ifndef _SCI_OS_INTTYPES_H_ -#define _SCI_OS_INTTYPES_H_ - -/* - * -------------------------------------------------------------------------------------- - * Basic types of various sizes. - * -------------------------------------------------------------------------------------- - */ -typedef unsigned char unsigned8; -typedef unsigned short unsigned16; -typedef unsigned int unsigned32; -typedef unsigned long long unsigned64; - -typedef signed char signed8; -typedef signed short signed16; -typedef signed int signed32; -typedef signed long long signed64; - - -#ifdef CPU_WORD_IS_64_BIT -typedef unsigned64 uptr_t; -typedef signed64 iptr_t; -#else -typedef unsigned32 uptr_t; -typedef signed32 iptr_t; -#endif - -#endif /* _SCI_OS_INTTYPES_H_ */ diff --git a/ndb/src/external/LINUX.x86/sci/include/rmlib.h b/ndb/src/external/LINUX.x86/sci/include/rmlib.h deleted file mode 100644 index 9d2722e9798..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/rmlib.h +++ /dev/null @@ -1,212 +0,0 @@ -/* $Id: rmlib.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */ - -/********************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 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 Lesser 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. * - * * - * * - *********************************************************************************/ - -/********************************************************************************/ -/* This header file contains the declarations of the SCI Reflective Memory */ -/* library rmlib. The implementation of the library functions is in rmlib.c. */ -/* The library contains all the functions that operate on the reflective */ -/* memory. */ -/* */ -/* NB! */ -/* */ -/* DOLPHIN'S SCI REFLECTIVE MEMORY FILES ARE UNDER DEVELOPMENT AND MAY CHANGE. */ -/* PLEASE CONTACT DOLPHIN FOR FURTHER INFORMATION. */ -/* */ -/* */ -/********************************************************************************/ - -#include "sisci_error.h" -#include "sisci_api.h" -#include "sisci_demolib.h" -#include "sisci_types.h" - -unsigned int seqerr, syncseqerr; - -#ifndef _RMLIB_H -#define _RMLIB_H - - -#if defined(_REENTRANT) - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_MT_ ## name - -#else - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_ST_ ## name - -#endif - -#ifdef __sparc -#define CACHE_SIZE 2097152 -#else -#define CACHE_SIZE 8192 -#endif - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define REFLECT_ERRCHECK 0x2 - -struct ReflectiveMemorySpace { - unsigned int localAdapterNo; - unsigned int localNodeId; - unsigned int remoteNodeId; - sci_desc_t sd; - sci_desc_t syncsd; - sci_map_t localMap; - sci_map_t remoteMap; - unsigned int localSegmentId; - unsigned int remoteSegmentId; - unsigned int syncSegmentId; - unsigned int sync_rSegmentId; - unsigned int segmentSize; - unsigned int *localMapAddr; - volatile unsigned int *remoteMapAddr; - sci_local_segment_t localSegment; - sci_remote_segment_t remoteSegment; - sci_local_segment_t syncSegment; - sci_remote_segment_t sync_rSegment; - sci_map_t syncMap; - sci_map_t sync_rMap; - sci_sequence_t syncsequence; - sci_sequence_t sequence; - unsigned int protection; - unsigned int retry_value; - sci_sequence_status_t sequenceStatus, syncsequenceStatus; - volatile unsigned int *syncMapAddr; - volatile unsigned int *sync_rMapAddr; -}; - -/*********************************************************************************/ -/* P R I N T R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectPrintParameters _RMLIB_EXPAND_NAME(ReflectPrintParameters) -void ReflectPrintParameters(FILE *stream, struct ReflectiveMemorySpace RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A S E T U P */ -/* */ -/*********************************************************************************/ -#define ReflectDmaSetup _RMLIB_EXPAND_NAME(ReflectDmaSetup) -sci_error_t ReflectDmaSetup(struct ReflectiveMemorySpace RM_space, sci_dma_queue_t *dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R E M O V E */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRemove _RMLIB_EXPAND_NAME(ReflectDmaRemove) -sci_error_t ReflectDmaRemove(sci_dma_queue_t dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R U N */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRun _RMLIB_EXPAND_NAME(ReflectDmaRun) -sci_error_t ReflectDmaRun(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - sci_dma_queue_t dmaQueue); -/*********************************************************************************/ -/* C L O S E R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectClose _RMLIB_EXPAND_NAME(ReflectClose) -sci_error_t ReflectClose(struct ReflectiveMemorySpace RM_space, unsigned int segment_no); - -/*********************************************************************************/ -/* O P E N R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectOpen _RMLIB_EXPAND_NAME(ReflectOpen) -sci_error_t ReflectOpen(struct ReflectiveMemorySpace *RM_space, - unsigned int size, - unsigned int segment_no, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int protection, - unsigned int retry_value); - -/*********************************************************************************/ -/* R E F L E C T G E T A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectGetAccess _RMLIB_EXPAND_NAME(ReflectGetAccess) -sci_error_t ReflectGetAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T R E L E A S E A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectReleaseAccess _RMLIB_EXPAND_NAME(ReflectReleaseAccess) -sci_error_t ReflectReleaseAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A */ -/* */ -/*********************************************************************************/ -#define ReflectDma _RMLIB_EXPAND_NAME(ReflectDma) -sci_error_t ReflectDma(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset); - -/*********************************************************************************/ -/* R E F L E C T M E M C O P Y */ -/* */ -/*********************************************************************************/ -#define ReflectMemCopy _RMLIB_EXPAND_NAME(ReflectMemCopy) -sci_error_t ReflectMemCopy(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - unsigned int flags); - -/*********************************************************************************/ -/* R E F L E C T S E T */ -/* */ -/*********************************************************************************/ -#define ReflectSet _RMLIB_EXPAND_NAME(ReflectSet) -sci_error_t ReflectSet(struct ReflectiveMemorySpace RM_space, - unsigned int value, - unsigned int size, - unsigned int offset, - unsigned int flags - ); - -/*********************************************************************************/ -/* R E F L E C T P R I N T */ -/* */ -/*********************************************************************************/ -#define ReflectPrint _RMLIB_EXPAND_NAME(ReflectPrint) -sci_error_t ReflectPrint(FILE *stream, - struct ReflectiveMemorySpace RM_space, - unsigned int size, - unsigned int offset - ); - - -#endif diff --git a/ndb/src/external/LINUX.x86/sci/include/sci_errno.h b/ndb/src/external/LINUX.x86/sci/include/sci_errno.h deleted file mode 100644 index 03f3256a86f..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sci_errno.h +++ /dev/null @@ -1,216 +0,0 @@ -/* $Id: sci_errno.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - - -#ifndef _SCI_ERRNO_H_ -#define _SCI_ERRNO_H_ - - -/* - * SCI Error return values always have 30 bit set - * Remote errors should have bit 0 set - */ -#define SCI_ERR_MASK 0x40000000 -#define ESCI_REMOTE_MASK 0x01000000 - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) -#define _SCI_ERROR(x) ((x) | SCI_ERR_MASK) -#define _SCI_REMOTE_ERROR(x) ( _SCI_ERROR(x) | ESCI_REMOTE_MASK ) - -/* - * Error codes - */ -typedef enum { - ESCI_OK = 0x000, - ESCI_STILL_EXPORTED = _SCI_ERROR(0x800), - - ESCI_BUS_ERR = _SCI_ERROR(0x900), - ESCI_PEND_SCIERR = _SCI_ERROR(0x901), - ESCI_SCI_ERR = _SCI_ERROR(0x902), - - /* - * Specific SCI error responses: - */ - ESCI_SCI_ERR_DATA = _SCI_ERROR(0x9021), - ESCI_SCI_ERR_TYPE = _SCI_ERROR(0x9022), - ESCI_SCI_ERR_ADDR = _SCI_ERROR(0x9023), - - ESCI_LINK_TIMEOUT = _SCI_ERROR(0x903), - ESCI_EXDEV_TIMEOUT = _SCI_ERROR(0x904), - ESCI_REMOTE_ERR = _SCI_ERROR(0x905), - ESCI_MBX_BUSY = _SCI_ERROR(0x906), - ESCI_DMAERR = _SCI_ERROR(0x907), - ESCI_DMA_DISABLED = _SCI_ERROR(0x908), - ESCI_SW_MBX_SEND_FAILED = _SCI_ERROR(0x909), - ESCI_HW_MBX_SEND_FAILED = _SCI_ERROR(0x90A), - ESCI_HAS_NO_SESSION = _SCI_ERROR(0xA00), - ESCI_CONNREFUSED_SESSION = _SCI_ERROR(0xA01), - ESCI_SESSION_NOT_ESTABLISHED = _SCI_ERROR(0xA11), - ESCI_REMOTE_NO_VALID_SESSION = _SCI_ERROR(0xA02), - ESCI_SESSION_DISABLED = _SCI_ERROR(0xA03), - ESCI_NODE_CLOSED = _SCI_ERROR(0xA04), - ESCI_NODE_DISABLED = _SCI_ERROR(0xA05), - - ESCI_LOCAL_MASTER_ERR = _SCI_ERROR(0xA06), - ESCI_REMOTE_MASTER_ERR = _SCI_REMOTE_ERROR(0xA06), - - ESCI_ILLEGAL_CMD_RECEIVED = _SCI_ERROR(0xA08), - ESCI_ILLEGAL_CMD_SENT = _SCI_ERROR(0xA09), - - /* used above: ESCI_SESSION_NOT_ESTABLISHED = _SCI_ERROR(0xA11), */ - - /* - * Remote error codes - */ - ESCI_CONNREFUSED = _SCI_ERROR(0xB00), - ESCI_NODE_NOT_RESPONDING = _SCI_ERROR(0xB01), - ESCI_ISCONN = _SCI_ERROR(0xB02), - ESCI_HOSTUNREACH = _SCI_ERROR(0xB03), - ESCI_NO_SUCH_USER_ID = _SCI_ERROR(0xB04), - ESCI_REMOTE_NO_SUCH_USER_ID = _SCI_REMOTE_ERROR(0xB04), /* ESCI_NO_SUCH_USER_ID */ - ESCI_NO_SUCH_KEY = _SCI_ERROR(0xB04), /* ESCI_NO_SUCH_USER_ID */ - ESCI_REMOTE_NO_SUCH_KEY = _SCI_REMOTE_ERROR(0xB04), /* ESCI_REMOTE_NO_SUCH_USER_ID */ - ESCI_NODE_ERR = _SCI_ERROR(0xB06), - ESCI_REMOTE_NODE_ERR = _SCI_REMOTE_ERROR(0xB06), /* ESCI_NODE_ERR */ - ESCI_NOSPC = _SCI_ERROR(0xB08), - ESCI_REMOTE_NOSPC = _SCI_REMOTE_ERROR(0xB08), /* ESCI_NOSPC */ - ESCI_NODMASPC = _SCI_ERROR(0xB0A), - ESCI_REMOTE_NODMASPC = _SCI_REMOTE_ERROR(0xB0A), /* ESCI_NODMASPC */ - ESCI_NOTMAP = _SCI_ERROR(0xC00), - ESCI_ISMAP = _SCI_ERROR(0xC01), - ESCI_NOT_INITIALIZED = _SCI_ERROR(0xD00), - ESCI_REMOTE_NOT_INITIALIZED = _SCI_REMOTE_ERROR(ESCI_NOT_INITIALIZED), - /* - * ??? - */ - ESCI_PARAM_ERR = _SCI_ERROR(0xD01), - ESCI_NO_FREE_VC = _SCI_ERROR(0xD02), - ESCI_REMOTE_NO_FREE_VC = _SCI_REMOTE_ERROR(0xD02), /* ESCI_NO_FREE_VC */ - - /* - * Adapter state related error codes: - */ - ESCI_SUSPENDED = _SCI_ERROR(0xD03), - ESCI_NOT_SUSPENDED = _SCI_ERROR(0xD04), - ESCI_NOT_READY = _SCI_ERROR(0xD05), - ESCI_NOT_CONFIGURED = _SCI_ERROR(0xD06), - ESCI_INVALID_ADAPTERID = _SCI_ERROR(0xD07), /* if an adapter-id is out of range */ - ESCI_NONEXIST_ADAPTERID = _SCI_ERROR(0xD08), /* if adapter-id is valid but no adapter matches */ - ESCI_ADAPTERID_INUSE = _SCI_ERROR(0xD09), - - ESCI_INVALID_INSTANCE = _SCI_ERROR(0xD0A), - ESCI_NONEXIST_INSTANCE = _SCI_ERROR(0xD0B), - - ESCI_ADAPTER_INIT_FAILURE = _SCI_ERROR(0xD0C), - - ESCI_PAUSED = _SCI_ERROR(0xD0D), - ESCI_NOT_PAUSED = _SCI_ERROR(0xD0E), - ESCI_ADAPTER_NEED_RESET = _SCI_ERROR(0xD0F), - - ESCI_NONEXIST_SERIAL_NUMBER = _SCI_ERROR(0xD10), - ESCI_NOT_AVAILABLE = _SCI_ERROR(0xD11), - - ESCI_EACCESS = _SCI_ERROR(0xD12), - - /* - * Local error codes - */ - ESCI_NO_LOCAL_ACCESS = _SCI_ERROR(0xE00), - ESCI_LRESOURCE_BUSY = _SCI_ERROR(0xE01), - ESCI_LRESOURCE_EXIST = _SCI_ERROR(0xE02), - ESCI_NO_LRESOURCE = _SCI_ERROR(0xE03), - ESCI_NOTCONN = _SCI_ERROR(0xE04), - ESCI_LOCAL_ERR = _SCI_ERROR(0xE05), - ESCI_NOVAL_NODEID = _SCI_ERROR(0xE06), - ESCI_NOT_SUPPORTED = _SCI_ERROR(0xE07), - ESCI_TIMEOUT = _SCI_ERROR(0xE08), - ESCI_NO_LOCAL_LC_ACCESS = _SCI_ERROR(0xE0A), - ESCI_INVALID_ATT = _SCI_ERROR(0xE0B), - ESCI_BAD_CHECKSUM = _SCI_ERROR(0xE0C), - ESCI_INTERRUPT_FLAG_DISABLED = _SCI_ERROR(0xE0D), - ESCI_COND_INT_RACE_PROBLEM = _SCI_ERROR(0xE0E), - ESCI_OVERFLOW = _SCI_ERROR(0xE0F), - ESCI_BLINK_PARITY_ERROR = _SCI_ERROR(0xE10), - ESCI_FIRMWARE_VERSION_MISMATCH = _SCI_ERROR(0xE11), - - /* - * Link error codes - */ - ESCI_NO_LINK_ACCESS = _SCI_ERROR(0xF00), - ESCI_NO_REMOTE_LINK_ACCESS = _SCI_REMOTE_ERROR(0xF00), /* ESCI_NO_LINK_ACCESS */ - - ESCI_NO_SUCH_NODE = _SCI_ERROR(0xF02), - ESCI_USR_ACCESS_DISABLED = _SCI_ERROR(0xF03), - ESCI_HW_AVOID_DEADLOCK = _SCI_ERROR(0xF04), - ESCI_POTENTIAL_ERROR = _SCI_ERROR(0xF05), - - ESCI_FENCED = _SCI_ERROR(0xF06), - ESCI_SWITCH_HW_FAILURE = _SCI_ERROR(0xF07), - ESCI_SWITCH_WRONG_BLINK_ID = _SCI_ERROR(0xF08), - ESCI_SWITCH_WRONG_PORT_NUMB = _SCI_ERROR(0xF09), - ESCI_SWITCH_WRONG_INIT_TYPE = _SCI_ERROR(0xF0A), /* It is determined that the swith initialization - * do not match the local adapter initialization - */ - ESCI_SWITCH_WRONG_SWITCH_NUMB = _SCI_ERROR(0xF0B), /* It is determined that we are operationg on the - * wrong switch port - */ - ESCI_SWITCH_NOT_CONNECTED = _SCI_ERROR(0xF0C), - ESCI_SWITCH_NOT_RECOGNIZED = _SCI_ERROR(0xF0D), - ESCI_SWITCH_INIT_IN_PROGRESS = _SCI_ERROR(0xF0E), /* Switch TINI initialization in progress */ - - - ESCI_NO_BACKBONE_LINK_ACCESS = _SCI_ERROR(0xF20), - ESCI_BACKBONE_FENCED = _SCI_ERROR(0xF21), - ESCI_NO_BACKBONE_ACCESS = _SCI_ERROR(0xF22), - ESCI_BACKBONE_CABLE_PROBLEM = _SCI_ERROR(0xF23), - ESCI_BACKBONE_BLINK_PROBLEM = _SCI_ERROR(0xF24), - ESCI_BACKBONE_HWINIT_PROBLEM = _SCI_ERROR(0xF25), - ESCI_BACKBONE_ID_PROBLEM = _SCI_ERROR(0xF26), - ESCI_BACKBONE_STATE_PROBLEM = _SCI_ERROR(0xF27), - ESCI_BACKBONE_REQ_LINK_PROBLEM = _SCI_ERROR(0xF28), - ESCI_BACKBONE_UNFENCING = _SCI_ERROR(0xF29), /* Unfencing in progress */ - - /* - * added for pci port - */ - ESCI_AGAIN = _SCI_ERROR(0xF15), - ESCI_ORANGE = _SCI_ERROR(0xF16), /* Out of range */ - ESCI_NOSYS = _SCI_ERROR(0xF17), /* Used instead of ENOSYS. Means function not implemented */ - ESCI_REMOTE_NOSYS = _SCI_REMOTE_ERROR(ESCI_NOSYS), - ESCI_INTR = _SCI_ERROR(0xF18), /* Used instead of EINTR from sys/errno.h */ - ESCI_IO = _SCI_ERROR(0xF19), /* Used instead of EIO from sys/errno.h */ - ESCI_FAULT = _SCI_ERROR(0xF1A), /* Used instead of EFAULT from sys/errno.h */ - ESCI_BUSY = _SCI_ERROR(0xF1B), /* Used instead of EBUST from sys/errno.h */ - ESCI_INVAL = _SCI_ERROR(0xF1C), /* Used instead of EINVAL from sys/errno.h */ - ESCI_NXIO = _SCI_ERROR(0xF1D), /* Used instead of ENXIO from sys/errno.h */ - ESCI_EXIST = _SCI_ERROR(0xF1E) /* Used instead of EEXIST from sys/errno.h */ - -} scierror_t; - -#endif /* _SCI_ERRNO_H_ */ - - - - diff --git a/ndb/src/external/LINUX.x86/sci/include/sci_types.h b/ndb/src/external/LINUX.x86/sci/include/sci_types.h deleted file mode 100644 index 740b3a45cfd..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sci_types.h +++ /dev/null @@ -1,300 +0,0 @@ -/* $Id: sci_types.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - -#ifndef _SCI_TYPES_H_ -#define _SCI_TYPES_H_ - -/* - * Remains for the time being for backward compatibility .... - */ - -/* #define UNIQUE(type) struct { type x; } * */ -#ifndef UNIQUE -#define UNIQUE(type) type -#endif -#include "os/inttypes.h" - -#if defined(WIN32) -#if defined(_KERNEL) -#include <ntddk.h> -#else -#include <WTYPES.H> -#endif /* _KERNEL */ -#else -#if defined(Linux) -#if defined(__KERNEL__) -#include <linux/types.h> -#else -#include <sys/types.h> -#endif -#else -#include <sys/types.h> -#endif -#ifdef SUNOS5 -#include <sys/ddi.h> -#include <sys/sunddi.h> -#endif -#ifdef OS_IS_TRU64 -#include <io/common/devdriver.h> -#endif -#ifdef OS_IS_HP_UX11 -#if defined(_KERNEL) -#include <../wsio/wsio.h> -#else -#include <sys/wsio.h> -#endif -#endif -#endif - -/* See comments about "UNCONFIGURED_ADAPTERS" in config.h */ -#define UNCONFIGURED_ADAPTERS 100 - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef IN -#define IN -#endif - -#ifndef NOT -#define NOT ! -#endif - -/* - * -------------------------------------------------------------------------------------- - * Basic types of various sizes. - * -------------------------------------------------------------------------------------- - */ - -typedef signed32 scibool; -#ifndef OS_IS_VXWORKS -typedef signed32 BOOL; -#else -/* VXWORKS has already defined BOOL */ -#endif -typedef unsigned32 node_t; /* This is the logical nodeid */ -typedef unsigned32 sciNodeId_t; /* This is the physical 16 bit SCI nodeid */ - -/* - * -------------------------------------------------------------------------------------- - * Various register types. - * -------------------------------------------------------------------------------------- - */ -typedef volatile unsigned32 register32; - - -/* -Temporary for Windows NT, until we use only the above types. -*/ - -#ifdef WIN32 - -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned long u_long; -typedef unsigned int u_int; -typedef char * caddr_t; - -typedef long off_t; -typedef unsigned int size_t; - -#endif -#ifdef OS_IS_VXWORKS -#include <vxWorks.h> -#endif - -/* - * -------------------------------------------------------------------------------------- - * Various address types. - * - * We are using a struct * instead of unsigned long (int) inorder to enforce strong - * type checking - * - * -------------------------------------------------------------------------------------- - */ -typedef UNIQUE(void *) vkaddr_t; /* Virtual kernel address */ -typedef UNIQUE(uptr_t) vuaddr_t; /* Virtual user address */ - -typedef UNIQUE(unsigned32) remaddr_t; /* Remote IO address (physical address on PCs) */ -typedef UNIQUE(unsigned32) sciofs_lo_t; /* Lower 32 bits of an SCI offset. */ -typedef UNIQUE(unsigned32) sciofs_hi_t; /* The upper 16 bits of an SCI offset. */ - -typedef UNIQUE(unsigned32) ioaddr_t; /* Local IO address (physical address on PCs) */ -typedef unsigned32 u_ioaddr_t; -typedef unsigned32 iooffset_t; -typedef unsigned32 iosize_t; - -typedef uptr_t vkoffset_t; -typedef uptr_t u_vkaddr_t; -typedef uptr_t u_vuaddr_t; -typedef unsigned32 u_sciofs_lo_t; -typedef unsigned32 u_sciofs_hi_t; -typedef unsigned32 u_remaddr_t; -typedef unsigned32 attOffset_t; /* Address displacement from start of ATT entry */ - -typedef unsigned32 adapterNo_t; - -typedef enum { - NO_NODE = 0, - AD_MEM_NODE = 1, - AD_ALT_NODE = 2, - AD_MBX_NODE = 3, - AD_LC_NODE = 4, - AD_LC_PORT_0 = 5, - AD_LC_PORT_1 = 6, - AD_LC_PORT_2 = 7, - PHYS_NODE = 8 -} node_type_t; - - -/* - * Currently we don't support more than 32 bit sizes. - */ -#define SIZEOF(x) ((unsigned32)sizeof(x)) - -#if defined(_KERNEL) - -/* - * -------------------------------------------------------------------------------------- - * Some small macros intended to ease the transition to more strongly typed address - * types. The intention is that they in the long run shall be removed ... - * -------------------------------------------------------------------------------------- - */ -#define P2SIZE_T(x) ((size_t)((uptr_t)(x))) /* Pointer to size_t */ -#define P2U32(x) ((unsigned32)((uptr_t)(x))) /* Pointer to Unsigned 32-bit int */ -#ifdef WIN32 -#define PHADDR(x) ((ioaddr_t)(x)) -#define HASV(x) (x) -#endif -#if 0 -static vkaddr_t VKPTR (void * ptr) { return (vkaddr_t)ptr; } -static vkaddr_t VKADDR(volatile void * ptr) { return (vkaddr_t)ptr; } -#else -#define VKPTR(ptr) (vkaddr_t)ptr -#define VKADDR(ptr) (vkaddr_t)ptr -#endif - -#ifdef KLOG -#define KLOG_LOG(n,m,v) ts_log((n),(m),(v)) -#else -#define KLOG_LOG(n,m,v) -#endif /* KLOG */ - - -/* - * -------------------------------------------------------------------------------------- - * - * M E M A R E A T - * - * Memory area descriptor. - * - * paddr -- Physical address (aligned) of memory area - * ual_vaddr -- (Kernel )Virtual address of the unaligned memory area - * vaddr -- (Kernel) Virtual address of memory area - * rsize -- Real (Physical) Size of memory area - * msize -- Mapped (Virtual) Size of memory area (Size of area mapped - * into virtual) memory - * - * -------------------------------------- - * | | <----- msize ----->| | - * |<------|------- rsize ------|------>| - * -------------------------------------- - * /|\ /|\ - * | | - * ual_vaddr vaddr/paddr - * - * -------------------------------------------------------------------------------------- - */ -struct _memarea_ { - ioaddr_t ioaddr; - vkaddr_t vaddr; - vkaddr_t ual_vaddr; - size_t rsize; - size_t msize; - char *id; - unsigned32 cookie; - - -#ifdef SUNOS5 -#ifdef _USE_NEW_SOLARIS_DDI_INTERFACE - ddi_acc_handle_t mem_handle; - ddi_dma_handle_t dma_handle; -#else - ddi_dma_handle_t handle; -#endif -#endif -#ifdef OS_IS_TRU64 - dma_handle_t dma_handle; -#endif - -#if OS_IS_LINUX - unsigned long ph_base_addr; -#endif - -#ifdef OS_IS_HP_UX11 - struct isc_table_type * isc; - wsio_shmem_attr_t type; -#endif -}; - -typedef struct _memarea_ memarea_t; - -#ifdef SCI_MALLOC_DEBUG -struct _maddr_ { - char *id; - size_t size; - struct _maddr_ *next; - struct _maddr_ **prev; - unsigned32 cookie; -}; - -typedef struct _maddr_ maddr_t; - -#define MALLOC_COOKIE 0xc3c3c3c3 - -#else - -typedef struct { void *p; } *maddr_t; - -#endif /* SCI_MALLOC_DEBUG */ - - -typedef struct { - scibool disabled; - unsigned32 disable_cnt; -} disable_info_t; - -#endif /* _KERNEL */ - -#endif /* _SCI_TYPES_H_ */ diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_api.h b/ndb/src/external/LINUX.x86/sci/include/sisci_api.h deleted file mode 100644 index 38fdf54125f..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_api.h +++ /dev/null @@ -1,2170 +0,0 @@ -/* $Id: sisci_api.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ -/******************************************************************************* - * * - * Copyright (C) 1993 - 2001 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 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 Lesser 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. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_API_H -#define _SISCI_API_H - -#include "sisci_types.h" -#include "sisci_error.h" - - -#ifdef WIN32 -#ifdef API_DLL -#define DLL __declspec(dllexport) -#elif CLIENT_DLL -#define DLL __declspec(dllimport) -#endif -#endif /* WIN32 */ - - -#ifndef DLL -#define DLL -#endif - -#if defined(_REENTRANT) -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_MT_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_MT_ ## name -#else -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_ST_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_ST_ ## name -#endif -#define _SISCI_EXPANDE_CONSTANT_NAME(name) _SISCI_PUBLIC_CONST_ ## name - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCI_FLAG_FIXED_INTNO _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_INTNO) -extern const unsigned int SCI_FLAG_FIXED_INTNO; - -#define SCI_FLAG_SHARED_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_INT) -extern const unsigned int SCI_FLAG_SHARED_INT; - -#define SCI_FLAG_FIXED_MAP_ADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_MAP_ADDR) -extern const unsigned int SCI_FLAG_FIXED_MAP_ADDR; - -#define SCI_FLAG_READONLY_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READONLY_MAP) -extern const unsigned int SCI_FLAG_READONLY_MAP; - -#define SCI_FLAG_USE_CALLBACK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_USE_CALLBACK) -extern const unsigned int SCI_FLAG_USE_CALLBACK; - -#define SCI_FLAG_BLOCK_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_BLOCK_READ) -extern const unsigned int SCI_FLAG_BLOCK_READ; - -#define SCI_FLAG_THREAD_SAFE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_THREAD_SAFE) -extern const unsigned int SCI_FLAG_THREAD_SAFE; - -#define SCI_FLAG_ASYNCHRONOUS_CONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ASYNCHRONOUS_CONNECT) -extern const unsigned int SCI_FLAG_ASYNCHRONOUS_CONNECT; - -#define SCI_FLAG_EMPTY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_EMPTY) -extern const unsigned int SCI_FLAG_EMPTY; - -#define SCI_FLAG_PRIVATE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_PRIVATE) -extern const unsigned int SCI_FLAG_PRIVATE; - -#define SCI_FLAG_FORCE_DISCONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FORCE_DISCONNECT) -extern const unsigned int SCI_FLAG_FORCE_DISCONNECT; - -#define SCI_FLAG_NOTIFY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NOTIFY) -extern const unsigned int SCI_FLAG_NOTIFY; - -#define SCI_FLAG_DMA_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_READ) -extern const unsigned int SCI_FLAG_DMA_READ; - -#define SCI_FLAG_DMA_POST _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_POST) -extern const unsigned int SCI_FLAG_DMA_POST; - -#define SCI_FLAG_DMA_WAIT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_WAIT) -extern const unsigned int SCI_FLAG_DMA_WAIT; - -#define SCI_FLAG_DMA_RESET _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_RESET) -extern const unsigned int SCI_FLAG_DMA_RESET; - -#define SCI_FLAG_NO_FLUSH _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_FLUSH) -extern const unsigned int SCI_FLAG_NO_FLUSH; - -#define SCI_FLAG_NO_STORE_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_STORE_BARRIER) -extern const unsigned int SCI_FLAG_NO_STORE_BARRIER; - -#define SCI_FLAG_FAST_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FAST_BARRIER) -extern const unsigned int SCI_FLAG_FAST_BARRIER; - -#define SCI_FLAG_ERROR_CHECK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ERROR_CHECK) -extern const unsigned int SCI_FLAG_ERROR_CHECK; - -#define SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) -extern const unsigned int SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY; - -/* the FLUSH_CPU_BUFFERS_ONLY flag is for backwards compabillity only and should never be used */ -#define FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) - -#define SCI_FLAG_LOCK_OPERATION _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_LOCK_OPERATION) -extern const unsigned int SCI_FLAG_LOCK_OPERATION; - -#define SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP; - -#define SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP; - -#define SCI_FLAG_IO_MAP_IOSPACE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_IO_MAP_IOSPACE) -extern const unsigned int SCI_FLAG_IO_MAP_IOSPACE; - -#define SCI_FLAG_DMOVE_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMOVE_MAP) -extern const unsigned int SCI_FLAG_DMOVE_MAP; - -#define SCI_FLAG_WRITES_DISABLE_GATHER_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_WRITES_DISABLE_GATHER_MAP) -extern const unsigned int SCI_FLAG_WRITES_DISABLE_GATHER_MAP; - -#define SCI_FLAG_DISABLE_128_BYTES_PACKETS _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DISABLE_128_BYTES_PACKETS) -extern const unsigned int SCI_FLAG_DISABLE_128_BYTES_PACKETS; - -#define SCI_FLAG_SHARED_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_MAP) -extern const unsigned int SCI_FLAG_SHARED_MAP; - -#define SCI_FLAG_DMA_SOURCE_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_SOURCE_ONLY) -extern const unsigned int SCI_FLAG_DMA_SOURCE_ONLY; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT_MAP; - -#define SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP; - -#define SCI_FLAG_NO_MEMORY_LOOPBACK_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_MEMORY_LOOPBACK_MAP) -extern const unsigned int SCI_FLAG_NO_MEMORY_LOOPBACK_MAP; - -#if defined(OS_IS_LYNXOS) || defined(OS_IS_VXWORKS) -#define SCI_FLAG_WRITE_BACK_CACHE_MAP _SISCI_EXPANDE_CONSTANT_NAME(WRITE_BACK_CACHE_MAP) -extern const unsigned int SCI_FLAG_WRITE_BACK_CACHE_MAP; -#endif - -#define SCI_FLAG_DMA_PHDMA _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_PHDMA) -extern const unsigned int SCI_FLAG_DMA_PHDMA; - -/*********************************************************************************/ -/* GENERAL VALUES */ -/*********************************************************************************/ -#define SCI_LOCAL_HOST _SISCI_EXPANDE_CONSTANT_NAME(SCI_LOCAL_HOST) -extern const unsigned int SCI_LOCAL_HOST; - -#define SCI_INFINITE_TIMEOUT _SISCI_EXPANDE_CONSTANT_NAME(SCI_INFINITE_TIMEOUT) -extern const unsigned int SCI_INFINITE_TIMEOUT; - -/*********************************************************************************/ -/* GENERAL ERROR CODES */ -/* */ -/* SCI_ERR_ILLEGAL_FLAG - Illegal flag value. */ -/* SCI_ERR_FLAG_NOT_IMPLEMENTED - Flag legal but flag feature not implemented. */ -/* SCI_ERR_NOT_IMPLEMENTED - Function not implemented. */ -/* SCI_ERR_SYSTEM - A system error. Check errno. */ -/* SCI_ERR_NOSPC - Unable to allocate OS resources. */ -/* SCI_ERR_API_NOSPC - Unable to allocate API resources. */ -/* SCI_ERR_HW_NOSPC - Unable to allocate HW resources (Hardware) */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "ADAPTER" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_ADAPTERNO - Adapter number is legal but does not exist. */ -/* SCI_ERR_ILLEGAL_ADAPTERNO - Illegal local adapter number (i.e. outside */ -/* legal range). */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "NODEID" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_NODEID - The remote adapter identified by nodeId does */ -/* not respond, but the intermediate link(s) */ -/* seem(s) to be operational. */ -/* SCI_ERR_ILLEGAL_NODEID - Illegal NodeId. */ -/* */ -/*********************************************************************************/ - - - -/********************************************************************************* - * * - * S C I I N I T I A L I Z E * - * * - * This function initializes the SISCI library. * - * The function must be called before SCIOpen(). * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCIInitialize _SISCI_EXPANDE_FUNCTION_NAME(SCIInitialize) -DLL void SCIInitialize(unsigned int flags, - sci_error_t *error); -#if 0 -unsigned int __Internal_SISCI_version_var; -#endif - -/********************************************************************************* - * * - * S C I T E R M I N A T E * - * * - * This function terminates the SISCI library. * - * The function must be called after SCIClose(). * - * * - * * - *********************************************************************************/ -#define SCITerminate _SISCI_EXPANDE_FUNCTION_NAME(SCITerminate) -DLL void SCITerminate(void); - -/********************************************************************************* - * * - * S C I O P E N * - * * - * * - * Opens a SCI virtual device. * - * Caller must supply a pointer to a variable of type sci_desc_t to be * - * initialized. * - * * - * Flags * - * SCI_FLAG_THREAD_SAFE - Operations on resources associated with this * - * descriptor will be performed in a multithread-safe * - * manner. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INCONSISTENT_VERSIONS - Inconsistency between the SISCI library * - * and the SISCI driver versions. * - * * - * * - *********************************************************************************/ -#define SCIOpen _SISCI_EXPANDE_FUNCTION_NAME(SCIOpen) -DLL void SCIOpen(sci_desc_t *sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C L O S E * - * * - * This function closes an open SCI virtual device. * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - All resources are not deallocated. * - * * - *********************************************************************************/ -#define SCIClose _SISCI_EXPANDE_FUNCTION_NAME(SCIClose) -DLL void SCIClose(sci_desc_t sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S E G M E N T * - * * - * Connects to a remote shared memory segment located at <nodeId> with the * - * identifier <segmentId>. * - * The user may then call SCIMapRemoteSegment() to map shared memory * - * into user space. * - * * - * Flags * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_ASYNCHRONOUS_CONNECT * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_SEGMENT - Could not find the remote segment with the * - * given segmentId. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIConnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSegment) -DLL void SCIConnectSegment(sci_desc_t sd, - sci_remote_segment_t *segment, - unsigned int nodeId, - unsigned int segmentId, - unsigned int localAdapterNo, - sci_cb_remote_segment_t callback, - void *callbackArg, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T S E G M E N T * - * * - * Disconnects from the give mapped shared memory segment * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The segment is currently mapped or in use. * - * * - *********************************************************************************/ -#define SCIDisconnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectSegment) -DLL void SCIDisconnectSegment(sci_remote_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T R E M O T E S E G M E N T S I Z E * - * * - *********************************************************************************/ -#define SCIGetRemoteSegmentSize _SISCI_EXPANDE_FUNCTION_NAME(SCIGetRemoteSegmentSize) -DLL unsigned int SCIGetRemoteSegmentSize(sci_remote_segment_t segment); - - - -/********************************************************************************* - * * - * S C I W A I T F O R R E M O T E S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du * - * to a SCIDisconnectSegment() on the same * - * handle. The handle is invalid when this * - * error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForRemoteSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForRemoteSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForRemoteSegmentEvent( - sci_remote_segment_t segment, - sci_error_t *status, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P R E M O T E S E G M E N T * - * * - * This function is used to include a shared memory segment in the virtual * - * address space of the application. * - * * - * Flags: * - * * - * SCI_FLAG_SHARED_MAP - The low level physical map may be shared by * - * other applications. * - * * - * SCI_FLAG_FIXED_MAP_ADDR - Map at the suggested virtual address * - * SCI_FLAG_READONLY_MAP - The segment is mapped in read-only mode * - * SCI_FLAG_LOCK_OPERATION - Enable Lock operations (fetch and add) * - * SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP * - * - Enable aggressive prefetch with speculative * - * hold. * - * * - * SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP * - * - The PSB66 will prefetch 64 bytes. As soon * - * as the PCI read retry has been accepted, * - * the stream will change state to FREE, even * - * if less than 64 bytes were actually read. * - * * - * SCI_FLAG_IO_MAP_IOSPACE - Enable No Prefetch, no speculative hold. * - * * - * SCI_FLAG_DMOVE_MAP - Enable DMOVE packet type. The stream will be * - * set into FREE state immediately. * - * * - * SCI_FLAG_WRITES_DISABLE_GATHER_MAP * - * - Disable use of gather. * - * * - * SCI_FLAG_DISABLE_128_BYTES_PACKETS * - * - Disable use of 128-Byte packets * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an atomic "fetch-and-add-one" operation on * - * remote memory, but in addition an interrupt * - * will be generated if the target memory * - * location contained a "null value" before the * - * add operation was carried out. * - * The conditional interrupt flag must also be * - * specified in the SCIRegisterInterruptFlag() * - * function. * - * * - * SCI_FLAG_UNCONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an interrupt for the remote adapter * - * "in addition to" updating the corresponding * - * remote memory location with the data being * - * written. * - * The unconditional interrupt flag must also * - * be specified in the * - * SCIRegisterInterruptFlag() function. * - * * - * SCI_FLAG_WRITE_BACK_CACHE_MAP * - * - Enable cacheing of the mapped region. * - * Writes through this map will be written to a * - * write back cache, hence no remote SCI updates* - * until the cache line is flushed. The * - * application is responsible for the cache * - * flush operation. * - * The SCImemCopy() function will handle this * - * correctly by doing cache flushes internally. * - * This feature is architechture dependent and * - * not be available on all plattforms. * - * * - * SCI_FLAG_NO_MEMORY_LOOPBACK_MAP * - * - Forces a map to a remote segment located * - * in the local machine to be mapped using * - * SCI loopback. This is useful i.e. if you * - * want to use a regular map access to be * - * serialized with lock operations. * - * The default behaviour is to access a remte * - * segment located in the local machine as a * - * local MMU operation. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapRemoteSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapRemoteSegment) -DLL volatile void *SCIMapRemoteSegment( - sci_remote_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P L O C A L S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_FIXED_MAP_ADDR * - * SCI_FLAG_READONLY_MAP * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapLocalSegment) -DLL void *SCIMapLocalSegment(sci_local_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I U N M A P S E G M E N T * - * * - * This function unmaps pages of shared memory from the callers virtual * - * address space. * - * * - * Flags * - * None. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The map is currently in use. * - * * - *********************************************************************************/ -#define SCIUnmapSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIUnmapSegment) -DLL void SCIUnmapSegment(sci_map_t map, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E S E G M E N T * - * * - * Make the specified segment available for connections via the specified * - * adapter. If successful, the segment can be accessed from remote nodes * - * via the specified adapter. * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events * - * on this segment. * - * SCI_FLAG_EMPTY - No memory will be allocated for the segment. * - * SCI_FLAG_PRIVATE - The segment will be private meaning it will never * - * be any connections to it. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SEGMENTID_USED - The segment with this segmentId is already used * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * * - *********************************************************************************/ -#define SCICreateSegment _SISCI_EXPANDE_FUNCTION_NAME(SCICreateSegment) -DLL void SCICreateSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I W A I T F O R L O C A L S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du to a * - * SCIRemoveSegment() on the same handle. * - * The handle is invalid when this error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForLocalSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForLocalSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForLocalSegmentEvent( - sci_local_segment_t segment, - unsigned int *sourcenodeId, - unsigned int *localAdapterNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P R E P A R E S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_DMA_SOURCE_ONLY - The segment will be used as a source segment * - * for DMA operations. On some system types this * - * will enable the SISCI driver to use performance * - * improving features. * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIPrepareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIPrepareSegment) -DLL void SCIPrepareSegment(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E G M E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - Unable to remove the segment. The segment is currently * - * in use. * - * * - *********************************************************************************/ -#define SCIRemoveSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSegment) -DLL void SCIRemoveSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T A V A I L A B L E * - * * - * Flags * - * None. * - * * - * * - * SCI_ERR_SEGMENT_NOT_PREPARED - The segment has not been prepared for access * - * from this adapter. * - * SCI_ERR_ILLEGAL_OPERATION - The segment is created with the * - * SCI_FLAG_PRIVATE flag specified and * - * therefore has no segmentId. * - * * - *********************************************************************************/ -#define SCISetSegmentAvailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentAvailable) -DLL void SCISetSegmentAvailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T U N A V A I L A B L E * - * * - * Flags * - * * - * SCI_FLAG_FORCE_DISCONNECT * - * SCI_FLAG_NOTIFY * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * * - *********************************************************************************/ -#define SCISetSegmentUnavailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentUnavailable) -DLL void SCISetSegmentUnavailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E M A P S E Q U E N C E * - * * - * Flags: * - * * - * SCI_FLAG_FAST_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateMapSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICreateMapSequence) -DLL void SCICreateMapSequence(sci_map_t map, - sci_sequence_t *sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E Q U E N C E * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSequence) -DLL void SCIRemoveSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T A R T S E Q U E N C E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIStartSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIStartSequence) -DLL sci_sequence_status_t SCIStartSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I C H E C K S E Q U E N CE * - * * - * Flags * - * * - * SCI_FLAG_NO_FLUSH * - * SCI_FLAG_NO_STORE_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICheckSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICheckSequence) -DLL sci_sequence_status_t SCICheckSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T O R E B A R R I E R * - * * - * Flags * - * None. * - * * - * * - * * - *********************************************************************************/ -#define SCIStoreBarrier _SISCI_EXPANDE_FUNCTION_NAME(SCIStoreBarrier) -DLL void SCIStoreBarrier(sci_sequence_t sequence, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I F L U S H R E A D B U F F E R S * - * * - *********************************************************************************/ -#define SCIFlushReadBuffers _SISCI_EXPANDE_FUNCTION_NAME(SCIFlushReadBuffers) -DLL void SCIFlushReadBuffers(sci_sequence_t sequence); - - - - -/********************************************************************************* - * * - * S C I P R O B E N O D E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIProbeNode _SISCI_EXPANDE_FUNCTION_NAME(SCIProbeNode) -DLL int SCIProbeNode(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int nodeId, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIGetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCIGetCSRRegister) -DLL unsigned int SCIGetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCISetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCISetCSRRegister) -DLL void SCISetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I G E T L O C A L C S R * - * * - * SISCI Priveleged function * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIGetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCIGetLocalCSR) -DLL unsigned int SCIGetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T L O C A L C S R * - * * - * SISCI Priveleged function - * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCISetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCISetLocalCSR) -DLL void SCISetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A T T A C H P H Y S I C A L M E M O R Y * - * * - * SISCI Priveleged function * - * * - * Description: * - * * - * This function enables usage of physical devices and memory regions where the * - * Physical PCI bus address ( and mapped CPU address ) are already known. * - * The function will register the physical memory as a SISCI segment which can * - * be connected and mapped as a regular SISCI segment. * - * * - * Requirements: * - * * - * SCICreateSegment() with flag SCI_FLAG_EMPTY must have been called in advance * - * * - * Parameter description: * - * sci_ioaddr_t ioaddress : This is the address on the PCI bus that a PCI bus * - * master has to use to write to the specified memory * - * void * address : This is the (mapped) virtual address that the * - * application has to use to access the device. * - * This means that the device has to be mapped in * - * advance bye the devices own driver. * - * If the device is not to be accessed by the local * - * CPU, the address pointer shold be set to NULL * - * Flags * - * * - * None * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIAttachPhysicalMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachPhysicalMemory) -DLL void SCIAttachPhysicalMemory(sci_ioaddr_t ioaddress, - void *address, - unsigned int busNo, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I Q U E R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_QUERY - Unrecognized command. * - * * - *********************************************************************************/ -#define SCIQuery _SISCI_EXPANDE_FUNCTION_NAME(SCIQuery) -DLL void SCIQuery(unsigned int command, - void *data, - unsigned int flags, - sci_error_t *error); - - -/* MAJOR QUERY COMMANDS */ - -/* This command requires a pointer to a structure of type */ -/* "sci_query_string". The string will be filled in by the query. */ -#define SCI_Q_VENDORID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_VENDORID) -extern const unsigned int SCI_Q_VENDORID; - - -/* Same as for SCI_VENDOR_ID */ -#define SCI_Q_API _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_API) -extern const unsigned int SCI_Q_API; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_adapter" struct. */ -#define SCI_Q_ADAPTER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER) -extern const unsigned int SCI_Q_ADAPTER; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_system" struct. */ -#define SCI_Q_SYSTEM _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM) -extern const unsigned int SCI_Q_SYSTEM; - -#define SCI_Q_LOCAL_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT) -extern const unsigned int SCI_Q_LOCAL_SEGMENT; - -#define SCI_Q_REMOTE_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT) -extern const unsigned int SCI_Q_REMOTE_SEGMENT; - -#define SCI_Q_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP) -extern const unsigned int SCI_Q_MAP; - -typedef struct { - char *str; /* Pointer to a string of minimum "length" characters */ - unsigned int length; -} sci_query_string_t; - - -typedef struct { - unsigned int localAdapterNo; /* The adapter no. that the query concern. */ - unsigned int portNo; /* The SCI Link port number that the query concern. */ - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_adapter_t; - - -typedef struct { - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_system_t; - -typedef struct { - sci_local_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_local_segment_t; - -typedef struct { - sci_remote_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_remote_segment_t; - -typedef struct { - sci_map_t map; - unsigned int subcommand; - unsigned int data; -} sci_query_map_t; - -/* Minor query commands (sub-commands) for adapter specific information SCI_ADAPTER */ -#define SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_MTU _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_MTU) -extern const unsigned int SCI_Q_ADAPTER_DMA_MTU; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE; - -#define SCI_Q_ADAPTER_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NODEID) -extern const unsigned int SCI_Q_ADAPTER_NODEID; - -#define SCI_Q_ADAPTER_SERIAL_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SERIAL_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_SERIAL_NUMBER; - -#define SCI_Q_ADAPTER_CARD_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CARD_TYPE) -extern const unsigned int SCI_Q_ADAPTER_CARD_TYPE; - -#define SCI_Q_ADAPTER_NUMBER_OF_STREAMS _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER_OF_STREAMS) -extern const unsigned int SCI_Q_ADAPTER_NUMBER_OF_STREAMS; - -#define SCI_Q_ADAPTER_STREAM_BUFFER_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_STREAM_BUFFER_SIZE) -extern const unsigned int SCI_Q_ADAPTER_STREAM_BUFFER_SIZE; - -#define SCI_Q_ADAPTER_CONFIGURED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONFIGURED) -extern const unsigned int SCI_Q_ADAPTER_CONFIGURED; - -#define SCI_Q_ADAPTER_LINK_OPERATIONAL _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LINK_OPERATIONAL) -extern const unsigned int SCI_Q_ADAPTER_LINK_OPERATIONAL; - -#define SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK) -extern const unsigned int SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK; - -#define SCI_Q_ADAPTER_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_NUMBER; - -#define SCI_Q_ADAPTER_INSTANCE_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_INSTANCE_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_INSTANCE_NUMBER; - -#define SCI_Q_ADAPTER_FIRMWARE_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_FIRMWARE_OK) -extern const unsigned int SCI_Q_ADAPTER_FIRMWARE_OK; - -#define SCI_Q_ADAPTER_CONNECTED_TO_SWITCH _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_SWITCH) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_SWITCH; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER; - -#define SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT; - -#define SCI_Q_ADAPTER_ATT_PAGE_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_PAGE_SIZE) -extern const unsigned int SCI_Q_ADAPTER_ATT_PAGE_SIZE; - -#define SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES; - -#define SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES; - -#define SCI_Q_ADAPTER_PHYS_MEM_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MEM_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MEM_NODEID; - -#define SCI_Q_ADAPTER_PHYS_MBX_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MBX_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MBX_NODEID; - -#define SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID; - -#define SCI_Q_ADAPTER_SCI_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SCI_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_SCI_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_B_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_B_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_B_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_IO_BUS_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_IO_BUS_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_IO_BUS_FREQUENCY; - -/* Minor query commands (sub-commands) for adapter specific information SCI_SYSTEM */ -#define SCI_Q_SYSTEM_HOSTBRIDGE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_HOSTBRIDGE) -extern const unsigned int SCI_Q_SYSTEM_HOSTBRIDGE; - -#define SCI_Q_SYSTEM_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_POSTING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_POSTING_ENABLED; - -#define SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED; - -#define SCI_Q_LOCAL_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_LOCAL_SEGMENT_IOADDR; - -#define SCI_Q_REMOTE_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_REMOTE_SEGMENT_IOADDR; - -#define SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET; - -#define SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET; - -#define HOSTBRIDGE_NOT_AVAILABLE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_NOT_AVAILABLE) -extern const unsigned int HOSTBRIDGE_NOT_AVAILABLE; - -#define HOSTBRIDGE_UNKNOWN _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_UNKNOWN) -extern const unsigned int HOSTBRIDGE_UNKNOWN; - -#define HOSTBRIDGE_440FX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440FX) -extern const unsigned int HOSTBRIDGE_440FX; - -#define HOSTBRIDGE_440LX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440LX) -extern const unsigned int HOSTBRIDGE_440LX; - -#define HOSTBRIDGE_440BX_A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_A) -extern const unsigned int HOSTBRIDGE_440BX_A; - -#define HOSTBRIDGE_440BX_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_B) -extern const unsigned int HOSTBRIDGE_440BX_B; - -#define HOSTBRIDGE_440GX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440GX) -extern const unsigned int HOSTBRIDGE_440GX; - -#define HOSTBRIDGE_450KX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450KX) -extern const unsigned int HOSTBRIDGE_450KX; - -#define HOSTBRIDGE_430NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_430NX) -extern const unsigned int HOSTBRIDGE_430NX; - -#define HOSTBRIDGE_450NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX) -extern const unsigned int HOSTBRIDGE_450NX; - -#define HOSTBRIDGE_450NX_MICO _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_MICO) -extern const unsigned int HOSTBRIDGE_450NX_MICO; - -#define HOSTBRIDGE_450NX_PXB _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_PXB) -extern const unsigned int HOSTBRIDGE_450NX_PXB; - -#define HOSTBRIDGE_I810 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810) -extern const unsigned int HOSTBRIDGE_I810; - -#define HOSTBRIDGE_I810_DC100 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810_DC100) -extern const unsigned int HOSTBRIDGE_I810_DC100; - -#define HOSTBRIDGE_I810E _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810E) -extern const unsigned int HOSTBRIDGE_I810E; - -#define HOSTBRIDGE_I815 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I815) -extern const unsigned int HOSTBRIDGE_I815; - -#define HOSTBRIDGE_I840 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I840) -extern const unsigned int HOSTBRIDGE_I840; - -#define HOSTBRIDGE_I850 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I850) -extern const unsigned int HOSTBRIDGE_I850; - -#define HOSTBRIDGE_I860 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I860) -extern const unsigned int HOSTBRIDGE_I860; - -#define HOSTBRIDGE_INTEL_E7500 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_INTEL_E7500) -extern const unsigned int HOSTBRIDGE_INTEL_E7500; - -#define HOSTBRIDGE_VIA_KT133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KT133) -extern const unsigned int HOSTBRIDGE_VIA_KT133; - -#define HOSTBRIDGE_VIA_KX133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KX133) -extern const unsigned int HOSTBRIDGE_VIA_KX133; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_133A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_133A) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_133A; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_266 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_266) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_266; - -#define HOSTBRIDGE_AMD_760_MP _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_760_MP) -extern const unsigned int HOSTBRIDGE_AMD_760_MP; - -#define HOSTBRIDGE_AMD_HAMMER _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_HAMMER) -extern const unsigned int HOSTBRIDGE_AMD_HAMMER; - -#define HOSTBRIDGE_SERVERWORKS_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE; - -#define HOSTBRIDGE_SERVERWORKS_HE_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE_B) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE_B; - -#define HOSTBRIDGE_SERVERWORKS_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_HE; - -#define HOSTBRIDGE_SERVERWORKS_GC_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_WS _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_WS) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_WS; - -#define HOSTBRIDGE_SERVERWORKS_GC_SL _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_SL) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_SL; - - -#define HOSTBRIDGE_WRITE_POSTING_DISABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_DISABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_DISABLED; - -#define HOSTBRIDGE_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_ENABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_ENABLED; - - - - -/********************************************************************************* - * * - * S C I C R E A T E D M A Q U E U E * - * * - * Flags * - * * - * SCI_FLAG_DMA_PHDMA : Create physical DMA queue. Please note that this is an * - * priveleged operation. * - * * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCICreateDMAQueue) -DLL void SCICreateDMAQueue(sci_desc_t sd, - sci_dma_queue_t *dq, - unsigned int localAdapterNo, - unsigned int maxEntries, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Not allowed in this queue state. * - * * - *********************************************************************************/ -#define SCIRemoveDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveDMAQueue) -DLL void SCIRemoveDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I E N Q U E U E D M A T R A N S F E R * - * * - * Flags: * - * * - * SCI_FLAG_DMA_READ - The DMA will be remote --> local * - * (default is local --> remote) * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is larger * - * than the segment size or larger than max * - * DMA size. * - * SCI_ERR_MAX_ENTRIES - The DMA queue is full * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_SEGMENT_NOT_PREPARED - The local segment has not been prepared for * - * access from the adapter associated with the * - * queue. * - * SCI_ERR_SEGMENT_NOT_CONNECTED - The remote segment is not connected through * - * the adapter associated with the queue. * - *********************************************************************************/ -#define SCIEnqueueDMATransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIEnqueueDMATransfer) -DLL sci_dma_queue_state_t SCIEnqueueDMATransfer(sci_dma_queue_t dq, - sci_local_segment_t localSegment, - sci_remote_segment_t remoteSegment, - unsigned int localOffset, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P O S T D M A Q U E U E * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The end of the transfer will cause the callback * - * function to be invoked. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIPostDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIPostDMAQueue) -DLL void SCIPostDMAQueue(sci_dma_queue_t dq, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortDMAQueue) -DLL void SCIAbortDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I R E S E T D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIResetDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIResetDMAQueue) -DLL void SCIResetDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I D M A Q U E U E S T A T E * - * * - *********************************************************************************/ -#define SCIDMAQueueState _SISCI_EXPANDE_FUNCTION_NAME(SCIDMAQueueState) -DLL sci_dma_queue_state_t SCIDMAQueueState(sci_dma_queue_t dq); - - - -/********************************************************************************* - * * - * S C I W A I T F O R D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForDMAQueue) -DLL sci_dma_queue_state_t SCIWaitForDMAQueue(sci_dma_queue_t dq, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I P H D M A E N Q U E U E * - * * - * SISCI Priveleged function * - * * - * Flags * - * * - * SCI_FLAG_DMA_READ * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaEnqueue _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaEnqueue) -DLL void SCIphDmaEnqueue(sci_dma_queue_t dmaqueue, - unsigned int size, - sci_ioaddr_t localBusAddr, - unsigned int remote_nodeid, - unsigned int remote_highaddr, - unsigned int remote_lowaddr, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I P H D M A S T A R T * - * * - * Flags * - * * - * SCI_FLAG_DMA_WAIT * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_DMA_RESET * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaStart _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaStart) -DLL sci_dma_queue_state_t SCIphDmaStart(sci_dma_queue_t dmaqueue, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I C R E A T E I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateInterrupt) -DLL void SCICreateInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveInterrupt) -DLL void SCIRemoveInterrupt(sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait was interrupted by a call to * - * SCIRemoveInterrupt. * - * The handle is invalid when this error code is returned.* - * * - *********************************************************************************/ -#define SCIWaitForInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForInterrupt) -DLL void SCIWaitForInterrupt(sci_local_interrupt_t interrupt, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_INTNO - No such interrupt number. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIConnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectInterrupt) -DLL void SCIConnectInterrupt(sci_desc_t sd, - sci_remote_interrupt_t *interrupt, - unsigned int nodeId, - unsigned int localAdapterNo, - unsigned int interruptNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisconnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectInterrupt) -DLL void SCIDisconnectInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R I G G E R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCITriggerInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCITriggerInterrupt) -DLL void SCITriggerInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I R E G I S T E R I N T E R R U P T F L A G * - * * - * * - * This function register an "interrupt flag" that is identified as an unique * - * location within a local segment. If successful, the resulting interrupt * - * handle will have been associated with the specified local segment. * - * * - * It is up to the (remote) client(s) to set up an "interrupt mapping" for the * - * corresponding segment offset using either the * - * * - * - SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * * - * or the * - * * - * - SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP * - * * - * option to "SCIMapRemoteSegment()". - I.e. after having established a * - * connection to the corresponding segment. A trigger operation can then * - * be implemented using a store operation via the relevant "interrupt map". * - * * - * * - * * - * * - * * - * Flags: * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT - Triggering is to take place using * - * "conditional interrupts". * - * * - * * - * * - * Specific error codes for this function: * - * None. * - * * - *********************************************************************************/ -#define SCIRegisterInterruptFlag _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterInterruptFlag) -DLL void SCIRegisterInterruptFlag( - unsigned int localAdapterNo, - sci_local_interrupt_t *interrupt, - sci_local_segment_t segment, - unsigned int offset, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I E N A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * This function make sure that another HW interrupt will take place the next * - * time the corresponding interrupt flag is triggered by a * - * "conditional interrupt" operation. * - * * - * Default semantics: * - * * - * When successful, the client can rely on that the first subsequent trigger * - * operation will cause a HW interrupt and subsequently cause the client * - * handler function to be invoked. * - * * - * If an interrupt was triggered in parallell with the enable operation, then * - * the operation will fail (SCI_ERR_COND_INT_RACE_PROBLEM), and the client can * - * not rely on another trigger operation will lead to handler invocation. * - * Hence, any state checking normally associated with handling the * - * corresponding interrupt should take place before attempting to enable * - * again. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_COND_INT_RACE_PROBLEM - The enable operation failed because an * - * incomming trigger operation happened * - * concurrently. * - * * - *********************************************************************************/ -#define SCIEnableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIEnableConditionalInterrupt) -DLL void SCIEnableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I D I S A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * Prevent subsequent "conditional interrupt"trigger operations for * - * the specified interupt flag from causing HW interrupt and handler * - * invocations. * - * * - * * - * Default semantics: * - * * - * If successful, no subsequent HW interrupts will take place, but handler * - * invocations that have already been scheduled may still take place. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisableConditionalInterrupt) -DLL void SCIDisableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C O N D I T I O N A L I N T E R R U P T C O U N T E R * - * * - * * - * Returns a value that indicates the number of times this flag has * - * been trigged since the last time it was enabled or disabled. * - * Calling the SCIEnableConditionalInterrupt / SCIDisableConditionalInterrupt * - * functions will reset the counter value. * - * * - * Default semantics: * - * * - * If successful, the current trig count is returned in the * - * interruptTrigCounter parameter. * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OVERFLOW - The number of trig operations have exceeded the range * - * that can be counted. * - *********************************************************************************/ -#define SCIGetConditionalInterruptTrigCounter _SISCI_EXPANDE_FUNCTION_NAME(SCIGetConditionalInterruptTrigCounter) -DLL void SCIGetConditionalInterruptTrigCounter( - sci_local_interrupt_t interrupt, - unsigned int *interruptTrigCounter, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlock _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlock) -DLL void SCITransferBlock(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K A S Y N C * - * * - * Flags * - * * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_USE_CALLBACK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger than * - * the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlockAsync _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlockAsync) -DLL void SCITransferBlockAsync(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - sci_block_transfer_t *block, - sci_cb_block_transfer_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForBlockTransfer) -DLL void SCIWaitForBlockTransfer(sci_block_transfer_t block, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortBlockTransfer) -DLL void SCIAbortBlockTransfer(sci_block_transfer_t block, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M E M C P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - -#define SCIMemCpy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCpy) -DLL void SCIMemCpy(sci_sequence_t sequence, - void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I M E M C O P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - - -#define SCIMemCopy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCopy) -DLL void SCIMemCopy(void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E G I S T E R S E G M E N T M E M O R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_ILLEGAL_ADDRESS - Illegal address. * - * SCI_ERR_OUT_OF_RANGE - Size is larger than the maximum size for the * - * local segment. * - * * - *********************************************************************************/ -#define SCIRegisterSegmentMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterSegmentMemory) -DLL void SCIRegisterSegmentMemory(void *address, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S C I S P A C E * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * * - *********************************************************************************/ -#define SCIConnectSCISpace _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSCISpace) -DLL void SCIConnectSCISpace(sci_desc_t sd, - unsigned int localAdapterNo, - sci_remote_segment_t *segment, - sci_address_t address, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/* - * ===================================================================================== - * - * S C I A T T A C H L O C A L S E G M E N T - * Description: - * - * SCIAttachLocalSegment() permits an application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events - * on this segment. - * - * - * Specific error codes for this function: - * - * SCI_ERR_ACCESS - No such shared segment - * SCI_ERR_NO_SUCH_SEGMENT - No such segment - * Note: Current implenentation will return SCI_ERR_ACCESS for both cases. This will - * change from next release. Application should handle both cases. - * - * ===================================================================================== - */ -#define SCIAttachLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachLocalSegment) - -DLL void -SCIAttachLocalSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int *size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); -/* - * ===================================================================================== - * - * S C I S H A R E S E G M E N T - * - * Description: - * - * SCIShareSegment() permits other application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * none - * - * Specific error codes for this function: - * - * - * - * ===================================================================================== - */ -#define SCIShareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIShareSegment) - -DLL void -SCIShareSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I F L U S H * - * * - * This function will flush the CPU buffers and the PSB buffers. * - * * - * Flags * - * SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY : * - * Only flush CPU buffers ( Write combining * - * etc buffers). * - * * - *********************************************************************************/ - -#define SCIFlush _SISCI_EXPANDE_FUNCTION_NAME(SCIFlush) -DLL void SCIFlush(sci_sequence_t sequence, - unsigned int flags); - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - -#endif - - - - - - - - - - - diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h b/ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h deleted file mode 100644 index 4284fc5585c..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h +++ /dev/null @@ -1,226 +0,0 @@ -/* $Id: sisci_demolib.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_DEMOLIB_H -#define _SISCI_DEMOLIB_H - - -#if defined(_REENTRANT) - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_MT_ ## name - -#else - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_ST_ ## name - -#endif - -/*********************************************************************************/ -/* Q U E R Y A D A P T E R */ -/* */ -/*********************************************************************************/ - -#define QueryAdapter _SISCI_DEMOLIB_EXPAND_NAME(QueryAdapter) - -sci_error_t QueryAdapter( - unsigned int subcommand, - unsigned int localAdapterNo, - unsigned int portNo, - unsigned int *data); - - -/*********************************************************************************/ -/* Q U E R Y S Y S T E M */ -/* */ -/*********************************************************************************/ - -#define QuerySystem _SISCI_DEMOLIB_EXPAND_NAME(QuerySystem) - -sci_error_t QuerySystem( - unsigned int subcommand, - unsigned int *data); - - -/*********************************************************************************/ -/* D E T E C T F I R S T A D A P T E R C A R D */ -/* */ -/*********************************************************************************/ - -#define DetectFirstAdapterCard _SISCI_DEMOLIB_EXPAND_NAME(DetectFirstAdapterCard) - -sci_error_t DetectFirstAdapterCard( - unsigned int *localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetAdapterType _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterType) - -sci_error_t GetAdapterType(unsigned int localAdapterNo, - unsigned int *adapterType); - - -/*********************************************************************************/ -/* G E T L O C A L N O D E I D */ -/* */ -/*********************************************************************************/ - -#define GetLocalNodeId _SISCI_DEMOLIB_EXPAND_NAME(GetLocalNodeId) - -sci_error_t GetLocalNodeId( - unsigned int localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R S E R I A L N U M B E R */ -/* */ -/*********************************************************************************/ - -#define GetAdapterSerialNumber _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterSerialNumber) - -sci_error_t GetAdapterSerialNumber( - unsigned int localAdapterNo, - unsigned int *serialNo); - - - -/*********************************************************************************/ -/* G E T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(GetHostbridgeType) - -sci_error_t GetHostbridgeType(unsigned int *hostbridgeType); - - - -/*********************************************************************************/ -/* P R I N T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define PrintHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(PrintHostbridgeType) - -void PrintHostbridgeType(unsigned int hostbridge); - - - -/*********************************************************************************/ -/* G E T A P I V E R S I O N S T R I N G */ -/* */ -/*********************************************************************************/ - -#define GetAPIVersionString _SISCI_DEMOLIB_EXPAND_NAME(GetAPIVersionString) - -sci_error_t GetAPIVersionString(char str[], unsigned int strLength); - - - -/*********************************************************************************/ -/* G E T A D A P T E R I O B U S F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterIoBusFrequency(unsigned int localAdapterNo, - unsigned int *ioBusFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R S C I L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterSciLinkFrequency(unsigned int localAdapterNo, - unsigned int *sciLinkFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R B L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterBlinkFrequency(unsigned int localAdapterNo, - unsigned int *bLinkFrequency); - - -/*********************************************************************************/ -/* S E N D I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define SendInterrupt _SISCI_DEMOLIB_EXPAND_NAME(SendInterrupt) - -sci_error_t SendInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int remoteNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* R E C E I V E I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define ReceiveInterrupt _SISCI_DEMOLIB_EXPAND_NAME(ReceiveInterrupt) - -sci_error_t ReceiveInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* E N D I A N S W A P */ -/* */ -/*********************************************************************************/ - -#define EndianSwap _SISCI_DEMOLIB_EXPAND_NAME(EndianSwap) - -unsigned int EndianSwap (unsigned int value); - - -/*********************************************************************************/ -/* S L E E P M I L L I S E C O N D S */ -/* */ -/*********************************************************************************/ - -#define SleepMilliseconds _SISCI_DEMOLIB_EXPAND_NAME(SleepMilliseconds) - -void SleepMilliseconds(int milliseconds); - - - - -#endif diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_error.h b/ndb/src/external/LINUX.x86/sci/include/sisci_error.h deleted file mode 100644 index c53fe8ad5d9..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_error.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - - - -#ifndef _SISCI_ERROR_H_ -#define _SISCI_ERROR_H_ - - -/* SCI Error return values always have 30 bit set */ -#define SCI_ERR_MASK 0x40000000 -#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */ - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) - -/* Error codes */ -typedef enum { - SCI_ERR_OK = 0x000, - - - SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK), - SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK), - SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK), - SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK), - SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK), - SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK), - SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK), - SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK), - SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK), - SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK), - SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK), - SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK), - SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK), - SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK), - SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK), - SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK), - SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK), - SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK), - SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK), - SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK), - SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK), - - SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK), - - SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK), - SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK), - SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK), - SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK), - SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK) -} sci_error_t; - - -#endif /* _SCI_ERROR_H_ */ - - - diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_types.h b/ndb/src/external/LINUX.x86/sci/include/sisci_types.h deleted file mode 100644 index f4125fdec69..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - -#ifndef _SISCI_TYPES_H -#define _SISCI_TYPES_H - -#include "sisci_error.h" - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef IN_OUT -#define IN_OUT -#endif - -/* Opaque data types for descriptors/handles */ -typedef struct sci_desc *sci_desc_t; -typedef struct sci_local_segment *sci_local_segment_t; -typedef struct sci_remote_segment *sci_remote_segment_t; - -typedef struct sci_map *sci_map_t; -typedef struct sci_sequence *sci_sequence_t; -#ifndef KERNEL -typedef struct sci_dma_queue *sci_dma_queue_t; -#endif -typedef struct sci_remote_interrupt *sci_remote_interrupt_t; -typedef struct sci_local_interrupt *sci_local_interrupt_t; -typedef struct sci_block_transfer *sci_block_transfer_t; - -/* - * Constants defining reasons for segment callbacks: - */ - -typedef enum { - SCI_CB_CONNECT = 1, - SCI_CB_DISCONNECT, - SCI_CB_NOT_OPERATIONAL, - SCI_CB_OPERATIONAL, - SCI_CB_LOST -} sci_segment_cb_reason_t; - -#define MAX_CB_REASON SCI_CB_LOST - -/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/ -typedef enum { - SCI_DMAQUEUE_IDLE, - SCI_DMAQUEUE_GATHER, - SCI_DMAQUEUE_POSTED, - SCI_DMAQUEUE_DONE, - SCI_DMAQUEUE_ABORTED, - SCI_DMAQUEUE_ERROR -} sci_dma_queue_state_t; - - -typedef enum { - SCI_SEQ_OK, - SCI_SEQ_RETRIABLE, - SCI_SEQ_NOT_RETRIABLE, - SCI_SEQ_PENDING -} sci_sequence_status_t; - - -typedef struct { - unsigned short nodeId; /* SCI Address bit 63 - 48 */ - unsigned short offsHi; /* SCI Address bit 47 - 32 */ - unsigned int offsLo; /* SCI Address bit 31 - 0 */ -} sci_address_t; - - -typedef unsigned int sci_ioaddr_t; - -typedef enum { - SCI_CALLBACK_CANCEL = 1, - SCI_CALLBACK_CONTINUE -} sci_callback_action_t; - -#ifndef KERNEL -typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg, - sci_local_segment_t segment, - sci_segment_cb_reason_t reason, - unsigned int nodeId, - unsigned int localAdapterNo, - sci_error_t error); - -typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg, - sci_remote_segment_t segment, - sci_segment_cb_reason_t reason, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg, - sci_dma_queue_t queue, - sci_error_t status); - - -typedef int (*sci_cb_block_transfer_t)(void *arg, - sci_block_transfer_t block, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg, - sci_local_interrupt_t interrupt, - sci_error_t status); - -#endif /* KERNEL */ -#endif diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_version.h b/ndb/src/external/LINUX.x86/sci/include/sisci_version.h deleted file mode 100644 index f1807c33aa5..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_version.h +++ /dev/null @@ -1,91 +0,0 @@ -/* $Id: sisci_version.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 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 Lesser 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. * - * * - * * - *******************************************************************************/ - - -#ifndef SISCI_VERSION_H -#define SISCI_VERSION_H - - -#define SISCI_API_VER_MAJOR 0x01 -#define SISCI_API_VER_MAJORC "1" - -#define SISCI_API_VER_MINOR 0x010 -#define SISCI_API_VER_MINORC "10" -#define SISCI_API_VER_MICRO 0x005 -#define SISCI_API_VER_MICROC "5" - -#define SISCI_SIGN_VERSION_MASK 0xfffff000 /* used to mask off API_VER_MICRO */ - -#define SISCI_API_VERSION (SISCI_API_VER_MAJOR << 24 | SISCI_API_VER_MINOR << 12 | SISCI_API_VER_MICRO) - -/* the rules are: - * - * Changes in API_VER_MICRO should be binary compatible, New flags, functions added. No changes to user code - * required if new features is not needed. - * - * Changes in API_VER_MINOR requires recompilation of user code. - * - * Changes in the API_VER_MAJOR will most likely require changes to user code. This should not happen very - * often... - * - */ - -#ifndef BUILD_DATE -#define BUILD_DATE __DATE__ -#endif - -#ifndef BUILD_NAME -#define BUILD_NAME "" -#endif - -#define API_VERSION "SISCI API version " SISCI_API_VER_MAJORC "." SISCI_API_VER_MINORC "."SISCI_API_VER_MICROC " ( "BUILD_NAME" "BUILD_DATE" )" - -#endif - - -/* Version info: */ -/* */ -/* 1.5.2 First SISCI version */ -/* 1.5.3 Some bug fixes */ -/* 1.5.4 Some bug fixes */ -/* 1.5.5 No release */ -/* 1.5.6 Lock flag implemented in function SCIConnectSegment */ -/* 1.5.7 Expanded query functionality */ -/* 1.5.8 Updated error checking (sequence) functionality for D320 */ -/* 1.6.0 Updated error checking (sequence) D320 and IRM 1.9 support */ -/* 1.9.0 Ported to Solaris_sparc, Solaris_x86 and Linux. IRM 1.9. */ -/* 1.9.1 Some bug fixes */ -/* 1.9.2 Added more adapter queries */ -/* 1.9.3 Bug fix in SCIMapLocalSegment and SCIMapRemoteSegment */ -/* 1.9.4 NT Release Developers Kit 2.40 */ -/* 1.9.5 Added flush after data transfer in SCIMemCopy() */ -/* 1.9.5 NT Release Developers Kit 2.44 */ -/* 1.10.0: - * New SCIInitialize(), SCITerminate() functions. - * Support for D330 - * - * - */ - - diff --git a/ndb/src/external/LINUX.x86/sci/include/version.h b/ndb/src/external/LINUX.x86/sci/include/version.h deleted file mode 100644 index a0e1fa6c5cd..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/version.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _VERSION_H -#define _VERSION_H - - -/* -#define DEMO_VER_MAJOR "1" -#define DEMO_VER_MINOR "5" -#define DEMO_VER_MICRO "0" -*/ - -#ifndef BUILD_DATE -#define BUILD_DATE __DATE__ -#endif - -#ifndef BUILD_NAME -#define BUILD_NAME "" -#endif - -/* -#define DEMO_VERSION "version " DEMO_VER_MAJOR "." DEMO_VER_MINOR "."DEMO_VER_MICRO " ("BUILD_NAME" "BUILD_DATE" )" -*/ -#define DEMO_VERSION " ("BUILD_NAME" "BUILD_DATE" )" - - -#endif diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h deleted file mode 100644 index d02d3aafe7f..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h +++ /dev/null @@ -1,2148 +0,0 @@ -/* $Id: sisci_api.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ -/******************************************************************************* - * * - * Copyright (C) 1993 - 2001 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 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 Lesser 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. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_API_H -#define _SISCI_API_H - -#include "sisci_types.h" -#include "sisci_error.h" - - -#ifdef WIN32 -#ifdef API_DLL -#define DLL __declspec(dllexport) -#elif CLIENT_DLL -#define DLL __declspec(dllimport) -#endif -#endif /* WIN32 */ - - -#ifndef DLL -#define DLL -#endif - -#if defined(_REENTRANT) -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_MT_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_MT_ ## name -#else -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_ST_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_ST_ ## name -#endif -#define _SISCI_EXPANDE_CONSTANT_NAME(name) _SISCI_PUBLIC_CONST_ ## name - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCI_FLAG_FIXED_INTNO _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_INTNO) -extern const unsigned int SCI_FLAG_FIXED_INTNO; - -#define SCI_FLAG_SHARED_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_INT) -extern const unsigned int SCI_FLAG_SHARED_INT; - -#define SCI_FLAG_FIXED_MAP_ADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_MAP_ADDR) -extern const unsigned int SCI_FLAG_FIXED_MAP_ADDR; - -#define SCI_FLAG_READONLY_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READONLY_MAP) -extern const unsigned int SCI_FLAG_READONLY_MAP; - -#define SCI_FLAG_USE_CALLBACK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_USE_CALLBACK) -extern const unsigned int SCI_FLAG_USE_CALLBACK; - -#define SCI_FLAG_BLOCK_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_BLOCK_READ) -extern const unsigned int SCI_FLAG_BLOCK_READ; - -#define SCI_FLAG_THREAD_SAFE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_THREAD_SAFE) -extern const unsigned int SCI_FLAG_THREAD_SAFE; - -#define SCI_FLAG_ASYNCHRONOUS_CONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ASYNCHRONOUS_CONNECT) -extern const unsigned int SCI_FLAG_ASYNCHRONOUS_CONNECT; - -#define SCI_FLAG_EMPTY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_EMPTY) -extern const unsigned int SCI_FLAG_EMPTY; - -#define SCI_FLAG_PRIVATE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_PRIVATE) -extern const unsigned int SCI_FLAG_PRIVATE; - -#define SCI_FLAG_FORCE_DISCONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FORCE_DISCONNECT) -extern const unsigned int SCI_FLAG_FORCE_DISCONNECT; - -#define SCI_FLAG_NOTIFY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NOTIFY) -extern const unsigned int SCI_FLAG_NOTIFY; - -#define SCI_FLAG_DMA_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_READ) -extern const unsigned int SCI_FLAG_DMA_READ; - -#define SCI_FLAG_DMA_POST _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_POST) -extern const unsigned int SCI_FLAG_DMA_POST; - -#define SCI_FLAG_DMA_WAIT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_WAIT) -extern const unsigned int SCI_FLAG_DMA_WAIT; - -#define SCI_FLAG_DMA_RESET _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_RESET) -extern const unsigned int SCI_FLAG_DMA_RESET; - -#define SCI_FLAG_NO_FLUSH _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_FLUSH) -extern const unsigned int SCI_FLAG_NO_FLUSH; - -#define SCI_FLAG_NO_STORE_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_STORE_BARRIER) -extern const unsigned int SCI_FLAG_NO_STORE_BARRIER; - -#define SCI_FLAG_FAST_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FAST_BARRIER) -extern const unsigned int SCI_FLAG_FAST_BARRIER; - -#define SCI_FLAG_ERROR_CHECK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ERROR_CHECK) -extern const unsigned int SCI_FLAG_ERROR_CHECK; - -#define SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) -extern const unsigned int SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY; - -/* the FLUSH_CPU_BUFFERS_ONLY flag is for backwards compabillity only and should never be used */ -#define FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) - -#define SCI_FLAG_LOCK_OPERATION _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_LOCK_OPERATION) -extern const unsigned int SCI_FLAG_LOCK_OPERATION; - -#define SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP; - -#define SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP; - -#define SCI_FLAG_IO_MAP_IOSPACE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_IO_MAP_IOSPACE) -extern const unsigned int SCI_FLAG_IO_MAP_IOSPACE; - -#define SCI_FLAG_DMOVE_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMOVE_MAP) -extern const unsigned int SCI_FLAG_DMOVE_MAP; - -#define SCI_FLAG_WRITES_DISABLE_GATHER_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_WRITES_DISABLE_GATHER_MAP) -extern const unsigned int SCI_FLAG_WRITES_DISABLE_GATHER_MAP; - -#define SCI_FLAG_DISABLE_128_BYTES_PACKETS _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DISABLE_128_BYTES_PACKETS) -extern const unsigned int SCI_FLAG_DISABLE_128_BYTES_PACKETS; - -#define SCI_FLAG_DMA_SOURCE_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_SOURCE_ONLY) -extern const unsigned int SCI_FLAG_DMA_SOURCE_ONLY; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT_MAP; - -#define SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP; - -#define SCI_FLAG_NO_MEMORY_LOOPBACK_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_MEMORY_LOOPBACK_MAP) -extern const unsigned int SCI_FLAG_NO_MEMORY_LOOPBACK_MAP; - -#if defined(OS_IS_LYNXOS) || defined(OS_IS_VXWORKS) -#define SCI_FLAG_WRITE_BACK_CACHE_MAP _SISCI_EXPANDE_CONSTANT_NAME(WRITE_BACK_CACHE_MAP) -extern const unsigned int SCI_FLAG_WRITE_BACK_CACHE_MAP; -#endif - -#define SCI_FLAG_DMA_PHDMA _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_PHDMA) -extern const unsigned int SCI_FLAG_DMA_PHDMA; - -/*********************************************************************************/ -/* GENERAL VALUES */ -/*********************************************************************************/ -#define SCI_LOCAL_HOST _SISCI_EXPANDE_CONSTANT_NAME(SCI_LOCAL_HOST) -extern const unsigned int SCI_LOCAL_HOST; - -#define SCI_INFINITE_TIMEOUT _SISCI_EXPANDE_CONSTANT_NAME(SCI_INFINITE_TIMEOUT) -extern const unsigned int SCI_INFINITE_TIMEOUT; - -/*********************************************************************************/ -/* GENERAL ERROR CODES */ -/* */ -/* SCI_ERR_ILLEGAL_FLAG - Illegal flag value. */ -/* SCI_ERR_FLAG_NOT_IMPLEMENTED - Flag legal but flag feature not implemented. */ -/* SCI_ERR_NOT_IMPLEMENTED - Function not implemented. */ -/* SCI_ERR_SYSTEM - A system error. Check errno. */ -/* SCI_ERR_NOSPC - Unable to allocate OS resources. */ -/* SCI_ERR_API_NOSPC - Unable to allocate API resources. */ -/* SCI_ERR_HW_NOSPC - Unable to allocate HW resources (Hardware) */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "ADAPTER" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_ADAPTERNO - Adapter number is legal but does not exist. */ -/* SCI_ERR_ILLEGAL_ADAPTERNO - Illegal local adapter number (i.e. outside */ -/* legal range). */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "NODEID" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_NODEID - The remote adapter identified by nodeId does */ -/* not respond, but the intermediate link(s) */ -/* seem(s) to be operational. */ -/* SCI_ERR_ILLEGAL_NODEID - Illegal NodeId. */ -/* */ -/*********************************************************************************/ - - - -/********************************************************************************* - * * - * S C I I N I T I A L I Z E * - * * - * This function initializes the SISCI library. * - * The function must be called before SCIOpen(). * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCIInitialize _SISCI_EXPANDE_FUNCTION_NAME(SCIInitialize) -DLL void SCIInitialize(unsigned int flags, - sci_error_t *error); -#if 0 -unsigned int __Internal_SISCI_version_var; -#endif - -/********************************************************************************* - * * - * S C I T E R M I N A T E * - * * - * This function terminates the SISCI library. * - * The function must be called after SCIClose(). * - * * - * * - *********************************************************************************/ -#define SCITerminate _SISCI_EXPANDE_FUNCTION_NAME(SCITerminate) -DLL void SCITerminate(void); - -/********************************************************************************* - * * - * S C I O P E N * - * * - * * - * Opens a SCI virtual device. * - * Caller must supply a pointer to a variable of type sci_desc_t to be * - * initialized. * - * * - * Flags * - * SCI_FLAG_THREAD_SAFE - Operations on resources associated with this * - * descriptor will be performed in a multithread-safe * - * manner. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INCONSISTENT_VERSIONS - Inconsistency between the SISCI library * - * and the SISCI driver versions. * - * * - * * - *********************************************************************************/ -#define SCIOpen _SISCI_EXPANDE_FUNCTION_NAME(SCIOpen) -DLL void SCIOpen(sci_desc_t *sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C L O S E * - * * - * This function closes an open SCI virtual device. * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - All resources are not deallocated. * - * * - *********************************************************************************/ -#define SCIClose _SISCI_EXPANDE_FUNCTION_NAME(SCIClose) -DLL void SCIClose(sci_desc_t sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S E G M E N T * - * * - * Connects to a remote shared memory segment located at <nodeId> with the * - * identifier <segmentId>. * - * The user may then call SCIMapRemoteSegment() to map shared memory * - * into user space. * - * * - * Flags * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_ASYNCHRONOUS_CONNECT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_SEGMENT - Could not find the remote segment with the * - * given segmentId. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIConnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSegment) -DLL void SCIConnectSegment(sci_desc_t sd, - sci_remote_segment_t *segment, - unsigned int nodeId, - unsigned int segmentId, - unsigned int localAdapterNo, - sci_cb_remote_segment_t callback, - void *callbackArg, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T S E G M E N T * - * * - * Disconnects from the give mapped shared memory segment * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The segment is currently mapped or in use. * - * * - *********************************************************************************/ -#define SCIDisconnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectSegment) -DLL void SCIDisconnectSegment(sci_remote_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T R E M O T E S E G M E N T S I Z E * - * * - *********************************************************************************/ -#define SCIGetRemoteSegmentSize _SISCI_EXPANDE_FUNCTION_NAME(SCIGetRemoteSegmentSize) -DLL unsigned int SCIGetRemoteSegmentSize(sci_remote_segment_t segment); - - - -/********************************************************************************* - * * - * S C I W A I T F O R R E M O T E S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du * - * to a SCIDisconnectSegment() on the same * - * handle. The handle is invalid when this * - * error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForRemoteSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForRemoteSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForRemoteSegmentEvent( - sci_remote_segment_t segment, - sci_error_t *status, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P R E M O T E S E G M E N T * - * * - * This function is used to include a shared memory segment in the virtual * - * address space of the application. * - * * - * Flags: * - * * - * SCI_FLAG_FIXED_MAP_ADDR - Map at the suggested virtual address * - * SCI_FLAG_READONLY_MAP - The segment is mapped in read-only mode * - * SCI_FLAG_LOCK_OPERATION - Enable Lock operations (fetch and add) * - * SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP * - * - Enable aggressive prefetch with speculative * - * hold. * - * * - * SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP * - * - The PSB66 will prefetch 64 bytes. As soon * - * as the PCI read retry has been accepted, * - * the stream will change state to FREE, even * - * if less than 64 bytes were actually read. * - * * - * SCI_FLAG_IO_MAP_IOSPACE - Enable No Prefetch, no speculative hold. * - * * - * SCI_FLAG_DMOVE_MAP - Enable DMOVE packet type. The stream will be * - * set into FREE state immediately. * - * * - * SCI_FLAG_WRITES_DISABLE_GATHER_MAP * - * - Disable use of gather. * - * * - * SCI_FLAG_DISABLE_128_BYTES_PACKETS * - * - Disable use of 128-Byte packets * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an atomic "fetch-and-add-one" operation on * - * remote memory, but in addition an interrupt * - * will be generated if the target memory * - * location contained a "null value" before the * - * add operation was carried out. * - * The conditional interrupt flag must also be * - * specified in the SCIRegisterInterruptFlag() * - * function. * - * * - * SCI_FLAG_UNCONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an interrupt for the remote adapter * - * "in addition to" updating the corresponding * - * remote memory location with the data being * - * written. * - * The unconditional interrupt flag must also * - * be specified in the * - * SCIRegisterInterruptFlag() function. * - * * - * SCI_FLAG_WRITE_BACK_CACHE_MAP * - * - Enable cacheing of the mapped region. * - * Writes through this map will be written to a * - * write back cache, hence no remote SCI updates* - * until the cache line is flushed. The * - * application is responsible for the cache * - * flush operation. * - * The SCImemCopy() function will handle this * - * correctly by doing cache flushes internally. * - * This feature is architechture dependent and * - * not be available on all plattforms. * - * * - * SCI_FLAG_NO_MEMORY_LOOPBACK_MAP * - * - Forces a map to a remote segment located * - * in the local machine to be mapped using * - * SCI loopback. This is useful i.e. if you * - * want to use a regular map access to be * - * serialized with lock operations. * - * The default behaviour is to access a remte * - * segment located in the local machine as a * - * local MMU operation. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapRemoteSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapRemoteSegment) -DLL volatile void *SCIMapRemoteSegment( - sci_remote_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P L O C A L S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_FIXED_MAP_ADDR * - * SCI_FLAG_READONLY_MAP * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapLocalSegment) -DLL void *SCIMapLocalSegment(sci_local_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I U N M A P S E G M E N T * - * * - * This function unmaps pages of shared memory from the callers virtual * - * address space. * - * * - * Flags * - * None. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The map is currently in use. * - * * - *********************************************************************************/ -#define SCIUnmapSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIUnmapSegment) -DLL void SCIUnmapSegment(sci_map_t map, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E S E G M E N T * - * * - * Make the specified segment available for connections via the specified * - * adapter. If successful, the segment can be accessed from remote nodes * - * via the specified adapter. * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events * - * on this segment. * - * SCI_FLAG_EMPTY - No memory will be allocated for the segment. * - * SCI_FLAG_PRIVATE - The segment will be private meaning it will never * - * be any connections to it. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SEGMENTID_USED - The segment with this segmentId is already used * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * * - *********************************************************************************/ -#define SCICreateSegment _SISCI_EXPANDE_FUNCTION_NAME(SCICreateSegment) -DLL void SCICreateSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I W A I T F O R L O C A L S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du to a * - * SCIRemoveSegment() on the same handle. * - * The handle is invalid when this error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForLocalSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForLocalSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForLocalSegmentEvent( - sci_local_segment_t segment, - unsigned int *sourcenodeId, - unsigned int *localAdapterNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P R E P A R E S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_DMA_SOURCE_ONLY - The segment will be used as a source segment * - * for DMA operations. On some system types this * - * will enable the SISCI driver to use performance * - * improving features. * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIPrepareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIPrepareSegment) -DLL void SCIPrepareSegment(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E G M E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - Unable to remove the segment. The segment is currently * - * in use. * - * * - *********************************************************************************/ -#define SCIRemoveSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSegment) -DLL void SCIRemoveSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T A V A I L A B L E * - * * - * Flags * - * None. * - * * - * * - * SCI_ERR_SEGMENT_NOT_PREPARED - The segment has not been prepared for access * - * from this adapter. * - * SCI_ERR_ILLEGAL_OPERATION - The segment is created with the * - * SCI_FLAG_PRIVATE flag specified and * - * therefore has no segmentId. * - * * - *********************************************************************************/ -#define SCISetSegmentAvailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentAvailable) -DLL void SCISetSegmentAvailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T U N A V A I L A B L E * - * * - * Flags * - * * - * SCI_FLAG_FORCE_DISCONNECT * - * SCI_FLAG_NOTIFY * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * * - *********************************************************************************/ -#define SCISetSegmentUnavailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentUnavailable) -DLL void SCISetSegmentUnavailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E M A P S E Q U E N C E * - * * - * Flags: * - * * - * SCI_FLAG_FAST_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateMapSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICreateMapSequence) -DLL void SCICreateMapSequence(sci_map_t map, - sci_sequence_t *sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E Q U E N C E * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSequence) -DLL void SCIRemoveSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T A R T S E Q U E N C E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIStartSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIStartSequence) -DLL sci_sequence_status_t SCIStartSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I C H E C K S E Q U E N CE * - * * - * Flags * - * * - * SCI_FLAG_NO_FLUSH * - * SCI_FLAG_NO_STORE_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICheckSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICheckSequence) -DLL sci_sequence_status_t SCICheckSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T O R E B A R R I E R * - * * - * Flags * - * None. * - * * - * * - * * - *********************************************************************************/ -#define SCIStoreBarrier _SISCI_EXPANDE_FUNCTION_NAME(SCIStoreBarrier) -DLL void SCIStoreBarrier(sci_sequence_t sequence, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I F L U S H R E A D B U F F E R S * - * * - *********************************************************************************/ -#define SCIFlushReadBuffers _SISCI_EXPANDE_FUNCTION_NAME(SCIFlushReadBuffers) -DLL void SCIFlushReadBuffers(sci_sequence_t sequence); - - - - -/********************************************************************************* - * * - * S C I P R O B E N O D E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIProbeNode _SISCI_EXPANDE_FUNCTION_NAME(SCIProbeNode) -DLL int SCIProbeNode(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int nodeId, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIGetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCIGetCSRRegister) -DLL unsigned int SCIGetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCISetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCISetCSRRegister) -DLL void SCISetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I G E T L O C A L C S R * - * * - * SISCI Priveleged function * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIGetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCIGetLocalCSR) -DLL unsigned int SCIGetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T L O C A L C S R * - * * - * SISCI Priveleged function - * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCISetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCISetLocalCSR) -DLL void SCISetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A T T A C H P H Y S I C A L M E M O R Y * - * * - * SISCI Priveleged function * - * * - * Description: * - * * - * This function enables usage of physical devices and memory regions where the * - * Physical PCI bus address ( and mapped CPU address ) are already known. * - * The function will register the physical memory as a SISCI segment which can * - * be connected and mapped as a regular SISCI segment. * - * * - * Requirements: * - * * - * SCICreateSegment() with flag SCI_FLAG_EMPTY must have been called in advance * - * * - * Parameter description: * - * sci_ioaddr_t ioaddress : This is the address on the PCI bus that a PCI bus * - * master has to use to write to the specified memory * - * void * address : This is the (mapped) virtual address that the * - * application has to use to access the device. * - * This means that the device has to be mapped in * - * advance bye the devices own driver. * - * If the device is not to be accessed by the local * - * CPU, the address pointer shold be set to NULL * - * Flags * - * * - * None * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIAttachPhysicalMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachPhysicalMemory) -DLL void SCIAttachPhysicalMemory(sci_ioaddr_t ioaddress, - void *address, - unsigned int busNo, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I Q U E R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_QUERY - Unrecognized command. * - * * - *********************************************************************************/ -#define SCIQuery _SISCI_EXPANDE_FUNCTION_NAME(SCIQuery) -DLL void SCIQuery(unsigned int command, - void *data, - unsigned int flags, - sci_error_t *error); - - -/* MAJOR QUERY COMMANDS */ - -/* This command requires a pointer to a structure of type */ -/* "sci_query_string". The string will be filled in by the query. */ -#define SCI_Q_VENDORID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_VENDORID) -extern const unsigned int SCI_Q_VENDORID; - - -/* Same as for SCI_VENDOR_ID */ -#define SCI_Q_API _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_API) -extern const unsigned int SCI_Q_API; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_adapter" struct. */ -#define SCI_Q_ADAPTER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER) -extern const unsigned int SCI_Q_ADAPTER; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_system" struct. */ -#define SCI_Q_SYSTEM _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM) -extern const unsigned int SCI_Q_SYSTEM; - -#define SCI_Q_LOCAL_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT) -extern const unsigned int SCI_Q_LOCAL_SEGMENT; - -#define SCI_Q_REMOTE_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT) -extern const unsigned int SCI_Q_REMOTE_SEGMENT; - -#define SCI_Q_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP) -extern const unsigned int SCI_Q_MAP; - -typedef struct { - char *str; /* Pointer to a string of minimum "length" characters */ - unsigned int length; -} sci_query_string_t; - - -typedef struct { - unsigned int localAdapterNo; /* The adapter no. that the query concern. */ - unsigned int portNo; /* The SCI Link port number that the query concern. */ - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_adapter_t; - - -typedef struct { - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_system_t; - -typedef struct { - sci_local_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_local_segment_t; - -typedef struct { - sci_remote_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_remote_segment_t; - -typedef struct { - sci_map_t map; - unsigned int subcommand; - unsigned int data; -} sci_query_map_t; - -/* Minor query commands (sub-commands) for adapter specific information SCI_ADAPTER */ -#define SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_MTU _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_MTU) -extern const unsigned int SCI_Q_ADAPTER_DMA_MTU; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE; - -#define SCI_Q_ADAPTER_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NODEID) -extern const unsigned int SCI_Q_ADAPTER_NODEID; - -#define SCI_Q_ADAPTER_SERIAL_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SERIAL_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_SERIAL_NUMBER; - -#define SCI_Q_ADAPTER_CARD_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CARD_TYPE) -extern const unsigned int SCI_Q_ADAPTER_CARD_TYPE; - -#define SCI_Q_ADAPTER_NUMBER_OF_STREAMS _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER_OF_STREAMS) -extern const unsigned int SCI_Q_ADAPTER_NUMBER_OF_STREAMS; - -#define SCI_Q_ADAPTER_STREAM_BUFFER_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_STREAM_BUFFER_SIZE) -extern const unsigned int SCI_Q_ADAPTER_STREAM_BUFFER_SIZE; - -#define SCI_Q_ADAPTER_CONFIGURED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONFIGURED) -extern const unsigned int SCI_Q_ADAPTER_CONFIGURED; - -#define SCI_Q_ADAPTER_LINK_OPERATIONAL _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LINK_OPERATIONAL) -extern const unsigned int SCI_Q_ADAPTER_LINK_OPERATIONAL; - -#define SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK) -extern const unsigned int SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK; - -#define SCI_Q_ADAPTER_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_NUMBER; - -#define SCI_Q_ADAPTER_INSTANCE_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_INSTANCE_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_INSTANCE_NUMBER; - -#define SCI_Q_ADAPTER_FIRMWARE_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_FIRMWARE_OK) -extern const unsigned int SCI_Q_ADAPTER_FIRMWARE_OK; - -#define SCI_Q_ADAPTER_CONNECTED_TO_SWITCH _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_SWITCH) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_SWITCH; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER; - -#define SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT; - -#define SCI_Q_ADAPTER_ATT_PAGE_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_PAGE_SIZE) -extern const unsigned int SCI_Q_ADAPTER_ATT_PAGE_SIZE; - -#define SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES; - -#define SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES; - -#define SCI_Q_ADAPTER_PHYS_MEM_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MEM_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MEM_NODEID; - -#define SCI_Q_ADAPTER_PHYS_MBX_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MBX_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MBX_NODEID; - -#define SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID; - -#define SCI_Q_ADAPTER_SCI_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SCI_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_SCI_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_B_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_B_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_B_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_IO_BUS_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_IO_BUS_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_IO_BUS_FREQUENCY; - -/* Minor query commands (sub-commands) for adapter specific information SCI_SYSTEM */ -#define SCI_Q_SYSTEM_HOSTBRIDGE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_HOSTBRIDGE) -extern const unsigned int SCI_Q_SYSTEM_HOSTBRIDGE; - -#define SCI_Q_SYSTEM_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_POSTING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_POSTING_ENABLED; - -#define SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED; - -#define SCI_Q_LOCAL_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_LOCAL_SEGMENT_IOADDR; - -#define SCI_Q_REMOTE_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_REMOTE_SEGMENT_IOADDR; - -#define SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET; - -#define SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET; - -#define HOSTBRIDGE_NOT_AVAILABLE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_NOT_AVAILABLE) -extern const unsigned int HOSTBRIDGE_NOT_AVAILABLE; - -#define HOSTBRIDGE_UNKNOWN _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_UNKNOWN) -extern const unsigned int HOSTBRIDGE_UNKNOWN; - -#define HOSTBRIDGE_440FX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440FX) -extern const unsigned int HOSTBRIDGE_440FX; - -#define HOSTBRIDGE_440LX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440LX) -extern const unsigned int HOSTBRIDGE_440LX; - -#define HOSTBRIDGE_440BX_A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_A) -extern const unsigned int HOSTBRIDGE_440BX_A; - -#define HOSTBRIDGE_440BX_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_B) -extern const unsigned int HOSTBRIDGE_440BX_B; - -#define HOSTBRIDGE_440GX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440GX) -extern const unsigned int HOSTBRIDGE_440GX; - -#define HOSTBRIDGE_450KX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450KX) -extern const unsigned int HOSTBRIDGE_450KX; - -#define HOSTBRIDGE_430NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_430NX) -extern const unsigned int HOSTBRIDGE_430NX; - -#define HOSTBRIDGE_450NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX) -extern const unsigned int HOSTBRIDGE_450NX; - -#define HOSTBRIDGE_450NX_MICO _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_MICO) -extern const unsigned int HOSTBRIDGE_450NX_MICO; - -#define HOSTBRIDGE_450NX_PXB _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_PXB) -extern const unsigned int HOSTBRIDGE_450NX_PXB; - -#define HOSTBRIDGE_I810 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810) -extern const unsigned int HOSTBRIDGE_I810; - -#define HOSTBRIDGE_I810_DC100 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810_DC100) -extern const unsigned int HOSTBRIDGE_I810_DC100; - -#define HOSTBRIDGE_I810E _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810E) -extern const unsigned int HOSTBRIDGE_I810E; - -#define HOSTBRIDGE_I815 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I815) -extern const unsigned int HOSTBRIDGE_I815; - -#define HOSTBRIDGE_I840 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I840) -extern const unsigned int HOSTBRIDGE_I840; - -#define HOSTBRIDGE_I850 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I850) -extern const unsigned int HOSTBRIDGE_I850; - -#define HOSTBRIDGE_I860 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I860) -extern const unsigned int HOSTBRIDGE_I860; - -#define HOSTBRIDGE_VIA_KT133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KT133) -extern const unsigned int HOSTBRIDGE_VIA_KT133; - -#define HOSTBRIDGE_VIA_KX133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KX133) -extern const unsigned int HOSTBRIDGE_VIA_KX133; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_133A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_133A) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_133A; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_266 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_266) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_266; - -#define HOSTBRIDGE_AMD_760_MP _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_760_MP) -extern const unsigned int HOSTBRIDGE_AMD_760_MP; - -#define HOSTBRIDGE_SERVERWORKS_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE; - -#define HOSTBRIDGE_SERVERWORKS_HE_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE_B) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE_B; - -#define HOSTBRIDGE_SERVERWORKS_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_LE; - - - -#define HOSTBRIDGE_WRITE_POSTING_DISABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_DISABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_DISABLED; - -#define HOSTBRIDGE_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_ENABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_ENABLED; - - - - -/********************************************************************************* - * * - * S C I C R E A T E D M A Q U E U E * - * * - * Flags * - * * - * SCI_FLAG_DMA_PHDMA : Create physical DMA queue. Please note that this is an * - * priveleged operation. * - * * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCICreateDMAQueue) -DLL void SCICreateDMAQueue(sci_desc_t sd, - sci_dma_queue_t *dq, - unsigned int localAdapterNo, - unsigned int maxEntries, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Not allowed in this queue state. * - * * - *********************************************************************************/ -#define SCIRemoveDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveDMAQueue) -DLL void SCIRemoveDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I E N Q U E U E D M A T R A N S F E R * - * * - * Flags: * - * * - * SCI_FLAG_DMA_READ - The DMA will be remote --> local * - * (default is local --> remote) * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is larger * - * than the segment size or larger than max * - * DMA size. * - * SCI_ERR_MAX_ENTRIES - The DMA queue is full * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_SEGMENT_NOT_PREPARED - The local segment has not been prepared for * - * access from the adapter associated with the * - * queue. * - * SCI_ERR_SEGMENT_NOT_CONNECTED - The remote segment is not connected through * - * the adapter associated with the queue. * - *********************************************************************************/ -#define SCIEnqueueDMATransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIEnqueueDMATransfer) -DLL sci_dma_queue_state_t SCIEnqueueDMATransfer(sci_dma_queue_t dq, - sci_local_segment_t localSegment, - sci_remote_segment_t remoteSegment, - unsigned int localOffset, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P O S T D M A Q U E U E * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The end of the transfer will cause the callback * - * function to be invoked. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIPostDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIPostDMAQueue) -DLL void SCIPostDMAQueue(sci_dma_queue_t dq, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortDMAQueue) -DLL void SCIAbortDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I R E S E T D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIResetDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIResetDMAQueue) -DLL void SCIResetDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I D M A Q U E U E S T A T E * - * * - *********************************************************************************/ -#define SCIDMAQueueState _SISCI_EXPANDE_FUNCTION_NAME(SCIDMAQueueState) -DLL sci_dma_queue_state_t SCIDMAQueueState(sci_dma_queue_t dq); - - - -/********************************************************************************* - * * - * S C I W A I T F O R D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForDMAQueue) -DLL sci_dma_queue_state_t SCIWaitForDMAQueue(sci_dma_queue_t dq, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I P H D M A E N Q U E U E * - * * - * SISCI Priveleged function * - * * - * Flags * - * * - * SCI_FLAG_DMA_READ * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaEnqueue _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaEnqueue) -DLL void SCIphDmaEnqueue(sci_dma_queue_t dmaqueue, - unsigned int size, - sci_ioaddr_t localBusAddr, - unsigned int remote_nodeid, - unsigned int remote_highaddr, - unsigned int remote_lowaddr, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I P H D M A S T A R T * - * * - * Flags * - * * - * SCI_FLAG_DMA_WAIT * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_DMA_RESET * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaStart _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaStart) -DLL sci_dma_queue_state_t SCIphDmaStart(sci_dma_queue_t dmaqueue, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I C R E A T E I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateInterrupt) -DLL void SCICreateInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveInterrupt) -DLL void SCIRemoveInterrupt(sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait was interrupted by a call to * - * SCIRemoveInterrupt. * - * The handle is invalid when this error code is returned.* - * * - *********************************************************************************/ -#define SCIWaitForInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForInterrupt) -DLL void SCIWaitForInterrupt(sci_local_interrupt_t interrupt, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_INTNO - No such interrupt number. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIConnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectInterrupt) -DLL void SCIConnectInterrupt(sci_desc_t sd, - sci_remote_interrupt_t *interrupt, - unsigned int nodeId, - unsigned int localAdapterNo, - unsigned int interruptNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisconnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectInterrupt) -DLL void SCIDisconnectInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R I G G E R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCITriggerInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCITriggerInterrupt) -DLL void SCITriggerInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I R E G I S T E R I N T E R R U P T F L A G * - * * - * * - * This function register an "interrupt flag" that is identified as an unique * - * location within a local segment. If successful, the resulting interrupt * - * handle will have been associated with the specified local segment. * - * * - * It is up to the (remote) client(s) to set up an "interrupt mapping" for the * - * corresponding segment offset using either the * - * * - * - SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * * - * or the * - * * - * - SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP * - * * - * option to "SCIMapRemoteSegment()". - I.e. after having established a * - * connection to the corresponding segment. A trigger operation can then * - * be implemented using a store operation via the relevant "interrupt map". * - * * - * * - * * - * * - * * - * Flags: * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT - Triggering is to take place using * - * "conditional interrupts". * - * * - * * - * * - * Specific error codes for this function: * - * None. * - * * - *********************************************************************************/ -#define SCIRegisterInterruptFlag _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterInterruptFlag) -DLL void SCIRegisterInterruptFlag( - unsigned int localAdapterNo, - sci_local_interrupt_t *interrupt, - sci_local_segment_t segment, - unsigned int offset, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I E N A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * This function make sure that another HW interrupt will take place the next * - * time the corresponding interrupt flag is triggered by a * - * "conditional interrupt" operation. * - * * - * Default semantics: * - * * - * When successful, the client can rely on that the first subsequent trigger * - * operation will cause a HW interrupt and subsequently cause the client * - * handler function to be invoked. * - * * - * If an interrupt was triggered in parallell with the enable operation, then * - * the operation will fail (SCI_ERR_COND_INT_RACE_PROBLEM), and the client can * - * not rely on another trigger operation will lead to handler invocation. * - * Hence, any state checking normally associated with handling the * - * corresponding interrupt should take place before attempting to enable * - * again. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_COND_INT_RACE_PROBLEM - The enable operation failed because an * - * incomming trigger operation happened * - * concurrently. * - * * - *********************************************************************************/ -#define SCIEnableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIEnableConditionalInterrupt) -DLL void SCIEnableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I D I S A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * Prevent subsequent "conditional interrupt"trigger operations for * - * the specified interupt flag from causing HW interrupt and handler * - * invocations. * - * * - * * - * Default semantics: * - * * - * If successful, no subsequent HW interrupts will take place, but handler * - * invocations that have already been scheduled may still take place. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisableConditionalInterrupt) -DLL void SCIDisableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C O N D I T I O N A L I N T E R R U P T C O U N T E R * - * * - * * - * Returns a value that indicates the number of times this flag has * - * been trigged since the last time it was enabled or disabled. * - * Calling the SCIEnableConditionalInterrupt / SCIDisableConditionalInterrupt * - * functions will reset the counter value. * - * * - * Default semantics: * - * * - * If successful, the current trig count is returned in the * - * interruptTrigCounter parameter. * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OVERFLOW - The number of trig operations have exceeded the range * - * that can be counted. * - *********************************************************************************/ -#define SCIGetConditionalInterruptTrigCounter _SISCI_EXPANDE_FUNCTION_NAME(SCIGetConditionalInterruptTrigCounter) -DLL void SCIGetConditionalInterruptTrigCounter( - sci_local_interrupt_t interrupt, - unsigned int *interruptTrigCounter, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlock _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlock) -DLL void SCITransferBlock(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K A S Y N C * - * * - * Flags * - * * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_USE_CALLBACK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger than * - * the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlockAsync _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlockAsync) -DLL void SCITransferBlockAsync(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - sci_block_transfer_t *block, - sci_cb_block_transfer_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForBlockTransfer) -DLL void SCIWaitForBlockTransfer(sci_block_transfer_t block, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortBlockTransfer) -DLL void SCIAbortBlockTransfer(sci_block_transfer_t block, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M E M C P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - -#define SCIMemCpy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCpy) -DLL void SCIMemCpy(sci_sequence_t sequence, - void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I M E M C O P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - - -#define SCIMemCopy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCopy) -DLL void SCIMemCopy(void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E G I S T E R S E G M E N T M E M O R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_ILLEGAL_ADDRESS - Illegal address. * - * SCI_ERR_OUT_OF_RANGE - Size is larger than the maximum size for the * - * local segment. * - * * - *********************************************************************************/ -#define SCIRegisterSegmentMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterSegmentMemory) -DLL void SCIRegisterSegmentMemory(void *address, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S C I S P A C E * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * * - *********************************************************************************/ -#define SCIConnectSCISpace _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSCISpace) -DLL void SCIConnectSCISpace(sci_desc_t sd, - unsigned int localAdapterNo, - sci_remote_segment_t *segment, - sci_address_t address, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/* - * ===================================================================================== - * - * S C I A T T A C H L O C A L S E G M E N T - * Description: - * - * SCIAttachLocalSegment() permits an application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events - * on this segment. - * - * - * Specific error codes for this function: - * - * SCI_ERR_ACCESS - No such shared segment - * SCI_ERR_NO_SUCH_SEGMENT - No such segment - * Note: Current implenentation will return SCI_ERR_ACCESS for both cases. This will - * change from next release. Application should handle both cases. - * - * ===================================================================================== - */ -#define SCIAttachLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachLocalSegment) - -DLL void -SCIAttachLocalSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int *size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); -/* - * ===================================================================================== - * - * S C I S H A R E S E G M E N T - * - * Description: - * - * SCIShareSegment() permits other application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * none - * - * Specific error codes for this function: - * - * - * - * ===================================================================================== - */ -#define SCIShareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIShareSegment) - -DLL void -SCIShareSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I F L U S H * - * * - * This function will flush the CPU buffers and the PSB buffers. * - * * - * Flags * - * SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY : * - * Only flush CPU buffers ( Write combining * - * etc buffers). * - * * - *********************************************************************************/ - -#define SCIFlush _SISCI_EXPANDE_FUNCTION_NAME(SCIFlush) -DLL void SCIFlush(sci_sequence_t sequence, - unsigned int flags); - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - -#endif - - - - - - - - - - - diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h deleted file mode 100644 index aab7c136d3a..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - - - -#ifndef _SISCI_ERROR_H_ -#define _SISCI_ERROR_H_ - - -/* SCI Error return values always have 30 bit set */ -#define SCI_ERR_MASK 0x40000000 -#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */ - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) - -/* Error codes */ -typedef enum { - SCI_ERR_OK = 0x000, - - - SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK), - SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK), - SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK), - SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK), - SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK), - SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK), - SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK), - SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK), - SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK), - SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK), - SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK), - SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK), - SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK), - SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK), - SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK), - SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK), - SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK), - SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK), - SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK), - SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK), - SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK), - - SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK), - - SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK), - SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK), - SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK), - SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK), - SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK) -} sci_error_t; - - -#endif /* _SCI_ERROR_H_ */ - - - diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h deleted file mode 100644 index 77989ffca59..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - -#ifndef _SISCI_TYPES_H -#define _SISCI_TYPES_H - -#include "sisci_error.h" - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef IN_OUT -#define IN_OUT -#endif - -/* Opaque data types for descriptors/handles */ -typedef struct sci_desc *sci_desc_t; -typedef struct sci_local_segment *sci_local_segment_t; -typedef struct sci_remote_segment *sci_remote_segment_t; - -typedef struct sci_map *sci_map_t; -typedef struct sci_sequence *sci_sequence_t; -#ifndef KERNEL -typedef struct sci_dma_queue *sci_dma_queue_t; -#endif -typedef struct sci_remote_interrupt *sci_remote_interrupt_t; -typedef struct sci_local_interrupt *sci_local_interrupt_t; -typedef struct sci_block_transfer *sci_block_transfer_t; - -/* - * Constants defining reasons for segment callbacks: - */ - -typedef enum { - SCI_CB_CONNECT = 1, - SCI_CB_DISCONNECT, - SCI_CB_NOT_OPERATIONAL, - SCI_CB_OPERATIONAL, - SCI_CB_LOST -} sci_segment_cb_reason_t; - -#define MAX_CB_REASON SCI_CB_LOST - -/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/ -typedef enum { - SCI_DMAQUEUE_IDLE, - SCI_DMAQUEUE_GATHER, - SCI_DMAQUEUE_POSTED, - SCI_DMAQUEUE_DONE, - SCI_DMAQUEUE_ABORTED, - SCI_DMAQUEUE_ERROR -} sci_dma_queue_state_t; - - -typedef enum { - SCI_SEQ_OK, - SCI_SEQ_RETRIABLE, - SCI_SEQ_NOT_RETRIABLE, - SCI_SEQ_PENDING -} sci_sequence_status_t; - - -typedef struct { - unsigned short nodeId; /* SCI Address bit 63 - 48 */ - unsigned short offsHi; /* SCI Address bit 47 - 32 */ - unsigned int offsLo; /* SCI Address bit 31 - 0 */ -} sci_address_t; - - -typedef unsigned int sci_ioaddr_t; - -typedef enum { - SCI_CALLBACK_CANCEL = 1, - SCI_CALLBACK_CONTINUE -} sci_callback_action_t; - -#ifndef KERNEL -typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg, - sci_local_segment_t segment, - sci_segment_cb_reason_t reason, - unsigned int nodeId, - unsigned int localAdapterNo, - sci_error_t error); - -typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg, - sci_remote_segment_t segment, - sci_segment_cb_reason_t reason, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg, - sci_dma_queue_t queue, - sci_error_t status); - - -typedef int (*sci_cb_block_transfer_t)(void *arg, - sci_block_transfer_t block, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg, - sci_local_interrupt_t interrupt, - sci_error_t status); - -#endif /* KERNEL */ -#endif diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h deleted file mode 100644 index c2fccb9ec33..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h +++ /dev/null @@ -1,91 +0,0 @@ -/* $Id: sisci_version.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 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 Lesser 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. * - * * - * * - *******************************************************************************/ - - -#ifndef SISCI_VERSION_H -#define SISCI_VERSION_H - - -#define SISCI_API_VER_MAJOR 1 -#define SISCI_API_VER_MAJORC "1" - -#define SISCI_API_VER_MINOR 10 -#define SISCI_API_VER_MINORC "10" -#define SISCI_API_VER_MICRO 4 -#define SISCI_API_VER_MICROC "4" - -#define SISCI_SIGN_VERSION_MASK 0xfffff000 /* used to mask off API_VER_MICRO */ - -#define SISCI_API_VERSION (SISCI_API_VER_MAJOR << 24 | SISCI_API_VER_MINOR << 12 | SISCI_API_VER_MICRO) - -/* the rules are: - * - * Changes in API_VER_MICRO should be binary compatible, New flags, functions added. No changes to user code - * required if new features is not needed. - * - * Changes in API_VER_MINOR requires recompilation of user code. - * - * Changes in the API_VER_MAJOR will most likely require changes to user code. This should not happen very - * often... - * - */ - -#ifndef BUILD_DATE -#define BUILD_DATE __DATE__ -#endif - -#ifndef BUILD_NAME -#define BUILD_NAME "" -#endif - -#define API_VERSION "SISCI API version " SISCI_API_VER_MAJORC "." SISCI_API_VER_MINORC "."SISCI_API_VER_MICROC " ( "BUILD_NAME" "BUILD_DATE" )" - -#endif - - -/* Version info: */ -/* */ -/* 1.5.2 First SISCI version */ -/* 1.5.3 Some bug fixes */ -/* 1.5.4 Some bug fixes */ -/* 1.5.5 No release */ -/* 1.5.6 Lock flag implemented in function SCIConnectSegment */ -/* 1.5.7 Expanded query functionality */ -/* 1.5.8 Updated error checking (sequence) functionality for D320 */ -/* 1.6.0 Updated error checking (sequence) D320 and IRM 1.9 support */ -/* 1.9.0 Ported to Solaris_sparc, Solaris_x86 and Linux. IRM 1.9. */ -/* 1.9.1 Some bug fixes */ -/* 1.9.2 Added more adapter queries */ -/* 1.9.3 Bug fix in SCIMapLocalSegment and SCIMapRemoteSegment */ -/* 1.9.4 NT Release Developers Kit 2.40 */ -/* 1.9.5 Added flush after data transfer in SCIMemCopy() */ -/* 1.9.5 NT Release Developers Kit 2.44 */ -/* 1.10.0: - * New SCIInitialize(), SCITerminate() functions. - * Support for D330 - * - * - */ - - diff --git a/ndb/src/external/WIN32.x86/sci/include/rmlib.h b/ndb/src/external/WIN32.x86/sci/include/rmlib.h deleted file mode 100644 index 87ba20db99f..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/rmlib.h +++ /dev/null @@ -1,212 +0,0 @@ -/* $Id: rmlib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/********************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 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 Lesser 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. * - * * - * * - *********************************************************************************/ - -/********************************************************************************/ -/* This header file contains the declarations of the SCI Reflective Memory */ -/* library rmlib. The implementation of the library functions is in rmlib.c. */ -/* The library contains all the functions that operate on the reflective */ -/* memory. */ -/* */ -/* NB! */ -/* */ -/* DOLPHIN'S SCI REFLECTIVE MEMORY FILES ARE UNDER DEVELOPMENT AND MAY CHANGE. */ -/* PLEASE CONTACT DOLPHIN FOR FURTHER INFORMATION. */ -/* */ -/* */ -/********************************************************************************/ - -#include "sisci_error.h" -#include "sisci_api.h" -#include "sisci_demolib.h" -#include "sisci_types.h" - -unsigned int seqerr, syncseqerr; - -#ifndef _RMLIB_H -#define _RMLIB_H - - -#if defined(_REENTRANT) - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_MT_ ## name - -#else - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_ST_ ## name - -#endif - -#ifdef __sparc -#define CACHE_SIZE 2097152 -#else -#define CACHE_SIZE 8192 -#endif - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define REFLECT_ERRCHECK 0x2 - -struct ReflectiveMemorySpace { - unsigned int localAdapterNo; - unsigned int localNodeId; - unsigned int remoteNodeId; - sci_desc_t sd; - sci_desc_t syncsd; - sci_map_t localMap; - sci_map_t remoteMap; - unsigned int localSegmentId; - unsigned int remoteSegmentId; - unsigned int syncSegmentId; - unsigned int sync_rSegmentId; - unsigned int segmentSize; - unsigned int *localMapAddr; - volatile unsigned int *remoteMapAddr; - sci_local_segment_t localSegment; - sci_remote_segment_t remoteSegment; - sci_local_segment_t syncSegment; - sci_remote_segment_t sync_rSegment; - sci_map_t syncMap; - sci_map_t sync_rMap; - sci_sequence_t syncsequence; - sci_sequence_t sequence; - unsigned int protection; - unsigned int retry_value; - sci_sequence_status_t sequenceStatus, syncsequenceStatus; - volatile unsigned int *syncMapAddr; - volatile unsigned int *sync_rMapAddr; -}; - -/*********************************************************************************/ -/* P R I N T R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectPrintParameters _RMLIB_EXPAND_NAME(ReflectPrintParameters) -void ReflectPrintParameters(FILE *stream, struct ReflectiveMemorySpace RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A S E T U P */ -/* */ -/*********************************************************************************/ -#define ReflectDmaSetup _RMLIB_EXPAND_NAME(ReflectDmaSetup) -sci_error_t ReflectDmaSetup(struct ReflectiveMemorySpace RM_space, sci_dma_queue_t *dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R E M O V E */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRemove _RMLIB_EXPAND_NAME(ReflectDmaRemove) -sci_error_t ReflectDmaRemove(sci_dma_queue_t dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R U N */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRun _RMLIB_EXPAND_NAME(ReflectDmaRun) -sci_error_t ReflectDmaRun(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - sci_dma_queue_t dmaQueue); -/*********************************************************************************/ -/* C L O S E R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectClose _RMLIB_EXPAND_NAME(ReflectClose) -sci_error_t ReflectClose(struct ReflectiveMemorySpace RM_space, unsigned int segment_no); - -/*********************************************************************************/ -/* O P E N R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectOpen _RMLIB_EXPAND_NAME(ReflectOpen) -sci_error_t ReflectOpen(struct ReflectiveMemorySpace *RM_space, - unsigned int size, - unsigned int segment_no, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int protection, - unsigned int retry_value); - -/*********************************************************************************/ -/* R E F L E C T G E T A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectGetAccess _RMLIB_EXPAND_NAME(ReflectGetAccess) -sci_error_t ReflectGetAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T R E L E A S E A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectReleaseAccess _RMLIB_EXPAND_NAME(ReflectReleaseAccess) -sci_error_t ReflectReleaseAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A */ -/* */ -/*********************************************************************************/ -#define ReflectDma _RMLIB_EXPAND_NAME(ReflectDma) -sci_error_t ReflectDma(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset); - -/*********************************************************************************/ -/* R E F L E C T M E M C O P Y */ -/* */ -/*********************************************************************************/ -#define ReflectMemCopy _RMLIB_EXPAND_NAME(ReflectMemCopy) -sci_error_t ReflectMemCopy(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - unsigned int flags); - -/*********************************************************************************/ -/* R E F L E C T S E T */ -/* */ -/*********************************************************************************/ -#define ReflectSet _RMLIB_EXPAND_NAME(ReflectSet) -sci_error_t ReflectSet(struct ReflectiveMemorySpace RM_space, - unsigned int value, - unsigned int size, - unsigned int offset, - unsigned int flags - ); - -/*********************************************************************************/ -/* R E F L E C T P R I N T */ -/* */ -/*********************************************************************************/ -#define ReflectPrint _RMLIB_EXPAND_NAME(ReflectPrint) -sci_error_t ReflectPrint(FILE *stream, - struct ReflectiveMemorySpace RM_space, - unsigned int size, - unsigned int offset - ); - - -#endif diff --git a/ndb/src/external/WIN32.x86/sci/include/scilib.h b/ndb/src/external/WIN32.x86/sci/include/scilib.h deleted file mode 100644 index d1501082bab..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/scilib.h +++ /dev/null @@ -1,330 +0,0 @@ -/* $Id: scilib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 2002 * - * Dolphin Interconnect Solutions AS * - * * - *******************************************************************************/ - - -#if defined(_REENTRANT) -#define _SCIL_EXPANDE_FUNCTION_NAME(name) _SCIL_PUBLIC_FUNC_MT_ ## name -#define _SCIL_EXPANDE_VARIABLE_NAME(name) _SCIL_PUBLIC_VAR_MT_ ## name -#else -#define _SCIL_EXPANDE_FUNCTION_NAME(name) _SCIL_PUBLIC_FUNC_ST_ ## name -#define _SCIL_EXPANDE_VARIABLE_NAME(name) _SCIL_PUBLIC_VAR_ST_ ## name -#endif -#define _SCIL_EXPANDE_CONSTANT_NAME(name) _SCIL_PUBLIC_CONST_ ## name - -#include "sisci_api.h" - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/* - * SISCI segment id pollution: - * =========================== - * The SISCI library uses regular SISCI segmens internally. - * The MSG_QUEUE_LIB_IDENTIFIER_MASK is a mask which is used by the SISCI - * library to identify internal SISCI segments ids, from segments used directly - * by the user. - * - * Future versions of the library may have its own namespace. - * - */ - -#define MSG_QUEUE_LIB_IDENTIFIER_MASK 0x10000000 - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCIL_FLAG_ERROR_CHECK_DATA _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_ERROR_CHECK_DATA) -extern const unsigned int SCIL_FLAG_ERROR_CHECK_DATA; - -#define SCIL_FLAG_ERROR_CHECK_PROT _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_ERROR_CHECK_PROT) -extern const unsigned int SCIL_FLAG_ERROR_CHECK_PROT; - -#define SCIL_FLAG_FULL_ERROR_CHECK _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_FULL_ERROR_CHECK) -extern const unsigned int SCIL_FLAG_FULL_ERROR_CHECK; - - - - - -typedef struct sci_msq_queue *sci_msq_queue_t; - - -/********************************************************************************* - * * - * S C I L C r e a t e M s g Q u e u e * - * * - * Parameters: * - * * - * Creates a message queue. The message queue identifier object will be allocated* - * if the sci_msq_queue_t * msg pointer is NULL. The function will create a * - * remote connection. If this connection times out, the function shoud be * - * repeated until connection is established. SCILRemoveMsgQueue() must be called * - * to remove the connection and deallocate the message queue identifier. * - * * - * sci_msq_queue_t *msq : Message queue identifier * - * The function must be called with a null pointer * - * the first time. * - * unsigned int localAdapterNo: Local Adapter Number * - * unsigned int remoteNodeId : Remote nodeId * - * unsigned int msqId : Message queue number * - * unsigned int maxMsgCount : The maximum count of messages in queue * - * unsigned int maxMsgSize, : The maximum size of each messages in queue * - * unsigned int timeout : Time to wait for successful connection * - * unsigned int flags : Flags. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None. Normal SISIC error codes. * - * * - *********************************************************************************/ -#define SCILCreateMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILCreateMsgQueue) -DLL sci_error_t SCILCreateMsgQueue(sci_msq_queue_t *msq, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int msqId, - unsigned int maxMsgCount, - unsigned int maxMsgSize, - unsigned int timeout, - unsigned int flags); - - -/********************************************************************************* - * * - * S C I L R e c e i v e M s g * - * * - * * - * Receives a message from the queue. * - * * - * Paremeters * - * * - * sci_msq_queue_t msq : message queue identifier * - * void *msg : Location to store received data * - * unsigned int size : Size of message to read * - * unsigned int *sizeLeft: Bytes left in buffer, after current receive. This is * - * just a hint. There may be more. * - * * - * Flags * - * * - * SCIL_FLAG_ERROR_CHECK_PROT: The internal buffer management is done using full* - * error checking. - * * - * Specific error codes for this function: * - * * - * SCI_ERR_EWOULD_BLOCK : There is not enough data in the message buffer * - * to read the specified number of bytes. * - * . * - * SCI_ERR_NOT_CONNECTED : The connection is not established. * - * * - *********************************************************************************/ -#define SCILReceiveMsg _SCIL_EXPANDE_FUNCTION_NAME(SCILReceiveMsg) -DLL sci_error_t SCILReceiveMsg( - sci_msq_queue_t msq, - void *msg, - unsigned int size, - unsigned int *sizeLeft, - unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L S e n d M s g * - * * - * * - * Sends a message to the queue. * - * * - * Paremeters * - * * - * sci_msq_queue_t msq : Message queue identifier * - * void *msg : Send data * - * unsigned int size : Size of message to send * - * unsigned int *sizeFree: Bytes free in buffer, after current send. This is * - * just a hint. There may be more. * - * * - * Flags * - * * - * SCIL_FLAG_ERROR_CHECK_DATA: The data is transmitted using full error checking* - * SCIL_FLAG_ERROR_CHECK_PROT: The internal buffer management is done using full* - * error checking. * - * SCIL_FLSG_FULL_ERROR_CHECK: This flag is an combination of both above. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_EWOULD_BLOCK : There is not enough data in the message buffer * - * to send the specified number of bytes. * - * . * - * SCI_ERR_NOT_CONNECTED : The connection is not established. * - * * - *********************************************************************************/ -#define SCILSendMsg _SCIL_EXPANDE_FUNCTION_NAME(SCILSendMsg) -DLL sci_error_t SCILSendMsg( - sci_msq_queue_t msq, - void *msg, - unsigned int size, - unsigned int *sizeFree, - unsigned int flags); - - -/********************************************************************************* - * * - * S C I L R e m o v e M s g Q u e ue * - * * - * * - * Removes a message queue. * - * * - * sci_msq_queue_t msq : Message queue identifier * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCILRemoveMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILRemoveMsgQueue) -DLL sci_error_t SCILRemoveMsgQueue( - sci_msq_queue_t *msq, - unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L I n i t * - * * - * * - * Initializes the SCI library. This function must be called before any other * - * function in the library. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * . * - *********************************************************************************/ -#define SCILInit _SCIL_EXPANDE_FUNCTION_NAME(SCILInit) -DLL sci_error_t SCILInit(unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L D e s t r o y * - * * - * * - * Removes internal resources allocated by the SCI Library. No other library * - * function should be called after this function. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCILDestroy _SCIL_EXPANDE_FUNCTION_NAME(SCILDestroy) -DLL sci_error_t SCILDestroy(unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L C o n n e c t M s g Q u e u e * - * * - * * - * Makes a connection to a remote message queue. This must be done before * - * SCILSendMsg() is called. * - * * - * Parameters: * - * * - * sci_msq_queue_t *msq : Message queue identifier * - * unsigned int localAdapterNo: Local Adapter Number * - * unsigned int remoteNodeId : Remote nodeId * - * unsigned int msqId : Message queue number * - * unsigned int maxMsgCount : The maximum count of messages in queue * - * unsigned int maxMsgSize, : The maximum size of each messages in queue * - * unsigned int timeout : Time to wait for successful connection * - * unsigned int flags : Flags. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None. Normal SISIC error codes. * - * * - *********************************************************************************/ -#define SCILConnectMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILConnectMsgQueue) -DLL sci_error_t SCILConnectMsgQueue(sci_msq_queue_t *msq, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int rmsgId, - unsigned int maxMsgCount, - unsigned int maxMsgSize, - unsigned int timeout, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I L D i s c o n n e c t M s g Q u e u e * - * * - * * - * Disconnects from a remote message queue. * - * * - * Parameters: * - * * - * sci_msq_queue_t *msq : Message queue identifier * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCILDisconnectMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILDisconnectMsgQueue) -DLL sci_error_t SCILDisconnectMsgQueue(sci_msq_queue_t *msq, - unsigned int flags); - - - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - - - - - - - - - diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_api.h b/ndb/src/external/WIN32.x86/sci/include/sisci_api.h deleted file mode 100644 index 9f4a1ddffb3..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_api.h +++ /dev/null @@ -1,2217 +0,0 @@ -/* $Id: sisci_api.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ -/******************************************************************************* - * * - * Copyright (C) 1993 - 2001 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 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 Lesser 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. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_API_H -#define _SISCI_API_H - -#include "sisci_types.h" -#include "sisci_error.h" - - -#ifdef WIN32 -#ifdef API_DLL -#define DLL __declspec(dllexport) -#elif CLIENT_DLL -#define DLL __declspec(dllimport) -#endif -#endif /* WIN32 */ - - -#ifndef DLL -#define DLL -#endif - -#if defined(_REENTRANT) -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_MT_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_MT_ ## name -#else -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_ST_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_ST_ ## name -#endif -#define _SISCI_EXPANDE_CONSTANT_NAME(name) _SISCI_PUBLIC_CONST_ ## name - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCI_FLAG_FIXED_INTNO _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_INTNO) -extern const unsigned int SCI_FLAG_FIXED_INTNO; - -#define SCI_FLAG_SHARED_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_INT) -extern const unsigned int SCI_FLAG_SHARED_INT; - -#define SCI_FLAG_COUNTING_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_COUNTING_INT) -extern const unsigned int SCI_FLAG_COUNTING_INT; - -#define SCI_FLAG_FIXED_MAP_ADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_MAP_ADDR) -extern const unsigned int SCI_FLAG_FIXED_MAP_ADDR; - -#define SCI_FLAG_READONLY_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READONLY_MAP) -extern const unsigned int SCI_FLAG_READONLY_MAP; - -#define SCI_FLAG_USE_CALLBACK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_USE_CALLBACK) -extern const unsigned int SCI_FLAG_USE_CALLBACK; - -#define SCI_FLAG_BLOCK_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_BLOCK_READ) -extern const unsigned int SCI_FLAG_BLOCK_READ; - -#define SCI_FLAG_THREAD_SAFE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_THREAD_SAFE) -extern const unsigned int SCI_FLAG_THREAD_SAFE; - -#define SCI_FLAG_ASYNCHRONOUS_CONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ASYNCHRONOUS_CONNECT) -extern const unsigned int SCI_FLAG_ASYNCHRONOUS_CONNECT; - -#define SCI_FLAG_EMPTY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_EMPTY) -extern const unsigned int SCI_FLAG_EMPTY; - -#define SCI_FLAG_PRIVATE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_PRIVATE) -extern const unsigned int SCI_FLAG_PRIVATE; - -#define SCI_FLAG_FORCE_DISCONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FORCE_DISCONNECT) -extern const unsigned int SCI_FLAG_FORCE_DISCONNECT; - -#define SCI_FLAG_NOTIFY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NOTIFY) -extern const unsigned int SCI_FLAG_NOTIFY; - -#define SCI_FLAG_DMA_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_READ) -extern const unsigned int SCI_FLAG_DMA_READ; - -#define SCI_FLAG_DMA_POST _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_POST) -extern const unsigned int SCI_FLAG_DMA_POST; - -#define SCI_FLAG_DMA_WAIT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_WAIT) -extern const unsigned int SCI_FLAG_DMA_WAIT; - -#define SCI_FLAG_DMA_RESET _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_RESET) -extern const unsigned int SCI_FLAG_DMA_RESET; - -#define SCI_FLAG_NO_FLUSH _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_FLUSH) -extern const unsigned int SCI_FLAG_NO_FLUSH; - -#define SCI_FLAG_NO_STORE_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_STORE_BARRIER) -extern const unsigned int SCI_FLAG_NO_STORE_BARRIER; - -#define SCI_FLAG_FAST_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FAST_BARRIER) -extern const unsigned int SCI_FLAG_FAST_BARRIER; - -#define SCI_FLAG_ERROR_CHECK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ERROR_CHECK) -extern const unsigned int SCI_FLAG_ERROR_CHECK; - -#define SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) -extern const unsigned int SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY; - -/* the FLUSH_CPU_BUFFERS_ONLY flag is for backwards compabillity only and should never be used */ -#define FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) - -#define SCI_FLAG_LOCK_OPERATION _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_LOCK_OPERATION) -extern const unsigned int SCI_FLAG_LOCK_OPERATION; - -#define SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP; - -#define SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP; - -#define SCI_FLAG_IO_MAP_IOSPACE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_IO_MAP_IOSPACE) -extern const unsigned int SCI_FLAG_IO_MAP_IOSPACE; - -#define SCI_FLAG_DMOVE_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMOVE_MAP) -extern const unsigned int SCI_FLAG_DMOVE_MAP; - -#define SCI_FLAG_WRITES_DISABLE_GATHER_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_WRITES_DISABLE_GATHER_MAP) -extern const unsigned int SCI_FLAG_WRITES_DISABLE_GATHER_MAP; - -#define SCI_FLAG_DISABLE_128_BYTES_PACKETS _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DISABLE_128_BYTES_PACKETS) -extern const unsigned int SCI_FLAG_DISABLE_128_BYTES_PACKETS; - -#define SCI_FLAG_SHARED_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_MAP) -extern const unsigned int SCI_FLAG_SHARED_MAP; - -#define SCI_FLAG_DMA_SOURCE_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_SOURCE_ONLY) -extern const unsigned int SCI_FLAG_DMA_SOURCE_ONLY; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT_MAP; - -#define SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP; - -#define SCI_FLAG_NO_MEMORY_LOOPBACK_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_MEMORY_LOOPBACK_MAP) -extern const unsigned int SCI_FLAG_NO_MEMORY_LOOPBACK_MAP; - -#if defined(OS_IS_LYNXOS) || defined(OS_IS_VXWORKS) -#define SCI_FLAG_WRITE_BACK_CACHE_MAP _SISCI_EXPANDE_CONSTANT_NAME(WRITE_BACK_CACHE_MAP) -extern const unsigned int SCI_FLAG_WRITE_BACK_CACHE_MAP; -#endif - -#define SCI_FLAG_DMA_PHDMA _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_PHDMA) -extern const unsigned int SCI_FLAG_DMA_PHDMA; - -/*********************************************************************************/ -/* GENERAL VALUES */ -/*********************************************************************************/ -#define SCI_LOCAL_HOST _SISCI_EXPANDE_CONSTANT_NAME(SCI_LOCAL_HOST) -extern const unsigned int SCI_LOCAL_HOST; - -#define SCI_INFINITE_TIMEOUT _SISCI_EXPANDE_CONSTANT_NAME(SCI_INFINITE_TIMEOUT) -extern const unsigned int SCI_INFINITE_TIMEOUT; - -/*********************************************************************************/ -/* GENERAL ERROR CODES */ -/* */ -/* SCI_ERR_ILLEGAL_FLAG - Illegal flag value. */ -/* SCI_ERR_FLAG_NOT_IMPLEMENTED - Flag legal but flag feature not implemented. */ -/* SCI_ERR_NOT_IMPLEMENTED - Function not implemented. */ -/* SCI_ERR_SYSTEM - A system error. Check errno. */ -/* SCI_ERR_NOSPC - Unable to allocate OS resources. */ -/* SCI_ERR_API_NOSPC - Unable to allocate API resources. */ -/* SCI_ERR_HW_NOSPC - Unable to allocate HW resources (Hardware) */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "ADAPTER" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_ADAPTERNO - Adapter number is legal but does not exist. */ -/* SCI_ERR_ILLEGAL_ADAPTERNO - Illegal local adapter number (i.e. outside */ -/* legal range). */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "NODEID" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_NODEID - The remote adapter identified by nodeId does */ -/* not respond, but the intermediate link(s) */ -/* seem(s) to be operational. */ -/* SCI_ERR_ILLEGAL_NODEID - Illegal NodeId. */ -/* */ -/*********************************************************************************/ - - - -/********************************************************************************* - * * - * S C I I N I T I A L I Z E * - * * - * This function initializes the SISCI library. * - * The function must be called before SCIOpen(). * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCIInitialize _SISCI_EXPANDE_FUNCTION_NAME(SCIInitialize) -DLL void SCIInitialize(unsigned int flags, - sci_error_t *error); -#if 0 -unsigned int __Internal_SISCI_version_var; -#endif - -/********************************************************************************* - * * - * S C I T E R M I N A T E * - * * - * This function terminates the SISCI library. * - * The function must be called after SCIClose(). * - * * - * * - *********************************************************************************/ -#define SCITerminate _SISCI_EXPANDE_FUNCTION_NAME(SCITerminate) -DLL void SCITerminate(void); - -/********************************************************************************* - * * - * S C I O P E N * - * * - * * - * Opens a SCI virtual device. * - * Caller must supply a pointer to a variable of type sci_desc_t to be * - * initialized. * - * * - * Flags * - * SCI_FLAG_THREAD_SAFE - Operations on resources associated with this * - * descriptor will be performed in a multithread-safe * - * manner. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INCONSISTENT_VERSIONS - Inconsistency between the SISCI library * - * and the SISCI driver versions. * - * * - * * - *********************************************************************************/ -#define SCIOpen _SISCI_EXPANDE_FUNCTION_NAME(SCIOpen) -DLL void SCIOpen(sci_desc_t *sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C L O S E * - * * - * This function closes an open SCI virtual device. * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - All resources are not deallocated. * - * * - *********************************************************************************/ -#define SCIClose _SISCI_EXPANDE_FUNCTION_NAME(SCIClose) -DLL void SCIClose(sci_desc_t sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S E G M E N T * - * * - * Connects to a remote shared memory segment located at <nodeId> with the * - * identifier <segmentId>. * - * The user may then call SCIMapRemoteSegment() to map shared memory * - * into user space. * - * * - * Flags * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_ASYNCHRONOUS_CONNECT * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_SEGMENT - Could not find the remote segment with the * - * given segmentId. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIConnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSegment) -DLL void SCIConnectSegment(sci_desc_t sd, - sci_remote_segment_t *segment, - unsigned int nodeId, - unsigned int segmentId, - unsigned int localAdapterNo, - sci_cb_remote_segment_t callback, - void *callbackArg, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T S E G M E N T * - * * - * Disconnects from the give mapped shared memory segment * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The segment is currently mapped or in use. * - * * - *********************************************************************************/ -#define SCIDisconnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectSegment) -DLL void SCIDisconnectSegment(sci_remote_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T R E M O T E S E G M E N T S I Z E * - * * - *********************************************************************************/ -#define SCIGetRemoteSegmentSize _SISCI_EXPANDE_FUNCTION_NAME(SCIGetRemoteSegmentSize) -DLL unsigned int SCIGetRemoteSegmentSize(sci_remote_segment_t segment); - - - -/********************************************************************************* - * * - * S C I W A I T F O R R E M O T E S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du * - * to a SCIDisconnectSegment() on the same * - * handle. The handle is invalid when this * - * error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForRemoteSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForRemoteSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForRemoteSegmentEvent( - sci_remote_segment_t segment, - sci_error_t *status, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P R E M O T E S E G M E N T * - * * - * This function is used to include a shared memory segment in the virtual * - * address space of the application. * - * * - * Flags: * - * * - * SCI_FLAG_SHARED_MAP - The low level physical map may be shared by * - * other applications. * - * * - * SCI_FLAG_FIXED_MAP_ADDR - Map at the suggested virtual address * - * SCI_FLAG_READONLY_MAP - The segment is mapped in read-only mode * - * SCI_FLAG_LOCK_OPERATION - Enable Lock operations (fetch and add) * - * SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP * - * - Enable aggressive prefetch with speculative * - * hold. * - * * - * SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP * - * - The PSB66 will prefetch 64 bytes. As soon * - * as the PCI read retry has been accepted, * - * the stream will change state to FREE, even * - * if less than 64 bytes were actually read. * - * * - * SCI_FLAG_IO_MAP_IOSPACE - Enable No Prefetch, no speculative hold. * - * * - * SCI_FLAG_DMOVE_MAP - Enable DMOVE packet type. The stream will be * - * set into FREE state immediately. * - * * - * SCI_FLAG_WRITES_DISABLE_GATHER_MAP * - * - Disable use of gather. * - * * - * SCI_FLAG_DISABLE_128_BYTES_PACKETS * - * - Disable use of 128-Byte packets * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an atomic "fetch-and-add-one" operation on * - * remote memory, but in addition an interrupt * - * will be generated if the target memory * - * location contained a "null value" before the * - * add operation was carried out. * - * The conditional interrupt flag must also be * - * specified in the SCIRegisterInterruptFlag() * - * function. * - * * - * SCI_FLAG_UNCONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an interrupt for the remote adapter * - * "in addition to" updating the corresponding * - * remote memory location with the data being * - * written. * - * The unconditional interrupt flag must also * - * be specified in the * - * SCIRegisterInterruptFlag() function. * - * * - * SCI_FLAG_WRITE_BACK_CACHE_MAP * - * - Enable cacheing of the mapped region. * - * Writes through this map will be written to a * - * write back cache, hence no remote SCI updates* - * until the cache line is flushed. The * - * application is responsible for the cache * - * flush operation. * - * The SCImemCopy() function will handle this * - * correctly by doing cache flushes internally. * - * This feature is architechture dependent and * - * not be available on all plattforms. * - * * - * SCI_FLAG_NO_MEMORY_LOOPBACK_MAP * - * - Forces a map to a remote segment located * - * in the local machine to be mapped using * - * SCI loopback. This is useful i.e. if you * - * want to use a regular map access to be * - * serialized with lock operations. * - * The default behaviour is to access a remte * - * segment located in the local machine as a * - * local MMU operation. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapRemoteSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapRemoteSegment) -DLL volatile void *SCIMapRemoteSegment( - sci_remote_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P L O C A L S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_FIXED_MAP_ADDR * - * SCI_FLAG_READONLY_MAP * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapLocalSegment) -DLL void *SCIMapLocalSegment(sci_local_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I U N M A P S E G M E N T * - * * - * This function unmaps pages of shared memory from the callers virtual * - * address space. * - * * - * Flags * - * None. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The map is currently in use. * - * * - *********************************************************************************/ -#define SCIUnmapSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIUnmapSegment) -DLL void SCIUnmapSegment(sci_map_t map, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E S E G M E N T * - * * - * Make the specified segment available for connections via the specified * - * adapter. If successful, the segment can be accessed from remote nodes * - * via the specified adapter. * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events * - * on this segment. * - * SCI_FLAG_EMPTY - No memory will be allocated for the segment. * - * SCI_FLAG_PRIVATE - The segment will be private meaning it will never * - * be any connections to it. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SEGMENTID_USED - The segment with this segmentId is already used * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * * - *********************************************************************************/ -#define SCICreateSegment _SISCI_EXPANDE_FUNCTION_NAME(SCICreateSegment) -DLL void SCICreateSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I W A I T F O R L O C A L S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du to a * - * SCIRemoveSegment() on the same handle. * - * The handle is invalid when this error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForLocalSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForLocalSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForLocalSegmentEvent( - sci_local_segment_t segment, - unsigned int *sourcenodeId, - unsigned int *localAdapterNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P R E P A R E S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_DMA_SOURCE_ONLY - The segment will be used as a source segment * - * for DMA operations. On some system types this * - * will enable the SISCI driver to use performance * - * improving features. * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIPrepareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIPrepareSegment) -DLL void SCIPrepareSegment(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E G M E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - Unable to remove the segment. The segment is currently * - * in use. * - * * - *********************************************************************************/ -#define SCIRemoveSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSegment) -DLL void SCIRemoveSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T A V A I L A B L E * - * * - * Flags * - * None. * - * * - * * - * SCI_ERR_SEGMENT_NOT_PREPARED - The segment has not been prepared for access * - * from this adapter. * - * SCI_ERR_ILLEGAL_OPERATION - The segment is created with the * - * SCI_FLAG_PRIVATE flag specified and * - * therefore has no segmentId. * - * * - *********************************************************************************/ -#define SCISetSegmentAvailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentAvailable) -DLL void SCISetSegmentAvailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T U N A V A I L A B L E * - * * - * Flags * - * * - * SCI_FLAG_FORCE_DISCONNECT * - * SCI_FLAG_NOTIFY * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * * - *********************************************************************************/ -#define SCISetSegmentUnavailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentUnavailable) -DLL void SCISetSegmentUnavailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E M A P S E Q U E N C E * - * * - * Flags: * - * * - * SCI_FLAG_FAST_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateMapSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICreateMapSequence) -DLL void SCICreateMapSequence(sci_map_t map, - sci_sequence_t *sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E Q U E N C E * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSequence) -DLL void SCIRemoveSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T A R T S E Q U E N C E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIStartSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIStartSequence) -DLL sci_sequence_status_t SCIStartSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I C H E C K S E Q U E N CE * - * * - * Flags * - * * - * SCI_FLAG_NO_FLUSH * - * SCI_FLAG_NO_STORE_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICheckSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICheckSequence) -DLL sci_sequence_status_t SCICheckSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T O R E B A R R I E R * - * * - * Flags * - * None. * - * * - * * - * * - *********************************************************************************/ -#define SCIStoreBarrier _SISCI_EXPANDE_FUNCTION_NAME(SCIStoreBarrier) -DLL void SCIStoreBarrier(sci_sequence_t sequence, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I F L U S H R E A D B U F F E R S * - * * - *********************************************************************************/ -#define SCIFlushReadBuffers _SISCI_EXPANDE_FUNCTION_NAME(SCIFlushReadBuffers) -DLL void SCIFlushReadBuffers(sci_sequence_t sequence); - - - - -/********************************************************************************* - * * - * S C I P R O B E N O D E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIProbeNode _SISCI_EXPANDE_FUNCTION_NAME(SCIProbeNode) -DLL int SCIProbeNode(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int nodeId, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIGetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCIGetCSRRegister) -DLL unsigned int SCIGetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCISetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCISetCSRRegister) -DLL void SCISetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I G E T L O C A L C S R * - * * - * SISCI Priveleged function * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIGetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCIGetLocalCSR) -DLL unsigned int SCIGetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T L O C A L C S R * - * * - * SISCI Priveleged function - * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCISetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCISetLocalCSR) -DLL void SCISetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A T T A C H P H Y S I C A L M E M O R Y * - * * - * SISCI Priveleged function * - * * - * Description: * - * * - * This function enables usage of physical devices and memory regions where the * - * Physical PCI bus address ( and mapped CPU address ) are already known. * - * The function will register the physical memory as a SISCI segment which can * - * be connected and mapped as a regular SISCI segment. * - * * - * Requirements: * - * * - * SCICreateSegment() with flag SCI_FLAG_EMPTY must have been called in advance * - * * - * Parameter description: * - * sci_ioaddr_t ioaddress : This is the address on the PCI bus that a PCI bus * - * master has to use to write to the specified memory * - * void * address : This is the (mapped) virtual address that the * - * application has to use to access the device. * - * This means that the device has to be mapped in * - * advance bye the devices own driver. * - * If the device is not to be accessed by the local * - * CPU, the address pointer shold be set to NULL * - * Flags * - * * - * None * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIAttachPhysicalMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachPhysicalMemory) -DLL void SCIAttachPhysicalMemory(sci_ioaddr_t ioaddress, - void *address, - unsigned int busNo, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I Q U E R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_QUERY - Unrecognized command. * - * * - *********************************************************************************/ -#define SCIQuery _SISCI_EXPANDE_FUNCTION_NAME(SCIQuery) -DLL void SCIQuery(unsigned int command, - void *data, - unsigned int flags, - sci_error_t *error); - - -/* MAJOR QUERY COMMANDS */ - -/* This command requires a pointer to a structure of type */ -/* "sci_query_string". The string will be filled in by the query. */ -#define SCI_Q_VENDORID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_VENDORID) -extern const unsigned int SCI_Q_VENDORID; - - -/* Same as for SCI_VENDOR_ID */ -#define SCI_Q_API _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_API) -extern const unsigned int SCI_Q_API; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_adapter" struct. */ -#define SCI_Q_ADAPTER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER) -extern const unsigned int SCI_Q_ADAPTER; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_system" struct. */ -#define SCI_Q_SYSTEM _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM) -extern const unsigned int SCI_Q_SYSTEM; - -#define SCI_Q_LOCAL_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT) -extern const unsigned int SCI_Q_LOCAL_SEGMENT; - -#define SCI_Q_REMOTE_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT) -extern const unsigned int SCI_Q_REMOTE_SEGMENT; - -#define SCI_Q_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP) -extern const unsigned int SCI_Q_MAP; - -typedef char* sci_semaphoreId_t; - -#ifdef WIN32 -struct _semaphoreid { - char *semaphoreName; -}; -#endif /*WIN32*/ - -typedef struct { - char *str; /* Pointer to a string of minimum "length" characters */ - unsigned int length; -} sci_query_string_t; - - -typedef struct { - unsigned int localAdapterNo; /* The adapter no. that the query concern. */ - unsigned int portNo; /* The SCI Link port number that the query concern. */ - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_adapter_t; - - -typedef struct { - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_system_t; - -typedef struct { - sci_local_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_local_segment_t; - -typedef struct { - sci_remote_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_remote_segment_t; - -typedef struct { - sci_map_t map; - unsigned int subcommand; - unsigned int data; -} sci_query_map_t; - -/* Minor query commands (sub-commands) for adapter specific information SCI_ADAPTER */ -#define SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_MTU _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_MTU) -extern const unsigned int SCI_Q_ADAPTER_DMA_MTU; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE; - -#define SCI_Q_ADAPTER_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NODEID) -extern const unsigned int SCI_Q_ADAPTER_NODEID; - -#define SCI_Q_ADAPTER_SERIAL_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SERIAL_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_SERIAL_NUMBER; - -#define SCI_Q_ADAPTER_CARD_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CARD_TYPE) -extern const unsigned int SCI_Q_ADAPTER_CARD_TYPE; - -#define SCI_Q_ADAPTER_NUMBER_OF_STREAMS _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER_OF_STREAMS) -extern const unsigned int SCI_Q_ADAPTER_NUMBER_OF_STREAMS; - -#define SCI_Q_ADAPTER_STREAM_BUFFER_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_STREAM_BUFFER_SIZE) -extern const unsigned int SCI_Q_ADAPTER_STREAM_BUFFER_SIZE; - -#define SCI_Q_ADAPTER_CONFIGURED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONFIGURED) -extern const unsigned int SCI_Q_ADAPTER_CONFIGURED; - -#define SCI_Q_ADAPTER_LINK_OPERATIONAL _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LINK_OPERATIONAL) -extern const unsigned int SCI_Q_ADAPTER_LINK_OPERATIONAL; - -#define SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK) -extern const unsigned int SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK; - -#define SCI_Q_ADAPTER_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_NUMBER; - -#define SCI_Q_ADAPTER_INSTANCE_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_INSTANCE_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_INSTANCE_NUMBER; - -#define SCI_Q_ADAPTER_FIRMWARE_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_FIRMWARE_OK) -extern const unsigned int SCI_Q_ADAPTER_FIRMWARE_OK; - -#define SCI_Q_ADAPTER_CONNECTED_TO_SWITCH _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_SWITCH) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_SWITCH; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER; - -#define SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT; - -#define SCI_Q_ADAPTER_ATT_PAGE_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_PAGE_SIZE) -extern const unsigned int SCI_Q_ADAPTER_ATT_PAGE_SIZE; - -#define SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES; - -#define SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES; - -#define SCI_Q_ADAPTER_PHYS_MEM_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MEM_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MEM_NODEID; - -#define SCI_Q_ADAPTER_PHYS_MBX_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MBX_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MBX_NODEID; - -#define SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID; - -#define SCI_Q_ADAPTER_SCI_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SCI_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_SCI_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_B_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_B_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_B_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_IO_BUS_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_IO_BUS_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_IO_BUS_FREQUENCY; - -/* Minor query commands (sub-commands) for adapter specific information SCI_SYSTEM */ -#define SCI_Q_SYSTEM_HOSTBRIDGE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_HOSTBRIDGE) -extern const unsigned int SCI_Q_SYSTEM_HOSTBRIDGE; - -#define SCI_Q_SYSTEM_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_POSTING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_POSTING_ENABLED; - -#define SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED; - -#define SCI_Q_LOCAL_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_LOCAL_SEGMENT_IOADDR; - -#define SCI_Q_REMOTE_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_REMOTE_SEGMENT_IOADDR; - -#define SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET; - -#define SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET; - -#define HOSTBRIDGE_NOT_AVAILABLE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_NOT_AVAILABLE) -extern const unsigned int HOSTBRIDGE_NOT_AVAILABLE; - -#define HOSTBRIDGE_UNKNOWN _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_UNKNOWN) -extern const unsigned int HOSTBRIDGE_UNKNOWN; - -#define HOSTBRIDGE_440FX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440FX) -extern const unsigned int HOSTBRIDGE_440FX; - -#define HOSTBRIDGE_440LX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440LX) -extern const unsigned int HOSTBRIDGE_440LX; - -#define HOSTBRIDGE_440BX_A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_A) -extern const unsigned int HOSTBRIDGE_440BX_A; - -#define HOSTBRIDGE_440BX_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_B) -extern const unsigned int HOSTBRIDGE_440BX_B; - -#define HOSTBRIDGE_440GX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440GX) -extern const unsigned int HOSTBRIDGE_440GX; - -#define HOSTBRIDGE_450KX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450KX) -extern const unsigned int HOSTBRIDGE_450KX; - -#define HOSTBRIDGE_430NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_430NX) -extern const unsigned int HOSTBRIDGE_430NX; - -#define HOSTBRIDGE_450NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX) -extern const unsigned int HOSTBRIDGE_450NX; - -#define HOSTBRIDGE_450NX_MICO _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_MICO) -extern const unsigned int HOSTBRIDGE_450NX_MICO; - -#define HOSTBRIDGE_450NX_PXB _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_PXB) -extern const unsigned int HOSTBRIDGE_450NX_PXB; - -#define HOSTBRIDGE_I810 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810) -extern const unsigned int HOSTBRIDGE_I810; - -#define HOSTBRIDGE_I810_DC100 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810_DC100) -extern const unsigned int HOSTBRIDGE_I810_DC100; - -#define HOSTBRIDGE_I810E _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810E) -extern const unsigned int HOSTBRIDGE_I810E; - -#define HOSTBRIDGE_I815 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I815) -extern const unsigned int HOSTBRIDGE_I815; - -#define HOSTBRIDGE_I840 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I840) -extern const unsigned int HOSTBRIDGE_I840; - -#define HOSTBRIDGE_I850 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I850) -extern const unsigned int HOSTBRIDGE_I850; - -#define HOSTBRIDGE_I860 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I860) -extern const unsigned int HOSTBRIDGE_I860; - -#define HOSTBRIDGE_INTEL_E7500 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_INTEL_E7500) -extern const unsigned int HOSTBRIDGE_INTEL_E7500; - -#define HOSTBRIDGE_VIA_KT133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KT133) -extern const unsigned int HOSTBRIDGE_VIA_KT133; - -#define HOSTBRIDGE_VIA_KX133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KX133) -extern const unsigned int HOSTBRIDGE_VIA_KX133; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_133A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_133A) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_133A; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_266 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_266) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_266; - -#define HOSTBRIDGE_AMD_760_MP _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_760_MP) -extern const unsigned int HOSTBRIDGE_AMD_760_MP; - -#define HOSTBRIDGE_AMD_HAMMER _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_HAMMER) -extern const unsigned int HOSTBRIDGE_AMD_HAMMER; - -#define HOSTBRIDGE_SERVERWORKS_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE; - -#define HOSTBRIDGE_SERVERWORKS_HE_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE_B) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE_B; - -#define HOSTBRIDGE_SERVERWORKS_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_HE; - -#define HOSTBRIDGE_SERVERWORKS_GC_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_WS _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_WS) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_WS; - -#define HOSTBRIDGE_SERVERWORKS_GC_SL _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_SL) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_SL; - - -#define HOSTBRIDGE_WRITE_POSTING_DISABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_DISABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_DISABLED; - -#define HOSTBRIDGE_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_ENABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_ENABLED; - - - - -/********************************************************************************* - * * - * S C I C R E A T E D M A Q U E U E * - * * - * Flags * - * * - * SCI_FLAG_DMA_PHDMA : Create physical DMA queue. Please note that this is an * - * priveleged operation. * - * * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCICreateDMAQueue) -DLL void SCICreateDMAQueue(sci_desc_t sd, - sci_dma_queue_t *dq, - unsigned int localAdapterNo, - unsigned int maxEntries, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Not allowed in this queue state. * - * * - *********************************************************************************/ -#define SCIRemoveDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveDMAQueue) -DLL void SCIRemoveDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I E N Q U E U E D M A T R A N S F E R * - * * - * Flags: * - * * - * SCI_FLAG_DMA_READ - The DMA will be remote --> local * - * (default is local --> remote) * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is larger * - * than the segment size or larger than max * - * DMA size. * - * SCI_ERR_MAX_ENTRIES - The DMA queue is full * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_SEGMENT_NOT_PREPARED - The local segment has not been prepared for * - * access from the adapter associated with the * - * queue. * - * SCI_ERR_SEGMENT_NOT_CONNECTED - The remote segment is not connected through * - * the adapter associated with the queue. * - *********************************************************************************/ -#define SCIEnqueueDMATransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIEnqueueDMATransfer) -DLL sci_dma_queue_state_t SCIEnqueueDMATransfer(sci_dma_queue_t dq, - sci_local_segment_t localSegment, - sci_remote_segment_t remoteSegment, - unsigned int localOffset, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P O S T D M A Q U E U E * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The end of the transfer will cause the callback * - * function to be invoked. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIPostDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIPostDMAQueue) -DLL void SCIPostDMAQueue(sci_dma_queue_t dq, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortDMAQueue) -DLL void SCIAbortDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I R E S E T D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIResetDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIResetDMAQueue) -DLL void SCIResetDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I D M A Q U E U E S T A T E * - * * - *********************************************************************************/ -#define SCIDMAQueueState _SISCI_EXPANDE_FUNCTION_NAME(SCIDMAQueueState) -DLL sci_dma_queue_state_t SCIDMAQueueState(sci_dma_queue_t dq); - - - -/********************************************************************************* - * * - * S C I W A I T F O R D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForDMAQueue) -DLL sci_dma_queue_state_t SCIWaitForDMAQueue(sci_dma_queue_t dq, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I P H D M A E N Q U E U E * - * * - * SISCI Priveleged function * - * * - * Flags * - * * - * SCI_FLAG_DMA_READ * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaEnqueue _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaEnqueue) -DLL void SCIphDmaEnqueue(sci_dma_queue_t dmaqueue, - unsigned int size, - sci_ioaddr_t localBusAddr, - unsigned int remote_nodeid, - unsigned int remote_highaddr, - unsigned int remote_lowaddr, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I P H D M A S T A R T * - * * - * Flags * - * * - * SCI_FLAG_DMA_WAIT * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_DMA_RESET * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaStart _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaStart) -DLL sci_dma_queue_state_t SCIphDmaStart(sci_dma_queue_t dmaqueue, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - -#ifdef WIN32 -/********************************************************************************* - * * - * S C I C R E A T E N A M E D I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateNamedInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateNamedInterrupt) -DLL void SCICreateNamedInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_semaphoreId_t semId, - sci_error_t *error); -#endif /*WIN32*/ - -/********************************************************************************* - * * - * S C I C R E A T E I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * SCI_FLAG_COUNTING_INT: This flag will enable counting interrupts. This means * - * that the number of trigged interrupts is equal to the * - * number of received interrupts. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateInterrupt) -DLL void SCICreateInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveInterrupt) -DLL void SCIRemoveInterrupt(sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I W A I T F O R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait was interrupted by a call to * - * SCIRemoveInterrupt. * - * The handle is invalid when this error code is returned.* - * * - *********************************************************************************/ -#define SCIWaitForInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForInterrupt) -DLL void SCIWaitForInterrupt(sci_local_interrupt_t interrupt, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_COUNTING_INT: This flag will enable counting interrupts. This means * - * that the number of trigged interrupts is equal to the * - * number of received interrupts. * - * if SCI_FLAG_COUNTING_INT is not used, the interface * - * guarentees that there always will be an remote * - * interrupt generated after the first and after the last* - * trigger. If interupts is triggered faster than the * - * remote interrupt handler can handle, interrupts may be* - * lost. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_INTNO - No such interrupt number. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIConnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectInterrupt) -DLL void SCIConnectInterrupt(sci_desc_t sd, - sci_remote_interrupt_t *interrupt, - unsigned int nodeId, - unsigned int localAdapterNo, - unsigned int interruptNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisconnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectInterrupt) -DLL void SCIDisconnectInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I T R I G G E R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCITriggerInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCITriggerInterrupt) -DLL void SCITriggerInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I R E G I S T E R I N T E R R U P T F L A G * - * * - * * - * This function register an "interrupt flag" that is identified as an unique * - * location within a local segment. If successful, the resulting interrupt * - * handle will have been associated with the specified local segment. * - * * - * It is up to the (remote) client(s) to set up an "interrupt mapping" for the * - * corresponding segment offset using either the * - * * - * - SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * * - * or the * - * * - * - SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP * - * * - * option to "SCIMapRemoteSegment()". - I.e. after having established a * - * connection to the corresponding segment. A trigger operation can then * - * be implemented using a store operation via the relevant "interrupt map". * - * * - * * - * * - * * - * * - * Flags: * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT - Triggering is to take place using * - * "conditional interrupts". * - * * - * * - * * - * Specific error codes for this function: * - * None. * - * * - *********************************************************************************/ -#define SCIRegisterInterruptFlag _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterInterruptFlag) -DLL void SCIRegisterInterruptFlag( - unsigned int localAdapterNo, - sci_local_interrupt_t *interrupt, - sci_local_segment_t segment, - unsigned int offset, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I E N A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * This function make sure that another HW interrupt will take place the next * - * time the corresponding interrupt flag is triggered by a * - * "conditional interrupt" operation. * - * * - * Default semantics: * - * * - * When successful, the client can rely on that the first subsequent trigger * - * operation will cause a HW interrupt and subsequently cause the client * - * handler function to be invoked. * - * * - * If an interrupt was triggered in parallell with the enable operation, then * - * the operation will fail (SCI_ERR_COND_INT_RACE_PROBLEM), and the client can * - * not rely on another trigger operation will lead to handler invocation. * - * Hence, any state checking normally associated with handling the * - * corresponding interrupt should take place before attempting to enable * - * again. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_COND_INT_RACE_PROBLEM - The enable operation failed because an * - * incomming trigger operation happened * - * concurrently. * - * * - *********************************************************************************/ -#define SCIEnableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIEnableConditionalInterrupt) -DLL void SCIEnableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I D I S A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * Prevent subsequent "conditional interrupt"trigger operations for * - * the specified interupt flag from causing HW interrupt and handler * - * invocations. * - * * - * * - * Default semantics: * - * * - * If successful, no subsequent HW interrupts will take place, but handler * - * invocations that have already been scheduled may still take place. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisableConditionalInterrupt) -DLL void SCIDisableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C O N D I T I O N A L I N T E R R U P T C O U N T E R * - * * - * * - * Returns a value that indicates the number of times this flag has * - * been trigged since the last time it was enabled or disabled. * - * Calling the SCIEnableConditionalInterrupt / SCIDisableConditionalInterrupt * - * functions will reset the counter value. * - * * - * Default semantics: * - * * - * If successful, the current trig count is returned in the * - * interruptTrigCounter parameter. * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OVERFLOW - The number of trig operations have exceeded the range * - * that can be counted. * - *********************************************************************************/ -#define SCIGetConditionalInterruptTrigCounter _SISCI_EXPANDE_FUNCTION_NAME(SCIGetConditionalInterruptTrigCounter) -DLL void SCIGetConditionalInterruptTrigCounter( - sci_local_interrupt_t interrupt, - unsigned int *interruptTrigCounter, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlock _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlock) -DLL void SCITransferBlock(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K A S Y N C * - * * - * Flags * - * * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_USE_CALLBACK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger than * - * the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlockAsync _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlockAsync) -DLL void SCITransferBlockAsync(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - sci_block_transfer_t *block, - sci_cb_block_transfer_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForBlockTransfer) -DLL void SCIWaitForBlockTransfer(sci_block_transfer_t block, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortBlockTransfer) -DLL void SCIAbortBlockTransfer(sci_block_transfer_t block, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M E M C P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - -#define SCIMemCpy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCpy) -DLL void SCIMemCpy(sci_sequence_t sequence, - void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I M E M C O P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - - -#define SCIMemCopy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCopy) -DLL void SCIMemCopy(void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E G I S T E R S E G M E N T M E M O R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_ILLEGAL_ADDRESS - Illegal address. * - * SCI_ERR_OUT_OF_RANGE - Size is larger than the maximum size for the * - * local segment. * - * * - *********************************************************************************/ -#define SCIRegisterSegmentMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterSegmentMemory) -DLL void SCIRegisterSegmentMemory(void *address, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S C I S P A C E * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * * - *********************************************************************************/ -#define SCIConnectSCISpace _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSCISpace) -DLL void SCIConnectSCISpace(sci_desc_t sd, - unsigned int localAdapterNo, - sci_remote_segment_t *segment, - sci_address_t address, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/* - * ===================================================================================== - * - * S C I A T T A C H L O C A L S E G M E N T - * Description: - * - * SCIAttachLocalSegment() permits an application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events - * on this segment. - * - * - * Specific error codes for this function: - * - * SCI_ERR_ACCESS - No such shared segment - * SCI_ERR_NO_SUCH_SEGMENT - No such segment - * Note: Current implenentation will return SCI_ERR_ACCESS for both cases. This will - * change from next release. Application should handle both cases. - * - * ===================================================================================== - */ -#define SCIAttachLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachLocalSegment) - -DLL void -SCIAttachLocalSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int *size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); -/* - * ===================================================================================== - * - * S C I S H A R E S E G M E N T - * - * Description: - * - * SCIShareSegment() permits other application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * none - * - * Specific error codes for this function: - * - * - * - * ===================================================================================== - */ -#define SCIShareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIShareSegment) - -DLL void -SCIShareSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I F L U S H * - * * - * This function will flush the CPU buffers and the PSB buffers. * - * * - * Flags * - * SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY : * - * Only flush CPU buffers ( Write combining * - * etc buffers). * - * * - *********************************************************************************/ - -#define SCIFlush _SISCI_EXPANDE_FUNCTION_NAME(SCIFlush) -DLL void SCIFlush(sci_sequence_t sequence, - unsigned int flags); - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - -#endif - - - - - - - - - - - diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h b/ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h deleted file mode 100644 index ce5bb2aec8e..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h +++ /dev/null @@ -1,226 +0,0 @@ -/* $Id: sisci_demolib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_DEMOLIB_H -#define _SISCI_DEMOLIB_H - - -#if defined(_REENTRANT) - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_MT_ ## name - -#else - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_ST_ ## name - -#endif - -/*********************************************************************************/ -/* Q U E R Y A D A P T E R */ -/* */ -/*********************************************************************************/ - -#define QueryAdapter _SISCI_DEMOLIB_EXPAND_NAME(QueryAdapter) - -sci_error_t QueryAdapter( - unsigned int subcommand, - unsigned int localAdapterNo, - unsigned int portNo, - unsigned int *data); - - -/*********************************************************************************/ -/* Q U E R Y S Y S T E M */ -/* */ -/*********************************************************************************/ - -#define QuerySystem _SISCI_DEMOLIB_EXPAND_NAME(QuerySystem) - -sci_error_t QuerySystem( - unsigned int subcommand, - unsigned int *data); - - -/*********************************************************************************/ -/* D E T E C T F I R S T A D A P T E R C A R D */ -/* */ -/*********************************************************************************/ - -#define DetectFirstAdapterCard _SISCI_DEMOLIB_EXPAND_NAME(DetectFirstAdapterCard) - -sci_error_t DetectFirstAdapterCard( - unsigned int *localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetAdapterType _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterType) - -sci_error_t GetAdapterType(unsigned int localAdapterNo, - unsigned int *adapterType); - - -/*********************************************************************************/ -/* G E T L O C A L N O D E I D */ -/* */ -/*********************************************************************************/ - -#define GetLocalNodeId _SISCI_DEMOLIB_EXPAND_NAME(GetLocalNodeId) - -sci_error_t GetLocalNodeId( - unsigned int localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R S E R I A L N U M B E R */ -/* */ -/*********************************************************************************/ - -#define GetAdapterSerialNumber _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterSerialNumber) - -sci_error_t GetAdapterSerialNumber( - unsigned int localAdapterNo, - unsigned int *serialNo); - - - -/*********************************************************************************/ -/* G E T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(GetHostbridgeType) - -sci_error_t GetHostbridgeType(unsigned int *hostbridgeType); - - - -/*********************************************************************************/ -/* P R I N T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define PrintHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(PrintHostbridgeType) - -void PrintHostbridgeType(unsigned int hostbridge); - - - -/*********************************************************************************/ -/* G E T A P I V E R S I O N S T R I N G */ -/* */ -/*********************************************************************************/ - -#define GetAPIVersionString _SISCI_DEMOLIB_EXPAND_NAME(GetAPIVersionString) - -sci_error_t GetAPIVersionString(char str[], unsigned int strLength); - - - -/*********************************************************************************/ -/* G E T A D A P T E R I O B U S F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterIoBusFrequency(unsigned int localAdapterNo, - unsigned int *ioBusFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R S C I L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterSciLinkFrequency(unsigned int localAdapterNo, - unsigned int *sciLinkFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R B L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterBlinkFrequency(unsigned int localAdapterNo, - unsigned int *bLinkFrequency); - - -/*********************************************************************************/ -/* S E N D I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define SendInterrupt _SISCI_DEMOLIB_EXPAND_NAME(SendInterrupt) - -sci_error_t SendInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int remoteNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* R E C E I V E I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define ReceiveInterrupt _SISCI_DEMOLIB_EXPAND_NAME(ReceiveInterrupt) - -sci_error_t ReceiveInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* E N D I A N S W A P */ -/* */ -/*********************************************************************************/ - -#define EndianSwap _SISCI_DEMOLIB_EXPAND_NAME(EndianSwap) - -unsigned int EndianSwap (unsigned int value); - - -/*********************************************************************************/ -/* S L E E P M I L L I S E C O N D S */ -/* */ -/*********************************************************************************/ - -#define SleepMilliseconds _SISCI_DEMOLIB_EXPAND_NAME(SleepMilliseconds) - -void SleepMilliseconds(int milliseconds); - - - - -#endif diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_error.h b/ndb/src/external/WIN32.x86/sci/include/sisci_error.h deleted file mode 100644 index 56fa0d18b3a..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_error.h +++ /dev/null @@ -1,94 +0,0 @@ -/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - - - -#ifndef _SISCI_ERROR_H_ -#define _SISCI_ERROR_H_ - - -/* SCI Error return values always have 30 bit set */ -#define SCI_ERR_MASK 0x40000000 -#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */ - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) - -/* Error codes */ -typedef enum { - SCI_ERR_OK = 0x000, - - - SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK), - SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK), - SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK), - SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK), - SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK), - SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK), - SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK), - SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK), - SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK), - SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK), - SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK), - SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK), - SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK), - SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK), - SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK), - SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK), - SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK), - SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK), - SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK), - SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK), - SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK), - - SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK), - - SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK), - SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK), - SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK), - SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK), - SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK), - - SCI_ERR_EWOULD_BLOCK = ( 0xB00 | SCI_ERR_MASK), - SCI_ERR_SEMAPHORE_COUNT_EXCEEDED = ( 0xB01 | SCI_ERR_MASK), - SCI_ERR_IRQL_ILLEGAL = ( 0xB02 | SCI_ERR_MASK) - -} sci_error_t; - - -#endif /* _SCI_ERROR_H_ */ - - - diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_types.h b/ndb/src/external/WIN32.x86/sci/include/sisci_types.h deleted file mode 100644 index 03e7957c3f2..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * 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. * - * * - * * - *******************************************************************************/ - - -#ifndef _SISCI_TYPES_H -#define _SISCI_TYPES_H - -#include "sisci_error.h" - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef IN_OUT -#define IN_OUT -#endif - -/* Opaque data types for descriptors/handles */ -typedef struct sci_desc *sci_desc_t; -typedef struct sci_local_segment *sci_local_segment_t; -typedef struct sci_remote_segment *sci_remote_segment_t; - -typedef struct sci_map *sci_map_t; -typedef struct sci_sequence *sci_sequence_t; -#ifndef KERNEL -typedef struct sci_dma_queue *sci_dma_queue_t; -#endif -typedef struct sci_remote_interrupt *sci_remote_interrupt_t; -typedef struct sci_local_interrupt *sci_local_interrupt_t; -typedef struct sci_block_transfer *sci_block_transfer_t; - -/* - * Constants defining reasons for segment callbacks: - */ - -typedef enum { - SCI_CB_CONNECT = 1, - SCI_CB_DISCONNECT, - SCI_CB_NOT_OPERATIONAL, - SCI_CB_OPERATIONAL, - SCI_CB_LOST -} sci_segment_cb_reason_t; - -#define MAX_CB_REASON SCI_CB_LOST - -/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/ -typedef enum { - SCI_DMAQUEUE_IDLE, - SCI_DMAQUEUE_GATHER, - SCI_DMAQUEUE_POSTED, - SCI_DMAQUEUE_DONE, - SCI_DMAQUEUE_ABORTED, - SCI_DMAQUEUE_ERROR -} sci_dma_queue_state_t; - - -typedef enum { - SCI_SEQ_OK, - SCI_SEQ_RETRIABLE, - SCI_SEQ_NOT_RETRIABLE, - SCI_SEQ_PENDING -} sci_sequence_status_t; - - -typedef struct { - unsigned short nodeId; /* SCI Address bit 63 - 48 */ - unsigned short offsHi; /* SCI Address bit 47 - 32 */ - unsigned int offsLo; /* SCI Address bit 31 - 0 */ -} sci_address_t; - - -typedef unsigned int sci_ioaddr_t; - -typedef enum { - SCI_CALLBACK_CANCEL = 1, - SCI_CALLBACK_CONTINUE -} sci_callback_action_t; - -#ifndef KERNEL -typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg, - sci_local_segment_t segment, - sci_segment_cb_reason_t reason, - unsigned int nodeId, - unsigned int localAdapterNo, - sci_error_t error); - -typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg, - sci_remote_segment_t segment, - sci_segment_cb_reason_t reason, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg, - sci_dma_queue_t queue, - sci_error_t status); - - -typedef int (*sci_cb_block_transfer_t)(void *arg, - sci_block_transfer_t block, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg, - sci_local_interrupt_t interrupt, - sci_error_t status); - -#endif /* KERNEL */ -#endif diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 493ab4f9982..55d3c5a578f 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -59,3 +59,17 @@ LDADD += \ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndbd.dsp + +ndbd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndbd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/kernel/Makefile_old b/ndb/src/kernel/Makefile_old deleted file mode 100644 index d1f1741aca4..00000000000 --- a/ndb/src/kernel/Makefile_old +++ /dev/null @@ -1,5 +0,0 @@ -include .defs.mk - -DIRS := error vm ndb-main blocks - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index 70f11c33cd7..5193d3eae9d 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -1,8 +1,8 @@ Next QMGR 1 Next NDBCNTR 1000 Next NDBFS 2000 -Next DBACC 3001 -Next DBTUP 4007 +Next DBACC 3002 +Next DBTUP 4013 Next DBLQH 5042 Next DBDICT 6006 Next DBDIH 7174 @@ -10,7 +10,7 @@ Next DBTC 8035 Next CMVMI 9000 Next BACKUP 10022 Next DBUTIL 11002 -Next DBTUX 12001 +Next DBTUX 12007 Next SUMA 13001 TESTING NODE FAILURE, ARBITRATION @@ -393,6 +393,13 @@ Failed Create Table: -------------------- 7173: Create table failed due to not sufficient number of fragment or replica records. +3001: Fail create 1st fragment +4007 12001: Fail create 1st fragment +4008 12002: Fail create 2nd fragment +4009 12003: Fail create 1st attribute in 1st fragment +4010 12004: Fail create last attribute in 1st fragment +4011 12005: Fail create 1st attribute in 2nd fragment +4012 12006: Fail create last attribute in 2nd fragment Drop Table/Index: ----------------- diff --git a/ndb/src/kernel/blocks/Makefile.am b/ndb/src/kernel/blocks/Makefile.am index 0b2bc3b8c88..7ee90e6239f 100644 --- a/ndb/src/kernel/blocks/Makefile.am +++ b/ndb/src/kernel/blocks/Makefile.am @@ -15,3 +15,5 @@ SUBDIRS = \ suma \ grep \ dbtux + +windoze-dsp: diff --git a/ndb/src/kernel/blocks/Makefile_old b/ndb/src/kernel/blocks/Makefile_old deleted file mode 100644 index ce554dfc3b8..00000000000 --- a/ndb/src/kernel/blocks/Makefile_old +++ /dev/null @@ -1,28 +0,0 @@ -#-------------------------------------------------------------------------- -# -# Name Makefile -# -# -# -# List subdirectories to be travered -include .defs.mk - -DIRS := \ - cmvmi \ - dbacc \ - dbdict \ - dbdih \ - dblqh \ - dbtc \ - dbtup \ - ndbfs \ - ndbcntr \ - qmgr \ - trix \ - backup \ - dbutil \ - suma \ - grep \ - dbtux - -include ${NDB_TOP}/Epilogue.mk diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index e6fe63d9014..2e62979ce8e 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -863,6 +863,13 @@ Backup::execBACKUP_REQ(Signal* signal) sendBackupRef(senderRef, signal, senderData, BackupRef::IAmNotMaster); return; }//if + + if (m_diskless) + { + sendBackupRef(senderRef, signal, senderData, + BackupRef::CannotBackupDiskless); + return; + } if(dataLen32 != 0) { jam(); @@ -985,7 +992,11 @@ Backup::execUTIL_SEQUENCE_CONF(Signal* signal) }//if ndbrequire(ptr.p->masterData.state.getState() == DEFINING); - ptr.p->backupId = conf->sequenceValue[0]; + { + Uint64 backupId; + memcpy(&backupId,conf->sequenceValue,8); + ptr.p->backupId= (Uint32)backupId; + } ptr.p->backupKey[0] = (getOwnNodeId() << 16) | (ptr.p->backupId & 0xFFFF); ptr.p->backupKey[1] = NdbTick_CurrentMillisecond(); @@ -1265,10 +1276,6 @@ Backup::createAttributeMask(TablePtr tabPtr, jam(); AttributePtr attr; table.attributes.getPtr(attr, i); - if(attr.p->data.key != 0){ - jam(); - continue; - } mask.set(i); } } @@ -2954,12 +2961,9 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) tabPtr.p->schemaVersion = tmpTab.TableVersion; tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes; - tabPtr.p->noOfKeys = tmpTab.NoOfKeyAttr; tabPtr.p->noOfNull = 0; tabPtr.p->noOfVariable = 0; // Computed while iterating over attribs - tabPtr.p->sz_FixedKeys = 0; // Computed while iterating over attribs tabPtr.p->sz_FixedAttributes = 0; // Computed while iterating over attribs - tabPtr.p->variableKeyId = RNIL; // Computed while iterating over attribs tabPtr.p->triggerIds[0] = ILLEGAL_TRIGGER_ID; tabPtr.p->triggerIds[1] = ILLEGAL_TRIGGER_ID; tabPtr.p->triggerIds[2] = ILLEGAL_TRIGGER_ID; @@ -2994,7 +2998,6 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) attrPtr.p->data.nullable = tmp.AttributeNullableFlag; attrPtr.p->data.fixed = (tmp.AttributeArraySize != 0); - attrPtr.p->data.key = tmp.AttributeKeyFlag; attrPtr.p->data.sz32 = sz32; /** @@ -3002,50 +3005,26 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) * 1) Fixed * 2) Nullable * 3) Variable - * 4) Fixed key - * 5) Variable key */ - if(attrPtr.p->data.key == false) { + if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) { jam(); - - if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) { - jam(); - attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; - tabPtr.p->sz_FixedAttributes += sz32; - }//if - - if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) { - jam(); - attrPtr.p->data.offset = 0; - - attrPtr.p->data.offsetNull = tabPtr.p->noOfNull; - tabPtr.p->noOfNull++; - tabPtr.p->noOfVariable++; - }//if - - if(attrPtr.p->data.fixed == false) { - jam(); - tabPtr.p->noOfVariable++; - ndbrequire(0); - }//if - - } else if(attrPtr.p->data.key == true) { + attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; + tabPtr.p->sz_FixedAttributes += sz32; + }//if + + if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) { jam(); - ndbrequire(attrPtr.p->data.nullable == false); + attrPtr.p->data.offset = 0; - if(attrPtr.p->data.fixed == true) { // Fixed key - jam(); - tabPtr.p->sz_FixedKeys += sz32; - }//if - - if(attrPtr.p->data.fixed == false) { // Variable key - jam(); - attrPtr.p->data.offset = 0; - tabPtr.p->noOfVariable++; - ndbrequire(tabPtr.p->variableKeyId == RNIL); // Only one variable key - tabPtr.p->variableKeyId = attrPtr.i; - ndbrequire(0); - }//if + attrPtr.p->data.offsetNull = tabPtr.p->noOfNull; + tabPtr.p->noOfNull++; + tabPtr.p->noOfVariable++; + }//if + + if(attrPtr.p->data.fixed == false) { + jam(); + tabPtr.p->noOfVariable++; + ndbrequire(0); }//if it.next(); // Move Past EndOfAttribute @@ -3222,7 +3201,7 @@ Backup::execSTART_BACKUP_REQ(Signal* signal) return; }//if - tabPtr.p->triggerAllocated[i] = true; + tabPtr.p->triggerAllocated[j] = true; trigPtr.p->backupPtr = ptr.i; trigPtr.p->tableId = tabPtr.p->tableId; trigPtr.p->tab_ptr_i = tabPtr.i; @@ -3355,7 +3334,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) Table & table = * tabPtr.p; ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend(); const Uint32 parallelism = 16; - const Uint32 attrLen = 5 + table.noOfAttributes - table.noOfKeys; + const Uint32 attrLen = 5 + table.noOfAttributes; req->senderData = filePtr.i; req->resultRef = reference(); @@ -3366,7 +3345,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) req->tableId = table.tableId; ScanFragReq::setLockMode(req->requestInfo, 0); ScanFragReq::setHoldLockFlag(req->requestInfo, 0); - ScanFragReq::setKeyinfoFlag(req->requestInfo, 1); + ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); ScanFragReq::setAttrLen(req->requestInfo,attrLen); req->transId1 = 0; req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8); @@ -3381,7 +3360,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8); // Return all - signal->theData[3] = table.noOfAttributes - table.noOfKeys; + signal->theData[3] = table.noOfAttributes; signal->theData[4] = 0; signal->theData[5] = 0; signal->theData[6] = 0; @@ -3393,10 +3372,6 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) jam(); AttributePtr attr; table.attributes.getPtr(attr, i); - if(attr.p->data.key != 0) { - jam(); - continue; - }//if AttributeHeader::init(&signal->theData[dataPos], i, 0); dataPos++; @@ -3506,64 +3481,19 @@ Backup::execTRANSID_AI(Signal* signal) } } -void -Backup::execKEYINFO20(Signal* signal) -{ - jamEntry(); - - const Uint32 filePtrI = signal->theData[0]; - const Uint32 keyLen = signal->theData[1]; - //const Uint32 scanInfo = signal->theData[2]; - //const Uint32 transId1 = signal->theData[3]; - //const Uint32 transId2 = signal->theData[4]; - const Uint32 dataLen = signal->length() - 5; - - BackupFilePtr filePtr; - c_backupFilePool.getPtr(filePtr, filePtrI); - - OperationRecord & op = filePtr.p->operation; - - /** - * Unpack data - */ - ndbrequire(keyLen == dataLen); - const Uint32 * src = &signal->theData[5]; - const Uint32 klFixed = op.getFixedKeySize(); - ndbrequire(keyLen >= klFixed); - - Uint32 * dst = op.newKey(); - memcpy(dst, src, klFixed << 2); - - const Uint32 szLeft = (keyLen - klFixed); - if(szLeft > 0) { - jam(); - src += klFixed; - dst = op.newVariableKey(szLeft); - memcpy(dst, src, (szLeft << 2)); - ndbrequire(0); - }//if - - if(op.finished()){ - jam(); - op.newRecord(op.dst); - } -} - void Backup::OperationRecord::init(const TablePtr & ptr) { tablePtr = ptr.i; - noOfAttributes = (ptr.p->noOfAttributes - ptr.p->noOfKeys) + 1; - variableKeyId = ptr.p->variableKeyId; + noOfAttributes = ptr.p->noOfAttributes; sz_Bitmask = (ptr.p->noOfNull + 31) >> 5; - sz_FixedKeys = ptr.p->sz_FixedKeys; sz_FixedAttribs = ptr.p->sz_FixedAttributes; if(ptr.p->noOfVariable == 0) { jam(); - maxRecordSize = 1 + sz_Bitmask + sz_FixedKeys + sz_FixedAttribs; + maxRecordSize = 1 + sz_Bitmask + sz_FixedAttribs; } else { jam(); maxRecordSize = diff --git a/ndb/src/kernel/blocks/backup/Backup.hpp b/ndb/src/kernel/blocks/backup/Backup.hpp index 4dc2cd13ae0..1a5d6c7a925 100644 --- a/ndb/src/kernel/blocks/backup/Backup.hpp +++ b/ndb/src/kernel/blocks/backup/Backup.hpp @@ -76,7 +76,6 @@ protected: */ void execSCAN_HBREP(Signal* signal); void execTRANSID_AI(Signal* signal); - void execKEYINFO20(Signal* signal); void execSCAN_FRAGREF(Signal* signal); void execSCAN_FRAGCONF(Signal* signal); @@ -172,8 +171,8 @@ public: struct Data { Uint8 nullable; Uint8 fixed; - Uint8 key; - Uint8 unused; + Uint8 unused; + Uint8 unused2; Uint32 sz32; // No of 32 bit words Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys Uint32 offsetNull; // In NullBitmask @@ -199,12 +198,9 @@ public: Uint32 frag_mask; Uint32 tableType; Uint32 noOfNull; - Uint32 noOfKeys; Uint32 noOfAttributes; Uint32 noOfVariable; - Uint32 sz_FixedKeys; Uint32 sz_FixedAttributes; - Uint32 variableKeyId; Uint32 triggerIds[3]; bool triggerAllocated[3]; @@ -224,7 +220,6 @@ public: * Once per table */ void init(const TablePtr & ptr); - inline Uint32 getFixedKeySize() const { return sz_FixedKeys; } /** * Once per fragment @@ -247,23 +242,19 @@ public: /** * Per attribute */ - Uint32 * newKey(); void nullAttribute(Uint32 nullOffset); Uint32 * newNullable(Uint32 attrId, Uint32 sz); Uint32 * newAttrib(Uint32 offset, Uint32 sz); Uint32 * newVariable(Uint32 id, Uint32 sz); - Uint32 * newVariableKey(Uint32 sz); private: Uint32* base; Uint32* dst_Length; Uint32* dst_Bitmask; - Uint32* dst_FixedKeys; Uint32* dst_FixedAttribs; BackupFormat::DataFile::VariableData* dst_VariableData; Uint32 noOfAttributes; // No of Attributes - Uint32 variableKeyId; // Id of variable key Uint32 attrLeft; // No of attributes left Uint32 opNoDone; @@ -289,7 +280,6 @@ public: * sizes of part */ Uint32 sz_Bitmask; - Uint32 sz_FixedKeys; Uint32 sz_FixedAttribs; public: @@ -526,6 +516,7 @@ public: NdbNodeBitmask c_aliveNodes; DLList<BackupRecord> c_backups; Config c_defaults; + Uint32 m_diskless; STATIC_CONST(NO_OF_PAGES_META_FILE = 2); @@ -628,7 +619,6 @@ Backup::OperationRecord::newRecord(Uint32 * p){ base = p; dst_Length = p; p += 1; dst_Bitmask = p; p += sz_Bitmask; - dst_FixedKeys = p; p += sz_FixedKeys; dst_FixedAttribs = p; p += sz_FixedAttribs; dst_VariableData = (BackupFormat::DataFile::VariableData*)p; BitmaskImpl::clear(sz_Bitmask, dst_Bitmask); @@ -646,14 +636,6 @@ Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){ } inline -Uint32 * -Backup::OperationRecord::newKey(){ - attrLeft --; - attrSzLeft = 0; - return dst_FixedKeys; -} - -inline void Backup::OperationRecord::nullAttribute(Uint32 offsetNull){ attrLeft --; @@ -692,28 +674,13 @@ Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){ } inline -Uint32 * -Backup::OperationRecord::newVariableKey(Uint32 sz){ - attrLeft--; - attrSzLeft = 0; - attrSzTotal += sz; - - dst = &dst_VariableData->Data[0]; - dst_VariableData->Sz = htonl(sz); - dst_VariableData->Id = htonl(variableKeyId); - - dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz); - return dst; -} - -inline bool Backup::OperationRecord::finished(){ if(attrLeft != 0 || attrSzLeft != 0){ return false; } - opLen += attrSzTotal + sz_FixedKeys; + opLen += attrSzTotal; opNoDone++; scanStop = dst = (Uint32 *)dst_VariableData; diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index 8daad05558b..08fa089a9c0 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -22,7 +22,6 @@ //=========================================================================== #include "Backup.hpp" -#include <new> #include <Properties.hpp> #include <Configuration.hpp> @@ -42,8 +41,10 @@ Backup::Backup(const Configuration & conf) : ndbrequire(p != 0); Uint32 noBackups = 0, noTables = 0, noAttribs = 0; + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless)); ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups); - ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); + // ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs)); noAttribs++; //RT 527 bug fix @@ -126,7 +127,6 @@ Backup::Backup(const Configuration & conf) : addRecSignal(GSN_SCAN_HBREP, &Backup::execSCAN_HBREP); addRecSignal(GSN_TRANSID_AI, &Backup::execTRANSID_AI); - addRecSignal(GSN_KEYINFO20, &Backup::execKEYINFO20); addRecSignal(GSN_SCAN_FRAGREF, &Backup::execSCAN_FRAGREF); addRecSignal(GSN_SCAN_FRAGCONF, &Backup::execSCAN_FRAGCONF); @@ -204,7 +204,7 @@ Backup::~Backup() { } -BLOCK_FUNCTIONS(Backup); +BLOCK_FUNCTIONS(Backup) template class ArrayPool<Backup::Page32>; template class ArrayPool<Backup::Attribute>; diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am index 85bf5b12415..c8f44f31292 100644 --- a/ndb/src/kernel/blocks/backup/Makefile.am +++ b/ndb/src/kernel/blocks/backup/Makefile.am @@ -1,6 +1,4 @@ -SUBDIRS = restore - noinst_LIBRARIES = libbackup.a libbackup_a_SOURCES = Backup.cpp BackupInit.cpp @@ -10,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libbackup.dsp + +libbackup.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libbackup_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/backup/Makefile_old b/ndb/src/kernel/blocks/backup/Makefile_old deleted file mode 100644 index 989199cbe02..00000000000 --- a/ndb/src/kernel/blocks/backup/Makefile_old +++ /dev/null @@ -1,18 +0,0 @@ -include .defs.mk - -TYPE := kernel - -#ifneq ($(MYSQLCLUSTER_TOP),) -DIRS := restore -#endif - -ARCHIVE_TARGET := backup - -SOURCES = Backup.cpp BackupInit.cpp - -include $(NDB_TOP)/Epilogue.mk - -$(NDB_TOP)/bin/readBackupFile: read.o - $(C++) -o $@ read.o \ - $(NDB_TOP)/lib/libportlib.a $(NDB_TOP)/lib/libgeneral.a - diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/src/kernel/blocks/backup/restore/Makefile.am deleted file mode 100644 index 16550f13546..00000000000 --- a/ndb/src/kernel/blocks/backup/restore/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -ndbtools_PROGRAMS = ndb_restore - -ndb_restore_SOURCES = main.cpp consumer.cpp consumer_restore.cpp consumer_printer.cpp Restore.cpp - -LDADD_LOC = \ - $(top_builddir)/ndb/src/libndbclient.la \ - $(top_builddir)/dbug/libdbug.a \ - $(top_builddir)/mysys/libmysys.a \ - $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ - -include $(top_srcdir)/ndb/config/common.mk.am - -INCLUDES += -I.. -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -I$(top_srcdir)/ndb/src/ndbapi -I$(top_srcdir)/ndb/include/ndbapi -I$(top_srcdir)/ndb/include/util -I$(top_srcdir)/ndb/include/portlib -I$(top_srcdir)/ndb/include/kernel - -ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 234d832655c..dfae180ae71 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -39,7 +39,6 @@ #include <EventLogger.hpp> #include <TimeQueue.hpp> -#include <new> #include <NdbSleep.h> #include <SafeCounter.hpp> @@ -150,6 +149,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal) ndbrequire(false); } +#ifndef NDB_WIN32 if(ERROR_INSERTED(9996)){ simulate_error_during_shutdown= SIGSEGV; ndbrequire(false); @@ -159,6 +159,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal) simulate_error_during_shutdown= SIGSEGV; kill(getpid(), SIGABRT); } +#endif }//execNDB_TAMPER() void Cmvmi::execSET_LOGLEVELORD(Signal* signal) @@ -193,21 +194,11 @@ void Cmvmi::execEVENT_REP(Signal* signal) /** * If entry is not found */ - Uint32 threshold = 16; - LogLevel::EventCategory eventCategory = (LogLevel::EventCategory)0; - - for(unsigned int i = 0; i< EventLoggerBase::matrixSize; i++){ - if(EventLoggerBase::matrix[i].eventType == eventType){ - eventCategory = EventLoggerBase::matrix[i].eventCategory; - threshold = EventLoggerBase::matrix[i].threshold; - break; - } - } - - if(threshold > 15){ - // No entry found in matrix (or event that should never be printed) + Uint32 threshold; + LogLevel::EventCategory eventCategory; + Logger::LoggerLevel severity; + if (EventLoggerBase::event_lookup(eventType,eventCategory,threshold,severity)) return; - } SubscriberPtr ptr; for(subscribers.first(ptr); ptr.i != RNIL; subscribers.next(ptr)){ @@ -225,14 +216,15 @@ void Cmvmi::execEVENT_REP(Signal* signal) // Print the event info g_eventLogger.log(eventReport->getEventType(), signal->theData); + return; }//execEVENT_REP() void Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){ EventSubscribeReq * subReq = (EventSubscribeReq *)&signal->theData[0]; SubscriberPtr ptr; - jamEntry(); + DBUG_ENTER("Cmvmi::execEVENT_SUBSCRIBE_REQ"); /** * Search for subcription @@ -269,11 +261,13 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){ category = (LogLevel::EventCategory)(subReq->theData[i] >> 16); level = subReq->theData[i] & 0xFFFF; ptr.p->logLevel.setLogLevel(category, level); + DBUG_PRINT("info",("entry %d: level=%d, category= %d", i, level, category)); } } signal->theData[0] = ptr.i; sendSignal(ptr.p->blockRef, GSN_EVENT_SUBSCRIBE_CONF, signal, 1, JBB); + DBUG_VOID_RETURN; } void @@ -1117,7 +1111,7 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal) }//Cmvmi::execDUMP_STATE_ORD() -BLOCK_FUNCTIONS(Cmvmi); +BLOCK_FUNCTIONS(Cmvmi) static Uint32 g_print; static LinearSectionPtr g_test[3]; diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am index fdd43932682..dc2e12746fd 100644 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.am +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am @@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libcmvmi.dsp + +libcmvmi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libcmvmi_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile_old b/ndb/src/kernel/blocks/cmvmi/Makefile_old deleted file mode 100644 index d75e5dbf08b..00000000000 --- a/ndb/src/kernel/blocks/cmvmi/Makefile_old +++ /dev/null @@ -1,9 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := cmvmi - -SOURCES = Cmvmi.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp index 2705f95f6dd..95b336a0a65 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp @@ -264,4 +264,4 @@ Dbacc::~Dbacc() }//Dbacc::~Dbacc() -BLOCK_FUNCTIONS(Dbacc); +BLOCK_FUNCTIONS(Dbacc) diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 9a1bbd86562..a82c96beebd 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -1062,7 +1062,21 @@ void Dbacc::execACCFRAGREQ(Signal* signal) { const AccFragReq * const req = (AccFragReq*)&signal->theData[0]; jamEntry(); + if (ERROR_INSERTED(3001)) { + jam(); + addFragRefuse(signal, 1); + CLEAR_ERROR_INSERT_VALUE; + return; + } tabptr.i = req->tableId; +#ifndef VM_TRACE + // config mismatch - do not crash if release compiled + if (tabptr.i >= ctablesize) { + jam(); + addFragRefuse(signal, 800); + return; + } +#endif ptrCheckGuard(tabptr, ctablesize, tabrec); ndbrequire((req->reqInfo & 0xF) == ZADDFRAG); ndbrequire(!getrootfragmentrec(signal, rootfragrecptr, req->fragId)); @@ -4501,6 +4515,17 @@ void Dbacc::getdirindex(Signal* signal) /* BUCKET, AND SERCH FOR ELEMENT.THE PRIMARY KEYS WHICH IS SAVED */ /* IN THE OPERATION REC ARE THE CHECK ITEMS IN THE SEARCHING. */ /* --------------------------------------------------------------------------------- */ + +#if __ia64 == 1 +#if __INTEL_COMPILER == 810 +int ndb_acc_ia64_icc810_dummy_var = 0; +void ndb_acc_ia64_icc810_dummy_func() +{ + ndb_acc_ia64_icc810_dummy_var++; +} +#endif +#endif + void Dbacc::getElement(Signal* signal) { DirRangePtr geOverflowrangeptr; @@ -4595,6 +4620,12 @@ void Dbacc::getElement(Signal* signal) /* WE HAVE FOUND THE ELEMENT. GET THE LOCK INDICATOR AND RETURN FOUND. */ /* --------------------------------------------------------------------------------- */ jam(); +#if __ia64 == 1 +#if __INTEL_COMPILER == 810 + // prevents SIGSEGV under icc -O1 + ndb_acc_ia64_icc810_dummy_func(); +#endif +#endif tgeLocked = ElementHeader::getLocked(gePageptr.p->word32[tgeElementptr]); tgeResult = ZTRUE; TdataIndex = tgeElementptr + tgeForward; @@ -5673,7 +5704,8 @@ void Dbacc::commitOperation(Signal* signal) Uint32 tmp2Olq; if ((operationRecPtr.p->commitDeleteCheckFlag == ZFALSE) && - (operationRecPtr.p->operation != ZSCAN_OP)) { + (operationRecPtr.p->operation != ZSCAN_OP) && + (operationRecPtr.p->operation != ZREAD)) { jam(); /* This method is used to check whether the end result of the transaction will be to delete the tuple. In this case all operation will be marked diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am index 7ccfbe22f76..e44524c3edd 100644 --- a/ndb/src/kernel/blocks/dbacc/Makefile.am +++ b/ndb/src/kernel/blocks/dbacc/Makefile.am @@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbacc.dsp + +libdbacc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbacc_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbacc/Makefile_old b/ndb/src/kernel/blocks/dbacc/Makefile_old deleted file mode 100644 index 93a830cec95..00000000000 --- a/ndb/src/kernel/blocks/dbacc/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbacc - -SOURCES = \ - DbaccInit.cpp \ - DbaccMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index d1a8128ea7f..b1e573e1cc8 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -239,7 +239,11 @@ Dbdict::packTableIntoPagesImpl(SimpleProperties::Writer & w, w.add(DictTabInfo::TableName, tablePtr.p->tableName); w.add(DictTabInfo::TableId, tablePtr.i); +#ifdef HAVE_TABLE_REORG w.add(DictTabInfo::SecondTableId, tablePtr.p->secondTable); +#else + w.add(DictTabInfo::SecondTableId, (Uint32)0); +#endif w.add(DictTabInfo::TableVersion, tablePtr.p->tableVersion); w.add(DictTabInfo::NoOfKeyAttr, tablePtr.p->noOfPrimkey); w.add(DictTabInfo::NoOfAttributes, tablePtr.p->noOfAttributes); @@ -528,7 +532,7 @@ Dbdict::writeTableFile(Signal* signal, Uint32 tableId, Uint32 sz = tabInfoPtr.sz + ZPAGE_HEADER_SIZE; c_writeTableRecord.noOfPages = DIV(sz, ZSIZE_OF_PAGES_IN_WORDS); - c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK; + c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK; c_writeTableRecord.m_callback = * callback; c_writeTableRecord.pageId = 0; @@ -647,7 +651,7 @@ void Dbdict::closeWriteTableConf(Signal* signal, case WriteTableRecord::WRITE_RESTART_FROM_OWN : ndbrequire(false); break; - case WriteTableRecord::CALLBACK: + case WriteTableRecord::TWR_CALLBACK: jam(); execute(signal, c_writeTableRecord.m_callback, 0); return; @@ -1188,7 +1192,7 @@ Dbdict::~Dbdict() { }//Dbdict::~Dbdict() -BLOCK_FUNCTIONS(Dbdict); +BLOCK_FUNCTIONS(Dbdict) void Dbdict::initCommonData() { @@ -1436,6 +1440,7 @@ Uint32 Dbdict::getFreeTableRecord(Uint32 primaryTableId) jam(); return RNIL; }//if +#ifdef HAVE_TABLE_REORG bool secondFound = false; for (tablePtr.i = firstTablePtr.i + 1; tablePtr.i < tabSize ; tablePtr.i++) { jam(); @@ -1455,6 +1460,7 @@ Uint32 Dbdict::getFreeTableRecord(Uint32 primaryTableId) firstTablePtr.p->tabState = TableRecord::NOT_DEFINED; return RNIL; }//if +#endif return firstTablePtr.i; }//Dbdict::getFreeTableRecord() @@ -2381,7 +2387,7 @@ Dbdict::restartCreateTab_readTableConf(Signal* signal, ndbrequire(c_writeTableRecord.tableWriteState == WriteTableRecord::IDLE); c_writeTableRecord.noOfPages = c_readTableRecord.noOfPages; c_writeTableRecord.pageId = c_readTableRecord.pageId; - c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK; + c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK; c_writeTableRecord.m_callback.m_callbackData = callbackData; c_writeTableRecord.m_callback.m_callbackFunction = safe_cast(&Dbdict::restartCreateTab_writeTableConf); @@ -3661,9 +3667,8 @@ Dbdict::execCREATE_FRAGMENTATION_CONF(Signal* signal){ req->tableId = tabPtr.i; req->tableVersion = tabEntry->m_tableVersion + 1; - sendSignal(rg, GSN_CREATE_TAB_REQ, signal, - CreateTabReq::SignalLength, JBB); - + sendFragmentedSignal(rg, GSN_CREATE_TAB_REQ, signal, + CreateTabReq::SignalLength, JBB); return; } @@ -4624,7 +4629,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, jam(); tablePtr.p->tabState = TableRecord::DEFINING; }//if - +#ifdef HAVE_TABLE_REORG /* ---------------------------------------------------------------- */ // Get id of second table id and check that table doesn't already exist // and set up links between first and second table. @@ -4638,7 +4643,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, secondTablePtr.p->tabState = TableRecord::REORG_TABLE_PREPARED; secondTablePtr.p->secondTable = tablePtr.i; tablePtr.p->secondTable = secondTablePtr.i; - +#endif /* ---------------------------------------------------------------- */ // Set table version /* ---------------------------------------------------------------- */ @@ -5536,10 +5541,12 @@ void Dbdict::releaseTableObject(Uint32 tableId, bool removeFromHash) nextAttrRecord = attrPtr.p->nextAttrInTable; c_attributeRecordPool.release(attrPtr); }//if +#ifdef HAVE_TABLE_REORG Uint32 secondTableId = tablePtr.p->secondTable; initialiseTableRecord(tablePtr); c_tableRecordPool.getPtr(tablePtr, secondTableId); initialiseTableRecord(tablePtr); +#endif return; }//releaseTableObject() @@ -6046,11 +6053,21 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal) jam(); if (getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_CREATE_INDX_REQ, - signal, signal->getLength(), JBB); - return; + + releaseSections(signal); + OpCreateIndex opBusy; + opPtr.p = &opBusy; + opPtr.p->save(req); + opPtr.p->m_isMaster = (senderRef == reference()); + opPtr.p->key = 0; + opPtr.p->m_requestType = CreateIndxReq::RT_DICT_PREPARE; + opPtr.p->m_errorCode = CreateIndxRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + createIndex_sendReply(signal, opPtr, true); + return; } + // forward initial request plus operation key to all req->setOpKey(++c_opRecordSequence); NodeReceiverGroup rg(DBDICT, c_aliveNodes); @@ -6581,10 +6598,9 @@ Dbdict::execDROP_INDX_REQ(Signal* signal) jam(); if (getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_DROP_INDX_REQ, - signal, signal->getLength(), JBB); - return; + + err = DropIndxRef::NotMaster; + goto error; } // forward initial request plus operation key to all Uint32 indexId= req->getIndexId(); @@ -6672,6 +6688,7 @@ error: opPtr.p->save(req); opPtr.p->m_errorCode = (DropIndxRef::ErrorCode)err; opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; dropIndex_sendReply(signal, opPtr, true); } @@ -9110,9 +9127,15 @@ Dbdict::execALTER_INDX_REQ(Signal* signal) jam(); if (! isLocal && getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_ALTER_INDX_REQ, - signal, signal->getLength(), JBB); + + releaseSections(signal); + OpAlterIndex opBad; + opPtr.p = &opBad; + opPtr.p->save(req); + opPtr.p->m_errorCode = AlterIndxRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + alterIndex_sendReply(signal, opPtr, true); return; } // forward initial request plus operation key to all @@ -9790,9 +9813,15 @@ Dbdict::execBUILDINDXREQ(Signal* signal) jam(); if (getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_BUILDINDXREQ, - signal, signal->getLength(), JBB); + + releaseSections(signal); + OpBuildIndex opBad; + opPtr.p = &opBad; + opPtr.p->save(req); + opPtr.p->m_errorCode = BuildIndxRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + buildIndex_sendReply(signal, opPtr, true); return; } // forward initial request plus operation key to all @@ -10208,6 +10237,7 @@ Dbdict::buildIndex_sendReply(Signal* signal, OpBuildIndexPtr opPtr, rep->setIndexId(opPtr.p->m_request.getIndexId()); if (sendRef) { rep->setErrorCode(opPtr.p->m_errorCode); + rep->masterNodeId = opPtr.p->m_errorNode; gsn = GSN_BUILDINDXREF; length = BuildIndxRef::SignalLength; } @@ -10256,9 +10286,15 @@ Dbdict::execCREATE_TRIG_REQ(Signal* signal) jam(); if (! isLocal && getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_CREATE_TRIG_REQ, - signal, signal->getLength(), JBB); + + releaseSections(signal); + OpCreateTrigger opBad; + opPtr.p = &opBad; + opPtr.p->save(req); + opPtr.p->m_errorCode = CreateTrigRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + createTrigger_sendReply(signal, opPtr, true); return; } // forward initial request plus operation key to all diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 19c03a86e22..5fc4742e829 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -151,10 +151,10 @@ public: /* Temporary record used during add/drop table */ Uint32 myConnect; - +#ifdef HAVE_TABLE_REORG /* Second table used by this table (for table reorg) */ Uint32 secondTable; - +#endif /* Next record in Pool */ Uint32 nextPool; @@ -639,7 +639,7 @@ private: WRITE_ADD_TABLE_SLAVE = 2, WRITE_RESTART_FROM_MASTER = 3, WRITE_RESTART_FROM_OWN = 4, - CALLBACK = 5 + TWR_CALLBACK = 5 }; TableWriteState tableWriteState; Callback m_callback; diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am index dc4c4fe4734..9a0d68f8148 100644 --- a/ndb/src/kernel/blocks/dbdict/Makefile.am +++ b/ndb/src/kernel/blocks/dbdict/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbdict.dsp + +libdbdict.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdict_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdict/Makefile_old b/ndb/src/kernel/blocks/dbdict/Makefile_old deleted file mode 100644 index 46d938114fb..00000000000 --- a/ndb/src/kernel/blocks/dbdict/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbdict - -SOURCES = \ - Dbdict.cpp - -DIRS := printSchemafile - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 14fa262f871..ee67bf47d7b 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -147,7 +147,6 @@ public: Uint32 nfConnect; Uint32 table; Uint32 userpointer; - Uint32 nodeCount; BlockReference userblockref; }; typedef Ptr<ConnectRecord> ConnectRecordPtr; @@ -1469,7 +1468,7 @@ private: Uint32 c_blockCommitNo; bool getBlockCommit() const { - return c_blockCommit == true || cgckptflag == true; + return c_blockCommit || cgckptflag; } /** diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 7ca45ef4b43..9a5efebc56e 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -18,7 +18,6 @@ #define DBDIH_C #include "Dbdih.hpp" #include <ndb_limits.h> -#include <new> #define DEBUG(x) { ndbout << "DIH::" << x << endl; } @@ -314,7 +313,7 @@ Dbdih::~Dbdih() }//Dbdih::~Dbdih() -BLOCK_FUNCTIONS(Dbdih); +BLOCK_FUNCTIONS(Dbdih) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 76aa745c3e0..0bc8351a9db 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -2976,6 +2976,8 @@ void Dbdih::execCOPY_FRAGREF(Signal* signal) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); + sysErr->data1 = errorCode; + sysErr->data2 = 0; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); return; @@ -4492,6 +4494,8 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); + sysErr->data1= 0; + sysErr->data2= __LINE__; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); } @@ -6174,7 +6178,7 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){ break; case DictTabInfo::AllNodesMediumTable: jam(); - noOfFragments = csystemnodes; + noOfFragments = 2 * csystemnodes; break; case DictTabInfo::AllNodesLargeTable: jam(); @@ -7080,24 +7084,22 @@ void Dbdih::execDIGETPRIMREQ(Signal* signal) ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE); connectPtr.i = signal->theData[0]; - if(connectPtr.i != RNIL){ + if(connectPtr.i != RNIL) + { jam(); ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord); - ndbrequire(connectPtr.p->connectState == ConnectRecord::INUSE); - getFragstore(tabPtr.p, fragId, fragPtr); - connectPtr.p->nodeCount = extractNodeInfo(fragPtr.p, connectPtr.p->nodes); signal->theData[0] = connectPtr.p->userpointer; - signal->theData[1] = passThrough; - signal->theData[2] = connectPtr.p->nodes[0]; - sendSignal(connectPtr.p->userblockref, GSN_DIGETPRIMCONF, signal, 3, JBB); - return; - }//if - //connectPtr.i == RNIL -> question without connect record + } + else + { + jam(); + signal->theData[0] = RNIL; + } + Uint32 nodes[MAX_REPLICAS]; getFragstore(tabPtr.p, fragId, fragPtr); Uint32 count = extractNodeInfo(fragPtr.p, nodes); - signal->theData[0] = RNIL; signal->theData[1] = passThrough; signal->theData[2] = nodes[0]; signal->theData[3] = nodes[1]; @@ -12944,7 +12946,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) Uint32 nodeOrder[MAX_REPLICAS]; const Uint32 noOfReplicas = extractNodeInfo(fragPtr.p, nodeOrder); char buf[100]; - snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j); + BaseString::snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j); for(Uint32 k = 0; k < noOfReplicas; k++){ char tmp[100]; BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]); @@ -13155,7 +13157,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) getFragstore(tabPtr.p, fid, fragPtr); char buf[100], buf2[100]; - snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ", + BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ", fid, fragPtr.p->noLcpReplicas); Uint32 num=0; diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index 2ee8017ec13..d6ad380b806 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbdih.dsp + +libdbdih.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdih_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdih/Makefile_old b/ndb/src/kernel/blocks/dbdih/Makefile_old deleted file mode 100644 index 83c1b95b5c4..00000000000 --- a/ndb/src/kernel/blocks/dbdih/Makefile_old +++ /dev/null @@ -1,13 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbdih - -DIRS := printSysfile - -SOURCES = \ - DbdihInit.cpp \ - DbdihMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index d6987f3e478..0c63cb5fe17 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -550,6 +550,11 @@ public: UintR scanErrorCounter; UintR scanLocalFragid; UintR scanSchemaVersion; + + /** + * This is _always_ main table, even in range scan + * in which case scanTcrec->fragmentptr is different + */ Uint32 fragPtrI; UintR scanStoredProcId; ScanState scanState; @@ -2474,7 +2479,7 @@ private: void sendExecFragRefLab(Signal* signal); void fragrefLab(Signal* signal, BlockReference retRef, Uint32 retPtr, Uint32 errorCode); - void accFragRefLab(Signal* signal); + void abortAddFragOps(Signal* signal); void rwConcludedLab(Signal* signal); void sendsttorryLab(Signal* signal); void initialiseRecordsLab(Signal* signal, Uint32 data, Uint32, Uint32); @@ -2925,4 +2930,23 @@ Dblqh::ScanRecord::check_scan_batch_completed() const (max_bytes > 0 && (m_curr_batch_size_bytes >= max_bytes)); } +inline +void +Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) +{ + if (index == 0) { + acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; + } else { + Uint32 attr_buf_index, attr_buf_rec; + + AttrbufPtr regAttrPtr; + jam(); + attr_buf_rec= (index + 31) / 32; + attr_buf_index= (index - 1) & 31; + regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; + ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); + acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; + } +} + #endif diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index d0fef8753cb..ec29489180c 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -19,7 +19,6 @@ #define DBLQH_C #include "Dblqh.hpp" #include <ndb_limits.h> -#include <new> #define DEBUG(x) { ndbout << "LQH::" << x << endl; } @@ -454,5 +453,5 @@ Dblqh::~Dblqh() ctcNodeFailrecFileSize); }//Dblqh::~Dblqh() -BLOCK_FUNCTIONS(Dblqh); +BLOCK_FUNCTIONS(Dblqh) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index cd15ad0c3b2..c79f4dfc6c7 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -912,6 +912,10 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* signal) /* *********************************************************> */ /* LQHFRAGREQ: Create new fragments for a table. Sender DICT */ /* *********************************************************> */ + +// this unbelievable mess could be replaced by one signal to LQH +// and execute direct to local DICT to get everything at once + void Dblqh::execLQHFRAGREQ(Signal* signal) { jamEntry(); @@ -1049,6 +1053,11 @@ void Dblqh::execLQHFRAGREQ(Signal* signal) addfragptr.p->lh3DistrBits = tlhstar; addfragptr.p->tableType = tableType; addfragptr.p->primaryTableId = primaryTableId; + // + addfragptr.p->tup1Connectptr = RNIL; + addfragptr.p->tup2Connectptr = RNIL; + addfragptr.p->tux1Connectptr = RNIL; + addfragptr.p->tux2Connectptr = RNIL; if (DictTabInfo::isTable(tableType) || DictTabInfo::isHashIndex(tableType)) { @@ -1329,15 +1338,21 @@ void Dblqh::execTUP_ADD_ATTCONF(Signal* signal) { jamEntry(); addfragptr.i = signal->theData[0]; + // implies that operation was released on the other side + const bool lastAttr = signal->theData[1]; ptrCheckGuard(addfragptr, caddfragrecFileSize, addFragRecord); switch (addfragptr.p->addfragStatus) { case AddFragRecord::TUP_ATTR_WAIT1: jam(); + if (lastAttr) + addfragptr.p->tup1Connectptr = RNIL; addfragptr.p->addfragStatus = AddFragRecord::TUP_ATTR_WAIT2; sendAddAttrReq(signal); break; case AddFragRecord::TUP_ATTR_WAIT2: jam(); + if (lastAttr) + addfragptr.p->tup2Connectptr = RNIL; if (DictTabInfo::isOrderedIndex(addfragptr.p->tableType)) { addfragptr.p->addfragStatus = AddFragRecord::TUX_ATTR_WAIT1; sendAddAttrReq(signal); @@ -1347,11 +1362,15 @@ void Dblqh::execTUP_ADD_ATTCONF(Signal* signal) break; case AddFragRecord::TUX_ATTR_WAIT1: jam(); + if (lastAttr) + addfragptr.p->tux1Connectptr = RNIL; addfragptr.p->addfragStatus = AddFragRecord::TUX_ATTR_WAIT2; sendAddAttrReq(signal); break; case AddFragRecord::TUX_ATTR_WAIT2: jam(); + if (lastAttr) + addfragptr.p->tux2Connectptr = RNIL; goto done_with_attr; break; done_with_attr: @@ -1455,6 +1474,7 @@ Dblqh::sendAddAttrReq(Signal* signal) jam(); TupAddAttrConf* tupconf = (TupAddAttrConf*)signal->getDataPtrSend(); tupconf->userPtr = addfragptr.i; + tupconf->lastAttr = false; sendSignal(reference(), GSN_TUP_ADD_ATTCONF, signal, TupAddAttrConf::SignalLength, JBB); return; @@ -1485,6 +1505,7 @@ Dblqh::sendAddAttrReq(Signal* signal) jam(); TuxAddAttrConf* tuxconf = (TuxAddAttrConf*)signal->getDataPtrSend(); tuxconf->userPtr = addfragptr.i; + tuxconf->lastAttr = false; sendSignal(reference(), GSN_TUX_ADD_ATTRCONF, signal, TuxAddAttrConf::SignalLength, JBB); return; @@ -1549,6 +1570,40 @@ void Dblqh::fragrefLab(Signal* signal, return; }//Dblqh::fragrefLab() +/* + * Abort on-going ops. + */ +void Dblqh::abortAddFragOps(Signal* signal) +{ + fragptr.i = addfragptr.p->fragmentPtr; + ptrCheckGuard(fragptr, cfragrecFileSize, fragrecord); + signal->theData[0] = (Uint32)-1; + if (addfragptr.p->tup1Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tup1Connectptr; + sendSignal(fragptr.p->tupBlockref, GSN_TUPFRAGREQ, signal, 2, JBB); + addfragptr.p->tup1Connectptr = RNIL; + } + if (addfragptr.p->tup2Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tup2Connectptr; + sendSignal(fragptr.p->tupBlockref, GSN_TUPFRAGREQ, signal, 2, JBB); + addfragptr.p->tup2Connectptr = RNIL; + } + if (addfragptr.p->tux1Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tux1Connectptr; + sendSignal(fragptr.p->tuxBlockref, GSN_TUXFRAGREQ, signal, 2, JBB); + addfragptr.p->tux1Connectptr = RNIL; + } + if (addfragptr.p->tux2Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tux2Connectptr; + sendSignal(fragptr.p->tuxBlockref, GSN_TUXFRAGREQ, signal, 2, JBB); + addfragptr.p->tux2Connectptr = RNIL; + } +} + /* ************>> */ /* ACCFRAGREF > */ /* ************>> */ @@ -1582,6 +1637,27 @@ void Dblqh::execTUPFRAGREF(Signal* signal) fragptr.i = addfragptr.p->fragmentPtr; ptrCheckGuard(fragptr, cfragrecFileSize, fragrecord); addfragptr.p->addfragErrorCode = terrorCode; + + // no operation to release, just add some jams + switch (addfragptr.p->addfragStatus) { + case AddFragRecord::WAIT_TWO_TUP: + jam(); + break; + case AddFragRecord::WAIT_ONE_TUP: + jam(); + break; + case AddFragRecord::WAIT_TWO_TUX: + jam(); + break; + case AddFragRecord::WAIT_ONE_TUX: + jam(); + break; + default: + ndbrequire(false); + break; + } + abortAddFragOps(signal); + const Uint32 ref = addfragptr.p->dictBlockref; const Uint32 senderData = addfragptr.p->dictConnectptr; const Uint32 errorCode = addfragptr.p->addfragErrorCode; @@ -1605,11 +1681,38 @@ void Dblqh::execTUXFRAGREF(Signal* signal) void Dblqh::execTUP_ADD_ATTRREF(Signal* signal) { jamEntry(); - addfragptr.i = signal->theData[0]; ptrCheckGuard(addfragptr, caddfragrecFileSize, addFragRecord); terrorCode = signal->theData[1]; addfragptr.p->addfragErrorCode = terrorCode; + + // operation was released on the other side + switch (addfragptr.p->addfragStatus) { + case AddFragRecord::TUP_ATTR_WAIT1: + jam(); + ndbrequire(addfragptr.p->tup1Connectptr != RNIL); + addfragptr.p->tup1Connectptr = RNIL; + break; + case AddFragRecord::TUP_ATTR_WAIT2: + jam(); + ndbrequire(addfragptr.p->tup2Connectptr != RNIL); + addfragptr.p->tup2Connectptr = RNIL; + break; + case AddFragRecord::TUX_ATTR_WAIT1: + jam(); + ndbrequire(addfragptr.p->tux1Connectptr != RNIL); + addfragptr.p->tux1Connectptr = RNIL; + break; + case AddFragRecord::TUX_ATTR_WAIT2: + jam(); + ndbrequire(addfragptr.p->tux2Connectptr != RNIL); + addfragptr.p->tux2Connectptr = RNIL; + break; + default: + ndbrequire(false); + break; + } + abortAddFragOps(signal); const Uint32 Ref = addfragptr.p->dictBlockref; const Uint32 senderData = addfragptr.p->dictConnectptr; @@ -2981,6 +3084,7 @@ void Dblqh::execATTRINFO(Signal* signal) return; break; default: + ndbout_c("%d", regTcPtr->transactionState); ndbrequire(false); break; }//switch @@ -7058,10 +7162,7 @@ void Dblqh::continueScanNextReqLab(Signal* signal) // Update timer on tcConnectRecord tcConnectptr.p->tcTimer = cLqhTimeOutCount; - init_acc_ptr_list(scanptr.p); - scanptr.p->m_curr_batch_size_rows = 0; - scanptr.p->m_curr_batch_size_bytes= 0; scanptr.p->scanFlag = NextScanReq::ZSCAN_NEXT; scanNextLoopLab(signal); }//Dblqh::continueScanNextReqLab() @@ -7219,6 +7320,8 @@ void Dblqh::closeScanRequestLab(Signal* signal) scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; sendScanFragConf(signal, ZTRUE); + abort_scan(signal, scanptr.i, 0); + return; break; case TcConnectionrec::SCAN_TUPKEY: case TcConnectionrec::SCAN_FIRST_STOPPED: @@ -7260,22 +7363,32 @@ void Dblqh::scanLockReleasedLab(Signal* signal) tcConnectptr.i = scanptr.p->scanTcrec; ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec); releaseActiveFrag(signal); + if (scanptr.p->scanReleaseCounter == scanptr.p->m_curr_batch_size_rows) { if ((scanptr.p->scanErrorCounter > 0) || (scanptr.p->scanCompletedStatus == ZTRUE)) { jam(); + scanptr.p->m_curr_batch_size_rows = 0; + scanptr.p->m_curr_batch_size_bytes = 0; closeScanLab(signal); } else if (scanptr.p->check_scan_batch_completed() && scanptr.p->scanLockHold != ZTRUE) { jam(); scanptr.p->scanState = ScanRecord::WAIT_SCAN_NEXTREQ; sendScanFragConf(signal, ZFALSE); + } else if (scanptr.p->m_last_row && !scanptr.p->scanLockHold) { + jam(); + closeScanLab(signal); + return; } else { jam(); /* - We came here after releasing locks after receiving SCAN_NEXTREQ from TC. We only - come here when scanHoldLock == ZTRUE - */ + * We came here after releasing locks after + * receiving SCAN_NEXTREQ from TC. We only come here + * when scanHoldLock == ZTRUE + */ + scanptr.p->m_curr_batch_size_rows = 0; + scanptr.p->m_curr_batch_size_bytes = 0; continueScanNextReqLab(signal); }//if } else if (scanptr.p->scanReleaseCounter < scanptr.p->m_curr_batch_size_rows) { @@ -7362,25 +7475,6 @@ Dblqh::init_acc_ptr_list(ScanRecord* scanP) scanP->scan_acc_index = 0; } -inline -void -Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) -{ - if (index == 0) { - acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; - } else { - Uint32 attr_buf_index, attr_buf_rec; - - AttrbufPtr regAttrPtr; - jam(); - attr_buf_rec= (index + 31) / 32; - attr_buf_index= (index - 1) & 31; - regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; - ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); - acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; - } -} - Uint32 Dblqh::get_acc_ptr_from_scan_record(ScanRecord* scanP, Uint32 index, @@ -7611,18 +7705,25 @@ void Dblqh::abort_scan(Signal* signal, Uint32 scan_ptr_i, Uint32 errcode){ jam(); scanptr.i = scan_ptr_i; c_scanRecordPool.getPtr(scanptr); + + fragptr.i = tcConnectptr.p->fragmentptr; + ptrCheckGuard(fragptr, cfragrecFileSize, fragrecord); finishScanrec(signal); releaseScanrec(signal); tcConnectptr.p->transactionState = TcConnectionrec::IDLE; tcConnectptr.p->abortState = TcConnectionrec::ABORT_ACTIVE; - - ScanFragRef * ref = (ScanFragRef*)&signal->theData[0]; - ref->senderData = tcConnectptr.p->clientConnectrec; - ref->transId1 = tcConnectptr.p->transid[0]; - ref->transId2 = tcConnectptr.p->transid[1]; - ref->errorCode = errcode; - sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGREF, signal, - ScanFragRef::SignalLength, JBB); + + if(errcode) + { + jam(); + ScanFragRef * ref = (ScanFragRef*)&signal->theData[0]; + ref->senderData = tcConnectptr.p->clientConnectrec; + ref->transId1 = tcConnectptr.p->transid[0]; + ref->transId2 = tcConnectptr.p->transid[1]; + ref->errorCode = errcode; + sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGREF, signal, + ScanFragRef::SignalLength, JBB); + } deleteTransidHash(signal); releaseOprec(signal); releaseTcrec(signal, tcConnectptr); @@ -7904,6 +8005,13 @@ void Dblqh::nextScanConfScanLab(Signal* signal) /************************************************************* * STOP THE SCAN PROCESS IF THIS HAS BEEN REQUESTED. ************************************************************ */ + if (!scanptr.p->scanLockHold) + { + jam(); + closeScanLab(signal); + return; + } + if (scanptr.p->scanCompletedStatus == ZTRUE) { if ((scanptr.p->scanLockHold == ZTRUE) && (scanptr.p->m_curr_batch_size_rows > 0)) { @@ -8404,8 +8512,6 @@ void Dblqh::tupScanCloseConfLab(Signal* signal) ScanFragRef::SignalLength, JBB); } else { jam(); - scanptr.p->m_curr_batch_size_rows = 0; - scanptr.p->m_curr_batch_size_bytes= 0; sendScanFragConf(signal, ZSCAN_FRAG_CLOSED); }//if finishScanrec(signal); @@ -8477,7 +8583,7 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) tFragPtr.i = fragptr.p->tableFragptr; ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); scanptr.p->fragPtrI = fragptr.p->tableFragptr; - + /** * !idx uses 1 - (MAX_PARALLEL_SCANS_PER_FRAG - 1) = 1-11 * idx uses from MAX_PARALLEL_SCANS_PER_FRAG - MAX = 12-42) @@ -8486,10 +8592,10 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) Uint32 stop = (idx ? MAX_PARALLEL_INDEX_SCANS_PER_FRAG : MAX_PARALLEL_SCANS_PER_FRAG - 1); stop += start; Uint32 free = tFragPtr.p->m_scanNumberMask.find(start); - + if(free == Fragrecord::ScanNumberMask::NotFound || free >= stop){ jam(); - + if(scanPrio == 0){ jam(); return ScanFragRef::ZTOO_MANY_ACTIVE_SCAN_ERROR; @@ -8500,16 +8606,15 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) */ scanptr.p->scanState = ScanRecord::IN_QUEUE; LocalDLFifoList<ScanRecord> queue(c_scanRecordPool, - tFragPtr.p->m_queuedScans); + fragptr.p->m_queuedScans); queue.add(scanptr); return ZOK; } - scanptr.p->scanNumber = free; tFragPtr.p->m_scanNumberMask.clear(free);// Update mask - - LocalDLList<ScanRecord> active(c_scanRecordPool, tFragPtr.p->m_activeScans); + + LocalDLList<ScanRecord> active(c_scanRecordPool, fragptr.p->m_activeScans); active.add(scanptr); if(scanptr.p->scanKeyinfoFlag){ jam(); @@ -8569,12 +8674,8 @@ void Dblqh::finishScanrec(Signal* signal) { release_acc_ptr_list(scanptr.p); - FragrecordPtr tFragPtr; - tFragPtr.i = scanptr.p->fragPtrI; - ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); - LocalDLFifoList<ScanRecord> queue(c_scanRecordPool, - tFragPtr.p->m_queuedScans); + fragptr.p->m_queuedScans); if(scanptr.p->scanState == ScanRecord::IN_QUEUE){ jam(); @@ -8592,9 +8693,13 @@ void Dblqh::finishScanrec(Signal* signal) ndbrequire(tmp.p == scanptr.p); } - LocalDLList<ScanRecord> scans(c_scanRecordPool, tFragPtr.p->m_activeScans); + LocalDLList<ScanRecord> scans(c_scanRecordPool, fragptr.p->m_activeScans); scans.release(scanptr); + FragrecordPtr tFragPtr; + tFragPtr.i = scanptr.p->fragPtrI; + ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); + const Uint32 scanNumber = scanptr.p->scanNumber; ndbrequire(!tFragPtr.p->m_scanNumberMask.get(scanNumber)); ScanRecordPtr restart; @@ -8614,14 +8719,15 @@ void Dblqh::finishScanrec(Signal* signal) return; } + ndbrequire(restart.p->scanState == ScanRecord::IN_QUEUE); + ScanRecordPtr tmpScan = scanptr; TcConnectionrecPtr tmpTc = tcConnectptr; tcConnectptr.i = restart.p->scanTcrec; ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec); restart.p->scanNumber = scanNumber; - restart.p->scanState = ScanRecord::WAIT_ACC_SCAN; - + queue.remove(restart); scans.add(restart); if(restart.p->scanKeyinfoFlag){ @@ -8635,10 +8741,18 @@ void Dblqh::finishScanrec(Signal* signal) ndbout_c("adding-r (%d %d)", restart.p->scanNumber, restart.p->fragPtrI); #endif } - - scanptr = restart; - continueAfterReceivingAllAiLab(signal); - + + restart.p->scanState = ScanRecord::SCAN_FREE; // set in initScanRec + if(tcConnectptr.p->transactionState == TcConnectionrec::SCAN_STATE_USED) + { + jam(); + scanptr = restart; + continueAfterReceivingAllAiLab(signal); + } + else + { + ndbrequire(tcConnectptr.p->transactionState == TcConnectionrec::WAIT_SCAN_AI); + } scanptr = tmpScan; tcConnectptr = tmpTc; }//Dblqh::finishScanrec() @@ -8725,7 +8839,7 @@ void Dblqh::sendKeyinfo20(Signal* signal, sendSignal(ref, GSN_KEYINFO20, signal, 25, JBB); src += KeyInfo20::DataLength;; keyLen -= KeyInfo20::DataLength; - } while(keyLen >= KeyInfo20::DataLength); + } MEMCOPY_NO_WORDS(keyInfo->keyData, src, keyLen); sendSignal(ref, GSN_KEYINFO20, signal, @@ -8809,6 +8923,13 @@ void Dblqh::sendScanFragConf(Signal* signal, Uint32 scanCompleted) conf->total_len= total_len; sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGCONF, signal, ScanFragConf::SignalLength, JBB); + + if(!scanptr.p->scanLockHold) + { + jam(); + scanptr.p->m_curr_batch_size_rows = 0; + scanptr.p->m_curr_batch_size_bytes= 0; + } }//Dblqh::sendScanFragConf() /* ######################################################################### */ diff --git a/ndb/src/kernel/blocks/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am index 3a58dba742e..854860b269c 100644 --- a/ndb/src/kernel/blocks/dblqh/Makefile.am +++ b/ndb/src/kernel/blocks/dblqh/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdblqh.dsp + +libdblqh.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdblqh_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dblqh/Makefile_old b/ndb/src/kernel/blocks/dblqh/Makefile_old deleted file mode 100644 index 520486d8058..00000000000 --- a/ndb/src/kernel/blocks/dblqh/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dblqh -DIRS := redoLogReader - -SOURCES = \ - DblqhInit.cpp \ - DblqhMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index a209df24c44..fb90ccc8c90 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -1054,9 +1054,8 @@ public: // Id of the ScanRecord this fragment scan belongs to Uint32 scanRec; - // The maximum number of operations that can be scanned before - // returning to TC - Uint16 scanFragConcurrency; + // The value of fragmentCompleted in the last received SCAN_FRAGCONF + Uint8 m_scan_frag_conf_status; inline void startFragTimer(Uint32 timeVal){ scanFragTimer = timeVal; @@ -1193,8 +1192,10 @@ public: // Number of operation records per scanned fragment // Number of operations in first batch // Max number of bytes per batch - Uint16 noOprecPerFrag; - Uint16 first_batch_size; + union { + Uint16 first_batch_size_rows; + Uint16 batch_size_rows; + }; Uint32 batch_byte_size; Uint32 scanRequestInfo; // ScanFrag format diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index e38089242c3..59c8237f20a 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -20,7 +20,6 @@ #include <ndb_limits.h> #include <Properties.hpp> #include <Configuration.hpp> -#include <new> #define DEBUG(x) { ndbout << "TC::" << x << endl; } @@ -365,5 +364,5 @@ Dbtc::~Dbtc() capiConnectFilesize); }//Dbtc::~Dbtc() -BLOCK_FUNCTIONS(Dbtc); +BLOCK_FUNCTIONS(Dbtc) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index d8b3ee10532..97931041e2a 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -1271,7 +1271,10 @@ void Dbtc::execTCRELEASEREQ(Signal* signal) if (tapiBlockref == apiConnectptr.p->ndbapiBlockref) { if (apiConnectptr.p->apiConnectstate == CS_CONNECTED || (apiConnectptr.p->apiConnectstate == CS_ABORTING && - apiConnectptr.p->abortState == AS_IDLE)){ + apiConnectptr.p->abortState == AS_IDLE) || + (apiConnectptr.p->apiConnectstate == CS_STARTED && + apiConnectptr.p->firstTcConnect == RNIL)) + { jam(); /* JUST REPLY OK */ releaseApiCon(signal, apiConnectptr.i); signal->theData[0] = tuserpointer; @@ -1879,7 +1882,6 @@ void Dbtc::packKeyData000Lab(Signal* signal, Uint32 totalLen) { CacheRecord * const regCachePtr = cachePtr.p; - UintR Tmp; jam(); Uint32 len = 0; @@ -6366,7 +6368,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck) *------------------------------------------------------------------*/ char buf[96]; buf[0] = 0; char buf2[96]; - snprintf(buf, sizeof(buf), "TC %d: %d ops:", + BaseString::snprintf(buf, sizeof(buf), "TC %d: %d ops:", __LINE__, apiConnectptr.i); for(Uint32 i = 0; i<TloopCount; i++){ BaseString::snprintf(buf2, sizeof(buf2), "%s %d", buf, tmp[i]); @@ -8503,14 +8505,16 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) apiConnectptr.i = scanTabReq->apiConnectPtr; tabptr.i = scanTabReq->tableId; - if (apiConnectptr.i >= capiConnectFilesize || - tabptr.i >= ctabrecFilesize) { + if (apiConnectptr.i >= capiConnectFilesize) + { jam(); warningHandlerLab(signal); return; }//if + ptrAss(apiConnectptr, apiConnectRecord); ApiConnectRecord * transP = apiConnectptr.p; + if (transP->apiConnectstate != CS_CONNECTED) { jam(); // could be left over from TCKEYREQ rollback @@ -8524,9 +8528,16 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) } else { jam(); errCode = ZSTATE_ERROR; - goto SCAN_TAB_error; + goto SCAN_TAB_error_no_state_change; } } + + if(tabptr.i >= ctabrecFilesize) + { + errCode = ZUNKNOWN_TABLE_ERROR; + goto SCAN_TAB_error; + } + ptrAss(tabptr, tableRecord); if ((aiLength == 0) || (!tabptr.p->checkTable(schemaVersion)) || @@ -8621,8 +8632,18 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) errCode = ZNO_SCANREC_ERROR; goto SCAN_TAB_error; - SCAN_TAB_error: +SCAN_TAB_error: jam(); + /** + * Prepare for up coming ATTRINFO/KEYINFO + */ + transP->apiConnectstate = CS_ABORTING; + transP->abortState = AS_IDLE; + transP->transid[0] = transid1; + transP->transid[1] = transid2; + +SCAN_TAB_error_no_state_change: + ScanTabRef * ref = (ScanTabRef*)&signal->theData[0]; ref->apiConnectPtr = transP->ndbapiConnect; ref->transId1 = transid1; @@ -8646,9 +8667,9 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr, scanptr.p->scanTableref = tabptr.i; scanptr.p->scanSchemaVersion = scanTabReq->tableSchemaVersion; scanptr.p->scanParallel = scanParallel; - scanptr.p->noOprecPerFrag = noOprecPerFrag; - scanptr.p->first_batch_size= scanTabReq->first_batch_size; - scanptr.p->batch_byte_size= scanTabReq->batch_byte_size; + scanptr.p->first_batch_size_rows = scanTabReq->first_batch_size; + scanptr.p->batch_byte_size = scanTabReq->batch_byte_size; + scanptr.p->batch_size_rows = noOprecPerFrag; Uint32 tmp = 0; const UintR ri = scanTabReq->requestInfo; @@ -8672,7 +8693,6 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr, ndbrequire(list.seize(ptr)); ptr.p->scanRec = scanptr.i; ptr.p->scanFragId = 0; - ptr.p->scanFragConcurrency = noOprecPerFrag; ptr.p->m_apiPtr = cdata[i]; }//for @@ -8945,6 +8965,25 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) scanptr.i = scanFragptr.p->scanRec; ptrCheckGuard(scanptr, cscanrecFileSize, scanRecord); + /** + * This must be false as select count(*) otherwise + * can "pass" committing on backup fragments and + * get incorrect row count + */ + if(false && ScanFragReq::getReadCommittedFlag(scanptr.p->scanRequestInfo)) + { + jam(); + Uint32 max = 3+signal->theData[6]; + Uint32 nodeid = getOwnNodeId(); + for(Uint32 i = 3; i<max; i++) + if(signal->theData[i] == nodeid) + { + jam(); + tnodeid = nodeid; + break; + } + } + { /** * Check table @@ -8989,6 +9028,8 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) scanFragptr.p->lqhBlockref = ref; scanFragptr.p->m_connectCount = getNodeInfo(tnodeid).m_connectCount; sendScanFragReq(signal, scanptr.p, scanFragptr.p); + if(ERROR_INSERTED(8035)) + globalTransporterRegistry.performSend(); attrbufptr.i = cachePtr.p->firstAttrbuf; while (attrbufptr.i != RNIL) { jam(); @@ -8998,6 +9039,8 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) attrbufptr.p, ref); attrbufptr.i = attrbufptr.p->attrbuf[ZINBUF_NEXT]; + if(ERROR_INSERTED(8035)) + globalTransporterRegistry.performSend(); }//while scanFragptr.p->scanFragState = ScanFragRec::LQH_ACTIVE; scanFragptr.p->startFragTimer(ctcTimer); @@ -9141,6 +9184,7 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) const ScanFragConf * const conf = (ScanFragConf*)&signal->theData[0]; const Uint32 noCompletedOps = conf->completedOps; + const Uint32 status = conf->fragmentCompleted; scanFragptr.i = conf->senderData; c_scan_frag_pool.getPtr(scanFragptr); @@ -9163,11 +9207,9 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) ndbrequire(scanFragptr.p->scanFragState == ScanFragRec::LQH_ACTIVE); - const Uint32 status = conf->fragmentCompleted; - if(scanptr.p->scanState == ScanRecord::CLOSING_SCAN){ jam(); - if(status == ZFALSE){ + if(status == 0){ /** * We have started closing = we sent a close -> ignore this */ @@ -9184,11 +9226,11 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) return; } - if(status == ZCLOSED && scanptr.p->scanNextFragId < scanptr.p->scanNoFrag){ + if(noCompletedOps == 0 && status != 0 && + scanptr.p->scanNextFragId < scanptr.p->scanNoFrag){ /** * Start on next fragment */ - ndbrequire(noCompletedOps == 0); scanFragptr.p->scanFragState = ScanFragRec::WAIT_GET_PRIMCONF; scanFragptr.p->startFragTimer(ctcTimer); @@ -9218,6 +9260,7 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) scanptr.p->m_queued_count++; } + scanFragptr.p->m_scan_frag_conf_status = status; scanFragptr.p->m_ops = noCompletedOps; scanFragptr.p->m_totalLen = total_len; scanFragptr.p->scanFragState = ScanFragRec::QUEUED_FOR_DELIVERY; @@ -9311,7 +9354,6 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal) /********************************************************************* * APPLICATION IS CLOSING THE SCAN. **********************************************************************/ - ndbrequire(len == 0); close_scan_req(signal, scanptr, true); return; }//if @@ -9330,11 +9372,12 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal) // Copy op ptrs so I dont overwrite them when sending... memcpy(signal->getDataPtrSend()+25, signal->getDataPtr()+4, 4 * len); - ScanFragNextReq * nextReq = (ScanFragNextReq*)&signal->theData[0]; - nextReq->closeFlag = ZFALSE; - nextReq->transId1 = apiConnectptr.p->transid[0]; - nextReq->transId2 = apiConnectptr.p->transid[1]; - nextReq->batch_size_bytes= scanP->batch_byte_size; + ScanFragNextReq tmp; + tmp.closeFlag = ZFALSE; + tmp.transId1 = apiConnectptr.p->transid[0]; + tmp.transId2 = apiConnectptr.p->transid[1]; + tmp.batch_size_rows = scanP->batch_size_rows; + tmp.batch_size_bytes = scanP->batch_byte_size; ScanFragList running(c_scan_frag_pool, scanP->m_running_scan_frags); ScanFragList delivered(c_scan_frag_pool, scanP->m_delivered_scan_frags); @@ -9344,15 +9387,37 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal) c_scan_frag_pool.getPtr(scanFragptr); ndbrequire(scanFragptr.p->scanFragState == ScanFragRec::DELIVERED); - scanFragptr.p->scanFragState = ScanFragRec::LQH_ACTIVE; scanFragptr.p->startFragTimer(ctcTimer); - scanFragptr.p->m_ops = 0; - nextReq->senderData = scanFragptr.i; - nextReq->batch_size_rows= scanFragptr.p->scanFragConcurrency; - sendSignal(scanFragptr.p->lqhBlockref, GSN_SCAN_NEXTREQ, signal, - ScanFragNextReq::SignalLength, JBB); + if(scanFragptr.p->m_scan_frag_conf_status) + { + /** + * last scan was complete + */ + jam(); + ndbrequire(scanptr.p->scanNextFragId < scanptr.p->scanNoFrag); + scanFragptr.p->scanFragState = ScanFragRec::WAIT_GET_PRIMCONF; + + tcConnectptr.i = scanptr.p->scanTcrec; + ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord); + scanFragptr.p->scanFragId = scanptr.p->scanNextFragId++; + signal->theData[0] = tcConnectptr.p->dihConnectptr; + signal->theData[1] = scanFragptr.i; + signal->theData[2] = scanptr.p->scanTableref; + signal->theData[3] = scanFragptr.p->scanFragId; + sendSignal(cdihblockref, GSN_DIGETPRIMREQ, signal, 4, JBB); + } + else + { + jam(); + scanFragptr.p->scanFragState = ScanFragRec::LQH_ACTIVE; + ScanFragNextReq * req = (ScanFragNextReq*)signal->getDataPtrSend(); + * req = tmp; + req->senderData = scanFragptr.i; + sendSignal(scanFragptr.p->lqhBlockref, GSN_SCAN_NEXTREQ, signal, + ScanFragNextReq::SignalLength, JBB); + } delivered.remove(scanFragptr); running.add(scanFragptr); }//for @@ -9416,7 +9481,7 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){ ndbrequire(curr.p->scanFragState == ScanFragRec::DELIVERED); delivered.remove(curr); - if(curr.p->m_ops > 0){ + if(curr.p->m_ops > 0 && curr.p->m_scan_frag_conf_status == 0){ jam(); running.add(curr); curr.p->scanFragState = ScanFragRec::LQH_ACTIVE; @@ -9551,7 +9616,7 @@ void Dbtc::sendScanFragReq(Signal* signal, req->transId1 = apiConnectptr.p->transid[0]; req->transId2 = apiConnectptr.p->transid[1]; req->clientOpPtr = scanFragP->m_apiPtr; - req->batch_size_rows= scanFragP->scanFragConcurrency; + req->batch_size_rows= scanP->batch_size_rows; req->batch_size_bytes= scanP->batch_byte_size; sendSignal(scanFragP->lqhBlockref, GSN_SCAN_FRAGREQ, signal, ScanFragReq::SignalLength, JBB); @@ -9573,6 +9638,8 @@ void Dbtc::sendScanTabConf(Signal* signal, ScanRecordPtr scanPtr) { jam(); ops += 21; } + + Uint32 left = scanPtr.p->scanNoFrag - scanPtr.p->scanNextFragId; ScanTabConf * conf = (ScanTabConf*)&signal->theData[0]; conf->apiConnectPtr = apiConnectptr.p->ndbapiConnect; @@ -9588,24 +9655,25 @@ void Dbtc::sendScanTabConf(Signal* signal, ScanRecordPtr scanPtr) { ScanFragRecPtr curr = ptr; // Remove while iterating... queued.next(ptr); + bool done = curr.p->m_scan_frag_conf_status && --left; + * ops++ = curr.p->m_apiPtr; - * ops++ = curr.i; + * ops++ = done ? RNIL : curr.i; * ops++ = (curr.p->m_totalLen << 10) + curr.p->m_ops; queued.remove(curr); - if(curr.p->m_ops > 0){ + if(!done){ delivered.add(curr); curr.p->scanFragState = ScanFragRec::DELIVERED; curr.p->stopFragTimer(); } else { - (* --ops) = ScanTabConf::EndOfData; ops++; c_scan_frag_pool.release(curr); curr.p->scanFragState = ScanFragRec::COMPLETED; curr.p->stopFragTimer(); } } } - + if(scanPtr.p->m_delivered_scan_frags.isEmpty() && scanPtr.p->m_running_scan_frags.isEmpty()){ conf->requestInfo = op_count | ScanTabConf::EndOfData; @@ -10424,9 +10492,8 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal) sfp.i, sfp.p->scanFragState, sfp.p->scanFragId); - infoEvent(" nodeid=%d, concurr=%d, timer=%d", + infoEvent(" nodeid=%d, timer=%d", refToNode(sfp.p->lqhBlockref), - sfp.p->scanFragConcurrency, sfp.p->scanFragTimer); } @@ -10504,7 +10571,7 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal) sp.p->scanAiLength, sp.p->scanParallel, sp.p->scanReceivedOperations, - sp.p->noOprecPerFrag); + sp.p->batch_size_rows); infoEvent(" schv=%d, tab=%d, sproc=%d", sp.p->scanSchemaVersion, sp.p->scanTableref, diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am index 4aa514c0aba..98ee2639bac 100644 --- a/ndb/src/kernel/blocks/dbtc/Makefile.am +++ b/ndb/src/kernel/blocks/dbtc/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtc.dsp + +libdbtc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtc_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtc/Makefile_old b/ndb/src/kernel/blocks/dbtc/Makefile_old deleted file mode 100644 index ae876ab1f84..00000000000 --- a/ndb/src/kernel/blocks/dbtc/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbtc -SOURCES = \ - DbtcInit.cpp \ - DbtcMain.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 55ad1d0910a..b48546576f9 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -504,6 +504,7 @@ struct Fragoperrec { Uint32 noOfNewAttrCount; Uint32 charsetIndex; BlockReference lqhBlockrefFrag; + bool inUse; }; typedef Ptr<Fragoperrec> FragoperrecPtr; @@ -1936,6 +1937,7 @@ private: void setUpKeyArray(Tablerec* const regTabPtr); bool addfragtotab(Tablerec* const regTabPtr, Uint32 fragId, Uint32 fragIndex); void deleteFragTab(Tablerec* const regTabPtr, Uint32 fragId); + void abortAddFragOp(Signal* signal); void releaseTabDescr(Tablerec* const regTabPtr); void getFragmentrec(FragrecordPtr& regFragPtr, Uint32 fragId, Tablerec* const regTabPtr); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 49de0d80bcd..8e3ca6528c2 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -1113,6 +1113,7 @@ Dbtup::updateStartLab(Signal* signal, regOperPtr->attrinbufLen); if (retValue == -1) { tupkeyErrorLab(signal); + return -1; }//if } else { jam(); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index d33adcd08e1..0d7430e662d 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -31,7 +31,6 @@ #include <signaldata/TupKey.hpp> #include <signaldata/DropTab.hpp> -#include <new> #define DEBUG(x) { ndbout << "TUP::" << x << endl; } @@ -215,7 +214,7 @@ Dbtup::~Dbtup() }//Dbtup::~Dbtup() -BLOCK_FUNCTIONS(Dbtup); +BLOCK_FUNCTIONS(Dbtup) /* **************************************************************** */ /* ---------------------------------------------------------------- */ @@ -632,14 +631,11 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal) ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_FRAG, &cnoOfFragrec)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &cnoOfOprec)); - - // MemorySpaceTuples is specified in 8k pages, divide by 4 for 32k pages - Uint32 tmp; - ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE, &tmp)); - Uint64 pages = (tmp * 2048 + (ZWORDS_ON_PAGE - 1))/ (Uint64)ZWORDS_ON_PAGE; - cnoOfPage = (Uint32)pages; + + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE, &cnoOfPage)); Uint32 noOfTriggers= 0; + Uint32 tmp= 0; ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE_RANGE, &tmp)); initPageRangeSize(tmp); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_TABLE, &cnoOfTablerec)); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index efea312b865..405f790954e 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -39,11 +39,18 @@ /* ---------------------------------------------------------------- */ void Dbtup::execTUPFRAGREQ(Signal* signal) { + ljamEntry(); + + if (signal->theData[0] == (Uint32)-1) { + ljam(); + abortAddFragOp(signal); + return; + } + FragoperrecPtr fragOperPtr; FragrecordPtr regFragPtr; TablerecPtr regTabPtr; - ljamEntry(); Uint32 userptr = signal->theData[0]; Uint32 userblockref = signal->theData[1]; Uint32 reqinfo = signal->theData[2]; @@ -62,6 +69,17 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) Uint32 noOfAttributeGroups = signal->theData[12]; Uint32 globalCheckpointIdIndicator = signal->theData[13]; +#ifndef VM_TRACE + // config mismatch - do not crash if release compiled + if (regTabPtr.i >= cnoOfTablerec) { + ljam(); + signal->theData[0] = userptr; + signal->theData[1] = 800; + sendSignal(userblockref, GSN_TUPFRAGREF, signal, 2, JBB); + return; + } +#endif + ptrCheckGuard(regTabPtr, cnoOfTablerec, tablerec); if (cfirstfreeFragopr == RNIL) { ljam(); @@ -132,6 +150,15 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) return; }//if + if (ERROR_INSERTED(4007) && regTabPtr.p->fragid[0] == fragId || + ERROR_INSERTED(4008) && regTabPtr.p->fragid[1] == fragId) { + ljam(); + terrorCode = 1; + fragrefuse4Lab(signal, fragOperPtr, regFragPtr, regTabPtr.p, fragId); + CLEAR_ERROR_INSERT_VALUE; + return; + } + if (regTabPtr.p->tableStatus == NOT_DEFINED) { ljam(); //------------------------------------------------------------------------------------- @@ -243,6 +270,7 @@ void Dbtup::seizeFragoperrec(FragoperrecPtr& fragOperPtr) ptrCheckGuard(fragOperPtr, cnoOfFragoprec, fragoperrec); cfirstfreeFragopr = fragOperPtr.p->nextFragoprec; fragOperPtr.p->nextFragoprec = RNIL; + fragOperPtr.p->inUse = true; }//Dbtup::seizeFragoperrec() /* **************************************************************** */ @@ -273,6 +301,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) ndbrequire(fragOperPtr.p->attributeCount > 0); fragOperPtr.p->attributeCount--; + const bool lastAttr = (fragOperPtr.p->attributeCount == 0); if ((regTabPtr.p->tableStatus == DEFINING) && (fragOperPtr.p->definingFragment)) { @@ -346,20 +375,30 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); return; }//if - if ((fragOperPtr.p->attributeCount == 0) && - (fragOperPtr.p->freeNullBit != 0)) { + if (lastAttr && (fragOperPtr.p->freeNullBit != 0)) { ljam(); terrorCode = ZINCONSISTENT_NULL_ATTRIBUTE_COUNT; addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); return; }//if }//if + if (ERROR_INSERTED(4009) && regTabPtr.p->fragid[0] == fragId && attrId == 0 || + ERROR_INSERTED(4010) && regTabPtr.p->fragid[0] == fragId && lastAttr || + ERROR_INSERTED(4011) && regTabPtr.p->fragid[1] == fragId && attrId == 0 || + ERROR_INSERTED(4012) && regTabPtr.p->fragid[1] == fragId && lastAttr) { + ljam(); + terrorCode = 1; + addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); + CLEAR_ERROR_INSERT_VALUE; + return; + } /* **************************************************************** */ /* ************** TUP_ADD_ATTCONF ****************** */ /* **************************************************************** */ signal->theData[0] = fragOperPtr.p->lqhPtrFrag; - sendSignal(fragOperPtr.p->lqhBlockrefFrag, GSN_TUP_ADD_ATTCONF, signal, 1, JBB); - if (fragOperPtr.p->attributeCount > 0) { + signal->theData[1] = lastAttr; + sendSignal(fragOperPtr.p->lqhBlockrefFrag, GSN_TUP_ADD_ATTCONF, signal, 2, JBB); + if (! lastAttr) { ljam(); return; /* EXIT AND WAIT FOR MORE */ }//if @@ -491,11 +530,11 @@ void Dbtup::fragrefuseLab(Signal* signal, FragoperrecPtr fragOperPtr) void Dbtup::releaseFragoperrec(FragoperrecPtr fragOperPtr) { + fragOperPtr.p->inUse = false; fragOperPtr.p->nextFragoprec = cfirstfreeFragopr; cfirstfreeFragopr = fragOperPtr.i; }//Dbtup::releaseFragoperrec() - void Dbtup::deleteFragTab(Tablerec* const regTabPtr, Uint32 fragId) { for (Uint32 i = 0; i < (2 * MAX_FRAG_PER_NODE); i++) { @@ -510,6 +549,20 @@ void Dbtup::deleteFragTab(Tablerec* const regTabPtr, Uint32 fragId) ndbrequire(false); }//Dbtup::deleteFragTab() +/* + * LQH aborts on-going create table operation. The table is later + * dropped by DICT. + */ +void Dbtup::abortAddFragOp(Signal* signal) +{ + FragoperrecPtr fragOperPtr; + + fragOperPtr.i = signal->theData[1]; + ptrCheckGuard(fragOperPtr, cnoOfFragoprec, fragoperrec); + ndbrequire(fragOperPtr.p->inUse); + releaseFragoperrec(fragOperPtr); +} + void Dbtup::execDROP_TAB_REQ(Signal* signal) { diff --git a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index e6cc6f68842..cbb165c3eb1 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -706,7 +706,10 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr) tOutBufIndex = 0; tMaxRead = MAX_KEY_SIZE_IN_WORDS; + bool tmp = tXfrmFlag; + tXfrmFlag = false; ndbrequire((this->*f)(&keyReadBuffer[0], ahOut, attrDescriptor, attributeOffset)); + tXfrmFlag = tmp; ndbrequire(tOutBufIndex == ahOut->getDataSize()); if (ahIn.getDataSize() != ahOut->getDataSize()) { ljam(); diff --git a/ndb/src/kernel/blocks/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am index 7e94a01d43b..e51410e6be3 100644 --- a/ndb/src/kernel/blocks/dbtup/Makefile.am +++ b/ndb/src/kernel/blocks/dbtup/Makefile.am @@ -25,3 +25,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtup.dsp + +libdbtup.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtup_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtup/Makefile_old b/ndb/src/kernel/blocks/dbtup/Makefile_old deleted file mode 100644 index 87146f4b441..00000000000 --- a/ndb/src/kernel/blocks/dbtup/Makefile_old +++ /dev/null @@ -1,26 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbtup -SOURCES = \ - DbtupExecQuery.cpp \ - DbtupBuffer.cpp \ - DbtupRoutines.cpp \ - DbtupCommit.cpp \ - DbtupFixAlloc.cpp \ - DbtupTrigger.cpp \ - DbtupAbort.cpp \ - DbtupLCP.cpp \ - DbtupUndoLog.cpp \ - DbtupPageMap.cpp \ - DbtupPagMan.cpp \ - DbtupStoredProcDef.cpp \ - DbtupMeta.cpp \ - DbtupTabDesMan.cpp \ - DbtupGen.cpp \ - DbtupSystemRestart.cpp \ - DbtupIndex.cpp \ - DbtupDebug.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index 8896324f793..2c96271eb5d 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -17,7 +17,6 @@ #ifndef DBTUX_H #define DBTUX_H -#include <new> #include <ndb_limits.h> #include <SimulatedBlock.hpp> #include <AttributeDescriptor.hpp> @@ -575,6 +574,7 @@ private: void execDROP_TAB_REQ(Signal* signal); bool allocDescEnt(IndexPtr indexPtr); void freeDescEnt(IndexPtr indexPtr); + void abortAddFragOp(Signal* signal); void dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 senderData); /* @@ -684,6 +684,7 @@ private: friend class NdbOut& operator<<(NdbOut&, const ScanOp&); friend class NdbOut& operator<<(NdbOut&, const Index&); friend class NdbOut& operator<<(NdbOut&, const Frag&); + friend class NdbOut& operator<<(NdbOut&, const FragOp&); friend class NdbOut& operator<<(NdbOut&, const NodeHandle&); FILE* debugFile; NdbOut debugOut; @@ -1064,7 +1065,7 @@ Dbtux::Index::Index() : m_fragId[i] = ZNIL; m_fragPtrI[i] = RNIL; }; -}; +} // Dbtux::Frag @@ -1101,7 +1102,7 @@ Dbtux::FragOp::FragOp() : m_fragNo(ZNIL), m_numAttrsRecvd(ZNIL) { -}; +} // Dbtux::NodeHandle diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp index c5c22264460..1e1b0d1d5b6 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp @@ -404,6 +404,19 @@ operator<<(NdbOut& out, const Dbtux::Frag& frag) } NdbOut& +operator<<(NdbOut& out, const Dbtux::FragOp& fragOp) +{ + out << "[FragOp " << hex << &fragOp; + out << " [userPtr " << dec << fragOp.m_userPtr << "]"; + out << " [indexId " << dec << fragOp.m_indexId << "]"; + out << " [fragId " << dec << fragOp.m_fragId << "]"; + out << " [fragNo " << dec << fragOp.m_fragNo << "]"; + out << " numAttrsRecvd " << dec << fragOp.m_numAttrsRecvd << "]"; + out << "]"; + return out; +} + +NdbOut& operator<<(NdbOut& out, const Dbtux::NodeHandle& node) { const Dbtux::Frag& frag = node.m_frag; diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp index ded02696a89..8990d6c86b6 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp @@ -24,13 +24,8 @@ Dbtux::Dbtux(const Configuration& conf) : #ifdef VM_TRACE debugFile(0), debugOut(*new NullOutputStream()), - // until ndb_mgm supports dump -#ifdef DBTUX_DEBUG_TREE - debugFlags(DebugTree), -#else debugFlags(0), #endif -#endif c_internalStartPhase(0), c_typeOfStart(NodeState::ST_ILLEGAL_TYPE), c_dataBuffer(0) @@ -86,7 +81,7 @@ Dbtux::execCONTINUEB(Signal* signal) jamEntry(); const Uint32* data = signal->getDataPtr(); switch (data[0]) { - case TuxContinueB::DropIndex: + case TuxContinueB::DropIndex: // currently unused { IndexPtr indexPtr; c_indexPool.getPtr(indexPtr, data[1]); @@ -174,7 +169,7 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_ATTRIBUTE, &nAttribute)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp)); - const Uint32 nDescPage = (nIndex + nAttribute + DescPageSize - 1) / DescPageSize; + const Uint32 nDescPage = (nIndex * DescHeadSize + nAttribute * DescAttrSize + DescPageSize - 1) / DescPageSize; const Uint32 nScanBoundWords = nScanOp * ScanBoundSegmentSize * 4; c_indexPool.setSize(nIndex); @@ -298,4 +293,4 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2 #endif } -BLOCK_FUNCTIONS(Dbtux); +BLOCK_FUNCTIONS(Dbtux) diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp index 1577c5045e0..b7526593a08 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp @@ -29,6 +29,11 @@ void Dbtux::execTUXFRAGREQ(Signal* signal) { jamEntry(); + if (signal->theData[0] == (Uint32)-1) { + jam(); + abortAddFragOp(signal); + return; + } const TuxFragReq reqCopy = *(const TuxFragReq*)signal->getDataPtr(); const TuxFragReq* const req = &reqCopy; IndexPtr indexPtr; @@ -61,6 +66,11 @@ Dbtux::execTUXFRAGREQ(Signal* signal) fragOpPtr.p->m_fragId = req->fragId; fragOpPtr.p->m_fragNo = indexPtr.p->m_numFrags; fragOpPtr.p->m_numAttrsRecvd = 0; +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Seize frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif // check if index has place for more fragments ndbrequire(indexPtr.p->m_numFrags < MaxIndexFragments); // seize new fragment record @@ -129,6 +139,14 @@ Dbtux::execTUXFRAGREQ(Signal* signal) debugOut << "Add frag " << fragPtr.i << " " << *fragPtr.p << endl; } #endif + // error inserts + if (ERROR_INSERTED(12001) && fragOpPtr.p->m_fragNo == 0 || + ERROR_INSERTED(12002) && fragOpPtr.p->m_fragNo == 1) { + jam(); + errorCode = (TuxFragRef::ErrorCode)1; + CLEAR_ERROR_INSERT_VALUE; + break; + } // success TuxFragConf* const conf = (TuxFragConf*)signal->getDataPtrSend(); conf->userPtr = req->userPtr; @@ -145,10 +163,18 @@ Dbtux::execTUXFRAGREQ(Signal* signal) ref->errorCode = errorCode; sendSignal(req->userRef, GSN_TUXFRAGREF, signal, TuxFragRef::SignalLength, JBB); - if (fragOpPtr.i != RNIL) + if (fragOpPtr.i != RNIL) { +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release on frag error frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif c_fragOpPool.release(fragOpPtr); - if (indexPtr.i != RNIL) - dropIndex(signal, indexPtr, 0, 0); + } + if (indexPtr.i != RNIL) { + jam(); + // let DICT drop the unfinished index + } } void @@ -203,7 +229,16 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) } } #endif - if (indexPtr.p->m_numAttrs == fragOpPtr.p->m_numAttrsRecvd) { + const bool lastAttr = (indexPtr.p->m_numAttrs == fragOpPtr.p->m_numAttrsRecvd); + if (ERROR_INSERTED(12003) && fragOpPtr.p->m_fragNo == 0 && attrId == 0 || + ERROR_INSERTED(12004) && fragOpPtr.p->m_fragNo == 0 && lastAttr || + ERROR_INSERTED(12005) && fragOpPtr.p->m_fragNo == 1 && attrId == 0 || + ERROR_INSERTED(12006) && fragOpPtr.p->m_fragNo == 1 && lastAttr) { + errorCode = (TuxAddAttrRef::ErrorCode)1; + CLEAR_ERROR_INSERT_VALUE; + break; + } + if (lastAttr) { jam(); // initialize tree header TreeHead& tree = fragPtr.p->m_tree; @@ -246,11 +281,17 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) } #endif // fragment is defined +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif c_fragOpPool.release(fragOpPtr); } // success TuxAddAttrConf* conf = (TuxAddAttrConf*)signal->getDataPtrSend(); conf->userPtr = fragOpPtr.p->m_userPtr; + conf->lastAttr = lastAttr; sendSignal(fragOpPtr.p->m_userRef, GSN_TUX_ADD_ATTRCONF, signal, TuxAddAttrConf::SignalLength, JBB); return; @@ -261,8 +302,32 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) ref->errorCode = errorCode; sendSignal(fragOpPtr.p->m_userRef, GSN_TUX_ADD_ATTRREF, signal, TuxAddAttrRef::SignalLength, JBB); +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release on attr error frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif c_fragOpPool.release(fragOpPtr); - dropIndex(signal, indexPtr, 0, 0); + // let DICT drop the unfinished index +} + +/* + * LQH aborts on-going create index operation. + */ +void +Dbtux::abortAddFragOp(Signal* signal) +{ + FragOpPtr fragOpPtr; + IndexPtr indexPtr; + c_fragOpPool.getPtr(fragOpPtr, signal->theData[1]); + c_indexPool.getPtr(indexPtr, fragOpPtr.p->m_indexId); +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release on abort frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif + c_fragOpPool.release(fragOpPtr); + // let DICT drop the unfinished index } /* @@ -341,20 +406,13 @@ Dbtux::dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 sen { jam(); indexPtr.p->m_state = Index::Dropping; - // drop one fragment at a time - if (indexPtr.p->m_numFrags > 0) { + // drop fragments + while (indexPtr.p->m_numFrags > 0) { jam(); - unsigned i = --indexPtr.p->m_numFrags; + Uint32 i = --indexPtr.p->m_numFrags; FragPtr fragPtr; c_fragPool.getPtr(fragPtr, indexPtr.p->m_fragPtrI[i]); c_fragPool.release(fragPtr); - // the real time break is not used for anything currently - signal->theData[0] = TuxContinueB::DropIndex; - signal->theData[1] = indexPtr.i; - signal->theData[2] = senderRef; - signal->theData[3] = senderData; - sendSignal(reference(), GSN_CONTINUEB, signal, 4, JBB); - return; } // drop attributes if (indexPtr.p->m_descPage != RNIL) { diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am index 7d012924522..b5951e8ed37 100644 --- a/ndb/src/kernel/blocks/dbtux/Makefile.am +++ b/ndb/src/kernel/blocks/dbtux/Makefile.am @@ -18,3 +18,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtux.dsp + +libdbtux.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtux_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtux/Makefile_old b/ndb/src/kernel/blocks/dbtux/Makefile_old deleted file mode 100644 index 30927c31848..00000000000 --- a/ndb/src/kernel/blocks/dbtux/Makefile_old +++ /dev/null @@ -1,17 +0,0 @@ -include .defs.mk - -TYPE = kernel - -ARCHIVE_TARGET = dbtux - -SOURCES = \ - DbtuxGen.cpp \ - DbtuxMeta.cpp \ - DbtuxMaint.cpp \ - DbtuxNode.cpp \ - DbtuxTree.cpp \ - DbtuxScan.cpp \ - DbtuxCmp.cpp \ - DbtuxDebug.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index f7e8981e122..b94bb8e6d7e 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -158,7 +158,7 @@ DbUtil::~DbUtil() { } -BLOCK_FUNCTIONS(DbUtil); +BLOCK_FUNCTIONS(DbUtil) void DbUtil::releasePrepare(PreparePtr prepPtr) { diff --git a/ndb/src/kernel/blocks/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am index 763875d578f..925356c2f76 100644 --- a/ndb/src/kernel/blocks/dbutil/Makefile.am +++ b/ndb/src/kernel/blocks/dbutil/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbutil.dsp + +libdbutil.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbutil_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbutil/Makefile_old b/ndb/src/kernel/blocks/dbutil/Makefile_old deleted file mode 100644 index 54b7326e4e5..00000000000 --- a/ndb/src/kernel/blocks/dbutil/Makefile_old +++ /dev/null @@ -1,8 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbutil -SOURCES = DbUtil.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/grep/Grep.cpp b/ndb/src/kernel/blocks/grep/Grep.cpp index 0e41182348f..e89361dab06 100644 --- a/ndb/src/kernel/blocks/grep/Grep.cpp +++ b/ndb/src/kernel/blocks/grep/Grep.cpp @@ -603,7 +603,7 @@ Grep::PSCoord::execCREATE_SUBID_CONF(Signal* signal) GrepEvent::GrepPS_CreateSubIdConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); } void @@ -612,7 +612,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) { CreateSubscriptionIdRef const * ref = (CreateSubscriptionIdRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err; + GrepError::GE_Code err; Uint32 sendersBlockRef = signal->getSendersBlockRef(); if(sendersBlockRef == SUMA_REF) @@ -624,7 +624,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) { ndbrequire(false); /* Added since errorcode err unhandled * TODO: fix correct errorcode */ - err= GrepError::NO_ERROR; // remove compiler warning + err= GrepError::GE_NO_ERROR; // remove compiler warning } SubCoordinatorPtr subPtr; @@ -824,7 +824,7 @@ Grep::PSPart::execSUB_CREATE_REF(Signal* signal) jamEntry(); SubCreateRef * const ref = (SubCreateRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); sendRefToPSCoord(signal, *subPtr.p, err /*error*/); @@ -867,7 +867,7 @@ Grep::PSCoord::execGREP_CREATE_CONF(Signal* signal) GrepEvent::GrepPS_SubCreateConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); @@ -889,7 +889,7 @@ Grep::PSCoord::execGREP_CREATE_REF(Signal* signal) SubCoordinatorPtr subPtr; c_runningSubscriptions.getPtr(subPtr, subData); - sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/); + sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/); } @@ -1046,7 +1046,7 @@ Grep::PSPart::execSUB_START_REF(Signal* signal) { SubStartRef * const ref = (SubStartRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); @@ -1102,7 +1102,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubStartMetaConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); break; @@ -1118,7 +1118,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubStartDataConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); @@ -1145,7 +1145,7 @@ Grep::PSCoord::execGREP_START_REF(Signal* signal) jamEntry(); GrepStartRef * const ref = (GrepStartRef *)signal->getDataPtr(); Uint32 subData = ref->senderData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubCoordinatorPtr subPtr; @@ -1301,7 +1301,7 @@ Grep::PSPart::execSUB_REMOVE_REF(Signal* signal) jamEntry(); SubRemoveRef * const ref = (SubRemoveRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - /* GrepError::Code err = (GrepError::Code)ref->err;*/ + /* GrepError::GE_Code err = (GrepError::GE_Code)ref->err;*/ SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); @@ -1342,7 +1342,7 @@ Grep::PSCoord::execGREP_REMOVE_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubRemoveConf, subId, subKey, - GrepError::NO_ERROR); + GrepError::GE_NO_ERROR); GrepSubRemoveConf * grepConf = (GrepSubRemoveConf *) conf; grepConf->subscriptionId = subId; @@ -1375,7 +1375,7 @@ Grep::PSCoord::execGREP_REMOVE_REF(Signal* signal) subPtr.p = c_runningSubscriptions.getPtr(subPtr.i); if(subData == subPtr.i) { - sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/); + sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/); c_runningSubscriptions.release(subPtr); return; } @@ -1633,7 +1633,7 @@ Grep::PSPart::execSUB_SYNC_REF(Signal* signal) { jamEntry(); SubSyncRef * const ref = (SubSyncRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubscriptionPtr subPtr; @@ -1677,7 +1677,7 @@ Grep::PSCoord::execGREP_SYNC_CONF(Signal* signal) /* @todo Johan: Add firstGCI here. /Lars */ m_grep->sendEventRep(signal, EventReport::GrepSubscriptionInfo, event, subId, subKey, - (Uint32)GrepError::NO_ERROR, + (Uint32)GrepError::GE_NO_ERROR, lastGCI); /************************* @@ -1707,7 +1707,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) { GrepSyncRef * const ref = (GrepSyncRef *)signal->getDataPtr(); Uint32 subData = ref->senderData; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubCoordinatorPtr subPtr; c_runningSubscriptions.getPtr(subPtr, subData); sendRefToSS(signal, *subPtr.p, err /*error*/, part); @@ -1718,7 +1718,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) { void Grep::PSCoord::sendRefToSS(Signal * signal, SubCoordinator sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part) { /** @@ -1843,7 +1843,7 @@ Grep::PSCoord::sendRefToSS(Signal * signal, void Grep::PSPart::sendRefToPSCoord(Signal * signal, Subscription sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part) { jam(); diff --git a/ndb/src/kernel/blocks/grep/Grep.hpp b/ndb/src/kernel/blocks/grep/Grep.hpp index eeabac36966..7d3dd916ecc 100644 --- a/ndb/src/kernel/blocks/grep/Grep.hpp +++ b/ndb/src/kernel/blocks/grep/Grep.hpp @@ -380,16 +380,16 @@ public: Uint32 subId, Uint32 subKey, BlockReference to, - GrepError::Code err); + GrepError::GE_Code err); void sendSubRemoveRef_SS(Signal * signal, SubCoordinator sub, - GrepError::Code err); + GrepError::GE_Code err); void sendRefToSS(Signal * signal, SubCoordinator sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part = (SubscriptionData::Part)0); void setRepRef(BlockReference rr) { m_repRef = rr; }; @@ -496,7 +496,7 @@ public: void sendRefToPSCoord(Signal * signal, Subscription sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part = (SubscriptionData::Part)0); //protected: diff --git a/ndb/src/kernel/blocks/grep/GrepInit.cpp b/ndb/src/kernel/blocks/grep/GrepInit.cpp index cfb454a1f9b..d764fb1f473 100644 --- a/ndb/src/kernel/blocks/grep/GrepInit.cpp +++ b/ndb/src/kernel/blocks/grep/GrepInit.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Grep.hpp" -#include <new> #include <Properties.hpp> #include <Configuration.hpp> @@ -132,7 +131,7 @@ Grep::~Grep() { } -BLOCK_FUNCTIONS(Grep); +BLOCK_FUNCTIONS(Grep) Grep::PSPart::PSPart(Grep * sb) : BlockComponent(sb), diff --git a/ndb/src/kernel/blocks/grep/Makefile.am b/ndb/src/kernel/blocks/grep/Makefile.am index 31081c7b6a0..6d2b422784b 100644 --- a/ndb/src/kernel/blocks/grep/Makefile.am +++ b/ndb/src/kernel/blocks/grep/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libgrep.dsp + +libgrep.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/grep/Makefile_old b/ndb/src/kernel/blocks/grep/Makefile_old deleted file mode 100644 index 5ad5a0bce3b..00000000000 --- a/ndb/src/kernel/blocks/grep/Makefile_old +++ /dev/null @@ -1,9 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := grep - -SOURCES = Grep.cpp GrepInit.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am index 9230b55b374..3f24675b2b3 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.am +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am @@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbcntr.dsp + +libndbcntr.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbcntr_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile_old b/ndb/src/kernel/blocks/ndbcntr/Makefile_old deleted file mode 100644 index 8e9c4f01027..00000000000 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := ndbcntr - -SOURCES = \ - NdbcntrInit.cpp \ - NdbcntrSysTable.cpp \ - NdbcntrMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index 43044eeebcd..c7b472fc91a 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -114,4 +114,4 @@ Ndbcntr::~Ndbcntr() }//Ndbcntr::~Ndbcntr() -BLOCK_FUNCTIONS(Ndbcntr); +BLOCK_FUNCTIONS(Ndbcntr) diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index a02bfd459b3..f76440a462a 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -14,19 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * O_DIRECT - */ -#if 0 -//#ifdef NDB_LINUX -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#endif - #include <ndb_global.h> +#include <my_sys.h> +#include <my_pthread.h> -#include "Error.hpp" +#include <Error.hpp> #include "AsyncFile.hpp" #include <ErrorHandlingMacros.hpp> @@ -35,13 +27,12 @@ #include <NdbThread.h> #include <signaldata/FsOpenReq.hpp> -#if 0 -#ifdef HAVE_PREAD -// This is for pread and pwrite -#ifndef __USE_UNIX98 -#define __USE_UNIX98 -#endif -#endif +// use this to test broken pread code +//#define HAVE_BROKEN_PREAD + +#ifdef HAVE_BROKEN_PREAD +#undef HAVE_PWRITE +#undef HAVE_PREAD #endif #if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE @@ -227,7 +218,8 @@ AsyncFile::run() rmrfReq(request, (char*)theFileName.c_str(), request->par.rmrf.own_directory); break; case Request:: end: - closeReq(request); + if (theFd > 0) + closeReq(request); endReq(); return; default: @@ -247,6 +239,7 @@ void AsyncFile::openReq(Request* request) { m_openedWithSync = false; m_syncFrequency = 0; + m_syncCount= 0; // for open.flags, see signal FSOPENREQ #ifdef NDB_WIN32 @@ -337,7 +330,6 @@ void AsyncFile::openReq(Request* request) } else { #endif m_openedWithSync = false; - m_syncCount = 0; m_syncFrequency = Global_syncFreq; #if 0 } @@ -395,9 +387,12 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){ if(dwSFP != offset) { return GetLastError(); } -#elif defined NDB_OSE || defined NDB_SOFTOSE - return_value = lseek(theFd, offset, SEEK_SET); - if (return_value != offset) { +#elif ! defined(HAVE_PREAD) + off_t seek_val; + while((seek_val= lseek(theFd, offset, SEEK_SET)) == (off_t)-1 + && errno == EINTR); + if(seek_val == (off_t)-1) + { return errno; } #endif @@ -416,7 +411,7 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){ return GetLastError(); } bytes_read = dwBytesRead; -#elif defined NDB_OSE || defined NDB_SOFTOSE +#elif ! defined(HAVE_PREAD) return_value = ::read(theFd, buf, size); #else // UNIX return_value = ::pread(theFd, buf, size, offset); @@ -469,7 +464,7 @@ AsyncFile::readReq( Request * request) void AsyncFile::readvReq( Request * request) { -#if defined NDB_OSE || defined NDB_SOFTOSE +#if ! defined(HAVE_PREAD) readReq(request); return; #elif defined NDB_WIN32 @@ -499,7 +494,7 @@ AsyncFile::readvReq( Request * request) int AsyncFile::extendfile(Request* request) { -#if defined NDB_OSE || defined NDB_SOFTOSE +#if ! defined(HAVE_PWRITE) // Find max size of this file in this request int maxOffset = 0; int maxSize = 0; @@ -608,27 +603,13 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, if(dwSFP != offset) { return GetLastError(); } -#elif defined NDB_OSE || defined NDB_SOFTOSE - return_value = lseek(theFd, offset, SEEK_SET); - if (return_value != offset) { - DEBUG(ndbout_c("AsyncFile::writeReq, err1: return_value=%d, offset=%d\n", - return_value, chunk_offset)); - PRINT_ERRORANDFLAGS(0); - if (errno == 78) { - // Could not write beyond end of file, try to extend file - DEBUG(ndbout_c("AsyncFile::writeReq, Extend. file! filename=\"%s\" \n", - theFileName.c_str())); - return_value = extendfile(request); - if (return_value == -1) { - return errno; - } - return_value = lseek(theFd, offset, SEEK_SET); - if (return_value != offset) { - return errno; - } - } else { - return errno; - } +#elif ! defined(HAVE_PWRITE) + off_t seek_val; + while((seek_val= lseek(theFd, offset, SEEK_SET)) == (off_t)-1 + && errno == EINTR); + if(seek_val == (off_t)-1) + { + return errno; } #endif @@ -650,7 +631,7 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, DEBUG(ndbout_c("Warning partial write %d != %d", bytes_written, bytes_to_write)); } -#elif defined NDB_OSE || defined NDB_SOFTOSE +#elif ! defined(HAVE_PWRITE) return_value = ::write(theFd, buf, bytes_to_write); #else // UNIX return_value = ::pwrite(theFd, buf, bytes_to_write, offset); @@ -675,6 +656,7 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, } #endif + m_syncCount+= bytes_written; buf += bytes_written; size -= bytes_written; offset += bytes_written; @@ -701,6 +683,10 @@ AsyncFile::closeReq(Request * request) hFile = INVALID_HANDLE_VALUE; #else if (-1 == ::close(theFd)) { +#ifndef DBUG_OFF + if (theFd == -1) + abort(); +#endif request->error = errno; } theFd = -1; @@ -719,7 +705,8 @@ bool AsyncFile::isOpen(){ void AsyncFile::syncReq(Request * request) { - if(m_openedWithSync){ + if(m_openedWithSync || + m_syncCount == 0){ return; } #ifdef NDB_WIN32 @@ -775,7 +762,6 @@ AsyncFile::appendReq(Request * request){ if(m_syncFrequency != 0 && m_syncCount > m_syncFrequency){ syncReq(request); - request->error = 0; } } @@ -889,7 +875,6 @@ void AsyncFile::endReq() { // Thread is ended with return if (theWriteBuffer) NdbMem_Free(theWriteBuffer); - NdbThread_Exit(0); } diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am index c2b663c5042..a22386f8612 100644 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.am +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am @@ -11,3 +11,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbfs.dsp + +libndbfs.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbfs_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile_old b/ndb/src/kernel/blocks/ndbfs/Makefile_old deleted file mode 100644 index 58e1458bf16..00000000000 --- a/ndb/src/kernel/blocks/ndbfs/Makefile_old +++ /dev/null @@ -1,14 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := ndbfs - -SOURCES = \ - AsyncFile.cpp \ - Ndbfs.cpp VoidFs.cpp \ - Filename.cpp \ - CircularIndex.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp index aeab9f7828d..b98c60693f4 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp @@ -40,7 +40,6 @@ extern "C" void* runProducer(void*arg) NdbSleep_MilliSleep(i); i++; } - NdbThread_Exit(0); return NULL; } @@ -58,7 +57,6 @@ extern "C" void* runConsumer(void* arg) delete p; } - NdbThread_Exit(0); return NULL; } @@ -92,7 +90,6 @@ extern "C" void* runProducer2(void*arg) NdbSleep_MilliSleep(i); i++; } - NdbThread_Exit(0); return NULL; } @@ -111,7 +108,6 @@ extern "C" void* runConsumer2(void* arg) delete p; } ndbout << "Consumer2: " << count << " received" << endl; - NdbThread_Exit(0); return NULL; } diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 56e3d3abbed..9c943760e31 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -730,7 +730,7 @@ Ndbfs::scanIPC(Signal* signal) jam(); report(request, signal); theRequestPool->put(request); - return &request; + return true; } return false; } @@ -1010,7 +1010,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal) -BLOCK_FUNCTIONS(Ndbfs); +BLOCK_FUNCTIONS(Ndbfs) template class Vector<AsyncFile*>; template class Vector<OpenFiles::OpenFileItem>; diff --git a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp index d3407e8d4e7..d093089acfc 100644 --- a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp @@ -196,5 +196,5 @@ VoidFs::execDUMP_STATE_ORD(Signal* signal) -BLOCK_FUNCTIONS(VoidFs); +BLOCK_FUNCTIONS(VoidFs) diff --git a/ndb/src/kernel/blocks/qmgr/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am index 52cadb3bd3d..278af2a7865 100644 --- a/ndb/src/kernel/blocks/qmgr/Makefile.am +++ b/ndb/src/kernel/blocks/qmgr/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libqmgr.dsp + +libqmgr.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libqmgr_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/qmgr/Makefile_old b/ndb/src/kernel/blocks/qmgr/Makefile_old deleted file mode 100644 index cd15643ea60..00000000000 --- a/ndb/src/kernel/blocks/qmgr/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := qmgr - -SOURCES = \ - QmgrInit.cpp \ - QmgrMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp index b0f1088779c..d6960ce154e 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp @@ -100,4 +100,4 @@ Qmgr::~Qmgr() }//Qmgr::~Qmgr() -BLOCK_FUNCTIONS(Qmgr); +BLOCK_FUNCTIONS(Qmgr) diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 41deb3403c8..da8596076ec 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -1934,17 +1934,27 @@ void Qmgr::execAPI_REGREQ(Signal* signal) switch(getNodeInfo(apiNodePtr.i).getType()){ case NodeInfo::API: compatability_check = ndbCompatible_ndb_api(NDB_VERSION, version); + if (!compatability_check) + infoEvent("Connection attempt from api or mysqld id=%d with %s " + "incompatible with %s", apiNodePtr.i, + getVersionString(version,""), NDB_VERSION_STRING); break; case NodeInfo::MGM: compatability_check = ndbCompatible_ndb_mgmt(NDB_VERSION, version); + if (!compatability_check) + infoEvent("Connection attempt from management server id=%d with %s " + "incompatible with %s", apiNodePtr.i, + getVersionString(version,""), NDB_VERSION_STRING); break; case NodeInfo::REP: - compatability_check = ndbCompatible_ndb_api(NDB_VERSION, version); - break; + // compatability_check = ndbCompatible_ndb_api(NDB_VERSION, version); + // break; case NodeInfo::DB: case NodeInfo::INVALID: default: sendApiRegRef(signal, ref, ApiRegRef::WrongType); + infoEvent("Invalid connection attempt with type %d", + getNodeInfo(apiNodePtr.i).getType()); return; } @@ -2937,6 +2947,12 @@ void Qmgr::sendPrepFailReq(Signal* signal, Uint16 aNode) */ /** + * Should < 1/2 nodes die unconditionally. Affects only >= 3-way + * replication. + */ +static const bool g_ndb_arbit_one_half_rule = false; + +/** * Config signals are logically part of CM_INIT. */ void @@ -3147,7 +3163,8 @@ Qmgr::handleArbitCheck(Signal* signal) ndbrequire(cpresident == getOwnNodeId()); NodeBitmask ndbMask; computeArbitNdbMask(ndbMask); - if (2 * ndbMask.count() < cnoOfNodes) { + if (g_ndb_arbit_one_half_rule && + 2 * ndbMask.count() < cnoOfNodes) { jam(); arbitRec.code = ArbitCode::LoseNodes; } else { @@ -3171,6 +3188,11 @@ Qmgr::handleArbitCheck(Signal* signal) case CheckNodeGroups::Partitioning: jam(); arbitRec.code = ArbitCode::Partitioning; + if (g_ndb_arbit_one_half_rule && + 2 * ndbMask.count() > cnoOfNodes) { + jam(); + arbitRec.code = ArbitCode::WinNodes; + } break; default: ndbrequire(false); @@ -3180,8 +3202,12 @@ Qmgr::handleArbitCheck(Signal* signal) switch (arbitRec.code) { case ArbitCode::LoseNodes: jam(); + case ArbitCode::LoseGroups: + jam(); goto crashme; - case ArbitCode::WinGroups: + case ArbitCode::WinNodes: + jam(); + case ArbitCode::WinGroups: jam(); if (arbitRec.state == ARBIT_RUN) { jam(); @@ -3190,9 +3216,6 @@ Qmgr::handleArbitCheck(Signal* signal) arbitRec.state = ARBIT_INIT; arbitRec.newstate = true; break; - case ArbitCode::LoseGroups: - jam(); - goto crashme; case ArbitCode::Partitioning: if (arbitRec.state == ARBIT_RUN) { jam(); @@ -3752,8 +3775,7 @@ Qmgr::execARBIT_CHOOSEREF(Signal* signal) } /** - * Handle CRASH state. We must crash immediately. But it - * would be nice to wait until event reports have been sent. + * Handle CRASH state. We must crash immediately. * XXX tell other nodes in our party to crash too. */ void @@ -3763,12 +3785,11 @@ Qmgr::stateArbitCrash(Signal* signal) if (arbitRec.newstate) { jam(); CRASH_INSERTION((Uint32)910 + arbitRec.state); - arbitRec.setTimestamp(); arbitRec.code = 0; arbitRec.newstate = false; } -#if 0 +#ifdef ndb_arbit_crash_wait_for_event_report_to_get_out if (! (arbitRec.getTimediff() > getArbitTimeout())) return; #endif diff --git a/ndb/src/kernel/blocks/suma/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am index 4dacb22af51..5a74dbb74eb 100644 --- a/ndb/src/kernel/blocks/suma/Makefile.am +++ b/ndb/src/kernel/blocks/suma/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libsuma.dsp + +libsuma.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libsuma_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/suma/Makefile_old b/ndb/src/kernel/blocks/suma/Makefile_old deleted file mode 100644 index 20014c94670..00000000000 --- a/ndb/src/kernel/blocks/suma/Makefile_old +++ /dev/null @@ -1,10 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := suma - -SOURCES = Suma.cpp SumaInit.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index d11d5f7176a..44ac054dd67 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -824,7 +824,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal) return; } - Uint32 subId = conf->sequenceValue[0]; + Uint64 subId; + memcpy(&subId,conf->sequenceValue,8); Uint32 subData = conf->senderData; SubscriberPtr subbPtr; @@ -832,8 +833,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal) CreateSubscriptionIdConf * subconf = (CreateSubscriptionIdConf*)conf; - subconf->subscriptionId = subId; - subconf->subscriptionKey =(getOwnNodeId() << 16) | (subId & 0xFFFF); + subconf->subscriptionId = (Uint32)subId; + subconf->subscriptionKey =(getOwnNodeId() << 16) | (Uint32)(subId & 0xFFFF); subconf->subscriberData = subbPtr.p->m_senderData; sendSignal(subbPtr.p->m_subscriberRef, GSN_CREATE_SUBID_CONF, signal, @@ -1888,7 +1889,7 @@ SumaParticipant::SyncRecord::nextScan(Signal* signal){ req->requestInfo = 0; req->savePointId = 0; ScanFragReq::setLockMode(req->requestInfo, 0); - ScanFragReq::setHoldLockFlag(req->requestInfo, 0); + ScanFragReq::setHoldLockFlag(req->requestInfo, 1); ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); ScanFragReq::setAttrLen(req->requestInfo, attrLen); req->fragmentNoKeyLen = fd.m_fragDesc.m_fragmentNo; @@ -3471,10 +3472,10 @@ SumaParticipant::completeSubRemoveReq(Signal* signal, SubscriptionPtr subPtr) { */ #if 0 ndbout_c("c_subscriptionPool.getSize() %d c_subscriptionPool.getNoOfFree()%d", - c_subscriptionPool.getSize(),c_subscriptionPool.getNoOfFree()+1); + c_subscriptionPool.getSize(),c_subscriptionPool.getNoOfFree()); #endif - if(c_subscriptionPool.getSize() == c_subscriptionPool.getNoOfFree()+1) { + if(c_subscriptionPool.getSize() == c_subscriptionPool.getNoOfFree()) { jam(); #if 0 ndbout_c("SUB_REMOVE_REQ:Clearing c_tables"); @@ -3553,7 +3554,7 @@ Suma::Restart::Restart(Suma& s) : suma(s) { c_okToStart[i] = false; c_waitingToStart[i] = false; } -}; +} void Suma::Restart::resetNode(Uint32 sumaRef) diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp index 255abd47c94..b5945db3811 100644 --- a/ndb/src/kernel/blocks/suma/SumaInit.cpp +++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp @@ -16,7 +16,6 @@ #include "Suma.hpp" -#include <new> #include <Properties.hpp> #include <Configuration.hpp> @@ -188,6 +187,6 @@ Suma::~Suma() { } -BLOCK_FUNCTIONS(Suma); -BLOCK_FUNCTIONS(SumaParticipant); +BLOCK_FUNCTIONS(Suma) +BLOCK_FUNCTIONS(SumaParticipant) diff --git a/ndb/src/kernel/blocks/trix/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am index 803da815cf0..343063a6283 100644 --- a/ndb/src/kernel/blocks/trix/Makefile.am +++ b/ndb/src/kernel/blocks/trix/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtrix.dsp + +libtrix.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtrix_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/trix/Makefile_old b/ndb/src/kernel/blocks/trix/Makefile_old deleted file mode 100644 index 5ac0da11f33..00000000000 --- a/ndb/src/kernel/blocks/trix/Makefile_old +++ /dev/null @@ -1,8 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := trix -SOURCES = Trix.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/trix/Trix.cpp b/ndb/src/kernel/blocks/trix/Trix.cpp index 80cf9f88c0d..75bc19b6a20 100644 --- a/ndb/src/kernel/blocks/trix/Trix.cpp +++ b/ndb/src/kernel/blocks/trix/Trix.cpp @@ -962,6 +962,6 @@ void Trix::checkParallelism(Signal* signal, SubscriptionRecord* subRec) } } -BLOCK_FUNCTIONS(Trix); +BLOCK_FUNCTIONS(Trix) template void append(DataBuffer<15>&,SegmentedSectionPtr,SectionSegmentPool&); diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index 35c99b30994..35cd3f099d9 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -137,7 +137,7 @@ ErrorReporter::formatMessage(ErrorCategory type, faultID, (problemData == NULL) ? "" : problemData, objRef, - programName, + my_progname, processId, theNameOfTheTraceFile ? theNameOfTheTraceFile : "<no tracefile>"); diff --git a/ndb/src/kernel/error/Makefile.am b/ndb/src/kernel/error/Makefile.am index 4514d2d105c..54f3de2d76d 100644 --- a/ndb/src/kernel/error/Makefile.am +++ b/ndb/src/kernel/error/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: liberror.dsp + +liberror.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(liberror_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/error/Makefile_old b/ndb/src/kernel/error/Makefile_old deleted file mode 100644 index 0fe81f083ce..00000000000 --- a/ndb/src/kernel/error/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := error - -SOURCES = \ - TimeModule.cpp \ - ErrorReporter.cpp \ - ErrorMessages.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index fa44704807d..e6e0a7ca877 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -19,7 +19,6 @@ #include <ndb_version.h> #include "Configuration.hpp" -#include <LocalConfig.hpp> #include <TransporterRegistry.hpp> #include "vm/SimBlockList.hpp" @@ -53,15 +52,13 @@ extern "C" void handler_error(int signum); // for process signal handling void systemInfo(const Configuration & conf, const LogLevel & ll); -const char programName[] = "NDB Kernel"; - -NDB_MAIN(ndb_kernel){ - - ndb_init(); +int main(int argc, char** argv) +{ + NDB_INIT(argv[0]); // Print to stdout/console g_eventLogger.createConsoleHandler(); g_eventLogger.setCategory("NDB"); - g_eventLogger.enable(Logger::LL_INFO, Logger::LL_ALERT); // Log INFO to ALERT + g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); globalEmulatorData.create(); @@ -71,19 +68,14 @@ NDB_MAIN(ndb_kernel){ return NRT_Default; } - LocalConfig local_config; - if (!local_config.init(theConfig->getConnectString(),0)){ - local_config.printError(); - local_config.printUsage(); - return NRT_Default; - } - { // Do configuration - signal(SIGPIPE, SIG_IGN); - theConfig->fetch_configuration(local_config); +#ifndef NDB_WIN32 + signal(SIGPIPE, SIG_IGN); +#endif + theConfig->fetch_configuration(); } - - chdir(NdbConfig_get_path(0)); + + my_setwd(NdbConfig_get_path(0), MYF(0)); if (theConfig->getDaemonMode()) { // Become a daemon @@ -97,6 +89,7 @@ NDB_MAIN(ndb_kernel){ } } +#ifndef NDB_WIN32 for(pid_t child = fork(); child != 0; child = fork()){ /** * Parent @@ -143,10 +136,13 @@ NDB_MAIN(ndb_kernel){ exit(0); } g_eventLogger.info("Ndb has terminated (pid %d) restarting", child); - theConfig->fetch_configuration(local_config); + theConfig->fetch_configuration(); } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); +#else + g_eventLogger.info("Ndb started"); +#endif theConfig->setupConfiguration(); systemInfo(* theConfig, * theConfig->m_logLevel); @@ -184,11 +180,9 @@ NDB_MAIN(ndb_kernel){ assert("Illegal state globalData.theRestartFlag" == 0); } - SocketServer socket_server; - globalTransporterRegistry.startSending(); globalTransporterRegistry.startReceiving(); - if (!globalTransporterRegistry.start_service(socket_server)){ + if (!globalTransporterRegistry.start_service(*globalEmulatorData.m_socket_server)){ ndbout_c("globalTransporterRegistry.start_service() failed"); exit(-1); } @@ -200,7 +194,7 @@ NDB_MAIN(ndb_kernel){ globalEmulatorData.theWatchDog->doStart(); - socket_server.startServer(); + globalEmulatorData.m_socket_server->startServer(); // theConfig->closeConfiguration(); @@ -208,11 +202,6 @@ NDB_MAIN(ndb_kernel){ NdbShutdown(NST_Normal); - socket_server.stopServer(); - socket_server.stopSessions(); - - globalTransporterRegistry.stop_clients(); - return NRT_Default; } @@ -278,7 +267,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){ void catchsigs(bool ignore){ -#if ! defined NDB_SOFTOSE && !defined NDB_OSE +#if !defined NDB_WIN32 && !defined NDB_SOFTOSE && !defined NDB_OSE static const int signals_shutdown[] = { #ifdef SIGBREAK @@ -320,7 +309,6 @@ catchsigs(bool ignore){ SIGTRAP #endif }; -#endif static const int signals_ignore[] = { SIGPIPE @@ -333,6 +321,7 @@ catchsigs(bool ignore){ handler_register(signals_error[i], handler_error, ignore); for(i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++) handler_register(signals_ignore[i], SIG_IGN, ignore); +#endif } extern "C" @@ -351,8 +340,10 @@ handler_error(int signum){ if (thread_id != 0 && thread_id == my_thread_id()) { // Shutdown thread received signal - signal(signum, SIG_DFL); +#ifndef NDB_WIN32 + signal(signum, SIG_DFL); kill(getpid(), signum); +#endif while(true) NdbSleep_MilliSleep(10); } diff --git a/ndb/src/kernel/vm/Callback.hpp b/ndb/src/kernel/vm/Callback.hpp index bf1ae5968d3..6a619ba7859 100644 --- a/ndb/src/kernel/vm/Callback.hpp +++ b/ndb/src/kernel/vm/Callback.hpp @@ -20,12 +20,5 @@ /** * Block callbacks */ -typedef void (SimulatedBlock::* CallbackFunction)(class Signal*, - Uint32 callbackData, - Uint32 returnCode); -struct Callback { - CallbackFunction m_callbackFunction; - Uint32 m_callbackData; -}; #endif diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 706f60fd9cf..de78a4e927c 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> +#include <ndb_opts.h> -#include <LocalConfig.hpp> #include "Configuration.hpp" #include <ErrorHandlingMacros.hpp> #include "GlobalData.hpp" @@ -28,14 +28,13 @@ #include <NdbOut.hpp> #include <WatchDog.hpp> -#include <getarg.h> - #include <mgmapi_configuration.hpp> #include <mgmapi_config_parameters_debug.h> #include <kernel_config_parameters.h> #include <kernel_types.h> #include <ndb_limits.h> +#include <ndbapi_limits.h> #include "pc.hpp" #include <LogLevel.hpp> #include <NdbSleep.h> @@ -47,81 +46,77 @@ extern "C" { #include <EventLogger.hpp> extern EventLogger g_eventLogger; +enum ndbd_options { + OPT_INITIAL = NDB_STD_OPTIONS_LAST, + OPT_NODAEMON +}; + +NDB_STD_OPTS_VARS; +static int _daemon, _no_daemon, _initial, _no_start; +/** + * Arguments to NDB process + */ +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndbd"), + { "initial", OPT_INITIAL, + "Perform initial start of ndbd, including cleaning the file system. " + "Consult documentation before using this", + (gptr*) &_initial, (gptr*) &_initial, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "nostart", 'n', + "Don't start ndbd immediately. Ndbd will await command from ndb_mgmd", + (gptr*) &_no_start, (gptr*) &_no_start, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "daemon", 'd', "Start ndbd as daemon (default)", + (gptr*) &_daemon, (gptr*) &_daemon, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, + { "nodaemon", OPT_NODAEMON, + "Do not start ndbd as daemon, provided for testing purposes", + (gptr*) &_no_daemon, (gptr*) &_no_daemon, 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 short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS]\n", my_progname); +} +static void usage() +{ + short_usage_sub(); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, + argument ? argument : "d:t:O,/tmp/ndbd.trace"); +} + bool -Configuration::init(int argc, const char** argv){ +Configuration::init(int argc, char** argv) +{ + const char *load_default_groups[]= { "mysql_cluster","ndbd",0 }; + load_defaults("my",load_default_groups,&argc,&argv); - /** - * Default values for arguments - */ - int _no_start = 0; - int _initial = 0; - const char* _connect_str = NULL; - int _daemon = 1; - int _no_daemon = 0; - int _help = 0; - int _print_version = 0; -#ifndef DBUG_OFF - const char *debug_option= 0; -#endif - - /** - * Arguments to NDB process - */ - - struct getargs args[] = { - { "version", 'v', arg_flag, &_print_version, "Print ndbd version", "" }, - { "nostart", 'n', arg_flag, &_no_start, - "Don't start ndbd immediately. Ndbd will await command from ndb_mgmd", "" }, - { "daemon", 'd', arg_flag, &_daemon, "Start ndbd as daemon (default)", "" }, - { "nodaemon", 0, arg_flag, &_no_daemon, "Do not start ndbd as daemon, provided for testing purposes", "" }, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options" }, -#endif - { "initial", 0, arg_flag, &_initial, - "Perform initial start of ndbd, including cleaning the file system. Consult documentation before using this", "" }, + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(ho_error); - { "connect-string", 'c', arg_string, &_connect_str, - "Set connect string for connecting to ndb_mgmd. <constr>=\"host=<hostname:port>[;nodeid=<id>]\". Overides specifying entries in NDB_CONNECTSTRING and config file", - "<constr>" }, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; - char desc[] = - "The MySQL Cluster kernel"; - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, argv[0], desc); - for (int i = 0; i < argc; i++) { - if (strcmp("-i",argv[i]) == 0) { - printf("flag depricated %s, use %s\n", "-i", "--initial"); - } - } - return false; - } if (_no_daemon) { _daemon= 0; } - // check for depricated flag '-i' - -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif DBUG_PRINT("info", ("no_start=%d", _no_start)); DBUG_PRINT("info", ("initial=%d", _initial)); DBUG_PRINT("info", ("daemon=%d", _daemon)); - DBUG_PRINT("info", ("connect_str=%s", _connect_str)); + DBUG_PRINT("info", ("connect_str=%s", opt_connect_str)); ndbSetOwnVersion(); - if (_print_version) { - ndbPrintVersion(); - return false; - } - // Check the start flag if (_no_start) globalData.theRestartFlag = initial_state; @@ -133,8 +128,8 @@ Configuration::init(int argc, const char** argv){ _initialStart = true; // Check connectstring - if (_connect_str) - _connectString = strdup(_connect_str); + if (opt_connect_str) + _connectString = strdup(opt_connect_str); // Check daemon flag if (_daemon) @@ -146,6 +141,8 @@ Configuration::init(int argc, const char** argv){ else _programName = strdup(""); + globalData.ownId= 0; + return true; } @@ -185,7 +182,7 @@ Configuration::closeConfiguration(){ } void -Configuration::fetch_configuration(LocalConfig &local_config){ +Configuration::fetch_configuration(){ /** * Fetch configuration from management server */ @@ -195,8 +192,17 @@ Configuration::fetch_configuration(LocalConfig &local_config){ m_mgmd_port= 0; m_mgmd_host= 0; - m_config_retriever= new ConfigRetriever(local_config, NDB_VERSION, NODE_TYPE_DB); - if(m_config_retriever->do_connect() == -1){ + m_config_retriever= new ConfigRetriever(getConnectString(), + NDB_VERSION, NODE_TYPE_DB); + + if (m_config_retriever->hasError()) + { + ERROR_SET(fatal, ERR_INVALID_CONFIG, + "Could not connect initialize handle to management server", + m_config_retriever->getErrorString()); + } + + if(m_config_retriever->do_connect(12,5,1) == -1){ const char * s = m_config_retriever->getErrorString(); if(s == 0) s = "No error given!"; @@ -211,13 +217,14 @@ Configuration::fetch_configuration(LocalConfig &local_config){ ConfigRetriever &cr= *m_config_retriever; - if((globalData.ownId = cr.allocNodeId()) == 0){ - for(Uint32 i = 0; i<3; i++){ - NdbSleep_SecSleep(3); - if((globalData.ownId = cr.allocNodeId()) != 0) - break; - } - } + /** + * if we have a nodeid set (e.g in a restart situation) + * reuse it + */ + if (globalData.ownId) + cr.setNodeId(globalData.ownId); + + globalData.ownId = cr.allocNodeId(2 /*retry*/,3 /*delay*/); if(globalData.ownId == 0){ ERROR_SET(fatal, ERR_INVALID_CONFIG, @@ -274,19 +281,19 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter, memset(buf2, 0,sizeof(buf2)); #ifdef NDB_WIN32 char* szFilePart; - if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) - || (::GetFileAttributes(alloc_path)&FILE_ATTRIBUTE_READONLY)) + if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) || + (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY)) #else - if((::realpath(path, buf2) == NULL)|| + if((::realpath(path, buf2) == NULL)|| (::access(buf2, W_OK) != 0)) #endif - { - ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); - } - + { + ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); + } + if (strcmp(&buf2[strlen(buf2) - 1], DIR_SEPARATOR)) strcat(buf2, DIR_SEPARATOR); - + return strdup(buf2); } @@ -448,6 +455,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ unsigned int noOfTables = 0; unsigned int noOfUniqueHashIndexes = 0; unsigned int noOfOrderedIndexes = 0; + unsigned int noOfTriggers = 0; unsigned int noOfReplicas = 0; unsigned int noOfDBNodes = 0; unsigned int noOfAPINodes = 0; @@ -472,6 +480,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ { CFG_DB_NO_TABLES, &noOfTables, false }, { CFG_DB_NO_ORDERED_INDEXES, &noOfOrderedIndexes, false }, { CFG_DB_NO_UNIQUE_HASH_INDEXES, &noOfUniqueHashIndexes, false }, + { CFG_DB_NO_TRIGGERS, &noOfTriggers, true }, { CFG_DB_NO_REPLICAS, &noOfReplicas, false }, { CFG_DB_NO_ATTRIBUTES, &noOfAttributes, false }, { CFG_DB_NO_OPS, &noOfOperations, false }, @@ -506,7 +515,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } - noOfDataPages = (dataMem / 8192); + noOfDataPages = (dataMem / 32768); noOfIndexPages = (indexMem / 8192); for(unsigned j = 0; j<LogLevel::LOGLEVEL_CATEGORIES; j++){ @@ -552,7 +561,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ noOfDBNodes++; // No of NDB processes if(nodeId > MAX_NDB_NODES){ - snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", + BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", MAX_NDB_NODES); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } @@ -580,12 +589,42 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ConfigValues::Iterator it2(*ownConfig, db.m_config); it2.set(CFG_DB_NO_TABLES, noOfTables); it2.set(CFG_DB_NO_ATTRIBUTES, noOfAttributes); + { + Uint32 neededNoOfTriggers = /* types: Insert/Update/Delete/Custom */ + 3 * noOfUniqueHashIndexes + /* for unique hash indexes, I/U/D */ + 3 * NDB_MAX_ACTIVE_EVENTS + /* for events in suma, I/U/D */ + 3 * noOfTables + /* for backup, I/U/D */ + noOfOrderedIndexes; /* for ordered indexes, C */ + if (noOfTriggers < neededNoOfTriggers) + { + noOfTriggers= neededNoOfTriggers; + it2.set(CFG_DB_NO_TRIGGERS, noOfTriggers); + } + } /** * Do size calculations */ ConfigValuesFactory cfg(ownConfig); + Uint32 noOfMetaTables= noOfTables + noOfOrderedIndexes + + noOfUniqueHashIndexes; + Uint32 noOfMetaTablesDict= noOfMetaTables; + if (noOfMetaTablesDict > MAX_TABLES) + noOfMetaTablesDict= MAX_TABLES; + + { + /** + * Dict Size Alt values + */ + cfg.put(CFG_DICT_ATTRIBUTE, + noOfAttributes); + + cfg.put(CFG_DICT_TABLE, + noOfMetaTablesDict); + } + + if (noOfLocalScanRecords == 0) { noOfLocalScanRecords = (noOfDBNodes * noOfScanRecords) + 1; } @@ -595,7 +634,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ Uint32 noOfTCScanRecords = noOfScanRecords; { - Uint32 noOfAccTables= noOfTables + noOfUniqueHashIndexes; + Uint32 noOfAccTables= noOfMetaTables/*noOfTables+noOfUniqueHashIndexes*/; /** * Acc Size Alt values */ @@ -637,19 +676,6 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ cfg.put(CFG_ACC_SCAN, noOfLocalScanRecords); } - Uint32 noOfMetaTables= noOfTables + noOfOrderedIndexes + - noOfUniqueHashIndexes; - { - /** - * Dict Size Alt values - */ - cfg.put(CFG_DICT_ATTRIBUTE, - noOfAttributes); - - cfg.put(CFG_DICT_TABLE, - noOfMetaTables); - } - { /** * Dih Size Alt values @@ -742,8 +768,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ noOfMetaTables); cfg.put(CFG_TUP_TABLE_DESC, - 4 * NO_OF_FRAG_PER_NODE * noOfAttributes* noOfReplicas + - 12 * NO_OF_FRAG_PER_NODE * noOfMetaTables* noOfReplicas ); + 2 * 6 * NO_OF_FRAG_PER_NODE * noOfAttributes * noOfReplicas + + 2 * 10 * NO_OF_FRAG_PER_NODE * noOfMetaTables * noOfReplicas ); cfg.put(CFG_TUP_STORED_PROC, noOfLocalScanRecords); @@ -754,9 +780,9 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ * Tux Size Alt values */ cfg.put(CFG_TUX_INDEX, - noOfOrderedIndexes); + noOfMetaTables /*noOfOrderedIndexes*/); - cfg.put(CFG_TUX_FRAGMENT, + cfg.put(CFG_TUX_FRAGMENT, 2 * NO_OF_FRAG_PER_NODE * noOfOrderedIndexes * noOfReplicas); cfg.put(CFG_TUX_ATTRIBUTE, diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp index 2ea32ffea37..acf0e163a84 100644 --- a/ndb/src/kernel/vm/Configuration.hpp +++ b/ndb/src/kernel/vm/Configuration.hpp @@ -21,7 +21,6 @@ #include <ndb_types.h> class ConfigRetriever; -class LocalConfig; class Configuration { public: @@ -31,9 +30,9 @@ public: /** * Returns false if arguments are invalid */ - bool init(int argc, const char** argv); + bool init(int argc, char** argv); - void fetch_configuration(LocalConfig &local_config); + void fetch_configuration(); void setupConfiguration(); void closeConfiguration(); diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index a5897cd4064..d6ed6c0dafd 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -33,7 +33,6 @@ #include <NdbOut.hpp> #include <NdbMutex.h> #include <NdbSleep.h> -#include <new> extern "C" { extern void (* ndb_new_handler)(); @@ -69,6 +68,7 @@ EmulatorData::EmulatorData(){ theThreadConfig = 0; theSimBlockList = 0; theShutdownMutex = 0; + m_socket_server = 0; } void @@ -84,6 +84,7 @@ EmulatorData::create(){ theWatchDog = new WatchDog(); theThreadConfig = new ThreadConfig(); theSimBlockList = new SimBlockList(); + m_socket_server = new SocketServer(); theShutdownMutex = NdbMutex_Create(); @@ -100,7 +101,8 @@ EmulatorData::destroy(){ delete theThreadConfig; theThreadConfig = 0; if(theSimBlockList) delete theSimBlockList; theSimBlockList = 0; - + if(m_socket_server) + delete m_socket_server; m_socket_server = 0; NdbMem_Destroy(); } @@ -179,12 +181,14 @@ NdbShutdown(NdbShutdownType type, exit(-1); #endif } - + +#ifndef NDB_WIN32 if (simulate_error_during_shutdown) { kill(getpid(), simulate_error_during_shutdown); while(true) NdbSleep_MilliSleep(10); } +#endif globalEmulatorData.theWatchDog->doStop(); @@ -194,9 +198,22 @@ NdbShutdown(NdbShutdownType type, fclose(outputStream); #endif + /** + * Stop all transporter connection attempts and accepts + */ + globalEmulatorData.m_socket_server->stopServer(); + globalEmulatorData.m_socket_server->stopSessions(); + globalTransporterRegistry.stop_clients(); + + /** + * Stop transporter communication with other nodes + */ globalTransporterRegistry.stopSending(); globalTransporterRegistry.stopReceiving(); + /** + * Remove all transporters + */ globalTransporterRegistry.removeAll(); #ifdef VM_TRACE diff --git a/ndb/src/kernel/vm/Emulator.hpp b/ndb/src/kernel/vm/Emulator.hpp index bd240f8679b..dba8cb3ab9b 100644 --- a/ndb/src/kernel/vm/Emulator.hpp +++ b/ndb/src/kernel/vm/Emulator.hpp @@ -25,6 +25,7 @@ // //=========================================================================== #include <kernel_types.h> +#include <TransporterRegistry.hpp> extern class JobTable globalJobTable; extern class TimeQueue globalTimeQueue; @@ -54,7 +55,8 @@ struct EmulatorData { class WatchDog * theWatchDog; class ThreadConfig * theThreadConfig; class SimBlockList * theSimBlockList; - + class SocketServer * m_socket_server; + /** * Constructor * diff --git a/ndb/src/kernel/vm/FastScheduler.cpp b/ndb/src/kernel/vm/FastScheduler.cpp index eca456d26dd..d0b7af27463 100644 --- a/ndb/src/kernel/vm/FastScheduler.cpp +++ b/ndb/src/kernel/vm/FastScheduler.cpp @@ -76,21 +76,27 @@ FastScheduler::activateSendPacked() globalData.loopMax = 2048; }//FastScheduler::activateSendPacked() +//------------------------------------------------------------------------ +// sendPacked is executed at the end of the loop. +// To ensure that we don't send any messages before executing all local +// packed signals we do another turn in the loop (unless we have already +// executed too many signals in the loop). +//------------------------------------------------------------------------ void FastScheduler::doJob() { + Uint32 loopCount = 0; + Uint32 TminLoops = getBOccupancy() + EXTRA_SIGNALS_PER_DO_JOB; + Uint32 TloopMax = (Uint32)globalData.loopMax; + if (TminLoops < TloopMax) { + TloopMax = TminLoops; + }//if + if (TloopMax < MIN_NUMBER_OF_SIG_PER_DO_JOB) { + TloopMax = MIN_NUMBER_OF_SIG_PER_DO_JOB; + }//if + register Signal* signal = getVMSignals(); + register Uint32 tHighPrio= globalData.highestAvailablePrio; do{ - Uint32 loopCount = 0; - Uint32 TminLoops = getBOccupancy() + EXTRA_SIGNALS_PER_DO_JOB; - Uint32 TloopMax = (Uint32)globalData.loopMax; - if (TminLoops < TloopMax) { - TloopMax = TminLoops; - }//if - if (TloopMax < MIN_NUMBER_OF_SIG_PER_DO_JOB) { - TloopMax = MIN_NUMBER_OF_SIG_PER_DO_JOB; - }//if - register Uint32 tHighPrio = globalData.highestAvailablePrio; - register Signal* signal = getVMSignals(); while ((tHighPrio < LEVEL_IDLE) && (loopCount < TloopMax)) { // signal->garbage_register(); // To ensure we find bugs quickly @@ -148,20 +154,27 @@ FastScheduler::doJob() }//if loopCount++; }//while - if (globalData.sendPackedActivated == 1) { - Uint32 t1 = theDoJobTotalCounter; - Uint32 t2 = theDoJobCallCounter; - t1 += loopCount; - t2++; - theDoJobTotalCounter = t1; - theDoJobCallCounter = t2; - if (t2 == 8192) { - reportDoJobStatistics(t1 >> 13); - theDoJobCallCounter = 0; - theDoJobTotalCounter = 0; - }//if - }//if - } while (getBOccupancy() > MAX_OCCUPANCY); + sendPacked(); + tHighPrio = globalData.highestAvailablePrio; + if(getBOccupancy() > MAX_OCCUPANCY) + { + if(loopCount != TloopMax) + abort(); + assert( loopCount == TloopMax ); + TloopMax += 512; + } + } while ((getBOccupancy() > MAX_OCCUPANCY) || + ((loopCount < TloopMax) && + (tHighPrio < LEVEL_IDLE))); + + theDoJobCallCounter ++; + theDoJobTotalCounter += loopCount; + if (theDoJobCallCounter == 8192) { + reportDoJobStatistics(theDoJobTotalCounter >> 13); + theDoJobCallCounter = 0; + theDoJobTotalCounter = 0; + }//if + }//FastScheduler::doJob() void FastScheduler::sendPacked() diff --git a/ndb/src/kernel/vm/LongSignal.hpp b/ndb/src/kernel/vm/LongSignal.hpp index f9ed443d995..9818358011f 100644 --- a/ndb/src/kernel/vm/LongSignal.hpp +++ b/ndb/src/kernel/vm/LongSignal.hpp @@ -25,7 +25,7 @@ */ struct SectionSegment { - STATIC_CONST( DataLength = 60 ); + STATIC_CONST( DataLength = NDB_SECTION_SEGMENT_SZ ); Uint32 m_ownerRef; Uint32 m_sz; diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am index 4e9dbe36c78..0dce9285ae3 100644 --- a/ndb/src/kernel/vm/Makefile.am +++ b/ndb/src/kernel/vm/Makefile.am @@ -27,3 +27,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libkernel.dsp + +libkernel.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libkernel_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/vm/Makefile_old b/ndb/src/kernel/vm/Makefile_old deleted file mode 100644 index a162f3672ce..00000000000 --- a/ndb/src/kernel/vm/Makefile_old +++ /dev/null @@ -1,30 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := kernel - -SOURCES = \ - SimulatedBlock.cpp \ - FastScheduler.cpp \ - TimeQueue.cpp \ - VMSignal.cpp \ - ThreadConfig.cpp \ - TransporterCallback.cpp \ - Emulator.cpp \ - Configuration.cpp \ - WatchDog.cpp \ - SimplePropertiesSection.cpp \ - SectionReader.cpp \ - MetaData.cpp \ - Mutex.cpp SafeCounter.cpp - -CFLAGS_Configuration.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) - -DIRS := testCopy testDataBuffer testSimplePropertiesSection - -ifneq ($(USE_EDITLINE), N) -DIRS += testLongSig -endif - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/vm/Mutex.cpp b/ndb/src/kernel/vm/Mutex.cpp index 1dbc6e7ec4a..aab9e74312b 100644 --- a/ndb/src/kernel/vm/Mutex.cpp +++ b/ndb/src/kernel/vm/Mutex.cpp @@ -19,48 +19,51 @@ #include "Mutex.hpp" #include <signaldata/UtilLock.hpp> -MutexManager::MutexManager(class SimulatedBlock & block) +SimulatedBlock::MutexManager::MutexManager(class SimulatedBlock & block) : m_block(block), m_activeMutexes(m_mutexPool) { } bool -MutexManager::setSize(Uint32 maxNoOfActiveMutexes){ +SimulatedBlock::MutexManager::setSize(Uint32 maxNoOfActiveMutexes){ return m_mutexPool.setSize(maxNoOfActiveMutexes); } Uint32 -MutexManager::getSize() const { +SimulatedBlock::MutexManager::getSize() const { return m_mutexPool.getSize(); } bool -MutexManager::seize(ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::seize(ActiveMutexPtr& ptr){ return m_activeMutexes.seize(ptr); } void -MutexManager::release(Uint32 activeMutexPtrI){ +SimulatedBlock::MutexManager::release(Uint32 activeMutexPtrI){ m_activeMutexes.release(activeMutexPtrI); } void -MutexManager::getPtr(ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::getPtr(ActiveMutexPtr& ptr){ m_activeMutexes.getPtr(ptr); } BlockReference -MutexManager::reference() const { +SimulatedBlock::MutexManager::reference() const { return m_block.reference(); } void -MutexManager::progError(int line, int err_code, const char* extra) { +SimulatedBlock::MutexManager::progError(int line, + int err_code, + const char* extra) +{ m_block.progError(line, err_code, extra); } void -MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ UtilCreateLockReq * req = (UtilCreateLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -78,7 +81,7 @@ MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ UtilCreateLockRef * ref = (UtilCreateLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; @@ -91,7 +94,7 @@ MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ UtilCreateLockConf * conf = (UtilCreateLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; @@ -105,7 +108,7 @@ MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ void -MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ UtilDestroyLockReq * req = (UtilDestroyLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -123,7 +126,7 @@ MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ UtilDestroyLockRef * ref = (UtilDestroyLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -135,7 +138,7 @@ MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ UtilDestroyLockConf * conf = (UtilDestroyLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -148,7 +151,7 @@ MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ void -MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -166,7 +169,7 @@ MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -184,7 +187,7 @@ MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_LOCK_REF(Signal* signal){ UtilLockRef * ref = (UtilLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -196,7 +199,7 @@ MutexManager::execUTIL_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_LOCK_CONF(Signal* signal){ UtilLockConf * conf = (UtilLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -210,7 +213,7 @@ MutexManager::execUTIL_LOCK_CONF(Signal* signal){ } void -MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ UtilUnlockReq * req = (UtilUnlockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; req->senderRef = m_block.reference(); @@ -227,7 +230,7 @@ MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ UtilUnlockRef * ref = (UtilUnlockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -239,7 +242,7 @@ MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ UtilUnlockConf * conf = (UtilUnlockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -251,8 +254,9 @@ MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ } void -Mutex::release(MutexManager& mgr, Uint32 activePtrI, Uint32 mutexId){ - MutexManager::ActiveMutexPtr ptr; +Mutex::release(SimulatedBlock::MutexManager& mgr, + Uint32 activePtrI, Uint32 mutexId){ + SimulatedBlock::MutexManager::ActiveMutexPtr ptr; ptr.i = activePtrI; mgr.getPtr(ptr); if(ptr.p->m_gsn == 0 && ptr.p->m_mutexId == mutexId){ @@ -272,7 +276,8 @@ Mutex::unlock(){ if(!m_ptr.isNull()){ m_mgr.getPtr(m_ptr); if(m_ptr.p->m_mutexId == m_mutexId){ - Callback c = { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i }; + SimulatedBlock::Callback c = + { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i }; m_ptr.p->m_callback = c; m_mgr.unlock(m_signal, m_ptr); m_ptr.setNull(); // Remove reference diff --git a/ndb/src/kernel/vm/Mutex.hpp b/ndb/src/kernel/vm/Mutex.hpp index 40e3fb56b4f..7a16046188c 100644 --- a/ndb/src/kernel/vm/Mutex.hpp +++ b/ndb/src/kernel/vm/Mutex.hpp @@ -22,63 +22,6 @@ class Mutex; -class MutexManager { - friend class Mutex; - friend class SimulatedBlock; - friend class DbUtil; -public: - MutexManager(class SimulatedBlock &); - - bool setSize(Uint32 maxNoOfActiveMutexes); - Uint32 getSize() const ; // Get maxNoOfActiveMutexes - -private: - /** - * core interface - */ - struct ActiveMutex { - Uint32 m_gsn; // state - Uint32 m_mutexId; - Uint32 m_mutexKey; - Callback m_callback; - union { - Uint32 nextPool; - Uint32 nextList; - }; - Uint32 prevList; - }; - typedef Ptr<ActiveMutex> ActiveMutexPtr; - - bool seize(ActiveMutexPtr& ptr); - void release(Uint32 activeMutexPtrI); - - void getPtr(ActiveMutexPtr& ptr); - - void create(Signal*, ActiveMutexPtr&); - void destroy(Signal*, ActiveMutexPtr&); - void lock(Signal*, ActiveMutexPtr&); - void trylock(Signal*, ActiveMutexPtr&); - void unlock(Signal*, ActiveMutexPtr&); - -private: - void execUTIL_CREATE_LOCK_REF(Signal* signal); - void execUTIL_CREATE_LOCK_CONF(Signal* signal); - void execUTIL_DESTORY_LOCK_REF(Signal* signal); - void execUTIL_DESTORY_LOCK_CONF(Signal* signal); - void execUTIL_LOCK_REF(Signal* signal); - void execUTIL_LOCK_CONF(Signal* signal); - void execUTIL_UNLOCK_REF(Signal* signal); - void execUTIL_UNLOCK_CONF(Signal* signal); - - SimulatedBlock & m_block; - ArrayPool<ActiveMutex> m_mutexPool; - DLList<ActiveMutex> m_activeMutexes; - - BlockReference reference() const; - void progError(int line, int err_code, const char* extra = 0); -}; - - /** * MutexHandle - A "reference" to a mutex * - Should be used together with Mutex @@ -89,7 +32,7 @@ public: MutexHandle(Uint32 id); bool isNull() const; - void release(MutexManager & mgr); + void release(SimulatedBlock::MutexManager & mgr); private: const Uint32 m_mutexId; @@ -106,7 +49,7 @@ public: MutexHandle2(); bool isNull() const; - void release(MutexManager & mgr); + void release(SimulatedBlock::MutexManager & mgr); private: Uint32 m_activeMutexPtrI; @@ -117,33 +60,34 @@ private: */ class Mutex { public: - Mutex(Signal*, MutexManager & mgr, MutexHandle &); + Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle &); template<Uint32 MutexId> - Mutex(Signal*, MutexManager & mgr, MutexHandle2<MutexId> &); + Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle2<MutexId> &); ~Mutex(); void release(); bool isNull() const ; - bool lock(Callback & callback); - bool trylock(Callback & callback); - void unlock(Callback & callback); + bool lock(SimulatedBlock::Callback & callback); + bool trylock(SimulatedBlock::Callback & callback); + void unlock(SimulatedBlock::Callback & callback); void unlock(); // Ignore callback - bool create(Callback & callback); - bool destroy(Callback & callback); + bool create(SimulatedBlock::Callback & callback); + bool destroy(SimulatedBlock::Callback & callback); private: Signal* m_signal; - MutexManager & m_mgr; + SimulatedBlock::MutexManager & m_mgr; const Uint32 m_mutexId; Uint32 & m_srcPtrI; - MutexManager::ActiveMutexPtr m_ptr; + SimulatedBlock::MutexManager::ActiveMutexPtr m_ptr; public: - static void release(MutexManager&, Uint32 activePtrI, Uint32 mutexId); + static void release(SimulatedBlock::MutexManager&, + Uint32 activePtrI, Uint32 mutexId); }; inline @@ -159,7 +103,7 @@ MutexHandle::isNull() const { inline void -MutexHandle::release(MutexManager & mgr){ +MutexHandle::release(SimulatedBlock::MutexManager & mgr){ if(!isNull()){ Mutex::release(mgr, m_activeMutexPtrI, m_mutexId); m_activeMutexPtrI = RNIL; @@ -183,7 +127,7 @@ MutexHandle2<MutexId>::isNull() const { template<Uint32 MutexId> inline void -MutexHandle2<MutexId>::release(MutexManager & mgr){ +MutexHandle2<MutexId>::release(SimulatedBlock::MutexManager & mgr){ if(!isNull()){ Mutex::release(mgr, m_activeMutexPtrI, MutexId); m_activeMutexPtrI = RNIL; @@ -192,7 +136,8 @@ MutexHandle2<MutexId>::release(MutexManager & mgr){ inline -Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh) +Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr, + MutexHandle & mh) : m_signal(signal), m_mgr(mgr), m_mutexId(mh.m_mutexId), @@ -204,7 +149,8 @@ Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh) template<Uint32 MutexId> inline -Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle2<MutexId> & mh) +Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr, + MutexHandle2<MutexId> & mh) : m_signal(signal), m_mgr(mgr), m_mutexId(MutexId), @@ -236,7 +182,7 @@ Mutex::isNull() const { inline bool -Mutex::lock(Callback & callback){ +Mutex::lock(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -253,7 +199,7 @@ Mutex::lock(Callback & callback){ inline bool -Mutex::trylock(Callback & callback){ +Mutex::trylock(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -270,7 +216,7 @@ Mutex::trylock(Callback & callback){ inline void -Mutex::unlock(Callback & callback){ +Mutex::unlock(SimulatedBlock::Callback & callback){ if(!m_ptr.isNull()){ m_mgr.getPtr(m_ptr); if(m_ptr.p->m_mutexId == m_mutexId){ @@ -285,7 +231,7 @@ Mutex::unlock(Callback & callback){ inline bool -Mutex::create(Callback & callback){ +Mutex::create(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -302,7 +248,7 @@ Mutex::create(Callback & callback){ inline bool -Mutex::destroy(Callback & callback){ +Mutex::destroy(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; diff --git a/ndb/src/kernel/vm/SectionReader.cpp b/ndb/src/kernel/vm/SectionReader.cpp index 9e1cbc855e6..dd474a49e50 100644 --- a/ndb/src/kernel/vm/SectionReader.cpp +++ b/ndb/src/kernel/vm/SectionReader.cpp @@ -26,7 +26,7 @@ #endif SectionReader::SectionReader -(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) +(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) : m_pool(pool) { if(ptr.p == 0){ diff --git a/ndb/src/kernel/vm/SectionReader.hpp b/ndb/src/kernel/vm/SectionReader.hpp index 17eade24a66..b51006b6128 100644 --- a/ndb/src/kernel/vm/SectionReader.hpp +++ b/ndb/src/kernel/vm/SectionReader.hpp @@ -21,7 +21,7 @@ class SectionReader { public: - SectionReader(class SegmentedSectionPtr &, + SectionReader(struct SegmentedSectionPtr &, class SectionSegmentPool &); void reset(); diff --git a/ndb/src/kernel/vm/SimplePropertiesSection.cpp b/ndb/src/kernel/vm/SimplePropertiesSection.cpp index d442ff2e698..070563be36b 100644 --- a/ndb/src/kernel/vm/SimplePropertiesSection.cpp +++ b/ndb/src/kernel/vm/SimplePropertiesSection.cpp @@ -19,7 +19,7 @@ #include "LongSignal.hpp" SimplePropertiesSectionReader::SimplePropertiesSectionReader -(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) +(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) : m_pool(pool) { if(ptr.p == 0){ @@ -190,7 +190,7 @@ SimplePropertiesSectionWriter::putWords(const Uint32 * src, Uint32 len){ } void -SimplePropertiesSectionWriter::getPtr(class SegmentedSectionPtr & dst){ +SimplePropertiesSectionWriter::getPtr(struct SegmentedSectionPtr & dst){ // Set last ptr and size if(m_pos >= 0){ dst.p = m_head; diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index e6b97771d36..94fd5769406 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -1598,7 +1598,7 @@ SimulatedBlock::sendFragmentedSignal(NodeReceiverGroup rg, } } -Callback SimulatedBlock::TheEmptyCallback = {0, 0}; +SimulatedBlock::Callback SimulatedBlock::TheEmptyCallback = {0, 0}; void SimulatedBlock::sendFragmentedSignal(BlockReference ref, diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index 7972cb39746..787d14ca5cb 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -36,12 +36,10 @@ #include <ErrorReporter.hpp> #include <ErrorHandlingMacros.hpp> -#include <new> #include "DLList.hpp" #include "ArrayPool.hpp" #include "DLHashTable.hpp" #include "Callback.hpp" -#include "Mutex.hpp" #include "SafeCounter.hpp" #include "MetaData.hpp" @@ -77,7 +75,6 @@ typedef struct NewVar } NewVARIABLE; /* 128 bits */ class SimulatedBlock { - friend class MutexManager; friend class SafeCounter; friend class SafeCounterManager; friend struct UpgradeStartup; @@ -104,6 +101,14 @@ public: * */ inline void executeFunction(GlobalSignalNumber gsn, Signal* signal); +public: + typedef void (SimulatedBlock::* CallbackFunction)(class Signal*, + Uint32 callbackData, + Uint32 returnCode); + struct Callback { + CallbackFunction m_callbackFunction; + Uint32 m_callbackData; + }; protected: static Callback TheEmptyCallback; void execute(Signal* signal, Callback & c, Uint32 returnCode); @@ -405,7 +410,64 @@ private: DLList<FragmentSendInfo> c_linearFragmentSendList; DLList<FragmentSendInfo> c_segmentedFragmentSendList; -public: +public: + class MutexManager { + friend class Mutex; + friend class SimulatedBlock; + friend class DbUtil; + public: + MutexManager(class SimulatedBlock &); + + bool setSize(Uint32 maxNoOfActiveMutexes); + Uint32 getSize() const ; // Get maxNoOfActiveMutexes + + private: + /** + * core interface + */ + struct ActiveMutex { + Uint32 m_gsn; // state + Uint32 m_mutexId; + Uint32 m_mutexKey; + Callback m_callback; + union { + Uint32 nextPool; + Uint32 nextList; + }; + Uint32 prevList; + }; + typedef Ptr<ActiveMutex> ActiveMutexPtr; + + bool seize(ActiveMutexPtr& ptr); + void release(Uint32 activeMutexPtrI); + + void getPtr(ActiveMutexPtr& ptr); + + void create(Signal*, ActiveMutexPtr&); + void destroy(Signal*, ActiveMutexPtr&); + void lock(Signal*, ActiveMutexPtr&); + void trylock(Signal*, ActiveMutexPtr&); + void unlock(Signal*, ActiveMutexPtr&); + + private: + void execUTIL_CREATE_LOCK_REF(Signal* signal); + void execUTIL_CREATE_LOCK_CONF(Signal* signal); + void execUTIL_DESTORY_LOCK_REF(Signal* signal); + void execUTIL_DESTORY_LOCK_CONF(Signal* signal); + void execUTIL_LOCK_REF(Signal* signal); + void execUTIL_LOCK_CONF(Signal* signal); + void execUTIL_UNLOCK_REF(Signal* signal); + void execUTIL_UNLOCK_CONF(Signal* signal); + + SimulatedBlock & m_block; + ArrayPool<ActiveMutex> m_mutexPool; + DLList<ActiveMutex> m_activeMutexes; + + BlockReference reference() const; + void progError(int line, int err_code, const char* extra = 0); + }; + + friend class MutexManager; MutexManager c_mutexMgr; void ignoreMutexUnlockCallback(Signal* signal, Uint32 ptrI, Uint32 retVal); @@ -688,5 +750,7 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \ addRecSignalImpl(gsn, (ExecFunction)f, force);\ } +#include "Mutex.hpp" + #endif diff --git a/ndb/src/kernel/vm/ThreadConfig.cpp b/ndb/src/kernel/vm/ThreadConfig.cpp index 4844bb9a477..76fcc4ba84f 100644 --- a/ndb/src/kernel/vm/ThreadConfig.cpp +++ b/ndb/src/kernel/vm/ThreadConfig.cpp @@ -173,9 +173,6 @@ void ThreadConfig::ipControlLoop() // until all buffers are empty or until we have executed 2048 signals. //-------------------------------------------------------------------- globalScheduler.doJob(); - - globalScheduler.sendPacked(); - }//while globalData.incrementWatchDogCounter(6); diff --git a/ndb/src/kernel/vm/WatchDog.cpp b/ndb/src/kernel/vm/WatchDog.cpp index 4e07dc1df90..23475a478d3 100644 --- a/ndb/src/kernel/vm/WatchDog.cpp +++ b/ndb/src/kernel/vm/WatchDog.cpp @@ -27,10 +27,7 @@ extern "C" void* runWatchDog(void* w){ - my_thread_init(); ((WatchDog*)w)->run(); - my_thread_end(); - NdbThread_Exit(0); return NULL; } diff --git a/ndb/src/common/mgmcommon/LocalConfig.cpp b/ndb/src/mgmapi/LocalConfig.cpp index 3cd4341c6b7..0265f982df3 100644 --- a/ndb/src/common/mgmcommon/LocalConfig.cpp +++ b/ndb/src/mgmapi/LocalConfig.cpp @@ -90,7 +90,7 @@ LocalConfig::init(const char *connectString, //7. Check { char buf[256]; - BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_BASE_PORT); + BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_PORT); if(readConnectString(buf, "default connect string")) return true; } @@ -124,12 +124,12 @@ void LocalConfig::printUsage() const { ndbout << "1. Put a Ndb.cfg file in the directory where you start"<<endl << " the node. "<< endl << " Ex: Ndb.cfg" << endl - << " | host=localhost:"<<NDB_BASE_PORT<<endl; + << " | host=localhost:"<<NDB_PORT<<endl; ndbout << "2. Use the environment variable NDB_CONNECTSTRING to "<<endl << " provide this information." <<endl << " Ex: " << endl - << " >export NDB_CONNECTSTRING=\"host=localhost:"<<NDB_BASE_PORT<<"\"" + << " >export NDB_CONNECTSTRING=\"host=localhost:"<<NDB_PORT<<"\"" <<endl<<endl; } @@ -164,17 +164,25 @@ LocalConfig::parseNodeId(const char * buf){ bool LocalConfig::parseHostName(const char * buf){ char tempString[1024]; + char tempString2[1024]; int port; - for(int i = 0; hostNameTokens[i] != 0; i++) { - if (sscanf(buf, hostNameTokens[i], tempString, &port) == 2) { - MgmtSrvrId mgmtSrvrId; - mgmtSrvrId.type = MgmId_TCP; - mgmtSrvrId.name.assign(tempString); - mgmtSrvrId.port = port; - ids.push_back(mgmtSrvrId); - return true; + do { + for(int i = 0; hostNameTokens[i] != 0; i++) { + if (sscanf(buf, hostNameTokens[i], tempString, &port) == 2) { + MgmtSrvrId mgmtSrvrId; + mgmtSrvrId.type = MgmId_TCP; + mgmtSrvrId.name.assign(tempString); + mgmtSrvrId.port = port; + ids.push_back(mgmtSrvrId); + return true; + } } - } + if (buf == tempString2) + break; + // try to add default port to see if it works + snprintf(tempString2, sizeof(tempString2),"%s:%s", buf, NDB_PORT); + buf= tempString2; + } while(1); return false; } @@ -218,7 +226,13 @@ LocalConfig::parseString(const char * connectString, BaseString &err){ return false; } - if (!found_other) { + if (b_nodeId && !found_other) + { + BaseString tmp; + tmp.assfmt("host=localhost:%s", NDB_PORT); + if(parseHostName(tmp.c_str())) + return true; + err.appfmt("Missing host/file name extry in \"%s\"", connectString); return false; } @@ -286,4 +300,27 @@ LocalConfig::readConnectString(const char * connectString, return return_value; } +char * +LocalConfig::makeConnectString(char *buf, int sz) +{ + int p= BaseString::snprintf(buf,sz,"nodeid=%d", _ownNodeId); + if (p < sz) + for (unsigned i = 0; i < ids.size(); i++) + { + if (ids[i].type != MgmId_TCP) + continue; + int new_p= p+BaseString::snprintf(buf+p,sz-p,",%s:%d", + ids[i].name.c_str(), ids[i].port); + if (new_p < sz) + p= new_p; + else + { + buf[p]= 0; + break; + } + } + buf[sz-1]=0; + return buf; +} + template class Vector<MgmtSrvrId>; diff --git a/ndb/include/mgmcommon/LocalConfig.hpp b/ndb/src/mgmapi/LocalConfig.hpp index 9ceeffdba36..c415ec1be91 100644 --- a/ndb/include/mgmcommon/LocalConfig.hpp +++ b/ndb/src/mgmapi/LocalConfig.hpp @@ -61,6 +61,7 @@ struct LocalConfig { bool parseHostName(const char *buf); bool parseFileName(const char *buf); bool parseString(const char *buf, BaseString &err); + char * makeConnectString(char *buf, int sz); }; #endif // LocalConfig_H diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am index 0f0e1cea5d8..2f2fb407e46 100644 --- a/ndb/src/mgmapi/Makefile.am +++ b/ndb/src/mgmapi/Makefile.am @@ -1,10 +1,11 @@ noinst_LTLIBRARIES = libmgmapi.la -libmgmapi_la_SOURCES = mgmapi.cpp mgmapi_configuration.cpp +libmgmapi_la_SOURCES = mgmapi.cpp mgmapi_configuration.cpp LocalConfig.cpp -INCLUDES_LOC = -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon -DEFS_LOC = -DNO_DEBUG_MESSAGES +INCLUDES_LOC = -I$(top_srcdir)/ndb/include/mgmapi + +DEFS_LOC = -DNO_DEBUG_MESSAGES -DNDB_PORT="\"@ndb_port@\"" include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am @@ -13,3 +14,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libmgmapi.dsp + +libmgmapi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmapi_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/mgmapi/Makefile_old b/ndb/src/mgmapi/Makefile_old deleted file mode 100644 index fa734f998e6..00000000000 --- a/ndb/src/mgmapi/Makefile_old +++ /dev/null @@ -1,27 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := mgmapi - -A_LIB := Y -SO_LIB := Y -PIC_LIB := Y - -#DIRS := test - -LIB_TARGET := MGM_API -LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) general portlib - -# Source files of non-templated classes (.C files) -SOURCES = mgmapi.cpp mgmapi_configuration.cpp - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) - -CCFLAGS += -DNO_DEBUG_MESSAGES - -# -I$(NDB_TOP)/src/common/mgmcommon - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 4b62df968b3..68106c4689d 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -17,8 +17,10 @@ #include <ndb_global.h> #include <my_sys.h> +#include <LocalConfig.hpp> #include <NdbAutoPtr.hpp> +#include <NdbSleep.h> #include <NdbTCP.h> #include "mgmapi.h" #include "mgmapi_debug.h" @@ -82,8 +84,7 @@ typedef Parser<ParserDummy> Parser_t; #define NDB_MGM_MAX_ERR_DESC_SIZE 256 struct ndb_mgm_handle { - char * hostname; - unsigned short port; + int cfg_i; int connected; int last_error; @@ -94,6 +95,8 @@ struct ndb_mgm_handle { NDB_SOCKET_TYPE socket; + LocalConfig cfg; + #ifdef MGMAPI_LOG FILE* logfile; #endif @@ -145,12 +148,16 @@ ndb_mgm_create_handle() h->connected = 0; h->last_error = 0; h->last_error_line = 0; - h->hostname = 0; - h->socket = -1; + h->socket = NDB_INVALID_SOCKET; h->read_timeout = 50000; h->write_timeout = 100; + h->cfg_i = 0; strncpy(h->last_error_desc, "No error", NDB_MGM_MAX_ERR_DESC_SIZE); + + new (&(h->cfg)) LocalConfig; + h->cfg.init(0, 0); + #ifdef MGMAPI_LOG h->logfile = 0; #endif @@ -158,6 +165,23 @@ ndb_mgm_create_handle() return h; } +extern "C" +int +ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv) +{ + new (&(handle->cfg)) LocalConfig; + if (!handle->cfg.init(mgmsrv, 0) || + handle->cfg.ids.size() == 0) + { + new (&(handle->cfg)) LocalConfig; + handle->cfg.init(0, 0); /* reset the LocalCongig */ + SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); + return -1; + } + handle->cfg_i= 0; + return 0; +} + /** * Destroy a handle */ @@ -170,13 +194,13 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) if((* handle)->connected){ ndb_mgm_disconnect(* handle); } - my_free((* handle)->hostname,MYF(MY_ALLOW_ZERO_PTR)); #ifdef MGMAPI_LOG if ((* handle)->logfile != 0){ fclose((* handle)->logfile); (* handle)->logfile = 0; } #endif + (*handle)->cfg.~LocalConfig(); my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR)); * handle = 0; } @@ -220,42 +244,6 @@ ndb_mgm_get_latest_error_msg(const NdbMgmHandle h) return "Error"; // Unknown Error message } -static -int -parse_connect_string(const char * connect_string, - NdbMgmHandle handle) -{ - if(connect_string == 0){ - SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); - return -1; - } - - char * line = my_strdup(connect_string,MYF(MY_WME)); - My_auto_ptr<char> ap1(line); - if(line == 0){ - SET_ERROR(handle, NDB_MGM_OUT_OF_MEMORY, ""); - return -1; - } - - char * tmp = strchr(line, ':'); - if(tmp == 0){ - SET_ERROR(handle, NDB_MGM_OUT_OF_MEMORY, ""); - return -1; - } - * tmp = 0; tmp++; - - int port = 0; - if(sscanf(tmp, "%d", &port) != 1){ - SET_ERROR(handle, NDB_MGM_ILLEGAL_PORT_NUMBER, ""); - return -1; - } - - my_free(handle->hostname,MYF(MY_ALLOW_ZERO_PTR)); - handle->hostname = my_strdup(line,MYF(MY_WME)); - handle->port = port; - return 0; -} - /* * Call an operation, and return the reply */ @@ -344,15 +332,11 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow<ParserDummy> *command_reply, */ extern "C" int -ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) +ndb_mgm_connect(NdbMgmHandle handle, int no_retries, + int retry_delay_in_seconds, int verbose) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_connect"); CHECK_HANDLE(handle, -1); - - if(parse_connect_string(mgmsrv, handle) != 0) { - SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); - return -1; - } #ifdef MGMAPI_LOG /** @@ -366,14 +350,61 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) /** * Do connect */ - SocketClient s(handle->hostname, handle->port); - const NDB_SOCKET_TYPE sockfd = s.connect(); - if (sockfd < 0) { - setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, - "Unable to connect to %s", mgmsrv); - return -1; + LocalConfig &cfg= handle->cfg; + NDB_SOCKET_TYPE sockfd= NDB_INVALID_SOCKET; + Uint32 i; + while (sockfd == NDB_INVALID_SOCKET) + { + // do all the mgmt servers + for (i = 0; i < cfg.ids.size(); i++) + { + if (cfg.ids[i].type != MgmId_TCP) + continue; + SocketClient s(cfg.ids[i].name.c_str(), cfg.ids[i].port); + sockfd = s.connect(); + if (sockfd != NDB_INVALID_SOCKET) + break; + } + if (sockfd != NDB_INVALID_SOCKET) + break; + if (verbose > 0) { + char buf[1024]; + ndbout_c("Unable to connect with connect string: %s", + cfg.makeConnectString(buf,sizeof(buf))); + verbose= -1; + } + if (no_retries == 0) { + char buf[1024]; + setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, + "Unable to connect with connect string: %s", + cfg.makeConnectString(buf,sizeof(buf))); + if (verbose == -2) + ndbout << ", failed." << endl; + return -1; + } + if (verbose == -1) { + ndbout << "Retrying every " << retry_delay_in_seconds << " seconds"; + if (no_retries > 0) + ndbout << ". Attempts left:"; + else + ndbout << ", until connected.";; + ndbout << flush; + verbose= -2; + } + if (no_retries > 0) { + if (verbose == -2) { + ndbout << " " << no_retries; + ndbout << flush; + } + no_retries--; + } + NdbSleep_SecSleep(retry_delay_in_seconds); } - + if (verbose == -2) + ndbout << endl; + + handle->cfg_i = i; + handle->socket = sockfd; handle->connected = 1; @@ -392,7 +423,7 @@ ndb_mgm_disconnect(NdbMgmHandle handle) CHECK_CONNECTED(handle, -1); NDB_CLOSE_SOCKET(handle->socket); - handle->socket = -1; + handle->socket = NDB_INVALID_SOCKET; handle->connected = 0; return 0; @@ -543,7 +574,9 @@ cmp_state(const void *_a, const void *_b) a = (struct ndb_mgm_node_state *)_a; b = (struct ndb_mgm_node_state *)_b; - return a->node_id > b->node_id; + if (a->node_id > b->node_id) + return 1; + return -1; } extern "C" @@ -881,21 +914,67 @@ ndb_mgm_restart(NdbMgmHandle handle, int no_of_nodes, const int *node_list) return ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0); } +static const char *clusterlog_level_names[]= + { "enabled", "debug", "info", "warning", "error", "critical", "alert" }; + +struct ndb_mgm_clusterlog_levels +{ + const char* name; + enum ndb_mgm_clusterlog_level level; +} clusterlog_levels[] = { + { clusterlog_level_names[0], NDB_MGM_CLUSTERLOG_ON }, + { clusterlog_level_names[1], NDB_MGM_CLUSTERLOG_DEBUG }, + { clusterlog_level_names[2], NDB_MGM_CLUSTERLOG_INFO }, + { clusterlog_level_names[3], NDB_MGM_CLUSTERLOG_WARNING }, + { clusterlog_level_names[4], NDB_MGM_CLUSTERLOG_ERROR }, + { clusterlog_level_names[5], NDB_MGM_CLUSTERLOG_CRITICAL }, + { clusterlog_level_names[6], NDB_MGM_CLUSTERLOG_ALERT }, + { "all", NDB_MGM_CLUSTERLOG_ALL }, + { 0, NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL }, +}; + +extern "C" +ndb_mgm_clusterlog_level +ndb_mgm_match_clusterlog_level(const char * name) +{ + if(name == 0) + return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; + + for(int i = 0; clusterlog_levels[i].name !=0 ; i++) + if(strcasecmp(name, clusterlog_levels[i].name) == 0) + return clusterlog_levels[i].level; + + return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; +} + +extern "C" +const char * +ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level) +{ + int i= (int)level; + if (i >= 0 && i < (int)NDB_MGM_CLUSTERLOG_ALL) + return clusterlog_level_names[i]; + for(i = (int)NDB_MGM_CLUSTERLOG_ALL; clusterlog_levels[i].name != 0; i++) + if(clusterlog_levels[i].level == level) + return clusterlog_levels[i].name; + return 0; +} + extern "C" unsigned int * ndb_mgm_get_logfilter(NdbMgmHandle handle) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_logfilter"); - static Uint32 enabled[7] = {0,0,0,0,0,0,0}; + static Uint32 enabled[(int)NDB_MGM_CLUSTERLOG_ALL] = {0,0,0,0,0,0,0}; const ParserRow<ParserDummy> getinfo_reply[] = { MGM_CMD("clusterlog", NULL, ""), - MGM_ARG("enabled", Int, Mandatory, ""), - MGM_ARG("debug", Int, Mandatory, ""), - MGM_ARG("info", Int, Mandatory, ""), - MGM_ARG("warning", Int, Mandatory, ""), - MGM_ARG("error", Int, Mandatory, ""), - MGM_ARG("critical", Int, Mandatory, ""), - MGM_ARG("alert", Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[0], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[1], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[2], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[3], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[4], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[5], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[6], Int, Mandatory, ""), }; CHECK_HANDLE(handle, NULL); CHECK_CONNECTED(handle, NULL); @@ -905,10 +984,8 @@ ndb_mgm_get_logfilter(NdbMgmHandle handle) reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args); CHECK_REPLY(reply, NULL); - const char *names[] = { "enabled", "debug", "info", "warning", "error", - "critical", "alert" }; - for(int i=0; i < 7; i++) { - reply->get(names[i], &enabled[i]); + for(int i=0; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { + reply->get(clusterlog_level_names[i], &enabled[i]); } return enabled; } @@ -917,6 +994,7 @@ extern "C" int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, enum ndb_mgm_clusterlog_level level, + int enable, struct ndb_mgm_reply* /*reply*/) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_filter_clusterlog"); @@ -931,6 +1009,7 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle, Properties args; args.put("level", level); + args.put("enable", enable); const Properties *reply; reply = ndb_mgm_call(handle, filter_reply, "set logfilter", &args); @@ -938,11 +1017,14 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle, BaseString result; reply->get("result", result); - if(strcmp(result.c_str(), "1") == 0) { + + if (strcmp(result.c_str(), "1") == 0) + retval = 1; + else if (strcmp(result.c_str(), "0") == 0) retval = 0; - } else { + else + { SET_ERROR(handle, EINVAL, result.c_str()); - retval = -1; } delete reply; return retval; @@ -1020,15 +1102,18 @@ ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId, "set cluster loglevel", &args); CHECK_REPLY(reply, -1); + DBUG_ENTER("ndb_mgm_set_loglevel_clusterlog"); + DBUG_PRINT("enter",("node=%d, category=%d, level=%d", nodeId, cat, level)); + BaseString result; reply->get("result", result); if(strcmp(result.c_str(), "Ok") != 0) { SET_ERROR(handle, EINVAL, result.c_str()); delete reply; - return -1; + DBUG_RETURN(-1); } delete reply; - return 0; + DBUG_RETURN(0); } extern "C" @@ -1080,9 +1165,11 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]) }; CHECK_HANDLE(handle, -1); - SocketClient s(handle->hostname, handle->port); + const char *hostname= ndb_mgm_get_connected_host(handle); + int port= ndb_mgm_get_connected_port(handle); + SocketClient s(hostname, port); const NDB_SOCKET_TYPE sockfd = s.connect(); - if (sockfd < 0) { + if (sockfd == NDB_INVALID_SOCKET) { setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, "Unable to connect to"); return -1; @@ -1458,7 +1545,8 @@ ndb_mgm_start(NdbMgmHandle handle, int no_of_nodes, const int * node_list) *****************************************************************************/ extern "C" int -ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id, +ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, + unsigned int* _backup_id, struct ndb_mgm_reply* /*reply*/) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_start_backup"); @@ -1472,8 +1560,17 @@ ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id, CHECK_CONNECTED(handle, -1); Properties args; + args.put("completed", wait_completed); const Properties *reply; - reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); + { // start backup can take some time, set timeout high + Uint64 old_timeout= handle->read_timeout; + if (wait_completed == 2) + handle->read_timeout= 30*60*1000; // 30 minutes + else if (wait_completed == 1) + handle->read_timeout= 5*60*1000; // 5 minutes + reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); + handle->read_timeout= old_timeout; + } CHECK_REPLY(reply, -1); BaseString result; @@ -1625,19 +1722,59 @@ ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *cfg) extern "C" int -ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, unsigned *pnodeid, int nodetype) +ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid) { + CHECK_HANDLE(handle, -1); + handle->cfg._ownNodeId= nodeid; + return 0; +} +extern "C" +int +ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle) +{ + CHECK_HANDLE(handle, 0); + return handle->cfg._ownNodeId; +} + +extern "C" +int ndb_mgm_get_connected_port(NdbMgmHandle handle) +{ + return handle->cfg.ids[handle->cfg_i].port; +} + +extern "C" +const char *ndb_mgm_get_connected_host(NdbMgmHandle handle) +{ + return handle->cfg.ids[handle->cfg_i].name.c_str(); +} + +extern "C" +const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz) +{ + return handle->cfg.makeConnectString(buf,buf_sz); +} + +extern "C" +int +ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) +{ CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); + union { long l; char c[sizeof(long)]; } endian_check; + + endian_check.l = 1; + + int nodeid= handle->cfg._ownNodeId; Properties args; args.put("version", version); args.put("nodetype", nodetype); - args.put("nodeid", *pnodeid); + args.put("nodeid", nodeid); args.put("user", "mysqld"); args.put("password", "mysqld"); args.put("public key", "a public key"); + args.put("endian", (endian_check.c[sizeof(long)-1])?"big":"little"); const ParserRow<ParserDummy> reply[]= { MGM_CMD("get nodeid reply", NULL, ""), @@ -1650,26 +1787,29 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, unsigned *pnodei prop= ndb_mgm_call(handle, reply, "get nodeid", &args); CHECK_REPLY(prop, -1); - int res= -1; + nodeid= -1; do { const char * buf; if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ + const char *hostname= ndb_mgm_get_connected_host(handle); + unsigned port= ndb_mgm_get_connected_port(handle); BaseString err; err.assfmt("Could not alloc node id at %s port %d: %s", - handle->hostname, handle->port, buf); + hostname, port, buf); setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, err.c_str()); break; } - if(!prop->get("nodeid", pnodeid) != 0){ + Uint32 _nodeid; + if(!prop->get("nodeid", &_nodeid) != 0){ ndbout_c("ERROR Message: <nodeid Unspecified>\n"); break; } - res= 0; + nodeid= _nodeid; }while(0); delete prop; - return res; + return nodeid; } /***************************************************************************** @@ -1834,4 +1974,80 @@ ndb_mgm_set_string_parameter(NdbMgmHandle handle, return res; } +extern "C" +int +ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **purged){ + CHECK_HANDLE(handle, 0); + CHECK_CONNECTED(handle, 0); + + Properties args; + + const ParserRow<ParserDummy> reply[]= { + MGM_CMD("purge stale sessions reply", NULL, ""), + MGM_ARG("purged", String, Optional, ""), + MGM_ARG("result", String, Mandatory, "Error message"), + MGM_END() + }; + + const Properties *prop; + prop= ndb_mgm_call(handle, reply, "purge stale sessions", &args); + + if(prop == NULL) { + SET_ERROR(handle, EIO, "Unable to purge stale sessions"); + return -1; + } + + int res= -1; + do { + const char * buf; + if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ + ndbout_c("ERROR Message: %s\n", buf); + break; + } + if (purged) { + if (prop->get("purged", &buf)) + *purged= strdup(buf); + else + *purged= 0; + } + res= 0; + } while(0); + delete prop; + return res; +} + +extern "C" +int +ndb_mgm_check_connection(NdbMgmHandle handle){ + CHECK_HANDLE(handle, 0); + CHECK_CONNECTED(handle, 0); + SocketOutputStream out(handle->socket); + SocketInputStream in(handle->socket, handle->read_timeout); + char buf[32]; + + if (out.println("check connection")) + goto ndb_mgm_check_connection_error; + + if (out.println("")) + goto ndb_mgm_check_connection_error; + + in.gets(buf, sizeof(buf)); + if(strcmp("check connection reply\n", buf)) + goto ndb_mgm_check_connection_error; + + in.gets(buf, sizeof(buf)); + if(strcmp("result: Ok\n", buf)) + goto ndb_mgm_check_connection_error; + + in.gets(buf, sizeof(buf)); + if(strcmp("\n", buf)) + goto ndb_mgm_check_connection_error; + + return 0; + +ndb_mgm_check_connection_error: + ndb_mgm_disconnect(handle); + return -1; +} + template class Vector<const ParserRow<ParserDummy>*>; diff --git a/ndb/src/mgmapi/mgmapi_configuration.cpp b/ndb/src/mgmapi/mgmapi_configuration.cpp index ae7fe2c294c..80ab428c05a 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.cpp +++ b/ndb/src/mgmapi/mgmapi_configuration.cpp @@ -1,6 +1,6 @@ +#include <ndb_types.h> #include <mgmapi.h> #include "mgmapi_configuration.hpp" -#include <new> ndb_mgm_configuration_iterator::ndb_mgm_configuration_iterator (const ndb_mgm_configuration & conf, unsigned type_of_section) @@ -138,7 +138,7 @@ ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator* iter, extern "C" int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator* iter, - int param, unsigned long long * value){ + int param, Uint64 * value){ return iter->get(param, value); } diff --git a/ndb/src/mgmapi/mgmapi_configuration.hpp b/ndb/src/mgmapi/mgmapi_configuration.hpp index c7feffd3a4e..9e94b3311bf 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.hpp +++ b/ndb/src/mgmapi/mgmapi_configuration.hpp @@ -21,7 +21,7 @@ struct ndb_mgm_configuration_iterator { int find(int param, unsigned value); int get(int param, unsigned * value) const ; - int get(int param, unsigned long long * value) const ; + int get(int param, Uint64 * value) const ; int get(int param, const char ** value) const ; // diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index e0935c2104e..c3b0ee7fe97 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -17,7 +17,199 @@ #include <ndb_global.h> #include <my_sys.h> -#include "CommandInterpreter.hpp" +//#define HAVE_GLOBAL_REPLICATION + +#include <Vector.hpp> +#ifdef HAVE_GLOBAL_REPLICATION +#include "../rep/repapi/repapi.h" +#endif + +#include <mgmapi.h> + +class MgmtSrvr; + +/** + * @class CommandInterpreter + * @brief Reads command line in management client + * + * This class has one public method which reads a command line + * from a stream. It then interpret that commmand line and calls a suitable + * method in the MgmtSrvr class which executes the command. + * + * For command syntax, see the HELP command. + */ +class CommandInterpreter { +public: + /** + * Constructor + * @param mgmtSrvr: Management server to use when executing commands + */ + CommandInterpreter(const char *, int verbose); + ~CommandInterpreter(); + + /** + * Reads one line from the stream, parse the line to find + * a command and then calls a suitable method which executes + * the command. + * + * @return true until quit/bye/exit has been typed + */ + int execute(const char *_line, int _try_reconnect=-1, int *error= 0); + +private: + void printError(); + int execute_impl(const char *_line); + + /** + * Analyse the command line, after the first token. + * + * @param processId: DB process id to send command to or -1 if + * command will be sent to all DB processes. + * @param allAfterFirstToken: What the client gave after the + * first token on the command line + */ + void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); + + /** + * Parse the block specification part of the LOG* commands, + * things after LOG*: [BLOCK = {ALL|<blockName>+}] + * + * @param allAfterLog: What the client gave after the second token + * (LOG*) on the command line + * @param blocks, OUT: ALL or name of all the blocks + * @return: true if correct syntax, otherwise false + */ + bool parseBlockSpecification(const char* allAfterLog, + Vector<const char*>& blocks); + + /** + * A bunch of execute functions: Executes one of the commands + * + * @param processId: DB process id to send command to + * @param parameters: What the client gave after the command name + * on the command line. + * For example if complete input from user is: "1 LOGLEVEL 22" then the + * parameters argument is the string with everything after LOGLEVEL, in + * this case "22". Each function is responsible to check the parameters + * argument. + */ + void executeHelp(char* parameters); + void executeShow(char* parameters); + void executeConnect(char* parameters); + void executePurge(char* parameters); + int executeShutdown(char* parameters); + void executeRun(char* parameters); + void executeInfo(char* parameters); + void executeClusterLog(char* parameters); + +public: + void executeStop(int processId, const char* parameters, bool all); + void executeEnterSingleUser(char* parameters); + void executeExitSingleUser(char* parameters); + void executeStart(int processId, const char* parameters, bool all); + void executeRestart(int processId, const char* parameters, bool all); + void executeLogLevel(int processId, const char* parameters, bool all); + void executeError(int processId, const char* parameters, bool all); + void executeLog(int processId, const char* parameters, bool all); + void executeLogIn(int processId, const char* parameters, bool all); + void executeLogOut(int processId, const char* parameters, bool all); + void executeLogOff(int processId, const char* parameters, bool all); + void executeTestOn(int processId, const char* parameters, bool all); + void executeTestOff(int processId, const char* parameters, bool all); + void executeSet(int processId, const char* parameters, bool all); + void executeGetStat(int processId, const char* parameters, bool all); + void executeStatus(int processId, const char* parameters, bool all); + void executeEventReporting(int processId, const char* parameters, bool all); + void executeDumpState(int processId, const char* parameters, bool all); + int executeStartBackup(char * parameters); + void executeAbortBackup(char * parameters); + + void executeRep(char* parameters); + + void executeCpc(char * parameters); + +public: + bool connect(); + bool disconnect(); + + /** + * A execute function definition + */ +public: + typedef void (CommandInterpreter::* ExecuteFunction)(int processId, + const char * param, + bool all); + + struct CommandFunctionPair { + const char * command; + ExecuteFunction executeFunction; + }; +private: + /** + * + */ + void executeForAll(const char * cmd, + ExecuteFunction fun, + const char * param); + + NdbMgmHandle m_mgmsrv; + NdbMgmHandle m_mgmsrv2; + bool m_connected; + int m_verbose; + int try_reconnect; + int m_error; +#ifdef HAVE_GLOBAL_REPLICATION + NdbRepHandle m_repserver; + const char *rep_host; + bool rep_connected; +#endif + struct NdbThread* m_event_thread; +}; + + +/* + * Facade object for CommandInterpreter + */ + +#include "ndb_mgmclient.hpp" +#include "ndb_mgmclient.h" + +Ndb_mgmclient::Ndb_mgmclient(const char *host,int verbose) +{ + m_cmd= new CommandInterpreter(host,verbose); +} +Ndb_mgmclient::~Ndb_mgmclient() +{ + delete m_cmd; +} +int Ndb_mgmclient::execute(const char *_line, int _try_reconnect, int *error) +{ + return m_cmd->execute(_line,_try_reconnect,error); +} +int +Ndb_mgmclient::disconnect() +{ + return m_cmd->disconnect(); +} + +extern "C" { + Ndb_mgmclient_handle ndb_mgmclient_handle_create(const char *connect_string) + { + return (Ndb_mgmclient_handle) new Ndb_mgmclient(connect_string); + } + int ndb_mgmclient_execute(Ndb_mgmclient_handle h, int argc, char** argv) + { + return ((Ndb_mgmclient*)h)->execute(argc, argv, 1); + } + int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle h) + { + delete (Ndb_mgmclient*)h; + return 0; + } +} +/* + * The CommandInterpreter + */ #include <mgmapi.h> #include <mgmapi_debug.h> @@ -33,8 +225,22 @@ #endif // HAVE_GLOBAL_REPLICATION #include "MgmtErrorReporter.hpp" -#include "CpcClient.hpp" +#include <Parser.hpp> +#include <SocketServer.hpp> +#include <util/InputStream.hpp> +#include <util/OutputStream.hpp> +int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect, int *error) +{ + if (argc <= 0) + return 0; + BaseString _line(argv[0]); + for (int i= 1; i < argc; i++) + { + _line.appfmt(" %s", argv[i]); + } + return m_cmd->execute(_line.c_str(),_try_reconnect, error); +} /***************************************************************************** * HELP @@ -56,12 +262,13 @@ static const char* helpText = "SHOW CONFIG Print configuration\n" "SHOW PARAMETERS Print configuration parameters\n" #endif -"START BACKUP Start backup\n" +"START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]\n" +" Start backup (default WAIT COMPLETED)\n" "ABORT BACKUP <backup id> Abort backup\n" -"SHUTDOWN Shutdown all processes in cluster and quit\n" -"CLUSTERLOG ON Enable Cluster logging\n" -"CLUSTERLOG OFF Disable Cluster logging\n" -"CLUSTERLOG FILTER <severity> Toggle severity filter on/off\n" +"SHUTDOWN Shutdown all processes in cluster\n" +"CLUSTERLOG ON [<severity>] ... Enable Cluster logging\n" +"CLUSTERLOG OFF [<severity>] ... Disable Cluster logging\n" +"CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off\n" "CLUSTERLOG INFO Print cluster log information\n" "<id> START Start DB node (started with -n)\n" "<id> RESTART [-n] [-i] Restart DB node\n" @@ -73,6 +280,8 @@ static const char* helpText = #ifdef HAVE_GLOBAL_REPLICATION "REP CONNECT <host:port> Connect to REP server on host:port\n" #endif +"PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server\n" +"CONNECT [<connectstring>] Connect to management server (reconnect if already connected)\n" "QUIT Quit management client\n" ; @@ -131,7 +340,6 @@ static const char* helpTextDebug = #ifdef ERROR_INSERT "<id> ERROR <errorNo> Inject error into NDB node\n" #endif -"<id> TRACE <traceNo> Set trace number\n" "<id> LOG [BLOCK = {ALL|<block>+}] Set logging on in & out signals\n" "<id> LOGIN [BLOCK = {ALL|<block>+}] Set logging on in signals\n" "<id> LOGOUT [BLOCK = {ALL|<block>+}] Set logging on out signals\n" @@ -171,18 +379,28 @@ convert(const char* s, int& val) { /* * Constructor */ -CommandInterpreter::CommandInterpreter(const char *_host) +CommandInterpreter::CommandInterpreter(const char *_host,int verbose) + : m_verbose(verbose) { m_mgmsrv = ndb_mgm_create_handle(); if(m_mgmsrv == NULL) { ndbout_c("Cannot create handle to management server."); + exit(-1); + } + m_mgmsrv2 = ndb_mgm_create_handle(); + if(m_mgmsrv2 == NULL) { + ndbout_c("Cannot create handle to management server."); + exit(-1); + } + if (ndb_mgm_set_connectstring(m_mgmsrv, _host)) + { printError(); + exit(-1); } - connected = false; + m_connected= false; + m_event_thread= 0; try_reconnect = 0; - - host = my_strdup(_host,MYF(MY_WME)); #ifdef HAVE_GLOBAL_REPLICATION rep_host = NULL; m_repserver = NULL; @@ -195,13 +413,12 @@ CommandInterpreter::CommandInterpreter(const char *_host) */ CommandInterpreter::~CommandInterpreter() { - connected = false; + disconnect(); ndb_mgm_destroy_handle(&m_mgmsrv); - my_free((char *)host,MYF(0)); - host = NULL; + ndb_mgm_destroy_handle(&m_mgmsrv2); } -bool +static bool emptyString(const char* s) { if (s == NULL) { @@ -220,6 +437,11 @@ emptyString(const char* s) void CommandInterpreter::printError() { + if (ndb_mgm_check_connection(m_mgmsrv)) + { + m_connected= false; + disconnect(); + } ndbout_c("* %5d: %s", ndb_mgm_get_latest_error(m_mgmsrv), ndb_mgm_get_latest_error_msg(m_mgmsrv)); @@ -229,34 +451,105 @@ CommandInterpreter::printError() //***************************************************************************** //***************************************************************************** -bool +static int do_event_thread; +static void* +event_thread_run(void* m) +{ + NdbMgmHandle handle= *(NdbMgmHandle*)m; + + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; + int fd = ndb_mgm_listen_event(handle, filter); + if (fd > 0) + { + do_event_thread= 1; + char *tmp= 0; + char buf[1024]; + SocketInputStream in(fd,10); + do { + if (tmp == 0) NdbSleep_MilliSleep(10); + if((tmp = in.gets(buf, 1024))) + ndbout << tmp; + } while(do_event_thread); + } + else + { + do_event_thread= -1; + } + + return NULL; +} + +bool CommandInterpreter::connect() { - if(!connected) { - int tries = try_reconnect; // tries == 0 => infinite - while(!connected) { - if(ndb_mgm_connect(m_mgmsrv, host) == -1) { - ndbout << "Cannot connect to management server (" << host << ")."; - tries--; - if (tries == 0) - break; - ndbout << "Retrying in 5 seconds." << endl; - NdbSleep_SecSleep(5); - } else - connected = true; + if(!m_connected) + { + if(!ndb_mgm_connect(m_mgmsrv, try_reconnect-1, 5, 1)) + { + const char *host= ndb_mgm_get_connected_host(m_mgmsrv); + unsigned port= ndb_mgm_get_connected_port(m_mgmsrv); + if(!ndb_mgm_set_connectstring(m_mgmsrv2, + BaseString(host).appfmt(":%d",port).c_str()) + && + !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) + { + assert(m_event_thread == 0); + assert(do_event_thread == 0); + do_event_thread= 0; + m_event_thread = NdbThread_Create(event_thread_run, + (void**)&m_mgmsrv2, + 32768, + "CommandInterpreted_event_thread", + NDB_THREAD_PRIO_LOW); + if (m_event_thread != 0) + { + int iter= 1000; // try for 30 seconds + while(do_event_thread == 0 && + iter-- > 0) + NdbSleep_MilliSleep(30); + } + if (m_event_thread == 0 || + do_event_thread == 0 || + do_event_thread == -1) + { + printf("Warning, event thread startup failed, degraded printouts as result\n"); + do_event_thread= 0; + } + } + else + { + printf("Warning, event connect failed, degraded printouts as result\n"); + } + m_connected= true; + if (m_verbose) + { + printf("Connected to Management Server at: %s:%d\n", + host, port); + } } } - return connected; + return m_connected; } bool CommandInterpreter::disconnect() { - if (ndb_mgm_disconnect(m_mgmsrv) == -1) { - ndbout_c("Could not disconnect from management server"); - printError(); + if (m_event_thread) { + void *res; + do_event_thread= 0; + NdbThread_WaitFor(m_event_thread, &res); + NdbThread_Destroy(&m_event_thread); + m_event_thread= 0; + ndb_mgm_disconnect(m_mgmsrv2); + } + if (m_connected) + { + if (ndb_mgm_disconnect(m_mgmsrv) == -1) { + ndbout_c("Could not disconnect from management server"); + printError(); + } + m_connected= false; } - connected = false; return true; } @@ -264,95 +557,136 @@ CommandInterpreter::disconnect() //***************************************************************************** int -CommandInterpreter::readAndExecute(int _try_reconnect) +CommandInterpreter::execute(const char *_line, int _try_reconnect, + int *error) { if (_try_reconnect >= 0) try_reconnect=_try_reconnect; + int result= execute_impl(_line); + if (error) + *error= m_error; + return result; +} + +static void +invalid_command(const char *cmd) +{ + ndbout << "Invalid command: " << cmd << endl; + ndbout << "Type HELP for help." << endl << endl; +} + +int +CommandInterpreter::execute_impl(const char *_line) +{ + DBUG_ENTER("CommandInterpreter::execute_impl"); + DBUG_PRINT("enter",("line=\"%s\"",_line)); + m_error= 0; - char* _line = readline_gets(); char * line; if(_line == NULL) { - // ndbout << endl; - return false; + DBUG_RETURN(false); } - line = my_strdup(_line,MYF(MY_WME)); My_auto_ptr<char> ptr(line); - - if (emptyString(line)) { - return true; - } - - for (unsigned int i = 0; i < strlen(line); ++i) { - line[i] = toupper(line[i]); - } + int do_continue; + do { + do_continue= 0; + BaseString::trim(line," \t"); + if (line[0] == 0 || + line[0] == '#') + { + DBUG_RETURN(true); + } + // for mysql client compatability remove trailing ';' + { + unsigned last= strlen(line)-1; + if (line[last] == ';') + { + line[last]= 0; + do_continue= 1; + } + } + } while (do_continue); // if there is anything in the line proceed char* firstToken = strtok(line, " "); char* allAfterFirstToken = strtok(NULL, ""); - if (strcmp(firstToken, "HELP") == 0 || - strcmp(firstToken, "?") == 0) { + if (strcasecmp(firstToken, "HELP") == 0 || + strcasecmp(firstToken, "?") == 0) { executeHelp(allAfterFirstToken); - return true; + DBUG_RETURN(true); + } + else if (strcasecmp(firstToken, "CONNECT") == 0) { + executeConnect(allAfterFirstToken); + DBUG_RETURN(true); } - else if (strcmp(firstToken, "SHOW") == 0) { + else if (strcasecmp(firstToken, "SLEEP") == 0) { + if (allAfterFirstToken) + sleep(atoi(allAfterFirstToken)); + DBUG_RETURN(true); + } + else if((strcasecmp(firstToken, "QUIT") == 0 || + strcasecmp(firstToken, "EXIT") == 0 || + strcasecmp(firstToken, "BYE") == 0) && + allAfterFirstToken == NULL){ + DBUG_RETURN(false); + } + + if (!connect()) + DBUG_RETURN(true); + + if (strcasecmp(firstToken, "SHOW") == 0) { executeShow(allAfterFirstToken); - return true; + DBUG_RETURN(true); } - else if (strcmp(firstToken, "SHUTDOWN") == 0) { - executeShutdown(allAfterFirstToken); - return true; + else if (strcasecmp(firstToken, "SHUTDOWN") == 0) { + m_error= executeShutdown(allAfterFirstToken); + DBUG_RETURN(true); } - else if (strcmp(firstToken, "CLUSTERLOG") == 0){ + else if (strcasecmp(firstToken, "CLUSTERLOG") == 0){ executeClusterLog(allAfterFirstToken); - return true; + DBUG_RETURN(true); } - else if(strcmp(firstToken, "START") == 0 && + else if(strcasecmp(firstToken, "START") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeStartBackup(allAfterFirstToken); - return true; + strncasecmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ + m_error= executeStartBackup(allAfterFirstToken); + DBUG_RETURN(true); } - else if(strcmp(firstToken, "ABORT") == 0 && + else if(strcasecmp(firstToken, "ABORT") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ + strncasecmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ executeAbortBackup(allAfterFirstToken); - return true; + DBUG_RETURN(true); } + else if (strcasecmp(firstToken, "PURGE") == 0) { + executePurge(allAfterFirstToken); + DBUG_RETURN(true); + } #ifdef HAVE_GLOBAL_REPLICATION - else if(strcmp(firstToken, "REPLICATION") == 0 || - strcmp(firstToken, "REP") == 0) { + else if(strcasecmp(firstToken, "REPLICATION") == 0 || + strcasecmp(firstToken, "REP") == 0) { executeRep(allAfterFirstToken); - return true; + DBUG_RETURN(true); } #endif // HAVE_GLOBAL_REPLICATION - else if(strcmp(firstToken, "ENTER") == 0 && + else if(strcasecmp(firstToken, "ENTER") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", + strncasecmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ executeEnterSingleUser(allAfterFirstToken); - return true; + DBUG_RETURN(true); } - else if(strcmp(firstToken, "EXIT") == 0 && + else if(strcasecmp(firstToken, "EXIT") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", + strncasecmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ executeExitSingleUser(allAfterFirstToken); - return true; + DBUG_RETURN(true); } - else if (strcmp(firstToken, "ALL") == 0) { + else if (strcasecmp(firstToken, "ALL") == 0) { analyseAfterFirstToken(-1, allAfterFirstToken); - } - else if((strcmp(firstToken, "QUIT") == 0 || - strcmp(firstToken, "EXIT") == 0 || - strcmp(firstToken, "BYE") == 0) && - allAfterFirstToken == NULL){ - return false; -#if 0 - } else if(strcmp(firstToken, "CPC") == 0) { - executeCpc(allAfterFirstToken); -#endif } else { /** * First token should be a digit, node ID @@ -360,20 +694,19 @@ CommandInterpreter::readAndExecute(int _try_reconnect) int nodeId; if (! convert(firstToken, nodeId)) { - ndbout << "Invalid command: " << line << endl; - ndbout << "Type HELP for help." << endl << endl; - return true; + invalid_command(_line); + DBUG_RETURN(true); } - if (nodeId < 0) { + if (nodeId <= 0) { ndbout << "Invalid node ID: " << firstToken << "." << endl; - return true; + DBUG_RETURN(true); } analyseAfterFirstToken(nodeId, allAfterFirstToken); } - return true; + DBUG_RETURN(true); } @@ -390,7 +723,6 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { #ifdef ERROR_INSERT ,{ "ERROR", &CommandInterpreter::executeError } #endif - ,{ "TRACE", &CommandInterpreter::executeTrace } ,{ "LOG", &CommandInterpreter::executeLog } ,{ "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } @@ -410,12 +742,8 @@ CommandInterpreter::analyseAfterFirstToken(int processId, char* allAfterFirstToken) { if (emptyString(allAfterFirstToken)) { - if (processId == -1) { - ndbout << "Expected a command after ALL." << endl; - } - else { - ndbout << "Expected a command after node ID." << endl; - } + ndbout << "Expected a command after " + << ((processId == -1) ? "ALL." : "node ID.") << endl; return; } @@ -426,7 +754,7 @@ CommandInterpreter::analyseAfterFirstToken(int processId, ExecuteFunction fun = 0; const char * command = 0; for(int i = 0; i<tmpSize; i++){ - if(strcmp(secondToken, commands[i].command) == 0){ + if(strcasecmp(secondToken, commands[i].command) == 0){ fun = commands[i].executeFunction; command = commands[i].command; break; @@ -434,19 +762,16 @@ CommandInterpreter::analyseAfterFirstToken(int processId, } if(fun == 0){ - ndbout << "Invalid command: " << secondToken << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(secondToken); return; } if(processId == -1){ executeForAll(command, fun, allAfterSecondToken); } else { - if(strcmp(command, "STATUS") != 0) - ndbout_c("Executing %s on node %d.", command, processId); (this->*fun)(processId, allAfterSecondToken, false); - ndbout << endl; } + ndbout << endl; } /** @@ -492,17 +817,16 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, const char * allAfterSecondToken) { int nodeId = 0; - if(strcmp(cmd, "STOP") == 0) { + if(strcasecmp(cmd, "STOP") == 0) { ndbout_c("Executing STOP on all nodes."); (this->*fun)(nodeId, allAfterSecondToken, true); - } else if(strcmp(cmd, "RESTART") == 0) { + } else if(strcasecmp(cmd, "RESTART") == 0) { ndbout_c("Executing RESTART on all nodes."); ndbout_c("Starting shutdown. This may take a while. Please wait..."); (this->*fun)(nodeId, allAfterSecondToken, true); ndbout_c("Trying to start all nodes of system."); ndbout_c("Use ALL STATUS to see the system start-up phases."); } else { - connect(); struct ndb_mgm_cluster_state *cl= ndb_mgm_get_status(m_mgmsrv); if(cl == 0){ ndbout_c("Unable get status from management server"); @@ -510,12 +834,8 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, return; } NdbAutoPtr<char> ap1((char*)cl); - while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) { - if(strcmp(cmd, "STATUS") != 0) - ndbout_c("Executing %s on node %d.", cmd, nodeId); + while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) (this->*fun)(nodeId, allAfterSecondToken, true); - ndbout << endl; - } // while } } @@ -539,7 +859,7 @@ CommandInterpreter::parseBlockSpecification(const char* allAfterLog, firstTokenAfterLog[i] = toupper(firstTokenAfterLog[i]); } - if (strcmp(firstTokenAfterLog, "BLOCK") != 0) { + if (strcasecmp(firstTokenAfterLog, "BLOCK") != 0) { ndbout << "Unexpected value: " << firstTokenAfterLog << ". Expected BLOCK." << endl; return false; @@ -552,7 +872,7 @@ CommandInterpreter::parseBlockSpecification(const char* allAfterLog, } char* secondTokenAfterLog = strtok(allAfterFirstToken, " "); - if (strcmp(secondTokenAfterLog, "=") != 0) { + if (strcasecmp(secondTokenAfterLog, "=") != 0) { ndbout << "Unexpected value: " << secondTokenAfterLog << ". Expected =." << endl; return false; @@ -560,7 +880,7 @@ CommandInterpreter::parseBlockSpecification(const char* allAfterLog, char* blockName = strtok(NULL, " "); bool all = false; - if (blockName != NULL && (strcmp(blockName, "ALL") == 0)) { + if (blockName != NULL && (strcasecmp(blockName, "ALL") == 0)) { all = true; } while (blockName != NULL) { @@ -611,20 +931,19 @@ CommandInterpreter::executeHelp(char* parameters) ndbout << "<level> = " << "0 - 15" << endl; ndbout << "<id> = " << "ALL | Any database node id" << endl; ndbout << endl; - } else if (strcmp(parameters, "SHOW") == 0) { + } else if (strcasecmp(parameters, "SHOW") == 0) { ndbout << helpTextShow; #ifdef HAVE_GLOBAL_REPLICATION - } else if (strcmp(parameters, "REPLICATION") == 0 || - strcmp(parameters, "REP") == 0) { + } else if (strcasecmp(parameters, "REPLICATION") == 0 || + strcasecmp(parameters, "REP") == 0) { ndbout << helpTextRep; #endif // HAVE_GLOBAL_REPLICATION #ifdef VM_TRACE // DEBUG ONLY - } else if (strcmp(parameters, "DEBUG") == 0) { + } else if (strcasecmp(parameters, "DEBUG") == 0) { ndbout << helpTextDebug; #endif } else { - ndbout << "Invalid argument: " << parameters << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(parameters); } } @@ -633,25 +952,23 @@ CommandInterpreter::executeHelp(char* parameters) * SHUTDOWN *****************************************************************************/ -void +int CommandInterpreter::executeShutdown(char* parameters) { - connect(); - ndb_mgm_cluster_state *state = ndb_mgm_get_status(m_mgmsrv); if(state == NULL) { ndbout_c("Could not get status"); printError(); - return; + return 1; } NdbAutoPtr<char> ap1((char*)state); int result = 0; result = ndb_mgm_stop(m_mgmsrv, 0, 0); if (result < 0) { - ndbout << "Shutdown failed." << endl; + ndbout << "Shutdown off NDB Cluster storage node(s) failed." << endl; printError(); - return; + return result; } ndbout << result << " NDB Cluster storage node(s) have shutdown." << endl; @@ -666,21 +983,24 @@ CommandInterpreter::executeShutdown(char* parameters) ndbout << "Unable to locate management server, " << "shutdown manually with <id> STOP" << endl; - return; + return 1; } } } - result = 0; result = ndb_mgm_stop(m_mgmsrv, 1, &mgm_id); if (result <= 0) { - ndbout << "Shutdown failed." << endl; + ndbout << "Shutdown of NDB Cluster management server failed." << endl; printError(); - return; + if (result == 0) + return 1; + return result; } + m_connected= false; + disconnect(); ndbout << "NDB Cluster management server shutdown." << endl; - exit(0); + return 0; } /***************************************************************************** @@ -729,7 +1049,7 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, const char *hostname= node_state->connect_address; if (hostname == 0 || strlen(hostname) == 0 - || strcmp(hostname,"0.0.0.0") == 0) + || strcasecmp(hostname,"0.0.0.0") == 0) ndbout << " "; else ndbout << "\t@" << hostname; @@ -749,16 +1069,19 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, } ndbout << ")" << endl; } else { - if(ndb_mgm_find(it, CFG_NODE_ID, node_id) != 0){ + ndb_mgm_first(it); + if(ndb_mgm_find(it, CFG_NODE_ID, node_id) == 0){ + const char *config_hostname= 0; + ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &config_hostname); + if (config_hostname == 0 || config_hostname[0] == 0) + config_hostname= "any host"; + ndbout_c(" (not connected, accepting connect from %s)", + config_hostname); + } + else + { ndbout_c("Unable to find node with id: %d", node_id); - return; } - const char *config_hostname= 0; - ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &config_hostname); - if (config_hostname == 0 || config_hostname[0] == 0) - config_hostname= "any host"; - ndbout << " (not connected, accepting connect from " - << config_hostname << ")" << endl; } } } @@ -766,14 +1089,49 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, } void +CommandInterpreter::executePurge(char* parameters) +{ + int command_ok= 0; + do { + if (emptyString(parameters)) + break; + char* firstToken = strtok(parameters, " "); + char* nextToken = strtok(NULL, " \0"); + if (strcasecmp(firstToken,"STALE") == 0 && + nextToken && + strcasecmp(nextToken, "SESSIONS") == 0) { + command_ok= 1; + break; + } + } while(0); + + if (!command_ok) { + ndbout_c("Unexpected command, expected: PURGE STALE SESSIONS"); + return; + } + + int i; + char *str; + + if (ndb_mgm_purge_stale_sessions(m_mgmsrv, &str)) { + ndbout_c("Command failed"); + return; + } + if (str) { + ndbout_c("Purged sessions with node id's: %s", str); + free(str); + } + else + { + ndbout_c("No sessions purged"); + } +} + +void CommandInterpreter::executeShow(char* parameters) { int i; - connect(); if (emptyString(parameters)) { - ndbout << "Cluster Configuration" << endl - << "---------------------" << endl; - ndb_mgm_cluster_state *state = ndb_mgm_get_status(m_mgmsrv); if(state == NULL) { ndbout_c("Could not get status"); @@ -833,22 +1191,24 @@ CommandInterpreter::executeShow(char* parameters) } } + ndbout << "Cluster Configuration" << endl + << "---------------------" << endl; print_nodes(state, it, "ndbd", ndb_nodes, NDB_MGM_NODE_TYPE_NDB, master_id); print_nodes(state, it, "ndb_mgmd", mgm_nodes, NDB_MGM_NODE_TYPE_MGM, 0); print_nodes(state, it, "mysqld", api_nodes, NDB_MGM_NODE_TYPE_API, 0); // ndbout << helpTextShow; return; - } else if (strcmp(parameters, "PROPERTIES") == 0 || - strcmp(parameters, "PROP") == 0) { + } else if (strcasecmp(parameters, "PROPERTIES") == 0 || + strcasecmp(parameters, "PROP") == 0) { ndbout << "SHOW PROPERTIES is not yet implemented." << endl; // ndbout << "_mgmtSrvr.getConfig()->print();" << endl; /* XXX */ - } else if (strcmp(parameters, "CONFIGURATION") == 0 || - strcmp(parameters, "CONFIG") == 0){ + } else if (strcasecmp(parameters, "CONFIGURATION") == 0 || + strcasecmp(parameters, "CONFIG") == 0){ ndbout << "SHOW CONFIGURATION is not yet implemented." << endl; //nbout << "_mgmtSrvr.getConfig()->printConfigFile();" << endl; /* XXX */ - } else if (strcmp(parameters, "PARAMETERS") == 0 || - strcmp(parameters, "PARAMS") == 0 || - strcmp(parameters, "PARAM") == 0) { + } else if (strcasecmp(parameters, "PARAMETERS") == 0 || + strcasecmp(parameters, "PARAMS") == 0 || + strcasecmp(parameters, "PARAM") == 0) { ndbout << "SHOW PARAMETERS is not yet implemented." << endl; // ndbout << "_mgmtSrvr.getConfig()->getConfigInfo()->print();" // << endl; /* XXX */ @@ -857,151 +1217,150 @@ CommandInterpreter::executeShow(char* parameters) } } +void +CommandInterpreter::executeConnect(char* parameters) +{ + disconnect(); + if (!emptyString(parameters)) { + if (ndb_mgm_set_connectstring(m_mgmsrv, + BaseString(parameters).trim().c_str())) + { + printError(); + return; + } + } + connect(); +} //***************************************************************************** //***************************************************************************** void CommandInterpreter::executeClusterLog(char* parameters) { + DBUG_ENTER("CommandInterpreter::executeClusterLog"); int i; - connect(); - if (parameters != 0 && strlen(parameters) != 0) { - enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; - int isOk = true; - char name[12]; - bool noArgs = false; - - char * tmpString = my_strdup(parameters,MYF(MY_WME)); - My_auto_ptr<char> ap1(tmpString); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); + if (emptyString(parameters)) + { + ndbout << "Missing argument." << endl; + DBUG_VOID_RETURN; + } + + enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; - /******************** - * CLUSTERLOG FILTER - ********************/ - if (strcmp(item, "FILTER") == 0) { - - item = strtok_r(NULL, " ", &tmpPtr); - if (item == NULL) { - noArgs = true; - } - while (item != NULL) { - snprintf(name, sizeof(name), item); - - if (strcmp(item, "ALL") == 0) { - severity = NDB_MGM_CLUSTERLOG_ALL; - } else if (strcmp(item, "ALERT") == 0) { - severity = NDB_MGM_CLUSTERLOG_ALERT; - } else if (strcmp(item, "CRITICAL") == 0) { - severity = NDB_MGM_CLUSTERLOG_CRITICAL; - } else if (strcmp(item, "ERROR") == 0) { - severity = NDB_MGM_CLUSTERLOG_ERROR; - } else if (strcmp(item, "WARNING") == 0) { - severity = NDB_MGM_CLUSTERLOG_WARNING; - } else if (strcmp(item, "INFO") == 0) { - severity = NDB_MGM_CLUSTERLOG_INFO; - } else if (strcmp(item, "DEBUG") == 0) { - severity = NDB_MGM_CLUSTERLOG_DEBUG; - } else if (strcmp(item, "OFF") == 0) { - severity = NDB_MGM_CLUSTERLOG_OFF; - } else { - isOk = false; - } - - item = strtok_r(NULL, " ", &tmpPtr); - } // while(item != NULL){ - - if (noArgs) { - ndbout << "Missing argument(s)." << endl; - } else if (isOk) { - if(ndb_mgm_filter_clusterlog(m_mgmsrv, severity, NULL)) { - if(strcmp(name, "ALL") == 0 || strcmp(name, "all") == 0) { - ndbout << "All severities levels enabled." << endl; - } else if(strcmp(name, "OFF") == 0 || strcmp(name, "off") == 0) { - ndbout << "Cluster logging enabled." << endl; - } else { - ndbout << name << " events disabled." << endl; - } - } else { - if(strcmp(name, "ALL") == 0) { - ndbout << "All severities levels disabled." << endl; - } else if(strcmp(name, "OFF") == 0) { - ndbout << "Cluster logging disabled." << endl; - } else { - ndbout << name << " events enabled." << endl; - } - } - } else { - ndbout << "Invalid severity level." << endl; - } + char * tmpString = my_strdup(parameters,MYF(MY_WME)); + My_auto_ptr<char> ap1(tmpString); + char * tmpPtr = 0; + char * item = strtok_r(tmpString, " ", &tmpPtr); + int enable; - /******************** - * CLUSTERLOG INFO - ********************/ - } else if (strcmp(item, "INFO") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Couldn't get status" << endl; - printError(); - return; - } - const char* names[] = {"ENABLED", "DEBUG", "INFO", "WARNING", "ERROR", - "CRITICAL", "ALERT"}; - if(enabled[0]) - ndbout << "Cluster logging is disabled." << endl; + Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); + if(enabled == NULL) { + ndbout << "Couldn't get status" << endl; + printError(); + DBUG_VOID_RETURN; + } - - for(i = 0; i<7;i++) - printf("enabled[%d] = %d\n", i, enabled[i]); - ndbout << "Severities enabled: "; - for(i = 1; i < 7; i++) { - if(enabled[i]) - ndbout << names[i] << " "; - } - ndbout << endl; - - /******************** - * CLUSTERLOG OFF - ********************/ - } else if (strcmp(item, "OFF") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Couldn't get status" << endl; - printError(); - return; - } - if(!enabled[0]) { - ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL); - ndbout << "Cluster logging is disabled." << endl; - } else { - ndbout << "Cluster logging is already disabled." << endl; - - } - - /******************** - * CLUSTERLOG ON - ********************/ - } else if (strcmp(item, "ON") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Could not get status" << endl; - printError(); - return; - } - if(enabled[0]) { - ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL); - ndbout << "Cluster logging is enabled." << endl; - } else { - ndbout << "Cluster logging is already enabled." << endl; - + /******************** + * CLUSTERLOG INFO + ********************/ + if (strcasecmp(item, "INFO") == 0) { + DBUG_PRINT("info",("INFO")); + if(enabled[0] == 0) + { + ndbout << "Cluster logging is disabled." << endl; + DBUG_VOID_RETURN; + } +#if 0 + for(i = 0; i<7;i++) + printf("enabled[%d] = %d\n", i, enabled[i]); +#endif + ndbout << "Severities enabled: "; + for(i = 1; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { + const char *str= ndb_mgm_get_clusterlog_level_string((ndb_mgm_clusterlog_level)i); + if (str == 0) + { + DBUG_ASSERT(false); + continue; } - } else { - ndbout << "Invalid argument." << endl; + if(enabled[i]) + ndbout << BaseString(str).ndb_toupper() << " "; } - + ndbout << endl; + DBUG_VOID_RETURN; + + } + else if (strcasecmp(item, "FILTER") == 0 || + strcasecmp(item, "TOGGLE") == 0) + { + DBUG_PRINT("info",("TOGGLE")); + enable= -1; + } + else if (strcasecmp(item, "OFF") == 0) + { + DBUG_PRINT("info",("OFF")); + enable= 0; + } else if (strcasecmp(item, "ON") == 0) { + DBUG_PRINT("info",("ON")); + enable= 1; } else { - ndbout << "Missing argument." << endl; + ndbout << "Invalid argument." << endl; + DBUG_VOID_RETURN; } + + int res_enable; + item = strtok_r(NULL, " ", &tmpPtr); + if (item == NULL) { + res_enable= ndb_mgm_filter_clusterlog(m_mgmsrv, + NDB_MGM_CLUSTERLOG_ON, enable, NULL); + if (res_enable < 0) + { + ndbout << "Couldn't set filter" << endl; + printError(); + DBUG_VOID_RETURN; + } + ndbout << "Cluster logging is " << (res_enable ? "enabled.":"disabled") << endl; + DBUG_VOID_RETURN; + } + + do { + severity= NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; + if (strcasecmp(item, "ALL") == 0) { + severity = NDB_MGM_CLUSTERLOG_ALL; + } else if (strcasecmp(item, "ALERT") == 0) { + severity = NDB_MGM_CLUSTERLOG_ALERT; + } else if (strcasecmp(item, "CRITICAL") == 0) { + severity = NDB_MGM_CLUSTERLOG_CRITICAL; + } else if (strcasecmp(item, "ERROR") == 0) { + severity = NDB_MGM_CLUSTERLOG_ERROR; + } else if (strcasecmp(item, "WARNING") == 0) { + severity = NDB_MGM_CLUSTERLOG_WARNING; + } else if (strcasecmp(item, "INFO") == 0) { + severity = NDB_MGM_CLUSTERLOG_INFO; + } else if (strcasecmp(item, "DEBUG") == 0) { + severity = NDB_MGM_CLUSTERLOG_DEBUG; + } else if (strcasecmp(item, "OFF") == 0 || + strcasecmp(item, "ON") == 0) { + if (enable < 0) // only makes sense with toggle + severity = NDB_MGM_CLUSTERLOG_ON; + } + if (severity == NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL) { + ndbout << "Invalid severity level: " << item << endl; + DBUG_VOID_RETURN; + } + + res_enable = ndb_mgm_filter_clusterlog(m_mgmsrv, severity, enable, NULL); + if (res_enable < 0) + { + ndbout << "Couldn't set filter" << endl; + printError(); + DBUG_VOID_RETURN; + } + ndbout << BaseString(item).ndb_toupper().c_str() << " " << (res_enable ? "enabled":"disabled") << endl; + + item = strtok_r(NULL, " ", &tmpPtr); + } while(item != NULL); + + DBUG_VOID_RETURN; } //***************************************************************************** @@ -1010,7 +1369,6 @@ CommandInterpreter::executeClusterLog(char* parameters) void CommandInterpreter::executeStop(int processId, const char *, bool all) { - connect(); int result = 0; if(all) { result = ndb_mgm_stop(m_mgmsrv, 0, 0); @@ -1032,7 +1390,6 @@ CommandInterpreter::executeStop(int processId, const char *, bool all) void CommandInterpreter::executeEnterSingleUser(char* parameters) { - connect(); strtok(parameters, " "); struct ndb_mgm_reply reply; char* id = strtok(NULL, " "); @@ -1059,7 +1416,6 @@ CommandInterpreter::executeEnterSingleUser(char* parameters) void CommandInterpreter::executeExitSingleUser(char* parameters) { - connect(); int result = ndb_mgm_exit_single_user(m_mgmsrv, 0); if (result != 0) { ndbout_c("Exiting single user mode failed."); @@ -1074,7 +1430,6 @@ void CommandInterpreter::executeStart(int processId, const char* parameters, bool all) { - connect(); int result; if(all) { result = ndb_mgm_start(m_mgmsrv, 0, 0); @@ -1098,7 +1453,6 @@ void CommandInterpreter::executeRestart(int processId, const char* parameters, bool all) { - connect(); int result; int nostart = 0; int initialstart = 0; @@ -1110,11 +1464,11 @@ CommandInterpreter::executeRestart(int processId, const char* parameters, char * tmpPtr = 0; char * item = strtok_r(tmpString, " ", &tmpPtr); while(item != NULL){ - if(strcmp(item, "-N") == 0) + if(strcasecmp(item, "-N") == 0) nostart = 1; - if(strcmp(item, "-I") == 0) + if(strcasecmp(item, "-I") == 0) initialstart = 1; - if(strcmp(item, "-A") == 0) + if(strcasecmp(item, "-A") == 0) abort = 1; item = strtok_r(NULL, " ", &tmpPtr); } @@ -1136,7 +1490,7 @@ CommandInterpreter::executeRestart(int processId, const char* parameters, if(all) ndbout << "NDB Cluster is being restarted." << endl; else - ndbout_c("Database node %d is being restarted.", processId); + ndbout_c("Node %d is being restarted.", processId); } } @@ -1144,11 +1498,10 @@ void CommandInterpreter::executeDumpState(int processId, const char* parameters, bool all) { - if(parameters == 0 || strlen(parameters) == 0){ + if(emptyString(parameters)){ ndbout << "Expected argument" << endl; return; } - connect(); Uint32 no = 0; int pars[25]; @@ -1184,11 +1537,10 @@ CommandInterpreter::executeStatus(int processId, const char* parameters, bool all) { if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; + ndbout_c("No parameters expected to this command."); return; } - connect(); ndb_mgm_node_status status; Uint32 startPhase, version; bool system; @@ -1216,7 +1568,7 @@ CommandInterpreter::executeStatus(int processId, ndbout << "Node " << processId << ": " << status_string(status); switch(status){ case NDB_MGM_NODE_STATUS_STARTING: - ndbout << " (Phase " << startPhase << ")" ; + ndbout << " (Phase " << startPhase << ")"; break; case NDB_MGM_NODE_STATUS_SHUTTING_DOWN: ndbout << " (Phase " << startPhase << ")"; @@ -1229,6 +1581,8 @@ CommandInterpreter::executeStatus(int processId, getMajor(version) , getMinor(version), getBuild(version)); + else + ndbout << endl; } @@ -1239,9 +1593,11 @@ void CommandInterpreter::executeLogLevel(int processId, const char* parameters, bool all) { - connect(); (void) all; - + if (emptyString(parameters)) { + ndbout << "Expected argument" << endl; + return; + } BaseString tmp(parameters); Vector<BaseString> spec; tmp.split(spec, "="); @@ -1267,6 +1623,8 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, return; } + ndbout << "Executing LOGLEVEL on node " << processId << flush; + struct ndb_mgm_reply reply; int result; result = ndb_mgm_set_loglevel_node(m_mgmsrv, @@ -1276,11 +1634,10 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, &reply); if (result < 0) { - ndbout_c("Executing LOGLEVEL on node %d failed.", processId); + ndbout_c(" failed."); printError(); } else { - ndbout << "Executing LOGLEVEL on node " << processId << " OK!" - << endl; + ndbout_c(" OK!"); } } @@ -1295,7 +1652,6 @@ void CommandInterpreter::executeError(int processId, return; } - connect(); // Copy parameters since strtok will modify it char* newpar = my_strdup(parameters,MYF(MY_WME)); My_auto_ptr<char> ap1(newpar); @@ -1318,48 +1674,11 @@ void CommandInterpreter::executeError(int processId, //***************************************************************************** //***************************************************************************** -void -CommandInterpreter::executeTrace(int /*processId*/, - const char* /*parameters*/, bool /*all*/) -{ -#if 0 - if (emptyString(parameters)) { - ndbout << "Missing trace number." << endl; - return; - } - - char* newpar = my_strdup(parameters,MYF(MY_WME)); - My_auto_ptr<char> ap1(newpar); - char* firstParameter = strtok(newpar, " "); - - - int traceNo; - if (! convert(firstParameter, traceNo)) { - ndbout << "Expected an integer." << endl; - return; - } - char* allAfterFirstParameter = strtok(NULL, "\0"); - - if (! emptyString(allAfterFirstParameter)) { - ndbout << "Nothing expected after trace number." << endl; - return; - } - - int result = _mgmtSrvr.setTraceNo(processId, traceNo); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } -#endif -} - -//***************************************************************************** -//***************************************************************************** void CommandInterpreter::executeLog(int processId, const char* parameters, bool all) { - connect(); struct ndb_mgm_reply reply; Vector<const char *> blocks; if (! parseBlockSpecification(parameters, blocks)) { @@ -1427,7 +1746,6 @@ CommandInterpreter::executeTestOn(int processId, ndbout << "No parameters expected to this command." << endl; return; } - connect(); struct ndb_mgm_reply reply; int result = ndb_mgm_start_signallog(m_mgmsrv, processId, &reply); if (result != 0) { @@ -1446,7 +1764,6 @@ CommandInterpreter::executeTestOff(int processId, ndbout << "No parameters expected to this command." << endl; return; } - connect(); struct ndb_mgm_reply reply; int result = ndb_mgm_stop_signallog(m_mgmsrv, processId, &reply); if (result != 0) { @@ -1510,7 +1827,7 @@ CommandInterpreter::executeSet(int /*processId*/, } } else { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; if (configBackupFileUpdated && configPrimaryFileUpdated) { ndbout << "The configuration files are however updated and " << "the value will be used next time the process is restarted." @@ -1545,7 +1862,7 @@ void CommandInterpreter::executeGetStat(int /*processId*/, MgmtSrvr::Statistics statistics; int result = _mgmtSrvr.getStatistics(processId, statistics); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; return; } #endif @@ -1564,8 +1881,10 @@ CommandInterpreter::executeEventReporting(int processId, const char* parameters, bool all) { - connect(); - + if (emptyString(parameters)) { + ndbout << "Expected argument" << endl; + return; + } BaseString tmp(parameters); Vector<BaseString> spec; tmp.split(spec, "="); @@ -1577,59 +1896,105 @@ CommandInterpreter::executeEventReporting(int processId, spec[0].trim().ndb_toupper(); int category = ndb_mgm_match_event_category(spec[0].c_str()); if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){ - category = atoi(spec[0].c_str()); - if(category < NDB_MGM_MIN_EVENT_CATEGORY || + if(!convert(spec[0].c_str(), category) || + category < NDB_MGM_MIN_EVENT_CATEGORY || category > NDB_MGM_MAX_EVENT_CATEGORY){ ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl; return; } } - - int level = atoi(spec[1].c_str()); - if(level < 0 || level > 15){ + + int level; + if (!convert(spec[1].c_str(),level)) + { ndbout << "Invalid level: " << spec[1].c_str() << endl; return; } - + + ndbout << "Executing CLUSTERLOG on node " << processId << flush; struct ndb_mgm_reply reply; int result; - result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv, - processId, // fast fix - pekka + processId, (ndb_mgm_event_category)category, level, &reply); if (result != 0) { - ndbout_c("Executing CLUSTERLOG on node %d failed", processId); + ndbout_c(" failed."); printError(); } else { - ndbout << "Executing CLUSTERLOG on node " << processId << " OK!" - << endl; + ndbout_c(" OK!"); } } /***************************************************************************** * Backup *****************************************************************************/ -void -CommandInterpreter::executeStartBackup(char* /*parameters*/) +int +CommandInterpreter::executeStartBackup(char* parameters) { - connect(); struct ndb_mgm_reply reply; unsigned int backupId; - +#if 0 int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; int fd = ndb_mgm_listen_event(m_mgmsrv, filter); - int result = ndb_mgm_start_backup(m_mgmsrv, &backupId, &reply); + if (fd < 0) + { + ndbout << "Initializing start of backup failed" << endl; + printError(); + return fd; + } +#endif + Vector<BaseString> args; + { + BaseString(parameters).split(args); + for (unsigned i= 0; i < args.size(); i++) + if (args[i].length() == 0) + args.erase(i--); + else + args[i].ndb_toupper(); + } + int sz= args.size(); + + int result; + if (sz == 2 && + args[1] == "NOWAIT") + { + result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply); + } + else if (sz == 1 || + (sz == 3 && + args[1] == "WAIT" && + args[2] == "COMPLETED")) + { + ndbout_c("Waiting for completed, this may take several minutes"); + result = ndb_mgm_start_backup(m_mgmsrv, 2, &backupId, &reply); + } + else if (sz == 3 && + args[1] == "WAIT" && + args[2] == "STARTED") + { + ndbout_c("Waiting for started, this may take several minutes"); + result = ndb_mgm_start_backup(m_mgmsrv, 1, &backupId, &reply); + } + else + { + invalid_command(parameters); + return -1; + } + if (result != 0) { ndbout << "Start of backup failed" << endl; printError(); +#if 0 close(fd); - return; +#endif + return result; } - +#if 0 + ndbout_c("Waiting for completed, this may take several minutes"); char *tmp; char buf[1024]; { @@ -1656,29 +2021,39 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/) ndbout << tmp; } } while(tmp && tmp[0] != 0); - + close(fd); +#endif + return 0; } void CommandInterpreter::executeAbortBackup(char* parameters) { - connect(); - strtok(parameters, " "); - struct ndb_mgm_reply reply; - char* id = strtok(NULL, "\0"); int bid = -1; - if(id == 0 || sscanf(id, "%d", &bid) != 1){ - ndbout << "Invalid arguments: expected <BackupId>" << endl; - return; + struct ndb_mgm_reply reply; + if (emptyString(parameters)) + goto executeAbortBackupError1; + + { + strtok(parameters, " "); + char* id = strtok(NULL, "\0"); + if(id == 0 || sscanf(id, "%d", &bid) != 1) + goto executeAbortBackupError1; } - int result = ndb_mgm_abort_backup(m_mgmsrv, bid, &reply); - if (result != 0) { - ndbout << "Abort of backup " << bid << " failed" << endl; - printError(); - } else { - ndbout << "Abort of backup " << bid << " ordered" << endl; + { + int result= ndb_mgm_abort_backup(m_mgmsrv, bid, &reply); + if (result != 0) { + ndbout << "Abort of backup " << bid << " failed" << endl; + printError(); + } else { + ndbout << "Abort of backup " << bid << " ordered" << endl; + } } + return; + executeAbortBackupError1: + ndbout << "Invalid arguments: expected <BackupId>" << endl; + return; } #ifdef HAVE_GLOBAL_REPLICATION @@ -1717,7 +2092,6 @@ CommandInterpreter::executeRep(char* parameters) return; } - connect(); char * line = my_strdup(parameters,MYF(MY_WME)); My_auto_ptr<char> ap1((char*)line); char * firstToken = strtok(line, " "); @@ -1726,7 +2100,7 @@ CommandInterpreter::executeRep(char* parameters) unsigned int repId; - if (!strcmp(firstToken, "CONNECT")) { + if (!strcasecmp(firstToken, "CONNECT")) { char * host = strtok(NULL, "\0"); for (unsigned int i = 0; i < strlen(host); ++i) { host[i] = tolower(host[i]); @@ -1761,30 +2135,30 @@ CommandInterpreter::executeRep(char* parameters) /******** * START ********/ - if (!strcmp(firstToken, "START")) { + if (!strcasecmp(firstToken, "START")) { unsigned int req; char *startType = strtok(NULL, "\0"); if (startType == NULL) { req = GrepReq::START; - } else if (!strcmp(startType, "SUBSCRIPTION")) { + } else if (!strcasecmp(startType, "SUBSCRIPTION")) { req = GrepReq::START_SUBSCR; - } else if (!strcmp(startType, "METALOG")) { + } else if (!strcasecmp(startType, "METALOG")) { req = GrepReq::START_METALOG; - } else if (!strcmp(startType, "METASCAN")) { + } else if (!strcasecmp(startType, "METASCAN")) { req = GrepReq::START_METASCAN; - } else if (!strcmp(startType, "DATALOG")) { + } else if (!strcasecmp(startType, "DATALOG")) { req = GrepReq::START_DATALOG; - } else if (!strcmp(startType, "DATASCAN")) { + } else if (!strcasecmp(startType, "DATASCAN")) { req = GrepReq::START_DATASCAN; - } else if (!strcmp(startType, "REQUESTOR")) { + } else if (!strcasecmp(startType, "REQUESTOR")) { req = GrepReq::START_REQUESTOR; - } else if (!strcmp(startType, "TRANSFER")) { + } else if (!strcasecmp(startType, "TRANSFER")) { req = GrepReq::START_TRANSFER; - } else if (!strcmp(startType, "APPLY")) { + } else if (!strcasecmp(startType, "APPLY")) { req = GrepReq::START_APPLY; - } else if (!strcmp(startType, "DELETE")) { + } else if (!strcasecmp(startType, "DELETE")) { req = GrepReq::START_DELETE; } else { ndbout_c("Illegal argument to command 'REPLICATION START'"); @@ -1804,7 +2178,7 @@ CommandInterpreter::executeRep(char* parameters) /******** * STOP ********/ - if (!strcmp(firstToken, "STOP")) { + if (!strcasecmp(firstToken, "STOP")) { unsigned int req; char *startType = strtok(NULL, " "); unsigned int epoch = 0; @@ -1814,7 +2188,7 @@ CommandInterpreter::executeRep(char* parameters) * Stop immediately */ req = GrepReq::STOP; - } else if (!strcmp(startType, "EPOCH")) { + } else if (!strcasecmp(startType, "EPOCH")) { char *strEpoch = strtok(NULL, "\0"); if(strEpoch == NULL) { ndbout_c("Epoch expected!"); @@ -1822,23 +2196,23 @@ CommandInterpreter::executeRep(char* parameters) } req = GrepReq::STOP; epoch=atoi(strEpoch); - } else if (!strcmp(startType, "SUBSCRIPTION")) { + } else if (!strcasecmp(startType, "SUBSCRIPTION")) { req = GrepReq::STOP_SUBSCR; - } else if (!strcmp(startType, "METALOG")) { + } else if (!strcasecmp(startType, "METALOG")) { req = GrepReq::STOP_METALOG; - } else if (!strcmp(startType, "METASCAN")) { + } else if (!strcasecmp(startType, "METASCAN")) { req = GrepReq::STOP_METASCAN; - } else if (!strcmp(startType, "DATALOG")) { + } else if (!strcasecmp(startType, "DATALOG")) { req = GrepReq::STOP_DATALOG; - } else if (!strcmp(startType, "DATASCAN")) { + } else if (!strcasecmp(startType, "DATASCAN")) { req = GrepReq::STOP_DATASCAN; - } else if (!strcmp(startType, "REQUESTOR")) { + } else if (!strcasecmp(startType, "REQUESTOR")) { req = GrepReq::STOP_REQUESTOR; - } else if (!strcmp(startType, "TRANSFER")) { + } else if (!strcasecmp(startType, "TRANSFER")) { req = GrepReq::STOP_TRANSFER; - } else if (!strcmp(startType, "APPLY")) { + } else if (!strcasecmp(startType, "APPLY")) { req = GrepReq::STOP_APPLY; - } else if (!strcmp(startType, "DELETE")) { + } else if (!strcasecmp(startType, "DELETE")) { req = GrepReq::STOP_DELETE; } else { ndbout_c("Illegal argument to command 'REPLICATION STOP'"); @@ -1857,7 +2231,7 @@ CommandInterpreter::executeRep(char* parameters) /********* * STATUS *********/ - if (!strcmp(firstToken, "STATUS")) { + if (!strcasecmp(firstToken, "STATUS")) { struct rep_state repstate; int result = ndb_rep_get_status(m_repserver, &repId, &reply, &repstate); @@ -1877,7 +2251,7 @@ CommandInterpreter::executeRep(char* parameters) /********* * QUERY (see repapi.h for querable counters) *********/ - if (!strcmp(firstToken, "QUERY")) { + if (!strcasecmp(firstToken, "QUERY")) { char *query = strtok(NULL, "\0"); int queryCounter=-1; if(query != NULL) { @@ -1903,169 +2277,4 @@ CommandInterpreter::executeRep(char* parameters) } #endif // HAVE_GLOBAL_REPLICATION - -/***************************************************************************** - * CPC - *****************************************************************************/ - -#if 0 - -#if 0 -//#ifdef NDB_SOLARIS // XXX fix me -static char* strsep(char** x, const char* y) { return 0; } -#endif - -// Note this code has not been verified -#if 0 -static char * my_strsep(char **stringp, const char *delim) -{ - char *tmp= *stringp; - if (tmp == 0) - return 0; - *stringp = strtok(tmp, delim); - return tmp; -} -#endif - -void -CommandInterpreter::executeCpc(char *parameters) -{ - char *host_str = NULL, *port_str = NULL, *end; - long port = 1234; /* XXX */ - - while((host_str = my_strsep(¶meters, " \t:")) != NULL && - host_str[0] == '\0'); - - if(parameters && parameters[0] != '\0') { - while((port_str = my_strsep(¶meters, " \t:")) != NULL && - port_str[0] == '\0'); - - errno = 0; - port = strtol(port_str, &end, 0); - if(end[0] != '\0') - goto error; - if((port == LONG_MAX || port == LONG_MIN) && - errno == ERANGE) - goto error; - } - - { - SimpleCpcClient cpc(host_str, port); - bool done = false; - - if(cpc.connect() < 0) { - ndbout_c("Cannot connect to %s:%d.", cpc.getHost(), cpc.getPort()); - switch(errno) { - case ENOENT: - ndbout << ": " << "No such host" << endl; - break; - default: - ndbout << ": " << strerror(errno) << endl; - break; - } - return; - } - - while(!done) { - char *line = readline("CPC> "); - if(line != NULL) { - add_history(line); - - char *cmd = strtok(line, " "); - char *arg = strtok(NULL, ""); - - if(arg != NULL) { - while(arg[0] == ' ') - arg++; - if(strlen(arg) == 0) - arg = NULL; - } - - if(cmd != NULL) { - if(strcmp(cmd, "exit") == 0) - done = true; - else if(strcmp(cmd, "list") == 0) - cpc.cmd_list(arg); - else if(strcmp(cmd, "start") == 0) - cpc.cmd_start(arg); - else if(strcmp(cmd, "stop") == 0) - cpc.cmd_stop(arg); - else if(strcmp(cmd, "help") == 0) - cpc.cmd_help(arg); - } - } else { - done = true; - ndbout << endl; - } - } - } - return; - - error: - ndbout << "Error: expected a tcp port number, got '" << port_str << "'." - << endl; - return; -} -#endif - -#if 0 -static -void -CmdBackupCallback(const MgmtSrvr::BackupEvent & event){ - char str[255]; - - ndbout << endl; - - bool ok = false; - switch(event.Event){ - case MgmtSrvr::BackupEvent::BackupStarted: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup %d started", event.Started.BackupId); - break; - case MgmtSrvr::BackupEvent::BackupFailedToStart: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup failed to start (Error %d)", - event.FailedToStart.ErrorCode); - break; - case MgmtSrvr::BackupEvent::BackupCompleted: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup %d completed", - event.Completed.BackupId); - ndbout << str << endl; - - BaseString::snprintf(str, sizeof(str), - " StartGCP: %d StopGCP: %d", - event.Completed.startGCP, event.Completed.stopGCP); - ndbout << str << endl; - - BaseString::snprintf(str, sizeof(str), - " #Records: %d #LogRecords: %d", - event.Completed.NoOfRecords, event.Completed.NoOfLogRecords); - ndbout << str << endl; - - BaseString::snprintf(str, sizeof(str), - " Data: %d bytes Log: %d bytes", - event.Completed.NoOfBytes, event.Completed.NoOfLogBytes); - break; - case MgmtSrvr::BackupEvent::BackupAborted: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup %d has been aborted reason %d", - event.Aborted.BackupId, - event.Aborted.Reason); - break; - } - if(!ok){ - BaseString::snprintf(str, sizeof(str), - "Unknown backup event: %d", - event.Event); - - } - ndbout << str << endl; -} -#endif - template class Vector<char const*>; diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp deleted file mode 100644 index eecc48a739e..00000000000 --- a/ndb/src/mgmclient/CommandInterpreter.hpp +++ /dev/null @@ -1,197 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -#ifndef CommandInterpreter_H -#define CommandInterpreter_H - -//#define HAVE_GLOBAL_REPLICATION -//***************************************************************************** -// Author: Peter Lind -//***************************************************************************** - -#include <ndb_global.h> -#include <Vector.hpp> -#include <editline/editline.h> - -#ifdef HAVE_GLOBAL_REPLICATION -#include "../rep/repapi/repapi.h" -#endif - -#include <mgmapi.h> - -class MgmtSrvr; - -/** - * @class CommandInterpreter - * @brief Reads command line in management client - * - * This class has one public method which reads a command line - * from a stream. It then interpret that commmand line and calls a suitable - * method in the MgmtSrvr class which executes the command. - * - * For command syntax, see the HELP command. - */ -class CommandInterpreter { -public: - /** - * Constructor - * @param mgmtSrvr: Management server to use when executing commands - */ - CommandInterpreter(const char *); - ~CommandInterpreter(); - - /** - * Reads one line from the stream, parse the line to find - * a command and then calls a suitable method which executes - * the command. - * - * @return true until quit/bye/exit has been typed - */ - int readAndExecute(int _try_reconnect=-1); - -private: - /** - * Read a string, and return a pointer to it. - * - * @return NULL on EOF. - */ - char *readline_gets () - { - static char *line_read = (char *)NULL; - - /* If the buffer has already been allocated, return the memory - to the free pool. */ - if (line_read) - { - free (line_read); - line_read = (char *)NULL; - } - - /* Get a line from the user. */ - line_read = readline ("NDB> "); - - /* If the line has any text in it, save it on the history. */ - if (line_read && *line_read) - add_history (line_read); - - return (line_read); - } - - void printError(); - - /** - * Analyse the command line, after the first token. - * - * @param processId: DB process id to send command to or -1 if - * command will be sent to all DB processes. - * @param allAfterFirstToken: What the client gave after the - * first token on the command line - */ - void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); - - /** - * Parse the block specification part of the LOG* commands, - * things after LOG*: [BLOCK = {ALL|<blockName>+}] - * - * @param allAfterLog: What the client gave after the second token - * (LOG*) on the command line - * @param blocks, OUT: ALL or name of all the blocks - * @return: true if correct syntax, otherwise false - */ - bool parseBlockSpecification(const char* allAfterLog, - Vector<const char*>& blocks); - - /** - * A bunch of execute functions: Executes one of the commands - * - * @param processId: DB process id to send command to - * @param parameters: What the client gave after the command name - * on the command line. - * For example if complete input from user is: "1 LOGLEVEL 22" then the - * parameters argument is the string with everything after LOGLEVEL, in - * this case "22". Each function is responsible to check the parameters - * argument. - */ - void executeHelp(char* parameters); - void executeShow(char* parameters); - void executeShutdown(char* parameters); - void executeRun(char* parameters); - void executeInfo(char* parameters); - void executeClusterLog(char* parameters); - -public: - void executeStop(int processId, const char* parameters, bool all); - void executeEnterSingleUser(char* parameters); - void executeExitSingleUser(char* parameters); - void executeStart(int processId, const char* parameters, bool all); - void executeRestart(int processId, const char* parameters, bool all); - void executeLogLevel(int processId, const char* parameters, bool all); - void executeError(int processId, const char* parameters, bool all); - void executeTrace(int processId, const char* parameters, bool all); - void executeLog(int processId, const char* parameters, bool all); - void executeLogIn(int processId, const char* parameters, bool all); - void executeLogOut(int processId, const char* parameters, bool all); - void executeLogOff(int processId, const char* parameters, bool all); - void executeTestOn(int processId, const char* parameters, bool all); - void executeTestOff(int processId, const char* parameters, bool all); - void executeSet(int processId, const char* parameters, bool all); - void executeGetStat(int processId, const char* parameters, bool all); - void executeStatus(int processId, const char* parameters, bool all); - void executeEventReporting(int processId, const char* parameters, bool all); - void executeDumpState(int processId, const char* parameters, bool all); - void executeStartBackup(char * parameters); - void executeAbortBackup(char * parameters); - - void executeRep(char* parameters); - - void executeCpc(char * parameters); - -public: - bool connect(); - bool disconnect(); - - /** - * A execute function definition - */ -public: - typedef void (CommandInterpreter::* ExecuteFunction)(int processId, - const char * param, - bool all); - - struct CommandFunctionPair { - const char * command; - ExecuteFunction executeFunction; - }; -private: - /** - * - */ - void executeForAll(const char * cmd, - ExecuteFunction fun, - const char * param); - - NdbMgmHandle m_mgmsrv; - bool connected; - const char *host; - int try_reconnect; -#ifdef HAVE_GLOBAL_REPLICATION - NdbRepHandle m_repserver; - const char *rep_host; - bool rep_connected; -#endif -}; - -#endif // CommandInterpreter_H diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index e271c7bed53..c63e8d1bff8 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -1,18 +1,26 @@ +noinst_LTLIBRARIES = libndbmgmclient.la ndbtools_PROGRAMS = ndb_mgm -ndb_mgm_SOURCES = \ - main.cpp \ - CommandInterpreter.cpp \ - CpcClient.cpp +libndbmgmclient_la_SOURCES = CommandInterpreter.cpp +libndbmgmclient_la_LIBADD = ../mgmapi/libmgmapi.la \ + ../common/logger/liblogger.la \ + ../common/portlib/libportlib.la \ + ../common/util/libgeneral.la \ + ../common/portlib/libportlib.la + + +ndb_mgm_SOURCES = main.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am -INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon +INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi \ + -I$(top_srcdir)/ndb/src/common/mgmcommon -LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ - $(top_builddir)/ndb/src/common/editline/libeditline.a \ +LDADD_LOC = $(noinst_LTLIBRARIES) \ + ../common/portlib/libportlib.la \ + @readline_link@ \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a \ @@ -22,3 +30,29 @@ ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndb_mgm.dsp libndbmgmclient.dsp + +ndb_mgm.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbtools_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgm_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +libndbmgmclient.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbmgmclient_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB diff --git a/ndb/src/mgmclient/Makefile_old b/ndb/src/mgmclient/Makefile_old deleted file mode 100644 index d1b2d60a52a..00000000000 --- a/ndb/src/mgmclient/Makefile_old +++ /dev/null @@ -1,25 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -BIN_TARGET := mgmtclient -BIN_TARGET_LIBS := -BIN_TARGET_ARCHIVES := trace logger mgmapi general mgmsrvcommon portlib repapi - -BIN_TARGET_ARCHIVES += editline - -DIRS = test_cpcd - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - main.cpp \ - CommandInterpreter.cpp \ - CpcClient.cpp - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) - -include $(NDB_TOP)/Epilogue.mk - -_bins_mkconfig : $(NDB_TOP)/bin/$(BIN_TARGET) - diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index cc6d4bf600e..73f0bad86c0 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -15,19 +15,32 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> +#include <ndb_opts.h> + +// copied from mysql.cc to get readline +extern "C" { +#if defined( __WIN__) || defined(OS2) +#include <conio.h> +#elif !defined(__NETWARE__) +#include <readline/readline.h> +extern "C" int add_history(const char *command); /* From readline directory */ +#define HAVE_READLINE +#endif +} #include <NdbMain.h> #include <NdbHost.h> -#include <util/getarg.h> +#include <BaseString.hpp> +#include <NdbOut.hpp> #include <mgmapi.h> -#include <LocalConfig.hpp> +#include <ndb_version.h> -#include "CommandInterpreter.hpp" +#include "ndb_mgmclient.hpp" const char *progname = "ndb_mgm"; -static CommandInterpreter* com; +static Ndb_mgmclient* com; extern "C" void @@ -43,59 +56,117 @@ handler(int sig){ } } -int main(int argc, const char** argv){ - ndb_init(); - int optind = 0; +NDB_STD_OPTS_VARS; + +static const char default_prompt[]= "ndb_mgm> "; +static unsigned _try_reconnect; +static const char *prompt= default_prompt; +static char *opt_execute_str= 0; + +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_mgm"), + { "execute", 'e', + "execute command and exit", + (gptr*) &opt_execute_str, (gptr*) &opt_execute_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "try-reconnect", 't', + "Specify number of tries for connecting to ndb_mgmd (0 = infinite)", + (gptr*) &_try_reconnect, (gptr*) &_try_reconnect, 0, + GET_UINT, REQUIRED_ARG, 3, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS] [hostname [port]]\n", my_progname); +} +static void usage() +{ + short_usage_sub(); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_mgm.trace"); +} + +static int +read_and_execute(int _try_reconnect) +{ + static char *line_read = (char *)NULL; + + /* If the buffer has already been allocated, return the memory + to the free pool. */ + if (line_read) + { + free (line_read); + line_read = (char *)NULL; + } +#ifdef HAVE_READLINE + /* Get a line from the user. */ + line_read = readline (prompt); + /* If the line has any text in it, save it on the history. */ + if (line_read && *line_read) + add_history (line_read); +#else + static char linebuffer[254]; + fputs(prompt, stdout); + linebuffer[sizeof(linebuffer)-1]=0; + line_read = fgets(linebuffer, sizeof(linebuffer)-1, stdin); + if (line_read == linebuffer) { + char *q=linebuffer; + while (*q > 31) q++; + *q=0; + line_read= strdup(linebuffer); + } +#endif + return com->execute(line_read,_try_reconnect); +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); const char *_host = 0; int _port = 0; - int _help = 0; - int _try_reconnect = 0; - - struct getargs args[] = { - { "try-reconnect", 't', arg_integer, &_try_reconnect, "Specify number of retries for connecting to ndb_mgmd, default infinite", "#" }, - { "usage", '?', arg_flag, &_help, "Print help", "" }, - }; - int num_args = sizeof(args) / sizeof(args[0]); /* Number of arguments */ - - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, progname, "[host [port]]"); - exit(1); - } + const char *load_default_groups[]= { "mysql_cluster","ndb_mgm",0 }; + + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(ho_error); - argv += optind; - argc -= optind; - - LocalConfig cfg; - - if(argc >= 1) { - _host = argv[0]; - if(argc >= 2) { - _port = atoi(argv[1]); - } - } else { - if(cfg.init(0, 0) && cfg.ids.size() > 0 && cfg.ids[0].type == MgmId_TCP){ - _host = cfg.ids[0].name.c_str(); - _port = cfg.ids[0].port; - } else { - cfg.printError(); - cfg.printUsage(); - return 1; - } - } - char buf[MAXHOSTNAMELEN+10]; - BaseString::snprintf(buf, sizeof(buf), "%s:%d", _host, _port); + if(argc == 1) { + BaseString::snprintf(buf, sizeof(buf), "%s", argv[0]); + opt_connect_str= buf; + } else if (argc >= 2) { + BaseString::snprintf(buf, sizeof(buf), "%s:%s", argv[0], argv[1]); + opt_connect_str= buf; + } - ndbout << "-- NDB Cluster -- Management Client --" << endl; - printf("Connecting to Management Server: %s\n", buf); + if (!isatty(0) || opt_execute_str) + { + prompt= 0; + } signal(SIGPIPE, handler); - - com = new CommandInterpreter(buf); - while(com->readAndExecute(_try_reconnect)); + com = new Ndb_mgmclient(opt_connect_str,1); + int ret= 0; + if (!opt_execute_str) + { + ndbout << "-- NDB Cluster -- Management Client --" << endl; + while(read_and_execute(_try_reconnect)); + } + else + { + com->execute(opt_execute_str,_try_reconnect, &ret); + } delete com; - return 0; + return ret; } diff --git a/ndb/src/mgmclient/ndb_mgmclient.h b/ndb/src/mgmclient/ndb_mgmclient.h new file mode 100644 index 00000000000..b62a33999a3 --- /dev/null +++ b/ndb/src/mgmclient/ndb_mgmclient.h @@ -0,0 +1,33 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef Ndb_mgmclient_h +#define Ndb_mgmclient_h + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* Ndb_mgmclient_handle; +Ndb_mgmclient_handle ndb_mgmclient_handle_create(const char *connect_string); +int ndb_mgmclient_execute(Ndb_mgmclient_handle, int argc, char** argv); +int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle); + +#ifdef __cplusplus +} +#endif + +#endif /* Ndb_mgmclient_h */ diff --git a/ndb/src/mgmclient/ndb_mgmclient.hpp b/ndb/src/mgmclient/ndb_mgmclient.hpp new file mode 100644 index 00000000000..bffdf69f920 --- /dev/null +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -0,0 +1,33 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef Ndb_mgmclient_hpp +#define Ndb_mgmclient_hpp + +class CommandInterpreter; +class Ndb_mgmclient +{ +public: + Ndb_mgmclient(const char*,int verbose=0); + ~Ndb_mgmclient(); + int execute(const char *_line, int _try_reconnect=-1, int *error= 0); + int execute(int argc, char** argv, int _try_reconnect=-1, int *error= 0); + int disconnect(); +private: + CommandInterpreter *m_cmd; +}; + +#endif // Ndb_mgmclient_hpp diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 2a054a01f1e..686155415d5 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -28,66 +28,12 @@ #include "ConfigInfo.hpp" #include <version.h> - - -static const char* helpTexts[] = { - "HELP Print help text", - "HELP SHOW Help for the SHOW command", -#ifdef VM_TRACE // DEBUG ONLY - "HELP DEBUG Help for debug compiled version", -#endif - "SHOW Print information about cluster", - "SHOW CONFIG Print configuration", - "SHOW PARAMETERS Print configuration parameters", - "START BACKUP Start backup\n" - "ABORT BACKUP <backup id> Aborts backup\n" - "CLUSTERLOG ON Enable Cluster logging", - "CLUSTERLOG OFF Disable Cluster logging", - "CLUSTERLOG FILTER <severity> Toggle severity filter on/off", - "CLUSTERLOG INFO Print cluster log information", - "{<id>|ALL} START Start DB node (started with -n)", - "{<id>|ALL} RESTART [-n] [-i] Restart DB node", - "{<id>|ALL} STOP Stop DB node", - "{<id>|ALL} STATUS Print status", - "{<id>|ALL} CLUSTERLOG {<category>=<level>}+ Set log level for cluster log", - "QUIT Quit management server", -}; -static const unsigned noOfHelpTexts = sizeof(helpTexts)/sizeof(const char*); - -static const char* helpTextShow = -"SHOW prints NDB Cluster information\n\n" -"SHOW Print information about cluster\n" -"SHOW CONFIG Print configuration (in initial config file format)\n" -"SHOW PARAMETERS Print information about configuration parameters\n\n" -; - -#ifdef VM_TRACE // DEBUG ONLY -static const char* helpTextDebug = -"SHOW PROPERTIES Print config properties object\n" -"{<id>|ALL} LOGLEVEL {<category>=<level>}+ Set log level\n" -"{<id>|ALL} ERROR <errorNo> Inject error into NDB node\n" -"{<id>|ALL} TRACE <traceNo> Set trace number\n" -"{<id>|ALL} LOG [BLOCK = {ALL|<block>+}] Set logging on in & out signals\n" -"{<id>|ALL} LOGIN [BLOCK = {ALL|<block>+}] Set logging on in signals\n" -"{<id>|ALL} LOGOUT [BLOCK = {ALL|<block>+}] Set logging on out signals\n" -"{<id>|ALL} LOGOFF [BLOCK = {ALL|<block>+}] Unset signal logging\n" -"{<id>|ALL} TESTON Start signal logging\n" -"{<id>|ALL} TESTOFF Stop signal logging\n" -"{<id>|ALL} SET <configParamName> <value> Update configuration variable\n" -"{<id>|ALL} DUMP <arg> Dump system state to cluster.log\n" -"{<id>|ALL} GETSTAT Print statistics\n" -"\n" -; -#endif - - +#include <m_string.h> //****************************************************************************** //****************************************************************************** CommandInterpreter::CommandInterpreter(MgmtSrvr& mgmtSrvr) : _mgmtSrvr(mgmtSrvr) { - - // _mgmtSrvr.setCallback(CmdBackupCallback); } @@ -113,6 +59,11 @@ private: void * m_ptr; }; +const char *CommandInterpreter::get_error_text(int err_no) +{ + return _mgmtSrvr.getErrorText(err_no, m_err_str, sizeof(m_err_str)); +} + //***************************************************************************** //***************************************************************************** int CommandInterpreter::readAndExecute() { @@ -140,52 +91,7 @@ int CommandInterpreter::readAndExecute() { char* firstToken = strtok(line, " "); char* allAfterFirstToken = strtok(NULL, "\0"); - if (strcmp(firstToken, "HELP") == 0) { - executeHelp(allAfterFirstToken); - return true; - } - else if (strcmp(firstToken, "?") == 0) { - executeHelp(allAfterFirstToken); - return true; - } - else if (strcmp(firstToken, "SHOW") == 0) { - executeShow(allAfterFirstToken); - return true; - } - else if (strcmp(firstToken, "CLUSTERLOG") == 0) { - executeClusterLog(allAfterFirstToken); - return true; - } - else if(strcmp(firstToken, "START") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeStartBackup(allAfterFirstToken); - return true; - } - else if(strcmp(firstToken, "ABORT") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeAbortBackup(allAfterFirstToken); - return true; - } - - else if(strcmp(firstToken, "ENTER") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", - sizeof("SINGLE USER MODE") - 1) == 0){ - executeEnterSingleUser(allAfterFirstToken); - return true; - } - - else if(strcmp(firstToken, "EXIT") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", - sizeof("SINGLE USER MODE") - 1) == 0){ - executeExitSingleUser(allAfterFirstToken); - return true; - } - - else if (strcmp(firstToken, "ALL") == 0) { + if (strcmp(firstToken, "ALL") == 0) { analyseAfterFirstToken(-1, allAfterFirstToken); } else if(strcmp(firstToken, "QUIT") == 0 || @@ -198,7 +104,6 @@ int CommandInterpreter::readAndExecute() { int processId; if (! convert(firstToken, processId)) { ndbout << "Invalid command: " << _line << "." << endl; - ndbout << "Type HELP for help." << endl << endl; return true; } if (processId < 0) { @@ -214,24 +119,10 @@ int CommandInterpreter::readAndExecute() { static const CommandInterpreter::CommandFunctionPair commands[] = { - { "START", &CommandInterpreter::executeStart } - ,{ "RESTART", &CommandInterpreter::executeRestart } - ,{ "STOP", &CommandInterpreter::executeStop } - ,{ "STATUS", &CommandInterpreter::executeStatus } - ,{ "LOGLEVEL", &CommandInterpreter::executeLogLevel } -#ifdef ERROR_INSERT - ,{ "ERROR", &CommandInterpreter::executeError } -#endif - ,{ "TRACE", &CommandInterpreter::executeTrace } - ,{ "LOG", &CommandInterpreter::executeLog } + { "TRACE", &CommandInterpreter::executeTrace } ,{ "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } ,{ "LOGOFF", &CommandInterpreter::executeLogOff } - ,{ "TESTON", &CommandInterpreter::executeTestOn } - ,{ "TESTOFF", &CommandInterpreter::executeTestOff } - ,{ "CLUSTERLOG", &CommandInterpreter::executeEventReporting } - ,{ "DUMP", &CommandInterpreter::executeDumpState } - ,{ "JONAS", &CommandInterpreter::jonas } }; @@ -268,16 +159,14 @@ CommandInterpreter::analyseAfterFirstToken(int processId, if(fun == 0){ ndbout << "Invalid command: " << secondToken << "." << endl; - ndbout << "Type HELP for help." << endl << endl; return; } if(processId == -1){ executeForAll(command, fun, allAfterSecondToken); } else { - if(strcmp(command, "STATUS") != 0) - ndbout << "Executing " << command << " on node: " - << processId << endl << endl; + ndbout << "Executing " << command << " on node: " + << processId << endl << endl; (this->*fun)(processId, allAfterSecondToken, false); ndbout << endl; } @@ -288,18 +177,11 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, const char * allAfterSecondToken){ NodeId nodeId = 0; - if(strcmp(cmd, "STOP") == 0 || - strcmp(cmd, "RESTART") == 0){ - ndbout << "Executing " << cmd << " on all nodes" << endl << "\n"; + while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ + ndbout << "Executing " << cmd << " on node: " + << nodeId << endl << endl; (this->*fun)(nodeId, allAfterSecondToken, true); - } else { - while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - if(strcmp(cmd, "STATUS") != 0) - ndbout << "Executing " << cmd << " on node: " - << nodeId << endl << endl; - (this->*fun)(nodeId, allAfterSecondToken, true); - ndbout << endl; - } // for + ndbout << endl; } } @@ -369,620 +251,6 @@ bool CommandInterpreter::parseBlockSpecification(const char* allAfterLog, return true; } - - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeHelp(char* parameters) { - - (void)parameters; // Don't want compiler warning - - if (emptyString(parameters)) { - unsigned i; - for (i = 0; i<noOfHelpTexts; i++) { - ndbout << helpTexts[i] << endl; - } - - ndbout << endl - << "<severity> = " - << "ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG" - << endl; - - ndbout << "<category> = "; - for(i = 0; i<CFG_MIN_LOGLEVEL; i++){ - ndbout << ndb_mgm_get_event_category_string((ndb_mgm_event_category)i); - if (i < CFG_MIN_LOGLEVEL - 1) { - ndbout << " | "; - } - } - ndbout << endl; - - ndbout << "<level> = " << "0 - 15" - << endl; - - ndbout << endl; - } else if (strcmp(parameters, "SHOW") == 0) { - ndbout << helpTextShow; -#ifdef VM_TRACE // DEBUG ONLY - } else if (strcmp(parameters, "DEBUG") == 0) { - ndbout << helpTextDebug; -#endif - } else { - ndbout << "Invalid argument." << endl; - } -} - -//***************************************************************************** -//***************************************************************************** - -void CommandInterpreter::executeShow(char* parameters) { - - if (emptyString(parameters)) { - ndbout << "Cluster Configuration" << endl - << "---------------------" << endl; - - NodeId nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_NDB) - << " NDB Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_API) - << " API Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_API)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_MGM) - << " MGM Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_MGM)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - ndbout << helpTextShow; - - return; - } else if (strcmp(parameters, "PROPERTIES") == 0 || - strcmp(parameters, "PROP") == 0) { - ndbout << "_mgmtSrvr.getConfig()->print();" << endl; /* XXX */ - } else if (strcmp(parameters, "CONFIGURATION") == 0 || - strcmp(parameters, "CONFIG") == 0){ - ndbout << "_mgmtSrvr.getConfigFile()->print();" << endl; /* XXX */ - _mgmtSrvr.getConfig()->printConfigFile(); - } else if (strcmp(parameters, "PARAMETERS") == 0 || - strcmp(parameters, "PARAMS") == 0 || - strcmp(parameters, "PARAM") == 0) { - ndbout << "_mgmtSrvr.getConfigInfo()->print();" << endl; /* XXX */ - } else { - ndbout << "Invalid argument." << endl; - } -} - - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeClusterLog(char* parameters) { - - if (parameters != 0 && strlen(parameters) != 0) { - int severity = 7; - int isOk = true; - char name[12]; - bool noArgs = false; - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - - /******************** - * CLUSTERLOG FILTER - ********************/ - if (strcmp(item, "FILTER") == 0) { - - item = strtok_r(NULL, " ", &tmpPtr); - if (item == NULL) { - noArgs = true; - } - while (item != NULL) { - snprintf(name, 12, item); - - if (strcmp(item, "ALL") == 0) { - severity = 7; - } else if (strcmp(item, "ALERT") == 0) { - severity = 6; - } else if (strcmp(item, "CRITICAL") == 0) { - severity = 5; - } else if (strcmp(item, "ERROR") == 0) { - severity = 4; - } else if (strcmp(item, "WARNING") == 0) { - severity = 3; - } else if (strcmp(item, "INFO") == 0) { - severity = 2; - } else if (strcmp(item, "DEBUG") == 0) { - severity = 1; - } else if (strcmp(item, "OFF") == 0) { - severity = 0; - } else { - isOk = false; - } - - item = strtok_r(NULL, " ", &tmpPtr); - } // while(item != NULL){ - free(tmpString); - - if (noArgs) { - ndbout << "Missing argument(s)." << endl; - } else if (isOk) { - if (_mgmtSrvr.setEventLogFilter(severity)) { - if(strcmp(name, "ALL") == 0 || strcmp(name, "all") == 0) { - ndbout << "All severities levels enabled." << endl; - } else if(strcmp(name, "OFF") == 0 || strcmp(name, "off") == 0) { - ndbout << "Cluster logging disabled." << endl; - } else { - ndbout << name << " events enabled." << endl; - } - } else { - if(strcmp(name, "ALL") == 0) { - ndbout << "All severities levels disabled." << endl; - } else if(strcmp(name, "OFF") == 0) { - ndbout << "Cluster logging enabled." << endl; - } else { - ndbout << name << " events disabled." << endl; - } - } - } else { - ndbout << "Invalid severity level." << endl; - } - - /******************** - * CLUSTERLOG INFO - ********************/ - } else if (strcmp(item, "INFO") == 0) { - const char* names[] = {"DEBUG", "INFO", "WARNING", "ERROR", - "CRITICAL", "ALERT"}; - if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF - ndbout << "Cluster logging is disabled." << endl; - } - - ndbout << "Severities enabled: "; - for (int i = 0; i < 6; i++) { - if (_mgmtSrvr.isEventLogFilterEnabled(i + 1)) { - ndbout << names[i] << " "; - } - } - ndbout << endl; - - /******************** - * CLUSTERLOG OFF - ********************/ - } else if (strcmp(item, "OFF") == 0) { - if (!_mgmtSrvr.isEventLogFilterEnabled(0)) { // ON - if (_mgmtSrvr.setEventLogFilter(0)); - ndbout << "Cluster logging is disabled." << endl; - } else { - ndbout << "Cluster logging is already disabled." << endl; - } - - /******************** - * CLUSTERLOG ON - ********************/ - } else if (strcmp(item, "ON") == 0) { - if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF - if (_mgmtSrvr.setEventLogFilter(0)); - ndbout << "Cluster logging is enabled." << endl; - } else { - ndbout << "Cluster logging is already enabled." << endl; - } - - } else { - ndbout << "Invalid argument." << endl; - } - - } else { - ndbout << "Missing argument." << endl; - } -} - -void -stopCallback(int nodeId, void * anyData, int errCode){ - if(errCode == 0){ - if(nodeId == 0) - ndbout << "\nCluster has shutdown" << endl; - else - ndbout << "\nNode " << nodeId << " has shutdown" << endl; - } else { - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - ndbout << "Node " << nodeId << " has not shutdown: " - << mgm->getErrorText(errCode) << endl; - } -} - -void -versionCallback(int nodeId, int version, void * anyData, int errCode){ - if(errCode == 0){ - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - switch(mgm->getNodeType(nodeId)){ - case NDB_MGM_NODE_TYPE_MGM: - { - ndbout << "MGMT node:\t" << nodeId << " "; - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - break; - case NDB_MGM_NODE_TYPE_NDB: - { - ndbout << "DB node:\t" << nodeId << " "; - if(version == 0) - ndbout << "(no version information available)" << endl; - else { - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - } - break; - case NDB_MGM_NODE_TYPE_API: - { - ndbout << "API node:\t" << nodeId << " "; - if(version == 0) - ndbout << "(no version information available)" << endl; - else { - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - - } - break; - case NDB_MGM_NODE_TYPE_UNKNOWN: - case NDB_MGM_NODE_TYPE_REP: - abort(); - }; - - } else { - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - ndbout << mgm->getErrorText(errCode) << endl; - } -} - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeStop(int processId, - const char* parameters, bool all) { - - (void)parameters; // Don't want compiler warning - - int result = 0; - if(all) - result = _mgmtSrvr.stop((int *)0, false, stopCallback, this); - else - result = _mgmtSrvr.stopNode(processId, false, stopCallback, this); - - if(result != 0) - ndbout << _mgmtSrvr.getErrorText(result) << endl; -} - - -void CommandInterpreter::executeStart(int processId, const char* parameters, - bool all) { - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - int result = _mgmtSrvr.start(processId); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } -} - -void -CommandInterpreter::executeRestart(int processId, const char* parameters, - bool all) { - - bool nostart = false; - bool initialstart = false; - - if(parameters != 0 && strlen(parameters) != 0){ - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - while(item != NULL){ - if(strcmp(item, "-N") == 0) - nostart = true; - if(strcmp(item, "-I") == 0) - initialstart = true; - item = strtok_r(NULL, " ", &tmpPtr); - } - free(tmpString); - } - int result; - if(all) - result = _mgmtSrvr.restart(nostart, initialstart, false, - 0, stopCallback, this); - else - result = _mgmtSrvr.restartNode(processId, nostart, initialstart, false, - stopCallback, - this); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } -} - -void -CommandInterpreter::executeDumpState(int processId, const char* parameters, - bool all) { - - (void)all; // Don't want compiler warning - - if(parameters == 0 || strlen(parameters) == 0){ - ndbout << "Expected argument" << endl; - return; - } - - Uint32 no = 0; - Uint32 pars[25]; - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - while(item != NULL){ - if (0x0 <= strtoll(item, NULL, 0) && strtoll(item, NULL, 0) <= 0xffffffff) { - pars[no] = strtoll(item, NULL, 0); - } else { - ndbout << "Illegal value in argument to signal." << endl - << "(Value must be between 0 and 0xffffffff.)" - << endl; - return; - } - no++; - item = strtok_r(NULL, " ", &tmpPtr); - } - ndbout << "Sending dump signal with data:" << endl; - for (Uint32 i=0; i<no; i++) { - ndbout.setHexFormat(1) << pars[i] << " "; - if (!(i+1 & 0x3)) ndbout << endl; - } - free(tmpString); - int result = _mgmtSrvr.dumpState(processId, pars, no); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } -} - -void CommandInterpreter::executeStatus(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - ndb_mgm_node_status status; - Uint32 startPhase, version, dynamicId, nodeGroup, connectCount; - bool system; - int result = _mgmtSrvr.status(processId, - &status, &version, &startPhase, &system, - &dynamicId, &nodeGroup, &connectCount); - if(result != 0){ - ndbout << _mgmtSrvr.getErrorText(result) << endl; - return; - } - - ndbout << "Node " << processId << ": "; - switch(status){ - case NDB_MGM_NODE_STATUS_NO_CONTACT: - ndbout << "No contact" << endl; - break; - case NDB_MGM_NODE_STATUS_NOT_STARTED: - ndbout << "Not started" ; - break; - case NDB_MGM_NODE_STATUS_STARTING: - ndbout << "Starting (Start phase " << startPhase << ")" ; - break; - case NDB_MGM_NODE_STATUS_STARTED: - ndbout << "Started" ; - break; - case NDB_MGM_NODE_STATUS_SHUTTING_DOWN: - ndbout << "Shutting down " << (system == false ? "node" : "system") - << " (Phase " << startPhase << ")" - ; - break; - case NDB_MGM_NODE_STATUS_RESTARTING: - ndbout << "Restarting" ; - break; - case NDB_MGM_NODE_STATUS_SINGLEUSER: - ndbout << "Single user mode" ; - break; - default: - ndbout << "Unknown state" ; - break; - } - if(status != NDB_MGM_NODE_STATUS_NO_CONTACT){ - - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - - // NOTE It's possible to print dynamicId and nodeGroup here ... - // ndbout << ", " <<dynamicId<<", "<<nodeGroup<<endl; - } -} - - - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeLogLevel(int processId, - const char* parameters, bool all) { -#if 0 - (void)all; // Don't want compiler warning - SetLogLevelOrd logLevel; logLevel.clear(); - - if (emptyString(parameters) || (strcmp(parameters, "ALL") == 0)) { - for(Uint32 i = 0; i<EventLoggerBase::noOfEventCategoryNames; i++) - logLevel.setLogLevel(EventLoggerBase::eventCategoryNames[i].category, 7); - } else { - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, ", ", &tmpPtr); - while(item != NULL){ - char categoryTxt[255]; - int level; - const int m = sscanf(item, "%[^=]=%d", categoryTxt, &level); - if(m != 2){ - free(tmpString); - ndbout << "Invalid loglevel specification category=level" << endl; - return; - } - LogLevel::EventCategory cat; - if(!EventLoggerBase::matchEventCategory(categoryTxt, - &cat)){ - ndbout << "Invalid loglevel specification, unknown category: " - << categoryTxt << endl; - free(tmpString); - return ; - } - if(level < 0 || level > 15){ - ndbout << "Invalid loglevel specification row, level 0-15" << endl; - free(tmpString); - return ; - } - logLevel.setLogLevel(cat, level); - - item = strtok_r(NULL, ", ", &tmpPtr); - } - free(tmpString); - } - - int result = _mgmtSrvr.setNodeLogLevel(processId, logLevel); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } -#endif -} - - - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeError(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (emptyString(parameters)) { - ndbout << "Missing error number." << endl; - return; - } - // Copy parameters since strtok will modify it - char* newpar = strdup(parameters); - char* firstParameter = strtok(newpar, " "); - - int errorNo; - if (! convert(firstParameter, errorNo)) { - ndbout << "Expected an integer." << endl; - free(newpar); - return; - } - - char* allAfterFirstParameter = strtok(NULL, "\0"); - if (! emptyString(allAfterFirstParameter)) { - ndbout << "Nothing expected after error number." << endl; - free(newpar); - return; - } - - int result = _mgmtSrvr.insertError(processId, errorNo); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } - free(newpar); -} - - - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeTrace(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (emptyString(parameters)) { - ndbout << "Missing trace number." << endl; - return; - } - - char* newpar = strdup(parameters); - char* firstParameter = strtok(newpar, " "); - - - int traceNo; - if (! convert(firstParameter, traceNo)) { - ndbout << "Expected an integer." << endl; - free(newpar); - return; - } - - char* allAfterFirstParameter = strtok(NULL, "\0"); - - if (! emptyString(allAfterFirstParameter)) { - ndbout << "Nothing expected after trace number." << endl; - free(newpar); - return; - } - - int result = _mgmtSrvr.setTraceNo(processId, traceNo); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } - free(newpar); -} - - - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeLog(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - Vector<BaseString> blocks; - if (! parseBlockSpecification(parameters, blocks)) { - return; - } - - int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::InOut, blocks); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } - -} - - - -//****************************************************************************** -//****************************************************************************** void CommandInterpreter::executeLogIn(int processId, const char* parameters, bool all) { @@ -995,7 +263,7 @@ void CommandInterpreter::executeLogIn(int processId, int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::In, blocks); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -1014,7 +282,7 @@ void CommandInterpreter::executeLogOut(int processId, int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Out, blocks); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -1035,215 +303,43 @@ void CommandInterpreter::executeLogOff(int processId, int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Off, blocks); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeTestOn(int processId, - const char* parameters, bool all) { +void CommandInterpreter::executeTrace(int processId, + const char* parameters, bool all) { (void)all; // Don't want compiler warning - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; + if (emptyString(parameters)) { + ndbout << "Missing trace number." << endl; return; } - int result = _mgmtSrvr.startSignalTracing(processId); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } - -} - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeTestOff(int processId, - const char* parameters, bool all) { + char* newpar = strdup(parameters); + char* firstParameter = strtok(newpar, " "); - (void)all; // Don't want compiler warning - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; + int traceNo; + if (! convert(firstParameter, traceNo)) { + ndbout << "Expected an integer." << endl; + free(newpar); return; } - int result = _mgmtSrvr.stopSignalTracing(processId); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } - -} - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeEventReporting(int processId, - const char* parameters, - bool all) { -#if 0 - (void)all; // Don't want compiler warning - SetLogLevelOrd logLevel; logLevel.clear(); - - if (emptyString(parameters) || (strcmp(parameters, "ALL") == 0)) { - for(Uint32 i = 0; i<EventLoggerBase::noOfEventCategoryNames; i++) - logLevel.setLogLevel(EventLoggerBase::eventCategoryNames[i].category, 7); - } else { - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, ", ", &tmpPtr); - while(item != NULL){ - char categoryTxt[255]; - int level; - const int m = sscanf(item, "%[^=]=%d", categoryTxt, &level); - if(m != 2){ - free(tmpString); - ndbout << "Invalid loglevel specification category=level" << endl; - return; - } - LogLevel::EventCategory cat; - if(!EventLoggerBase::matchEventCategory(categoryTxt, - &cat)){ - ndbout << "Invalid loglevel specification, unknown category: " - << categoryTxt << endl; - free(tmpString); - return ; - } - if(level < 0 || level > 15){ - ndbout << "Invalid loglevel specification row, level 0-15" << endl; - free(tmpString); - return ; - } - logLevel.setLogLevel(cat, level); - - item = strtok_r(NULL, ", ", &tmpPtr); - } - free(tmpString); - } - ndbout_c("processId %d", processId); - int result = _mgmtSrvr.setEventReportingLevel(processId, logLevel); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } -#endif -} - -void -CommandInterpreter::executeStartBackup(char* parameters) { - Uint32 backupId; - int result = _mgmtSrvr.startBackup(backupId); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } else { - // ndbout << "Start of backup ordered" << endl; - } -} + char* allAfterFirstParameter = strtok(NULL, "\0"); -void -CommandInterpreter::executeAbortBackup(char* parameters) { - strtok(parameters, " "); - char* id = strtok(NULL, "\0"); - int bid = -1; - if(id == 0 || sscanf(id, "%d", &bid) != 1){ - ndbout << "Invalid arguments: expected <BackupId>" << endl; + if (! emptyString(allAfterFirstParameter)) { + ndbout << "Nothing expected after trace number." << endl; + free(newpar); return; } - int result = _mgmtSrvr.abortBackup(bid); - if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } else { - ndbout << "Abort of backup " << bid << " ordered" << endl; - } -} - - -void -CommandInterpreter::executeEnterSingleUser(char* parameters) { - strtok(parameters, " "); - char* id = strtok(NULL, " "); - id = strtok(NULL, " "); - id = strtok(NULL, "\0"); - int nodeId = -1; - if(id == 0 || sscanf(id, "%d", &nodeId) != 1){ - ndbout << "Invalid arguments: expected <NodeId>" << endl; - return; - } - int result = _mgmtSrvr.enterSingleUser(0, nodeId,0,0); + int result = _mgmtSrvr.setTraceNo(processId, traceNo); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; - } else { - ndbout << "Entering single user mode, granting access for node " - << nodeId << " OK." << endl; + ndbout << get_error_text(result) << endl; } -} - -void CommandInterpreter::executeExitSingleUser(char* parameters) { - _mgmtSrvr.exitSingleUser(0,0,0,0); -} - - -#include <NdbApiSignal.hpp> - -void -CommandInterpreter::jonas(int processId, const char* parameters, bool all) { - - MgmtSrvr::Area51 tmp = _mgmtSrvr.getStuff(); - - NdbApiSignal signal(0); - Uint32 * theData = signal.getDataPtrSend(); - Uint32 data[25]; - Uint32 sec0[70]; - Uint32 sec1[123]; - - data[0] = 12; - data[1] = 13; - - unsigned i; - for(i = 0; i<70; i++) - sec0[i] = i; - - for(i = 0; i<123; i++) - sec1[i] = 70+i; - - signal.set(0, CMVMI, GSN_TESTSIG, 3); - signal.m_noOfSections = 2; - signal.m_fragmentInfo = 1; - - LinearSectionPtr ptr[3]; - - theData[0] = 3; - theData[1] = 0; - theData[2] = 7; // FragmentId - - ptr[0].sz = 2; - ptr[0].p = &data[0]; - - ptr[1].sz = 60; - ptr[1].p = &sec0[0]; - - tmp.theFacade->lock_mutex(); - tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr); - tmp.theFacade->unlock_mutex(); - - signal.set(0, CMVMI, GSN_TESTSIG, 3); - signal.m_noOfSections = 2; - signal.m_fragmentInfo = 3; - - theData[0] = 0; - theData[1] = 1; - theData[2] = 7; // FragmentId - - ptr[0].sz = 10; - ptr[0].p = &sec0[60]; - - ptr[1].sz = 123; - ptr[1].p = &sec1[0]; - - tmp.theFacade->lock_mutex(); - tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr); - tmp.theFacade->unlock_mutex(); + free(newpar); } diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 3466ee76226..6b67d1a5a5f 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -17,139 +17,57 @@ #ifndef CommandInterpreter_H #define CommandInterpreter_H -//***************************************************************************** -// Author: Peter Lind -//***************************************************************************** - #include <ndb_global.h> #include <Vector.hpp> -#include <editline/editline.h> #include <BaseString.hpp> class MgmtSrvr; -/** - * @class CommandInterpreter - * @brief Reads command line in management client - * - * This class has one public method which reads a command line - * from a stream. It then interpret that commmand line and calls a suitable - * method in the MgmtSrvr class which executes the command. - * - * For command syntax, see the HELP command. - */ class CommandInterpreter { public: - /** - * Constructor - * @param mgmtSrvr: Management server to use when executing commands - */ CommandInterpreter(MgmtSrvr& mgmtSrvr); - - /** - * Reads one line from the stream, parse the line to find - * a command and then calls a suitable method which executes - * the command. - * - * @return true until quit/bye/exit has been typed - */ int readAndExecute(); private: - /** - * Read a string, and return a pointer to it. - * - * @return NULL on EOF. - */ + char m_err_str[1024]; + const char *get_error_text(int err_no); + char *readline_gets () { + static char linebuffer[254]; static char *line_read = (char *)NULL; - // Disable the default file-name completion action of TAB - // rl_bind_key ('\t', rl_insert); - /* If the buffer has already been allocated, return the memory to the free pool. */ if (line_read) - { - free (line_read); - line_read = (char *)NULL; - } + { + free (line_read); + line_read = (char *)NULL; + } /* Get a line from the user. */ - line_read = readline ("NDB> "); - - /* If the line has any text in it, save it on the history. */ - if (line_read && *line_read) - add_history (line_read); - + fputs("ndb_mgmd> ", stdout); + linebuffer[sizeof(linebuffer)-1]=0; + line_read = fgets(linebuffer, sizeof(linebuffer)-1, stdin); + if (line_read == linebuffer) { + char *q=linebuffer; + while (*q > 31) q++; + *q=0; + line_read= strdup(linebuffer); + } return (line_read); } - /** - * Analyse the command line, after the first token. - * - * @param processId: DB process id to send command to or -1 if - * command will be sent to all DB processes. - * @param allAfterFirstToken: What the client gave after the - * first token on the command line - */ void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); - - /** - * Parse the block specification part of the LOG* commands, - * things after LOG*: [BLOCK = {ALL|<blockName>+}] - * - * @param allAfterLog: What the client gave after the second token - * (LOG*) on the command line - * @param blocks, OUT: ALL or name of all the blocks - * @return: true if correct syntax, otherwise false - */ bool parseBlockSpecification(const char* allAfterLog, Vector<BaseString>& blocks); - - /** - * A bunch of execute functions: Executes one of the commands - * - * @param processId: DB process id to send command to - * @param parameters: What the client gave after the command name - * on the command line. - * For example if complete input from user is: "1 LOGLEVEL 22" then the - * parameters argument is the string with everything after LOGLEVEL, in this - * case "22". Each function is responsible to check the parameters argument. - */ - void executeHelp(char* parameters); - void executeShow(char* parameters); - void executeRun(char* parameters); - void executeInfo(char* parameters); - void executeClusterLog(char* parameters); public: - void executeStop(int processId, const char* parameters, bool all); - void executeStart(int processId, const char* parameters, bool all); - void executeRestart(int processId, const char* parameters, bool all); - void executeLogLevel(int processId, const char* parameters, bool all); - void executeError(int processId, const char* parameters, bool all); void executeTrace(int processId, const char* parameters, bool all); - void executeLog(int processId, const char* parameters, bool all); void executeLogIn(int processId, const char* parameters, bool all); void executeLogOut(int processId, const char* parameters, bool all); void executeLogOff(int processId, const char* parameters, bool all); - void executeTestOn(int processId, const char* parameters, bool all); - void executeTestOff(int processId, const char* parameters, bool all); - void executeStatus(int processId, const char* parameters, bool all); - void executeEnterSingleUser(char* parameters); - void executeExitSingleUser(char* parameters); - void executeEventReporting(int processId, const char* parameters, bool all); - void executeDumpState(int processId, const char* parameters, bool all); - void executeStartBackup(char * pars); - void executeAbortBackup(char * pars); - - void jonas(int processId, const char* parameters, bool all); - /** - * A execute function definition - */ public: typedef void (CommandInterpreter::* ExecuteFunction)(int processId, const char * param, diff --git a/ndb/src/mgmsrv/Config.cpp b/ndb/src/mgmsrv/Config.cpp index f9c6a23f909..5ff9cbe04ad 100644 --- a/ndb/src/mgmsrv/Config.cpp +++ b/ndb/src/mgmsrv/Config.cpp @@ -53,27 +53,27 @@ Config::printAllNameValuePairs(NdbOut &out, if(!section->contains(n)) continue; - if (m_info.getStatus(section, n) == ConfigInfo::INTERNAL) + if (m_info.getStatus(section, n) == ConfigInfo::CI_INTERNAL) continue; - if (m_info.getStatus(section, n) == ConfigInfo::DEPRICATED) + if (m_info.getStatus(section, n) == ConfigInfo::CI_DEPRICATED) continue; - if (m_info.getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED) + if (m_info.getStatus(section, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue; out << n << ": "; switch (m_info.getType(section, n)) { - case ConfigInfo::INT: + case ConfigInfo::CI_INT: MGM_REQUIRE(prop->get(n, &int_value)); out << int_value; break; - case ConfigInfo::INT64: + case ConfigInfo::CI_INT64: MGM_REQUIRE(prop->get(n, &int_64)); out << int_64; break; - case ConfigInfo::BOOL: + case ConfigInfo::CI_BOOL: MGM_REQUIRE(prop->get(n, &int_value)); if (int_value) { out << "Y"; @@ -81,11 +81,11 @@ Config::printAllNameValuePairs(NdbOut &out, out << "N"; } break; - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: MGM_REQUIRE(prop->get(n, &str_value)); out << str_value; break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: out << "SECTION"; break; } diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index ad346b30ead..07310e3a8b8 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -15,12 +15,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> +#include <ndb_opt_defaults.h> #include <NdbTCP.h> #include "ConfigInfo.hpp" #include <mgmapi_config_parameters.h> #include <ndb_limits.h> #include "InitConfigFileParser.hpp" +#include <m_string.h> + +extern my_bool opt_ndb_shm; #define MAX_LINE_LENGTH 255 #define KEY_INTERNAL 0 @@ -78,11 +82,12 @@ static bool transformSystem(InitConfigFileParser::Context & ctx, const char *); static bool transformExternalSystem(InitConfigFileParser::Context & ctx, const char *); static bool transformNode(InitConfigFileParser::Context & ctx, const char *); static bool transformExtNode(InitConfigFileParser::Context & ctx, const char *); +static bool checkConnectionSupport(InitConfigFileParser::Context & ctx, const char *); static bool transformConnection(InitConfigFileParser::Context & ctx, const char *); static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *); static bool checkMandatory(InitConfigFileParser::Context & ctx, const char *); static bool fixPortNumber(InitConfigFileParser::Context & ctx, const char *); -static bool fixShmkey(InitConfigFileParser::Context & ctx, const char *); +static bool fixShmKey(InitConfigFileParser::Context & ctx, const char *); static bool checkDbConstraints(InitConfigFileParser::Context & ctx, const char *); static bool checkConnectionConstraints(InitConfigFileParser::Context &, const char *); static bool checkTCPConstraints(InitConfigFileParser::Context &, const char *); @@ -94,6 +99,7 @@ static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *); static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *); static bool fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data); static bool fixBackupDataDir(InitConfigFileParser::Context & ctx, const char * data); +static bool fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data); const ConfigInfo::SectionRule ConfigInfo::m_SectionRules[] = { @@ -107,6 +113,13 @@ ConfigInfo::m_SectionRules[] = { { "REP", transformNode, 0 }, { "EXTERNAL REP", transformExtNode, 0 }, + { MGM_TOKEN, fixShmUniqueId, 0 }, + + { "TCP", checkConnectionSupport, 0 }, + { "SHM", checkConnectionSupport, 0 }, + { "SCI", checkConnectionSupport, 0 }, + { "OSE", checkConnectionSupport, 0 }, + { "TCP", transformConnection, 0 }, { "SHM", transformConnection, 0 }, { "SCI", transformConnection, 0 }, @@ -129,15 +142,19 @@ ConfigInfo::m_SectionRules[] = { { "TCP", fixHostname, "HostName1" }, { "TCP", fixHostname, "HostName2" }, + { "SHM", fixHostname, "HostName1" }, + { "SHM", fixHostname, "HostName2" }, { "SCI", fixHostname, "HostName1" }, { "SCI", fixHostname, "HostName2" }, + { "SHM", fixHostname, "HostName1" }, + { "SHM", fixHostname, "HostName2" }, { "OSE", fixHostname, "HostName1" }, { "OSE", fixHostname, "HostName2" }, { "TCP", fixPortNumber, 0 }, // has to come after fixHostName { "SHM", fixPortNumber, 0 }, // has to come after fixHostName { "SCI", fixPortNumber, 0 }, // has to come after fixHostName - //{ "SHM", fixShmKey, 0 }, + { "SHM", fixShmKey, 0 }, /** * fixExtConnection must be after fixNodeId @@ -168,6 +185,8 @@ ConfigInfo::m_SectionRules[] = { { "TCP", checkTCPConstraints, "HostName2" }, { "SCI", checkTCPConstraints, "HostName1" }, { "SCI", checkTCPConstraints, "HostName2" }, + { "SHM", checkTCPConstraints, "HostName1" }, + { "SHM", checkTCPConstraints, "HostName2" }, { "*", checkMandatory, 0 }, @@ -192,6 +211,9 @@ static bool sanity_checks(Vector<ConfigInfo::ConfigRuleSection>§ions, static bool add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); +static bool set_connection_priorities(Vector<ConfigInfo::ConfigRuleSection>§ions, + struct InitConfigFileParser::Context &ctx, + const char * rule_data); static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); @@ -203,6 +225,7 @@ const ConfigInfo::ConfigRule ConfigInfo::m_ConfigRules[] = { { sanity_checks, 0 }, { add_node_connections, 0 }, + { set_connection_priorities, 0 }, { add_server_ports, 0 }, { check_node_vs_replicas, 0 }, { 0, 0 } @@ -256,9 +279,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "COMPUTER", "COMPUTER", "Computer section", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, 0, 0, 0 }, @@ -267,9 +290,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", "COMPUTER", "Name of computer", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -278,9 +301,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", "COMPUTER", "Hostname of computer (e.g. mysql.com)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -289,9 +312,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ByteOrder", "COMPUTER", 0, - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -304,9 +327,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SYSTEM", "SYSTEM", "System section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CFG_SECTION_SYSTEM, 0, 0 }, @@ -315,9 +338,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Name", "SYSTEM", "Name of system (NDB Cluster)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -326,9 +349,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReplicationRole", "SYSTEM", "Role in Global Replication (None, Primary, or Standby)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -337,9 +360,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrimaryMGMNode", "SYSTEM", "Node id of Primary "MGM_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -349,9 +372,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ConfigGenerationNumber", "SYSTEM", "Configuration generation number", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -364,9 +387,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { DB_TOKEN, DB_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_DB, 0, 0 }, @@ -376,9 +399,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", DB_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -387,9 +410,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", DB_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -398,9 +421,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", DB_TOKEN, "Number identifying the database node ("DB_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -410,9 +433,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ServerPort", DB_TOKEN, "Port used to setup transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "1", STR_VALUE(MAX_INT_RNIL) }, @@ -422,9 +445,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfReplicas", DB_TOKEN, "Number of copies of all data in the database (1-4)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", "4" }, @@ -434,9 +457,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfAttributes", DB_TOKEN, "Total number of attributes stored in database. I.e. sum over all tables", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -446,9 +469,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfTables", DB_TOKEN, "Total number of tables stored in the database", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "8", STR_VALUE(MAX_INT_RNIL) }, @@ -458,9 +481,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfOrderedIndexes", DB_TOKEN, "Total number of ordered indexes that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -470,9 +493,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfUniqueHashIndexes", DB_TOKEN, "Total number of unique hash indexes that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "64", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -482,9 +505,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfIndexes", DB_TOKEN, "Total number of indexes that can be defined in the system", - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -494,9 +517,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentIndexOperations", DB_TOKEN, "Total number of index operations that can execute simultaneously on one "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8K", "0", STR_VALUE(MAX_INT_RNIL) @@ -507,9 +530,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfTriggers", DB_TOKEN, "Total number of triggers that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "768", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -519,9 +542,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfFiredTriggers", DB_TOKEN, "Total number of triggers that can fire simultaneously in one "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -531,9 +554,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", DB_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -542,9 +565,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfSavedMessages", DB_TOKEN, "Max number of error messages in error log and max number of trace files", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "25", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -554,9 +577,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LockPagesInMainMemory", DB_TOKEN, "If set to yes, then NDB Cluster data will not be swapped out to disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -566,9 +589,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenWatchDogCheck", DB_TOKEN, "Time between execution checks inside a database node", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "6000", "70", STR_VALUE(MAX_INT_RNIL) }, @@ -578,9 +601,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StopOnError", DB_TOKEN, "If set to N, "DB_TOKEN_PRINT" automatically restarts/recovers in case of node failure", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -590,9 +613,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "RestartOnErrorInsert", DB_TOKEN, "See src/kernel/vm/Emulator.hpp NdbRestartType for details", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2", "0", "4" }, @@ -602,9 +625,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentOperations", DB_TOKEN, "Max number of operation records in transaction coordinator", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "32k", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -614,9 +637,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfLocalOperations", DB_TOKEN, "Max number of operation records defined in the local storage node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "32", STR_VALUE(MAX_INT_RNIL) }, @@ -626,9 +649,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfLocalScans", DB_TOKEN, "Max number of fragment scans in parallel in the local storage node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "32", STR_VALUE(MAX_INT_RNIL) }, @@ -638,9 +661,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchSizePerLocalScan", DB_TOKEN, "Used to calculate the number of lock records for scan with hold lock", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(DEF_BATCH_SIZE), "1", STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) }, @@ -650,9 +673,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentTransactions", DB_TOKEN, "Max number of transaction executing concurrently on the "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4096", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -662,9 +685,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentScans", DB_TOKEN, "Max number of scans executing concurrently on the "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "256", "2", "500" }, @@ -674,9 +697,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TransactionBufferMemory", DB_TOKEN, "Dynamic buffer space (in bytes) for key and attribute data allocated for each "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "1K", STR_VALUE(MAX_INT_RNIL) }, @@ -686,9 +709,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "IndexMemory", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for storing indexes", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT64, + ConfigInfo::CI_INT64, "18M", "1M", "1024G" }, @@ -698,9 +721,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataMemory", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for storing data", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT64, + ConfigInfo::CI_INT64, "80M", "1M", "1024G" }, @@ -710,9 +733,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "UndoIndexBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for index part", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -722,9 +745,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "UndoDataBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for data part", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "16M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -734,9 +757,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "RedoBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing REDO logs", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -746,9 +769,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LongMessageBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for internal long messages", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "512k", STR_VALUE(MAX_INT_RNIL)}, @@ -758,9 +781,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartPartialTimeout", DB_TOKEN, "Time to wait before trying to start wo/ all nodes. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "30000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -770,9 +793,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartPartitionedTimeout", DB_TOKEN, "Time to wait before trying to start partitioned. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "60000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -782,9 +805,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartFailureTimeout", DB_TOKEN, "Time to wait before terminating. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -794,9 +817,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalDbDb", DB_TOKEN, "Time between "DB_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "DB_TOKEN_PRINT" considered dead after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1500", "10", STR_VALUE(MAX_INT_RNIL) }, @@ -806,9 +829,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalDbApi", DB_TOKEN, "Time between "API_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "API_TOKEN_PRINT" connection closed after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1500", "100", STR_VALUE(MAX_INT_RNIL) }, @@ -818,9 +841,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenLocalCheckpoints", DB_TOKEN, "Time between taking snapshots of the database (expressed in 2log of bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "0", "31" }, @@ -830,9 +853,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenGlobalCheckpoints", DB_TOKEN, "Time between doing group commit of transactions to disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2000", "10", "32000" }, @@ -842,9 +865,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfFragmentLogFiles", DB_TOKEN, "No of 16 Mbyte Redo log files in each of 4 file sets belonging to "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -854,9 +877,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfOpenFiles", DB_TOKEN, "Max number of files open per "DB_TOKEN_PRINT" node.(One thread is created per file)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "20", "256" }, @@ -867,9 +890,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenInactiveTransactionAbortCheck", DB_TOKEN, "Time between inactive transaction checks", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "1000", STR_VALUE(MAX_INT_RNIL) }, @@ -883,9 +906,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "to execute or send another part (query, statement) of the transaction.\n" "If the application takes too long time, the transaction gets aborted.\n" "Timeout set to 0 means that we don't timeout at all on application wait.", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(MAX_INT_RNIL), "0", STR_VALUE(MAX_INT_RNIL) }, @@ -898,9 +921,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "This is the time the transaction coordinator waits for each database node\n" "of the transaction to execute a request. If the database node takes too\n" "long time, the transaction gets aborted.", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1200", "50", STR_VALUE(MAX_INT_RNIL) }, @@ -910,9 +933,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskDuringRestartTUP", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -922,9 +945,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskAfterRestartTUP", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -934,9 +957,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskDuringRestartACC", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -946,9 +969,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskAfterRestartACC", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -959,9 +982,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Diskless", DB_TOKEN, "Run wo/ disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true"}, @@ -971,9 +994,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Discless", DB_TOKEN, "Diskless", - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true"}, @@ -985,9 +1008,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationTimeout", DB_TOKEN, "Max time (milliseconds) database partion waits for arbitration signal", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "3000", "10", STR_VALUE(MAX_INT_RNIL) }, @@ -997,9 +1020,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataDir", DB_TOKEN, "Data directory for this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MYSQLCLUSTERDIR, 0, 0 }, @@ -1008,9 +1031,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "FileSystemPath", DB_TOKEN, "Path to directory where the "DB_TOKEN_PRINT" node stores its data (directory must exist)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1019,9 +1042,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelStartup", DB_TOKEN, "Node startup info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "0", "15" }, @@ -1031,9 +1054,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelShutdown", DB_TOKEN, "Node shutdown info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1043,9 +1066,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelStatistic", DB_TOKEN, "Transaction, operation, transporter info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1055,9 +1078,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelCheckpoint", DB_TOKEN, "Local and Global checkpoint info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1067,9 +1090,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelNodeRestart", DB_TOKEN, "Node restart, node failure info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1079,9 +1102,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelConnection", DB_TOKEN, "Node connect/disconnect info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1091,9 +1114,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelError", DB_TOKEN, "Transporter, heartbeat errors printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1103,9 +1126,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelInfo", DB_TOKEN, "Heartbeat and log info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1118,9 +1141,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ParallelBackups", DB_TOKEN, "Maximum number of parallel backups", - ConfigInfo::NOTIMPLEMENTED, + ConfigInfo::CI_NOTIMPLEMENTED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "1", "1" }, @@ -1130,9 +1153,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupDataDir", DB_TOKEN, "Path to where to store backups", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1141,9 +1164,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupMemory", DB_TOKEN, "Total memory allocated for backups per node (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4M", // sum of BackupDataBufferSize and BackupLogBufferSize "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1153,9 +1176,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupDataBufferSize", DB_TOKEN, "Default size of databuffer for a backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", // remember to change BackupMemory "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1165,9 +1188,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupLogBufferSize", DB_TOKEN, "Default size of logbuffer for a backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", // remember to change BackupMemory "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1177,9 +1200,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupWriteSize", DB_TOKEN, "Default size of filesystem writes made by backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "32K", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1192,9 +1215,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "REP", "REP", "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_REP, 0, 0 }, @@ -1204,9 +1227,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", "REP", "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1215,9 +1238,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", "REP", "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1226,9 +1249,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", "REP", "Number identifying replication node (REP)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1238,9 +1261,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", "REP", "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1249,9 +1272,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalRepRep", "REP", "Time between REP-REP heartbeats. Connection closed after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "3000", "100", STR_VALUE(MAX_INT_RNIL) }, @@ -1264,9 +1287,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { API_TOKEN, API_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_API, 0, 0 }, @@ -1276,9 +1299,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", API_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1287,9 +1310,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", API_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1298,9 +1321,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", API_TOKEN, "Number identifying application node ("API_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1310,9 +1333,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", API_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1321,9 +1344,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationRank", API_TOKEN, "If 0, then "API_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "2" }, @@ -1333,9 +1356,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationDelay", API_TOKEN, "When asked to arbitrate, arbitrator waits this long before voting (msec)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1345,9 +1368,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxScanBatchSize", "API", "The maximum collective batch size for one scan", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(MAX_SCAN_BATCH_SIZE), "32k", "16M" }, @@ -1357,9 +1380,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchByteSize", "API", "The default batch size in bytes", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(SCAN_BATCH_SIZE), "1k", "1M" }, @@ -1369,9 +1392,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchSize", "API", "The default batch size in number of records", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(DEF_BATCH_SIZE), "1", STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) }, @@ -1384,9 +1407,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { MGM_TOKEN, MGM_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_MGM, 0, 0 }, @@ -1396,9 +1419,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", MGM_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1407,9 +1430,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataDir", MGM_TOKEN, "Data directory for this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MYSQLCLUSTERDIR, 0, 0 }, @@ -1418,9 +1441,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", MGM_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1429,9 +1452,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", MGM_TOKEN, "Number identifying the management server node ("MGM_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1441,9 +1464,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogDestination", MGM_TOKEN, "String describing where logmessages are sent", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, 0, 0, 0 }, @@ -1452,9 +1475,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", MGM_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, 0, 0, 0 }, @@ -1463,9 +1486,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfSavedEvents", MGM_TOKEN, "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "100", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1475,10 +1498,10 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", MGM_TOKEN, "Port number to give commands to/fetch configurations from management server", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, - NDB_BASE_PORT, + ConfigInfo::CI_INT, + NDB_PORT, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1487,10 +1510,10 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumberStats", MGM_TOKEN, "Port number used to get statistical information from a management server", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, - "2199", + ConfigInfo::CI_INT, + UNDEFINED, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1499,9 +1522,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationRank", MGM_TOKEN, "If 0, then "MGM_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "0", "2" }, @@ -1511,9 +1534,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationDelay", MGM_TOKEN, "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1526,9 +1549,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TCP", "TCP", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_TCP, 0, 0 }, @@ -1538,9 +1561,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "TCP", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1549,9 +1572,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "TCP", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1560,9 +1583,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "TCP", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1571,20 +1594,31 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "TCP", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, { + CFG_CONNECTION_GROUP, + "Group", + "TCP", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "55", + "0", "200" }, + + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", "TCP", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1595,9 +1629,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "TCP", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1607,9 +1641,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "TCP", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1619,9 +1653,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendBufferMemory", "TCP", "Bytes of buffer for signals sent from this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "256K", "16K", STR_VALUE(MAX_INT_RNIL) }, @@ -1631,9 +1665,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReceiveBufferMemory", "TCP", "Bytes of buffer for signals received by this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "64K", "16K", STR_VALUE(MAX_INT_RNIL) }, @@ -1643,9 +1677,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Proxy", "TCP", "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1654,9 +1688,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "TCP", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1665,9 +1699,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "TCP", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1680,54 +1714,99 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SHM", "SHM", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_SHM, 0, 0 }, { - CFG_CONNECTION_NODE_1, - "NodeId1", + CFG_CONNECTION_HOSTNAME_1, + "HostName1", "SHM", - "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + "Name/IP of computer on one side of the connection", + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, - MANDATORY, + ConfigInfo::CI_STRING, + UNDEFINED, 0, 0 }, - + + { + CFG_CONNECTION_HOSTNAME_2, + "HostName2", + "SHM", + "Name/IP of computer on one side of the connection", + ConfigInfo::CI_INTERNAL, + false, + ConfigInfo::CI_STRING, + UNDEFINED, + 0, 0 }, + { CFG_CONNECTION_SERVER_PORT, "PortNumber", "SHM", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, { + CFG_SHM_SIGNUM, + "Signum", + "SHM", + "Signum to be used for signalling", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + UNDEFINED, + "0", + STR_VALUE(MAX_INT_RNIL) }, + + { + CFG_CONNECTION_NODE_1, + "NodeId1", + "SHM", + "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_STRING, + MANDATORY, + 0, 0 }, + + { CFG_CONNECTION_NODE_2, "NodeId2", "SHM", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, { + CFG_CONNECTION_GROUP, + "Group", + "SHM", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "35", + "0", "200" }, + + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", "SHM", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1738,9 +1817,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "SHM", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1750,10 +1829,10 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ShmKey", "SHM", "A shared memory key", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, - MANDATORY, + ConfigInfo::CI_INT, + "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1762,9 +1841,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ShmSize", "SHM", "Size of shared memory segment", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "4K", STR_VALUE(MAX_INT_RNIL) }, @@ -1774,9 +1853,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "SHM", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1785,9 +1864,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "SHM", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1799,9 +1878,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SCI", "SCI", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_SCI, 0, 0 }, @@ -1811,9 +1890,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "SCI", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1823,21 +1902,32 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "SCI", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, { + CFG_CONNECTION_GROUP, + "Group", + "SCI", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "15", + "0", "200" }, + + { CFG_CONNECTION_HOSTNAME_1, "HostName1", "SCI", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1846,9 +1936,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "SCI", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1857,9 +1947,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "SCI", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1869,9 +1959,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host1SciId0", "SCI", "SCI-node id for adapter 0 on Host1 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1881,9 +1971,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host1SciId1", "SCI", "SCI-node id for adapter 1 on Host1 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1893,9 +1983,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host2SciId0", "SCI", "SCI-node id for adapter 0 on Host2 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1905,9 +1995,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host2SciId1", "SCI", "SCI-node id for adapter 1 on Host2 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1917,9 +2007,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "SCI", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1929,9 +2019,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "SCI", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1941,9 +2031,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendLimit", "SCI", "Transporter send buffer contents are sent when this no of bytes is buffered", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8K", "128", "32K" }, @@ -1953,9 +2043,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SharedBufferSize", "SCI", "Size of shared memory segment", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "64K", STR_VALUE(MAX_INT_RNIL) }, @@ -1965,9 +2055,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "SCI", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1976,9 +2066,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "SCI", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1990,9 +2080,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "OSE", "OSE", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_OSE, 0, 0 }, @@ -2002,9 +2092,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "OSE", "Name of computer on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2013,9 +2103,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "OSE", "Name of computer on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2024,9 +2114,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "OSE", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2036,9 +2126,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "OSE", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2048,9 +2138,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "OSE", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -2060,9 +2150,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "OSE", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -2072,9 +2162,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrioASignalSize", "OSE", "Size of priority A signals (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2084,9 +2174,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrioBSignalSize", "OSE", "Size of priority B signals (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2096,9 +2186,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReceiveArraySize", "OSE", "Number of OSE signals checked for correct ordering (in no of OSE signals)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "10", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2108,9 +2198,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "OSE", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2119,9 +2209,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "OSE", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, }; @@ -2169,7 +2259,7 @@ ConfigInfo::ConfigInfo() } switch (param._type) { - case BOOL: + case CI_BOOL: { bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._min, tmp_bool)); @@ -2178,8 +2268,8 @@ ConfigInfo::ConfigInfo() pinfo.put64("Max", tmp_bool); break; } - case INT: - case INT64: + case CI_INT: + case CI_INT64: { Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._min, tmp_uint64)); @@ -2188,10 +2278,10 @@ ConfigInfo::ConfigInfo() pinfo.put64("Max", tmp_uint64); break; } - case SECTION: + case CI_SECTION: pinfo.put("SectionType", (Uint32)UintPtr(param._default)); break; - case STRING: + case CI_STRING: break; } @@ -2209,7 +2299,7 @@ ConfigInfo::ConfigInfo() // Replace section with modified section m_info.put(param._section, section, true); - if(param._type != ConfigInfo::SECTION){ + if(param._type != ConfigInfo::CI_SECTION){ Properties * p; if(!m_systemDefaults.getCopy(param._section, &p)){ p = new Properties(true); @@ -2218,20 +2308,20 @@ ConfigInfo::ConfigInfo() param._default != MANDATORY){ switch (param._type) { - case SECTION: + case CI_SECTION: break; - case STRING: + case CI_STRING: require(p->put(param._fname, param._default)); break; - case BOOL: + case CI_BOOL: { bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._default, default_bool)); require(p->put(param._fname, default_bool)); break; } - case INT: - case INT64: + case CI_INT: + case CI_INT64: { Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._default, default_uint64)); @@ -2253,7 +2343,7 @@ ConfigInfo::ConfigInfo() exit(-1); } - if(m_ParamInfo[i]._type == ConfigInfo::SECTION) + if(m_ParamInfo[i]._type == ConfigInfo::CI_SECTION) continue; const Properties * p = getInfo(m_ParamInfo[i]._section); @@ -2413,9 +2503,9 @@ void ConfigInfo::print(const char* section) const { Properties::Iterator it(sec); for (const char* n = it.first(); n != NULL; n = it.next()) { // Skip entries with different F- and P-names - if (getStatus(sec, n) == ConfigInfo::INTERNAL) continue; - if (getStatus(sec, n) == ConfigInfo::DEPRICATED) continue; - if (getStatus(sec, n) == ConfigInfo::NOTIMPLEMENTED) continue; + if (getStatus(sec, n) == ConfigInfo::CI_INTERNAL) continue; + if (getStatus(sec, n) == ConfigInfo::CI_DEPRICATED) continue; + if (getStatus(sec, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue; print(sec, n); } } @@ -2425,7 +2515,7 @@ void ConfigInfo::print(const Properties * section, ndbout << parameter; // ndbout << getDescription(section, parameter) << endl; switch (getType(section, parameter)) { - case ConfigInfo::BOOL: + case ConfigInfo::CI_BOOL: ndbout << " (Boolean value)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == false) { @@ -2440,8 +2530,8 @@ void ConfigInfo::print(const Properties * section, ndbout << endl; break; - case ConfigInfo::INT: - case ConfigInfo::INT64: + case ConfigInfo::CI_INT: + case ConfigInfo::CI_INT64: ndbout << " (Non-negative Integer)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == (UintPtr)MANDATORY) { @@ -2456,7 +2546,7 @@ void ConfigInfo::print(const Properties * section, ndbout << endl; break; - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: ndbout << " (String)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == (UintPtr)MANDATORY) { @@ -2466,7 +2556,7 @@ void ConfigInfo::print(const Properties * section, } ndbout << endl; break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: break; } } @@ -2654,11 +2744,50 @@ transformExtNode(InitConfigFileParser::Context & ctx, const char * data){ } /** - * Connection rule: Update "NoOfConnections" + * Connection rule: Check support of connection */ bool -transformConnection(InitConfigFileParser::Context & ctx, const char * data){ +checkConnectionSupport(InitConfigFileParser::Context & ctx, const char * data) +{ + int error= 0; + if (strcasecmp("TCP",ctx.fname) == 0) + { + // always enabled + } + else if (strcasecmp("SHM",ctx.fname) == 0) + { +#ifndef NDB_SHM_TRANSPORTER + error= 1; +#endif + } + else if (strcasecmp("SCI",ctx.fname) == 0) + { +#ifndef NDB_SCI_TRANSPORTER + error= 1; +#endif + } + else if (strcasecmp("OSE",ctx.fname) == 0) + { +#ifndef NDB_OSE_TRANSPORTER + error= 1; +#endif + } + if (error) + { + ctx.reportError("Binary not compiled with this connection support, " + "[%s] starting at line: %d", + ctx.fname, ctx.m_sectionLineno); + return false; + } + return true; +} +/** + * Connection rule: Update "NoOfConnections" + */ +bool +transformConnection(InitConfigFileParser::Context & ctx, const char * data) +{ Uint32 connections = 0; ctx.m_userProperties.get("NoOfConnections", &connections); BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "Connection_%d", connections); @@ -2746,26 +2875,26 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); if(!ctx.m_currentSection->contains(name)){ switch (ctx.m_info->getType(ctx.m_currentInfo, name)){ - case ConfigInfo::INT: - case ConfigInfo::BOOL:{ + case ConfigInfo::CI_INT: + case ConfigInfo::CI_BOOL:{ Uint32 val = 0; ::require(defaults->get(name, &val)); ctx.m_currentSection->put(name, val); break; } - case ConfigInfo::INT64:{ + case ConfigInfo::CI_INT64:{ Uint64 val = 0; ::require(defaults->get(name, &val)); ctx.m_currentSection->put64(name, val); break; } - case ConfigInfo::STRING:{ + case ConfigInfo::CI_STRING:{ const char * val; ::require(defaults->get(name, &val)); ctx.m_currentSection->put(name, val); break; } - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: break; } } @@ -2947,7 +3076,13 @@ fixHostname(InitConfigFileParser::Context & ctx, const char * data){ require(ctx.m_currentSection->get(buf, &id)); const Properties * node; - require(ctx.m_config->get("Node", id, &node)); + if(!ctx.m_config->get("Node", id, &node)) + { + ctx.reportError("Unknown node: \"%d\" specified in connection " + "[%s] starting at line: %d", + id, ctx.fname, ctx.m_sectionLineno); + return false; + } const char * hostname; require(node->get("HostName", &hostname)); @@ -3010,7 +3145,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ if(!(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base)) && !ctx.m_systemDefaults->get("PortNumber", &base)) { - base= strtoll(NDB_BASE_PORT,0,0)+2; + base= strtoll(NDB_TCP_BASE_PORT,0,0); // ctx.reportError("Cannot retrieve base port number"); // return false; } @@ -3025,15 +3160,75 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ << "per connection, please remove from config. " << "Will be changed to " << port << endl; ctx.m_currentSection->put("PortNumber", port, true); - } else + } + else + { ctx.m_currentSection->put("PortNumber", port); - + } DBUG_PRINT("info", ("connection %d-%d port %d host %s", id1, id2, port, hostname.c_str())); DBUG_RETURN(true); } +static bool +fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data) +{ + DBUG_ENTER("fixShmUniqueId"); + Uint32 nodes= 0; + ctx.m_userProperties.get(ctx.fname, &nodes); + if (nodes == 1) // first management server + { + Uint32 portno= atoi(NDB_PORT); + ctx.m_currentSection->get("PortNumber", &portno); + ctx.m_userProperties.put("ShmUniqueId", portno); + } + DBUG_RETURN(true); +} + +static +bool +fixShmKey(InitConfigFileParser::Context & ctx, const char *) +{ + DBUG_ENTER("fixShmKey"); + { + static int last_signum= -1; + Uint32 signum; + if(!ctx.m_currentSection->get("Signum", &signum)) + { + signum= OPT_NDB_SHM_SIGNUM_DEFAULT; + if (signum <= 0) + { + ctx.reportError("Unable to set default parameter for [SHM]Signum" + " please specify [SHM DEFAULT]Signum"); + return false; + } + ctx.m_currentSection->put("Signum", signum); + DBUG_PRINT("info",("Added Signum=%u", signum)); + } + if ( last_signum != (int)signum && last_signum >= 0 ) + { + ctx.reportError("All shared memory transporters must have same [SHM]Signum defined." + " Use [SHM DEFAULT]Signum"); + return false; + } + last_signum= (int)signum; + } + { + Uint32 id1= 0, id2= 0, key= 0; + require(ctx.m_currentSection->get("NodeId1", &id1)); + require(ctx.m_currentSection->get("NodeId2", &id2)); + if(!ctx.m_currentSection->get("ShmKey", &key)) + { + require(ctx.m_userProperties.get("ShmUniqueId", &key)); + key= key << 16 | (id1 > id2 ? id1 << 8 | id2 : id2 << 8 | id1); + ctx.m_currentSection->put("ShmKey", key); + DBUG_PRINT("info",("Added ShmKey=0x%x", key)); + } + } + DBUG_RETURN(true); +} + /** * DB Node rule: Check various constraints */ @@ -3165,7 +3360,7 @@ transform(InitConfigFileParser::Context & ctx, require(ctx.m_currentSection->getTypeOf(oldName, &oldType)); ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64) - && (newType == ConfigInfo::INT || newType == ConfigInfo::INT64 || newType == ConfigInfo::BOOL))){ + && (newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_INT64 || newType == ConfigInfo::CI_BOOL))){ ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl; ctx.reportError("Unable to handle type conversion w.r.t deprication %s %s" "- [%s] starting at line: %d", @@ -3176,7 +3371,7 @@ transform(InitConfigFileParser::Context & ctx, Uint64 oldVal; require(ctx.m_currentSection->get(oldName, &oldVal)); - Uint64 newVal = (Uint64)(oldVal * mul + add); + Uint64 newVal = (Uint64)((Int64)oldVal * mul + add); if(!ctx.m_info->verify(ctx.m_currentInfo, newName, newVal)){ ctx.reportError("Unable to handle deprication, new value not within bounds" "%s %s - [%s] starting at line: %d", @@ -3185,9 +3380,9 @@ transform(InitConfigFileParser::Context & ctx, return false; } - if(newType == ConfigInfo::INT || newType == ConfigInfo::BOOL){ + if(newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_BOOL){ require(dst.put(newName, (Uint32)newVal)); - } else if(newType == ConfigInfo::INT64) { + } else if(newType == ConfigInfo::CI_INT64) { require(dst.put64(newName, newVal)); } return true; @@ -3269,7 +3464,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ require(sec->get("Status", &status)); require(sec->get("SectionType", &typeVal)); - if(id == KEY_INTERNAL || status == ConfigInfo::INTERNAL){ + if(id == KEY_INTERNAL || status == ConfigInfo::CI_INTERNAL){ ndbout_c("skipping section %s", ctx.fname); break; } @@ -3348,11 +3543,51 @@ sanity_checks(Vector<ConfigInfo::ConfigRuleSection>§ions, return true; } +static void +add_a_connection(Vector<ConfigInfo::ConfigRuleSection>§ions, + struct InitConfigFileParser::Context &ctx, + Uint32 nodeId1, Uint32 nodeId2, bool use_shm) +{ + ConfigInfo::ConfigRuleSection s; + const char *hostname1= 0, *hostname2= 0; + const Properties *tmp; + + require(ctx.m_config->get("Node", nodeId1, &tmp)); + tmp->get("HostName", &hostname1); + + require(ctx.m_config->get("Node", nodeId2, &tmp)); + tmp->get("HostName", &hostname2); + + char buf[16]; + s.m_sectionData= new Properties(true); + BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); + s.m_sectionData->put("NodeId1", buf); + BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); + s.m_sectionData->put("NodeId2", buf); + + if (use_shm && + hostname1 && hostname1[0] && + hostname2 && hostname2[0] && + strcmp(hostname1,hostname2) == 0) + { + s.m_sectionType= BaseString("SHM"); + DBUG_PRINT("info",("adding SHM connection %d %d",nodeId1,nodeId2)); + } + else + { + s.m_sectionType= BaseString("TCP"); + DBUG_PRINT("info",("adding TCP connection %d %d",nodeId1,nodeId2)); + } + + sections.push_back(s); +} + static bool add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { + DBUG_ENTER("add_node_connections"); Uint32 i; Properties * props= ctx.m_config; Properties p_connections(true); @@ -3377,9 +3612,10 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions, ctx.m_userProperties.get("NoOfNodes", &nNodes); Properties p_db_nodes(true); - Properties p_api_mgm_nodes(true); + Properties p_api_nodes(true); + Properties p_mgm_nodes(true); - Uint32 i_db= 0, i_api_mgm= 0, n; + Uint32 i_db= 0, i_api= 0, i_mgm= 0, n; for (i= 0, n= 0; n < nNodes; i++){ const Properties * tmp; if(!props->get("Node", i, &tmp)) continue; @@ -3390,9 +3626,10 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions, if (strcmp(type,DB_TOKEN) == 0) p_db_nodes.put("", i_db++, i); - else if (strcmp(type,API_TOKEN) == 0 || - strcmp(type,MGM_TOKEN) == 0) - p_api_mgm_nodes.put("", i_api_mgm++, i); + else if (strcmp(type,API_TOKEN) == 0) + p_api_nodes.put("", i_api++, i); + else if (strcmp(type,MGM_TOKEN) == 0) + p_mgm_nodes.put("", i_mgm++, i); } Uint32 nodeId1, nodeId2, dummy; @@ -3401,39 +3638,39 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions, for (Uint32 j= i+1;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { - ConfigInfo::ConfigRuleSection s; - s.m_sectionType= BaseString("TCP"); - s.m_sectionData= new Properties(true); - char buf[16]; - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); - s.m_sectionData->put("NodeId1", buf); - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); - s.m_sectionData->put("NodeId2", buf); - sections.push_back(s); + add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm); } } } - for (i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){ + for (i= 0; p_api_nodes.get("", i, &nodeId1); i++){ if(!p_connections.get("", nodeId1, &dummy)) { for (Uint32 j= 0;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; - ConfigInfo::ConfigRuleSection s; - s.m_sectionType= BaseString("TCP"); - s.m_sectionData= new Properties(true); - char buf[16]; - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); - s.m_sectionData->put("NodeId1", buf); - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); - s.m_sectionData->put("NodeId2", buf); - sections.push_back(s); + add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm); } } } - return true; + for (i= 0; p_mgm_nodes.get("", i, &nodeId1); i++){ + if(!p_connections.get("", nodeId1, &dummy)) { + for (Uint32 j= 0;; j++){ + if(!p_db_nodes.get("", j, &nodeId2)) break; + add_a_connection(sections,ctx,nodeId1,nodeId2,0); + } + } + } + + DBUG_RETURN(true); } +static bool set_connection_priorities(Vector<ConfigInfo::ConfigRuleSection>§ions, + struct InitConfigFileParser::Context &ctx, + const char * rule_data) +{ + DBUG_ENTER("set_connection_priorities"); + DBUG_RETURN(true); +} static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>§ions, struct InitConfigFileParser::Context &ctx, @@ -3442,7 +3679,7 @@ static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>§ions, #if 0 Properties * props= ctx.m_config; Properties computers(true); - Uint32 port_base = NDB_BASE_PORT+2; + Uint32 port_base = NDB_TCP_BASE_PORT; Uint32 nNodes; ctx.m_userProperties.get("NoOfNodes", &nNodes); diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp index 512505cbd30..dff8b34bf4a 100644 --- a/ndb/src/mgmsrv/ConfigInfo.hpp +++ b/ndb/src/mgmsrv/ConfigInfo.hpp @@ -38,11 +38,11 @@ static const char* UNDEFINED = 0; // Default value for undefined */ class ConfigInfo { public: - enum Type { BOOL, INT, INT64, STRING, SECTION }; - enum Status { USED, ///< Active - DEPRICATED, ///< Can be, but shouldn't - NOTIMPLEMENTED, ///< Is ignored. - INTERNAL ///< Not configurable by the user + enum Type { CI_BOOL, CI_INT, CI_INT64, CI_STRING, CI_SECTION }; + enum Status { CI_USED, ///< Active + CI_DEPRICATED, ///< Can be, but shouldn't + CI_NOTIMPLEMENTED, ///< Is ignored. + CI_INTERNAL ///< Not configurable by the user }; /** diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index fdfe7823fc2..822e10c89aa 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -21,6 +21,7 @@ #include "MgmtErrorReporter.hpp" #include <NdbOut.hpp> #include "ConfigInfo.hpp" +#include <m_string.h> const int MAX_LINE_LENGTH = 1024; // Max length of line of text in config file static void trim(char *); @@ -213,57 +214,58 @@ InitConfigFileParser::parseConfig(FILE * file) { // Parse Name-Value Pair //**************************************************************************** -bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) { - - char tmpLine[MAX_LINE_LENGTH]; - char fname[MAX_LINE_LENGTH], rest[MAX_LINE_LENGTH]; - char* t; - const char *separator_list[]= {":", "=", 0}; - const char *separator= 0; - +bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) +{ if (ctx.m_currentSection == NULL){ ctx.reportError("Value specified outside section"); return false; } - strncpy(tmpLine, line, MAX_LINE_LENGTH); - // ************************************* - // Check if a separator exists in line + // Split string at first occurrence of + // '=' or ':' // ************************************* - for(int i= 0; separator_list[i] != 0; i++) { - if(strchr(tmpLine, separator_list[i][0])) { - separator= separator_list[i]; - break; - } - } - if (separator == 0) { + Vector<BaseString> tmp_string_split; + if (BaseString(line).split(tmp_string_split, + "=:", 2) != 2) + { ctx.reportError("Parse error"); return false; } - // ******************************************* - // Get pointer to substring before separator - // ******************************************* - t = strtok(tmpLine, separator); + // ************************************* + // Remove all after # + // ************************************* + + Vector<BaseString> tmp_string_split2; + tmp_string_split[1].split(tmp_string_split2, + "#", 2); + tmp_string_split[1]=tmp_string_split2[0]; - // ***************************************** - // Count number of tokens before separator - // ***************************************** - if (sscanf(t, "%120s%120s", fname, rest) != 1) { - ctx.reportError("Multiple names before \'%c\'", separator[0]); - return false; + // ************************************* + // Remove leading and trailing chars + // ************************************* + { + for (int i = 0; i < 2; i++) + tmp_string_split[i].trim("\r\n \t"); } + + // ************************************* + // First in split is fname + // ************************************* + + const char *fname= tmp_string_split[0].c_str(); + if (!ctx.m_currentInfo->contains(fname)) { ctx.reportError("[%s] Unknown parameter: %s", ctx.fname, fname); return false; } ConfigInfo::Status status = m_info->getStatus(ctx.m_currentInfo, fname); - if (status == ConfigInfo::NOTIMPLEMENTED) { + if (status == ConfigInfo::CI_NOTIMPLEMENTED) { ctx.reportWarning("[%s] %s not yet implemented", ctx.fname, fname); } - if (status == ConfigInfo::DEPRICATED) { + if (status == ConfigInfo::CI_DEPRICATED) { const char * desc = m_info->getDescription(ctx.m_currentInfo, fname); if(desc){ ctx.reportWarning("[%s] %s is depricated, use %s instead", @@ -273,24 +275,11 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) { } } - // ****************************************** - // Get pointer to substring after separator - // ****************************************** - t = strtok(NULL, "\0"); - if (t == NULL) { - ctx.reportError("No value for parameter"); - return false; - } - - // ****************************************** - // Remove prefix and postfix spaces and tabs - // ******************************************* - trim(t); - // *********************** // Store name-value pair // *********************** - return storeNameValuePair(ctx, fname, t); + + return storeNameValuePair(ctx, fname, tmp_string_split[1].c_str()); } @@ -316,7 +305,7 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, const ConfigInfo::Type type = m_info->getType(ctx.m_currentInfo, fname); switch(type){ - case ConfigInfo::BOOL: { + case ConfigInfo::CI_BOOL: { bool value_bool; if (!convertStringToBool(value, value_bool)) { ctx.reportError("Illegal boolean value for parameter %s", fname); @@ -325,8 +314,8 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, MGM_REQUIRE(ctx.m_currentSection->put(pname, value_bool)); break; } - case ConfigInfo::INT: - case ConfigInfo::INT64:{ + case ConfigInfo::CI_INT: + case ConfigInfo::CI_INT64:{ Uint64 value_int; if (!convertStringToUint64(value, value_int)) { ctx.reportError("Illegal integer value for parameter %s", fname); @@ -339,17 +328,17 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, m_info->getMax(ctx.m_currentInfo, fname)); return false; } - if(type == ConfigInfo::INT){ + if(type == ConfigInfo::CI_INT){ MGM_REQUIRE(ctx.m_currentSection->put(pname, (Uint32)value_int)); } else { MGM_REQUIRE(ctx.m_currentSection->put64(pname, value_int)); } break; } - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: MGM_REQUIRE(ctx.m_currentSection->put(pname, value)); break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: abort(); } return true; @@ -385,7 +374,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s, errno = 0; char* p; - long long v = strtoll(s, &p, log10base); + Int64 v = strtoll(s, &p, log10base); if (errno != 0) return false; diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 3b57b027827..50e0b6023ad 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -24,7 +24,6 @@ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/ndbapi \ -I$(top_srcdir)/ndb/src/common/mgmcommon LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ - $(top_builddir)/ndb/src/common/editline/libeditline.a \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ @@ -33,8 +32,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ - -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" \ - -DNDB_BASE_PORT="\"@ndb_port_base@\"" + -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am @@ -43,3 +41,17 @@ ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndb_mgmd.dsp + +ndb_mgmd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgmd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/mgmsrv/Makefile_old b/ndb/src/mgmsrv/Makefile_old deleted file mode 100644 index c99875ae8b6..00000000000 --- a/ndb/src/mgmsrv/Makefile_old +++ /dev/null @@ -1,41 +0,0 @@ -include .defs.mk - -TYPE := ndbapi mgmapiclient - -BIN_TARGET := mgmtsrvr -BIN_TARGET_LIBS := -BIN_TARGET_ARCHIVES := NDB_API mgmsrvcommon mgmapi general - -ifneq ($(USE_EDITLINE), N) -BIN_TARGET_ARCHIVES += editline -DIRS := mkconfig -endif -BIN_TARGET_ARCHIVES += general - -BIN_FLAGS += $(TERMCAP_LIB) - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - MgmtSrvr.cpp \ - MgmtSrvrGeneralSignalHandling.cpp \ - main.cpp \ - Services.cpp \ - convertStrToInt.cpp \ - NodeLogLevel.cpp \ - NodeLogLevelList.cpp \ - SignalQueue.cpp \ - MgmtSrvrConfig.cpp - -ifeq ($(findstring OSE, $(NDB_OS)),) -SOURCES += CommandInterpreter.cpp -endif - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/src/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/src/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) - -include $(NDB_TOP)/Epilogue.mk - -_bins_mkconfig : $(NDB_TOP)/bin/$(BIN_TARGET) - diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 29df10630f3..3bc00b18f50 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -49,9 +49,12 @@ #include <NdbAutoPtr.hpp> +#include <ndberror.h> + #include <mgmapi.h> #include <mgmapi_configuration.hpp> #include <mgmapi_config_parameters.h> +#include <m_string.h> //#define MGM_SRV_DEBUG #ifdef MGM_SRV_DEBUG @@ -67,12 +70,7 @@ void * MgmtSrvr::logLevelThread_C(void* m) { MgmtSrvr *mgm = (MgmtSrvr*)m; - my_thread_init(); mgm->logLevelThreadRun(); - - my_thread_end(); - NdbThread_Exit(0); - /* NOTREACHED */ return 0; } @@ -80,12 +78,7 @@ void * MgmtSrvr::signalRecvThread_C(void *m) { MgmtSrvr *mgm = (MgmtSrvr*)m; - my_thread_init(); mgm->signalRecvThreadRun(); - - my_thread_end(); - NdbThread_Exit(0); - /* NOTREACHED */ return 0; } @@ -123,15 +116,14 @@ MgmtSrvr::signalRecvThreadRun() while(!_isStopThread) { SigMatch *handler = NULL; NdbApiSignal *signal = NULL; - if(m_signalRecvQueue.waitFor(siglist, handler, signal, DEFAULT_TIMEOUT)) { + if(m_signalRecvQueue.waitFor(siglist, &handler, &signal, DEFAULT_TIMEOUT)) { if(handler->function != 0) (this->*handler->function)(signal); } } -}; - +} -EventLogger g_EventLogger; +extern EventLogger g_eventLogger; static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) @@ -151,7 +143,7 @@ MgmtSrvr::logLevelThreadRun() * Handle started nodes */ EventSubscribeReq req; - req = m_statisticsListner.m_clients[0].m_logLevel; + req = m_event_listner[0].m_logLevel; req.blockRef = _ownReference; SetLogLevelOrd ord; @@ -197,7 +189,7 @@ MgmtSrvr::logLevelThreadRun() void MgmtSrvr::startEventLog() { - g_EventLogger.setCategory("MgmSrvr"); + g_eventLogger.setCategory("MgmSrvr"); ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator ((ndb_mgm_configuration*)_config->m_configValues, CFG_SECTION_NODE); @@ -223,8 +215,9 @@ MgmtSrvr::startEventLog() logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6", clusterLog); } - if(!g_EventLogger.addHandler(logdest)) { - ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl; + if(!g_eventLogger.addHandler(logdest)) { + ndbout << "Warning: could not add log destination \"" + << logdest.c_str() << "\"" << endl; } } @@ -242,38 +235,29 @@ public: }; bool -MgmtSrvr::setEventLogFilter(int severity) +MgmtSrvr::setEventLogFilter(int severity, int enable) { - bool enabled = true; Logger::LoggerLevel level = (Logger::LoggerLevel)severity; - if (g_EventLogger.isEnable(level)) { - g_EventLogger.disable(level); - enabled = false; + if (enable > 0) { + g_eventLogger.enable(level); + } else if (enable == 0) { + g_eventLogger.disable(level); + } else if (g_eventLogger.isEnable(level)) { + g_eventLogger.disable(level); } else { - g_EventLogger.enable(level); + g_eventLogger.enable(level); } - - return enabled; + return g_eventLogger.isEnable(level); } bool MgmtSrvr::isEventLogFilterEnabled(int severity) { - return g_EventLogger.isEnable((Logger::LoggerLevel)severity); + return g_eventLogger.isEnable((Logger::LoggerLevel)severity); } static ErrorItem errorTable[] = { - {200, "Backup undefined error"}, - {202, "Backup failed to allocate buffers (check configuration)"}, - {203, "Backup failed to setup fs buffers (check configuration)"}, - {204, "Backup failed to allocate tables (check configuration)"}, - {205, "Backup failed to insert file header (check configuration)"}, - {206, "Backup failed to insert table list (check configuration)"}, - {207, "Backup failed to allocate table memory (check configuration)"}, - {208, "Backup failed to allocate file record (check configuration)"}, - {209, "Backup failed to allocate attribute record (check configuration)"}, - {MgmtSrvr::NO_CONTACT_WITH_PROCESS, "No contact with the process (dead ?)."}, {MgmtSrvr::PROCESS_NOT_CONFIGURED, "The process is not configured."}, {MgmtSrvr::WRONG_PROCESS_TYPE, @@ -399,22 +383,29 @@ MgmtSrvr::getPort() const { } /* Constructor */ -MgmtSrvr::MgmtSrvr(NodeId nodeId, - const BaseString &configFilename, - LocalConfig &local_config, - Config * config): +int MgmtSrvr::init() +{ + if ( _ownNodeId > 0) + return 0; + return -1; +} + +MgmtSrvr::MgmtSrvr(SocketServer *socket_server, + const char *config_filename, + const char *connect_string) : _blockNumber(1), // Hard coded block number since it makes it easy to send // signals to other management servers. + m_socket_server(socket_server), _ownReference(0), - m_local_config(local_config), - m_allocated_resources(*this), theSignalIdleList(NULL), theWaitState(WAIT_SUBSCRIBE_CONF), - m_statisticsListner(this) + m_event_listner(this) { DBUG_ENTER("MgmtSrvr::MgmtSrvr"); + _ownNodeId= 0; + _config = NULL; _isStopThread = false; @@ -425,12 +416,48 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, theFacade = 0; m_newConfig = NULL; - m_configFilename = configFilename; + if (config_filename) + m_configFilename.assign(config_filename); + else + m_configFilename.assign("config.ini"); m_nextConfigGenerationNumber = 0; - _config = (config == 0 ? readConfig() : config); - + m_config_retriever= new ConfigRetriever(connect_string, + NDB_VERSION, NDB_MGM_NODE_TYPE_MGM); + // if connect_string explicitly given or + // no config filename is given then + // first try to allocate nodeid from another management server + if ((connect_string || config_filename == NULL) && + (m_config_retriever->do_connect(0,0,0) == 0)) + { + int tmp_nodeid= 0; + tmp_nodeid= m_config_retriever->allocNodeId(0 /*retry*/,0 /*delay*/); + if (tmp_nodeid == 0) + { + ndbout_c(m_config_retriever->getErrorString()); + exit(-1); + } + // read config from other managent server + _config= fetchConfig(); + if (_config == 0) + { + ndbout << m_config_retriever->getErrorString() << endl; + exit(-1); + } + _ownNodeId= tmp_nodeid; + } + + if (_ownNodeId == 0) + { + // read config locally + _config= readConfig(); + if (_config == 0) { + ndbout << "Unable to read config file" << endl; + exit(-1); + } + } + theMgmtWaitForResponseCondPtr = NdbCondition_Create(); m_configMutex = NdbMutex_Create(); @@ -442,9 +469,11 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, nodeTypes[i] = (enum ndb_mgm_node_type)-1; m_connect_address[i].s_addr= 0; } + { - ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator - (config->m_configValues, CFG_SECTION_NODE); + ndb_mgm_configuration_iterator + *iter = ndb_mgm_create_configuration_iterator(_config->m_configValues, + CFG_SECTION_NODE); for(ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)){ unsigned type, id; if(ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, &type) != 0) @@ -477,69 +506,51 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, } _props = NULL; - _ownNodeId= 0; - NodeId tmp= nodeId; BaseString error_string; -#if 0 - char my_hostname[256]; - struct sockaddr_in tmp_addr; - SOCKET_SIZE_TYPE addrlen= sizeof(tmp_addr); - if (!g_no_nodeid_checks) { - if (gethostname(my_hostname, sizeof(my_hostname))) { - ndbout << "error: gethostname() - " << strerror(errno) << endl; - exit(-1); - } - if (Ndb_getInAddr(&(((sockaddr_in*)&tmp_addr)->sin_addr),my_hostname)) { - ndbout << "error: Ndb_getInAddr(" << my_hostname << ") - " - << strerror(errno) << endl; - exit(-1); - } - } - if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM, - (struct sockaddr *)&tmp_addr, - &addrlen, error_string)){ - ndbout << "Unable to obtain requested nodeid: " - << error_string.c_str() << endl; - exit(-1); - } -#else - if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM, - 0, 0, error_string)){ - ndbout << "Unable to obtain requested nodeid: " - << error_string.c_str() << endl; + + if ((m_node_id_mutex = NdbMutex_Create()) == 0) + { + ndbout << "mutex creation failed line = " << __LINE__ << endl; exit(-1); } -#endif - _ownNodeId = tmp; + if (_ownNodeId == 0) // we did not get node id from other server + { + NodeId tmp= m_config_retriever->get_configuration_nodeid(); + + if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM, + 0, 0, error_string)){ + ndbout << "Unable to obtain requested nodeid: " + << error_string.c_str() << endl; + exit(-1); + } + _ownNodeId = tmp; + } { DBUG_PRINT("info", ("verifyConfig")); - ConfigRetriever cr(m_local_config, NDB_VERSION, NDB_MGM_NODE_TYPE_MGM); - if (!cr.verifyConfig(config->m_configValues, _ownNodeId)) { - ndbout << cr.getErrorString() << endl; + if (!m_config_retriever->verifyConfig(_config->m_configValues, + _ownNodeId)) + { + ndbout << m_config_retriever->getErrorString() << endl; exit(-1); } } + // Setup clusterlog as client[0] in m_event_listner { - MgmStatService::StatListener se; - se.m_socket = -1; + Ndb_mgmd_event_service::Event_listener se; + se.m_socket = NDB_INVALID_SOCKET; for(size_t t = 0; t<LogLevel::LOGLEVEL_CATEGORIES; t++){ se.m_logLevel.setLogLevel((LogLevel::EventCategory)t, 7); } se.m_logLevel.setLogLevel(LogLevel::llError, 15); + se.m_logLevel.setLogLevel(LogLevel::llConnection, 8); se.m_logLevel.setLogLevel(LogLevel::llBackup, 15); - m_statisticsListner.m_clients.push_back(se); - m_statisticsListner.m_logLevel = se.m_logLevel; + m_event_listner.m_clients.push_back(se); + m_event_listner.m_logLevel = se.m_logLevel; } - if ((m_node_id_mutex = NdbMutex_Create()) == 0) - { - ndbout << "mutex creation failed line = " << __LINE__ << endl; - exit(-1); - } - DBUG_VOID_RETURN; } @@ -656,6 +667,8 @@ MgmtSrvr::~MgmtSrvr() NdbThread_WaitFor(m_signalRecvThread, &res); NdbThread_Destroy(&m_signalRecvThread); } + if (m_config_retriever) + delete m_config_retriever; } //**************************************************************************** @@ -1829,18 +1842,21 @@ MgmtSrvr::dumpState(int processId, const Uint32 args[], Uint32 no) //**************************************************************************** //**************************************************************************** -const char* MgmtSrvr::getErrorText(int errorCode) +const char* MgmtSrvr::getErrorText(int errorCode, char *buf, int buf_sz) { - static char text[255]; for (int i = 0; i < noOfErrorCodes; ++i) { if (errorCode == errorTable[i]._errorCode) { - return errorTable[i]._errorText; + BaseString::snprintf(buf, buf_sz, errorTable[i]._errorText); + buf[buf_sz-1]= 0; + return buf; } } - - BaseString::snprintf(text, 255, "Unknown management server error code %d", errorCode); - return text; + + ndb_error_string(errorCode, buf, buf_sz); + buf[buf_sz-1]= 0; + + return buf; } void @@ -1963,7 +1979,7 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal) } default: - g_EventLogger.error("Unknown signal received. SignalNumber: " + g_eventLogger.error("Unknown signal received. SignalNumber: " "%i from (%d, %x)", gsn, refToNode(signal->theSendersBlockRef), @@ -2039,7 +2055,7 @@ MgmtSrvr::handleStopReply(NodeId nodeId, Uint32 errCode) error: if(errCode != 0){ - g_EventLogger.error("Unexpected signal received. SignalNumber: %i from %d", + g_eventLogger.error("Unexpected signal received. SignalNumber: %i from %d", GSN_STOP_REF, nodeId); } } @@ -2047,21 +2063,18 @@ MgmtSrvr::handleStopReply(NodeId nodeId, Uint32 errCode) void MgmtSrvr::handleStatus(NodeId nodeId, bool alive) { + DBUG_ENTER("MgmtSrvr::handleStatus"); + Uint32 theData[25]; + theData[1] = nodeId; if (alive) { m_started_nodes.push_back(nodeId); - Uint32 theData[25]; theData[0] = EventReport::Connected; - theData[1] = nodeId; - eventReport(_ownNodeId, theData); } else { handleStopReply(nodeId, 0); - - Uint32 theData[25]; theData[0] = EventReport::Disconnected; - theData[1] = nodeId; - - eventReport(_ownNodeId, theData); } + eventReport(_ownNodeId, theData); + DBUG_VOID_RETURN; } //**************************************************************************** @@ -2082,8 +2095,11 @@ void MgmtSrvr::nodeStatusNotification(void* mgmSrv, Uint32 nodeId, bool alive, bool nfComplete) { + DBUG_ENTER("MgmtSrvr::nodeStatusNotification"); + DBUG_PRINT("enter",("nodeid= %d, alive= %d, nfComplete= %d", nodeId, alive, nfComplete)); if(!(!alive && nfComplete)) ((MgmtSrvr*)mgmSrv)->handleStatus(nodeId, alive); + DBUG_VOID_RETURN; } enum ndb_mgm_node_type @@ -2095,6 +2111,25 @@ MgmtSrvr::getNodeType(NodeId nodeId) const return nodeTypes[nodeId]; } +void +MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const +{ + if (theFacade && theFacade->theClusterMgr) + { + for(Uint32 i = 0; i < MAX_NODES; i++) + { + if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB) + { + const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(i); + if (node.connected) + { + connected_nodes.bitOR(node.m_state.m_connected_nodes); + } + } + } + } +} + bool MgmtSrvr::alloc_node_id(NodeId * nodeId, enum ndb_mgm_node_type type, @@ -2107,7 +2142,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, *nodeId, type, client_addr)); if (g_no_nodeid_checks) { if (*nodeId == 0) { - error_string.appfmt("no-nodeid-ckecks set in manegment server.\n" + error_string.appfmt("no-nodeid-checks set in management server.\n" "node id must be set explicitly in connectstring"); DBUG_RETURN(false); } @@ -2116,16 +2151,11 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, Guard g(m_node_id_mutex); int no_mgm= 0; NodeBitmask connected_nodes(m_reserved_nodes); - for(Uint32 i = 0; i < MAX_NODES; i++) + get_connected_nodes(connected_nodes); { - if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB && - theFacade && theFacade->theClusterMgr) { - const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(i); - if (node.connected) { - connected_nodes.bitOR(node.m_state.m_connected_nodes); - } - } else if (getNodeType(i) == NDB_MGM_NODE_TYPE_MGM) - no_mgm++; + for(Uint32 i = 0; i < MAX_NODES; i++) + if (getNodeType(i) == NDB_MGM_NODE_TYPE_MGM) + no_mgm++; } bool found_matching_id= false; bool found_matching_type= false; @@ -2184,6 +2214,18 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, if (*nodeId != 0 || type != NDB_MGM_NODE_TYPE_MGM || no_mgm == 1) { // any match is ok + + if (config_hostname == 0 && + *nodeId == 0 && + type != NDB_MGM_NODE_TYPE_MGM) + { + if (!id_found) // only set if not set earlier + id_found= tmp; + continue; /* continue looking for a nodeid with specified + * hostname + */ + } + assert(id_found == 0); id_found= tmp; break; } @@ -2228,6 +2270,10 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, m_connect_address[id_found].s_addr= 0; } m_reserved_nodes.set(id_found); + char tmp_str[128]; + m_reserved_nodes.getText(tmp_str); + g_eventLogger.info("Mgmt server state: nodeid %d reserved for ip %s, m_reserved_nodes %s.", + id_found, get_connect_address(id_found), tmp_str); DBUG_RETURN(true); } @@ -2252,8 +2298,9 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, if (found_matching_type) if (found_free_node) error_string.appfmt("Connection done from wrong host ip %s.", - inet_ntoa(((struct sockaddr_in *) - (client_addr))->sin_addr)); + (client_addr)? + inet_ntoa(((struct sockaddr_in *) + (client_addr))->sin_addr):""); else error_string.appfmt("No free node id found for %s.", type_string.c_str()); @@ -2284,6 +2331,36 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, error_string.appfmt("No node defined with id=%d in config file.", *nodeId); } + + g_eventLogger.warning("Allocate nodeid (%d) failed. Connection from ip %s. " + "Returned error string \"%s\"", + *nodeId, + client_addr != 0 ? inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr) : "<none>", + error_string.c_str()); + + NodeBitmask connected_nodes2; + get_connected_nodes(connected_nodes2); + { + BaseString tmp_connected, tmp_not_connected; + for(Uint32 i = 0; i < MAX_NODES; i++) + { + if (connected_nodes2.get(i)) + { + if (!m_reserved_nodes.get(i)) + tmp_connected.appfmt(" %d", i); + } + else if (m_reserved_nodes.get(i)) + { + tmp_not_connected.appfmt(" %d", i); + } + } + if (tmp_connected.length() > 0) + g_eventLogger.info("Mgmt server state: node id's %s connected but not reserved", + tmp_connected.c_str()); + if (tmp_not_connected.length() > 0) + g_eventLogger.info("Mgmt server state: node id's %s not connected but reserved", + tmp_not_connected.c_str()); + } DBUG_RETURN(false); } @@ -2313,16 +2390,16 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData) EventReport::EventType type = eventReport->getEventType(); // Log event - g_EventLogger.log(type, theData, nodeId, - &m_statisticsListner.m_clients[0].m_logLevel); - m_statisticsListner.log(type, theData, nodeId); + g_eventLogger.log(type, theData, nodeId, + &m_event_listner[0].m_logLevel); + m_event_listner.log(type, theData, nodeId); } /*************************************************************************** * Backup ***************************************************************************/ int -MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted) +MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) { bool next; NodeId nodeId = 0; @@ -2344,11 +2421,16 @@ MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted) req->backupDataLen = 0; int result; - if (waitCompleted) { - result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, signal, true); + if (waitCompleted == 2) { + result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, + signal, true, 30*60*1000 /*30 secs*/); + } + else if (waitCompleted == 1) { + result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, + signal, true, 5*60*1000 /*5 mins*/); } else { - result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, signal, true); + result = sendRecSignal(nodeId, NO_WAIT, signal, true); } if (result == -1) { return SEND_OR_RECEIVE_FAILED; @@ -2427,18 +2509,31 @@ MgmtSrvr::abortBackup(Uint32 backupId) void MgmtSrvr::backupCallback(BackupEvent & event) { + DBUG_ENTER("MgmtSrvr::backupCallback"); m_lastBackupEvent = event; switch(event.Event){ case BackupEvent::BackupFailedToStart: + DBUG_PRINT("info",("BackupEvent::BackupFailedToStart")); + theWaitState = NO_WAIT; + break; case BackupEvent::BackupAborted: + DBUG_PRINT("info",("BackupEvent::BackupAborted")); + theWaitState = NO_WAIT; + break; case BackupEvent::BackupCompleted: + DBUG_PRINT("info",("BackupEvent::BackupCompleted")); theWaitState = NO_WAIT; break; case BackupEvent::BackupStarted: if(theWaitState == WAIT_BACKUP_STARTED) + { + DBUG_PRINT("info",("BackupEvent::BackupStarted NO_WAIT")); theWaitState = NO_WAIT; + } else { + DBUG_PRINT("info",("BackupEvent::BackupStarted")); + } } - return; + DBUG_VOID_RETURN; } @@ -2532,10 +2627,15 @@ MgmtSrvr::Allocated_resources::~Allocated_resources() { Guard g(m_mgmsrv.m_node_id_mutex); if (!m_reserved_nodes.isclear()) { + m_mgmsrv.m_reserved_nodes.bitANDC(m_reserved_nodes); // node has been reserved, force update signal to ndb nodes global_flag_send_heartbeat_now= 1; + + char tmp_str[128]; + m_mgmsrv.m_reserved_nodes.getText(tmp_str); + g_eventLogger.info("Mgmt server state: nodeid %d freed, m_reserved_nodes %s.", + get_nodeid(), tmp_str); } - m_mgmsrv.m_reserved_nodes.bitANDC(m_reserved_nodes); } void @@ -2544,6 +2644,17 @@ MgmtSrvr::Allocated_resources::reserve_node(NodeId id) m_reserved_nodes.set(id); } +NodeId +MgmtSrvr::Allocated_resources::get_nodeid() const +{ + for(Uint32 i = 0; i < MAX_NODES; i++) + { + if (m_reserved_nodes.get(i)) + return i; + } + return 0; +} + int MgmtSrvr::setDbParameter(int node, int param, const char * value, BaseString& msg){ @@ -2586,7 +2697,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value, int p_type; unsigned val_32; - unsigned long long val_64; + Uint64 val_64; const char * val_char; do { p_type = 0; @@ -2648,9 +2759,9 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value, template class Vector<SigMatch>; #if __SUNPRO_CC != 0x560 -template bool SignalQueue::waitFor<SigMatch>(Vector<SigMatch>&, SigMatch*&, NdbApiSignal*&, unsigned); +template bool SignalQueue::waitFor<SigMatch>(Vector<SigMatch>&, SigMatch**, NdbApiSignal**, unsigned); #endif template class MutexVector<unsigned short>; -template class MutexVector<MgmStatService::StatListener>; +template class MutexVector<Ndb_mgmd_event_service::Event_listener>; template class MutexVector<EventSubscribeReq>; diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index a5f21b6bc4a..6378e763363 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -43,27 +43,34 @@ class Config; class SetLogLevelOrd; class SocketServer; -class MgmStatService : public EventLoggerBase +class Ndb_mgmd_event_service : public EventLoggerBase { friend class MgmtSrvr; public: - struct StatListener : public EventLoggerBase { + struct Event_listener : public EventLoggerBase { NDB_SOCKET_TYPE m_socket; }; private: class MgmtSrvr * m_mgmsrv; - MutexVector<StatListener> m_clients; + MutexVector<Event_listener> m_clients; public: - MgmStatService(class MgmtSrvr * m) : m_clients(5) { + Ndb_mgmd_event_service(class MgmtSrvr * m) : m_clients(5) { m_mgmsrv = m; } - void add_listener(const StatListener&); + void add_listener(const Event_listener&); + void update_max_log_level(const LogLevel&); + void update_log_level(const LogLevel&); void log(int eventType, const Uint32* theData, NodeId nodeId); - void stopSessions(); + void stop_sessions(); + + Event_listener& operator[](unsigned i) { return m_clients[i]; } + const Event_listener& operator[](unsigned i) const { return m_clients[i]; } + void lock() { m_clients.lock(); } + void unlock(){ m_clients.unlock(); } }; /** @@ -96,7 +103,10 @@ public: // methods to reserve/allocate resources which // will be freed when running destructor void reserve_node(NodeId id); - bool is_reserved(NodeId nodeId) { return m_reserved_nodes.get(nodeId);} + bool is_reserved(NodeId nodeId) { return m_reserved_nodes.get(nodeId); } + bool is_reserved(NodeBitmask mask) { return !mask.bitAND(m_reserved_nodes).isclear(); } + bool isclear() { return m_reserved_nodes.isclear(); } + NodeId get_nodeid() const; private: MgmtSrvr &m_mgmsrv; NodeBitmask m_reserved_nodes; @@ -119,7 +129,7 @@ public: * @param serverity the log level/serverity. * @return true if the severity was enabled. */ - bool setEventLogFilter(int severity); + bool setEventLogFilter(int severity, int enable); /** * Returns true if the log level/severity is enabled. @@ -172,10 +182,10 @@ public: /* Constructor */ - MgmtSrvr(NodeId nodeId, /* Local nodeid */ - const BaseString &config_filename, /* Where to save config */ - LocalConfig &local_config, /* Ndb.cfg filename */ - Config * config); + MgmtSrvr(SocketServer *socket_server, + const char *config_filename, /* Where to save config */ + const char *connect_string); + int init(); NodeId getOwnNodeId() const {return _ownNodeId;}; /** @@ -354,7 +364,7 @@ public: /** * Backup functionallity */ - int startBackup(Uint32& backupId, bool waitCompleted = false); + int startBackup(Uint32& backupId, int waitCompleted= 2); int abortBackup(Uint32 backupId); int performBackup(Uint32* backupId); @@ -463,7 +473,7 @@ public: * @param errorCode: Error code to get a match error text for. * @return The error text. */ - const char* getErrorText(int errorCode); + const char* getErrorText(int errorCode, char *buf, int buf_sz); /** * Get configuration @@ -499,6 +509,9 @@ public: int setDbParameter(int node, int parameter, const char * value, BaseString&); const char *get_connect_address(Uint32 node_id) { return inet_ntoa(m_connect_address[node_id]); } + void get_connected_nodes(NodeBitmask &connected_nodes) const; + SocketServer *get_socket_server() { return m_socket_server; } + //************************************************************************** private: //************************************************************************** @@ -525,16 +538,16 @@ private: int _blockNumber; NodeId _ownNodeId; + SocketServer *m_socket_server; + BlockReference _ownReference; NdbMutex *m_configMutex; const Config * _config; Config * m_newConfig; - LocalConfig &m_local_config; BaseString m_configFilename; Uint32 m_nextConfigGenerationNumber; NodeBitmask m_reserved_nodes; - Allocated_resources m_allocated_resources; struct in_addr m_connect_address[MAX_NODES]; //************************************************************************** @@ -655,7 +668,7 @@ private: */ static void signalReceivedNotification(void* mgmtSrvr, NdbApiSignal* signal, - class LinearSectionPtr ptr[3]); + struct LinearSectionPtr ptr[3]); /** * Called from "outside" of MgmtSrvr when a DB process has died. @@ -726,8 +739,8 @@ private: LogLevel m_nodeLogLevel[MAX_NODES]; enum ndb_mgm_node_type nodeTypes[MAX_NODES]; friend class MgmApiSession; - friend class MgmStatService; - MgmStatService m_statisticsListner; + friend class Ndb_mgmd_event_service; + Ndb_mgmd_event_service m_event_listner; /** * Handles the thread wich upon a 'Node is started' event will @@ -747,6 +760,9 @@ private: Config *_props; int send(class NdbApiSignal* signal, Uint32 node, Uint32 node_type); + + ConfigRetriever *m_config_retriever; + public: /** * This method does not exist diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp index 1d51061e909..6c4b4e9ae3c 100644 --- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp @@ -272,30 +272,20 @@ MgmtSrvr::saveConfig(const Config *conf) { Config * MgmtSrvr::readConfig() { - Config *conf = NULL; - if(m_configFilename.length() != 0) { - /* Use config file */ - InitConfigFileParser parser; - conf = parser.parseConfig(m_configFilename.c_str()); - - if(conf == NULL) { - /* Try to get configuration from other MGM server */ - return fetchConfig(); - } - } + Config *conf; + InitConfigFileParser parser; + conf = parser.parseConfig(m_configFilename.c_str()); return conf; } Config * MgmtSrvr::fetchConfig() { - ConfigRetriever cr(m_local_config, NDB_VERSION, NODE_TYPE_MGM); - struct ndb_mgm_configuration * tmp = cr.getConfig(); + struct ndb_mgm_configuration * tmp = m_config_retriever->getConfig(); if(tmp != 0){ Config * conf = new Config(); conf->m_configValues = tmp; return conf; } - return 0; } diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5b552836955..8ba8c2fe87e 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -29,7 +29,7 @@ #include <ConfigValues.hpp> #include <mgmapi_configuration.hpp> - +#include <Vector.hpp> #include "Services.hpp" extern bool g_StopServer; @@ -132,6 +132,7 @@ ParserRow<MgmApiSession> commands[] = { MGM_ARG("user", String, Mandatory, "Password"), MGM_ARG("password", String, Mandatory, "Password"), MGM_ARG("public key", String, Mandatory, "Public key"), + MGM_ARG("endian", String, Optional, "Endianness"), MGM_CMD("get version", &MgmApiSession::getVersion, ""), @@ -175,6 +176,7 @@ ParserRow<MgmApiSession> commands[] = { MGM_ARG("args", String, Mandatory, "Args(space separated int's)"), MGM_CMD("start backup", &MgmApiSession::startBackup, ""), + MGM_ARG("completed", Int, Optional ,"Wait until completed"), MGM_CMD("abort backup", &MgmApiSession::abortBackup, ""), MGM_ARG("id", Int, Mandatory, "Backup id"), @@ -207,16 +209,17 @@ ParserRow<MgmApiSession> commands[] = { MGM_CMD("set loglevel", &MgmApiSession::setLogLevel, ""), MGM_ARG("node", Int, Mandatory, "Node"), - MGM_ARG("category", String, Mandatory, "Event category"), + MGM_ARG("category", Int, Mandatory, "Event category"), MGM_ARG("level", Int, Mandatory, "Log level (0-15)"), MGM_CMD("set cluster loglevel", &MgmApiSession::setClusterLogLevel, ""), MGM_ARG("node", Int, Mandatory, "Node"), - MGM_ARG("category", String, Mandatory, "Event category"), + MGM_ARG("category", Int, Mandatory, "Event category"), MGM_ARG("level", Int, Mandatory, "Log level (0-15)"), MGM_CMD("set logfilter", &MgmApiSession::setLogFilter, ""), MGM_ARG("level", Int, Mandatory, "Severety level"), + MGM_ARG("enable", Int, Mandatory, "1=disable, 0=enable, -1=toggle"), MGM_CMD("config lock", &MgmApiSession::configLock, ""), @@ -242,6 +245,10 @@ ParserRow<MgmApiSession> commands[] = { MGM_ARG("node", Int, Optional, "Node"), MGM_ARG("filter", String, Mandatory, "Event category"), + MGM_CMD("purge stale sessions", &MgmApiSession::purge_stale_sessions, ""), + + MGM_CMD("check connection", &MgmApiSession::check_connection, ""), + MGM_END() }; @@ -280,8 +287,8 @@ MgmApiSession::runSession() { /* Backwards compatibility for old NDBs that still use * the old "GET CONFIG" command. */ - - for(size_t i=0; i<strlen(ctx.m_currentToken); i++) + size_t i; + for(i=0; i<strlen(ctx.m_currentToken); i++) ctx.m_currentToken[i] = toupper(ctx.m_currentToken[i]); if(strncmp("GET CONFIG ", @@ -382,6 +389,8 @@ MgmApiSession::get_nodeid(Parser_t::Context &, const char * user; const char * password; const char * public_key; + const char * endian= NULL; + union { long l; char c[sizeof(long)]; } endian_check; args.get("version", &version); args.get("nodetype", &nodetype); @@ -390,7 +399,17 @@ MgmApiSession::get_nodeid(Parser_t::Context &, args.get("user", &user); args.get("password", &password); args.get("public key", &public_key); - + args.get("endian", &endian); + + endian_check.l = 1; + if(endian + && strcmp(endian,(endian_check.c[sizeof(long)-1])?"big":"little")!=0) { + m_output->println(cmd); + m_output->println("result: Node does not have the same endianness as the management server."); + m_output->println(""); + return; + } + bool compatible; switch (nodetype) { case NODE_TYPE_MGM: @@ -577,7 +596,7 @@ MgmApiSession::insertError(Parser<MgmApiSession>::Context &, m_output->println("insert error reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -595,7 +614,7 @@ MgmApiSession::setTrace(Parser<MgmApiSession>::Context &, m_output->println("set trace reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -611,85 +630,30 @@ MgmApiSession::getVersion(Parser<MgmApiSession>::Context &, m_output->println("string: %s", NDB_VERSION_STRING); m_output->println(""); } -#if 0 - -/***************************************************************************** - * BACKUP - *****************************************************************************/ - -int completed; -MgmtSrvr::BackupEvent globalEvent; - -static void -completedCallback(const MgmtSrvr::BackupEvent & event){ - - ndbout << "WaitCallback" << endl; - // Save event in the latestEvent var - - switch(event.Event){ - case MgmtSrvr::BackupEvent::BackupCompleted: - case MgmtSrvr::BackupEvent::BackupFailedToStart: - globalEvent = event; - completed = 1; - break; - } -} void MgmApiSession::startBackup(Parser<MgmApiSession>::Context &, - Properties const &) { + Properties const &args) { + DBUG_ENTER("MgmApiSession::startBackup"); unsigned backupId; + Uint32 completed= 2; int result; - MgmtSrvr::BackupCallback prevCallback; - prevCallback = m_mgmsrv.setCallback(completedCallback); - completed = 0; - result = m_mgmsrv.startBackup(backupId); - if (result == 0){ - - // Wait for the callback to call our condition - // waitFor(); - while (completed == 0) - NdbSleep_SecSleep(0); - - if (globalEvent.Event == MgmtSrvr::BackupEvent::BackupFailedToStart) - result = globalEvent.FailedToStart.ErrorCode; - else - backupId = globalEvent.Completed.BackupId; - } + args.get("completed", &completed); - // restore old callback - m_mgmsrv.setCallback(prevCallback); + result = m_mgmsrv.startBackup(backupId, completed); m_output->println("start backup reply"); if(result != 0) - m_output->println("result: %s(%d)", m_mgmsrv.getErrorText(result), result); - else{ - m_output->println("result: Ok"); - m_output->println("id: %d", backupId); + { + m_output->println("result: %s", get_error_text(result)); } - m_output->println(""); - -} -#endif - -void -MgmApiSession::startBackup(Parser<MgmApiSession>::Context &, - Properties const &) { - unsigned backupId; - int result; - - result = m_mgmsrv.startBackup(backupId, true); - - m_output->println("start backup reply"); - if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); else{ m_output->println("result: Ok"); m_output->println("id: %d", backupId); } m_output->println(""); - + DBUG_VOID_RETURN; } void @@ -703,7 +667,7 @@ MgmApiSession::abortBackup(Parser<MgmApiSession>::Context &, m_output->println("abort backup reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -725,7 +689,7 @@ MgmApiSession::repCommand(Parser<MgmApiSession>::Context &, m_output->println("global replication reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else{ m_output->println("result: Ok"); m_output->println("id: %d", repReqId); @@ -747,7 +711,7 @@ MgmApiSession::dumpState(Parser<MgmApiSession>::Context &, int result = m_mgmsrv.dumpState(node, args_str.c_str()); m_output->println("dump state reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -763,68 +727,84 @@ MgmApiSession::bye(Parser<MgmApiSession>::Context &, void MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &, Properties const &args) { - Uint32 node, level, category; + const char *reply= "set cluster loglevel reply"; + Uint32 node, level, cat; BaseString errorString; SetLogLevelOrd logLevel; int result; + DBUG_ENTER("MgmApiSession::setClusterLogLevel"); args.get("node", &node); - args.get("category", &category); + args.get("category", &cat); args.get("level", &level); + DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level)); + /* XXX should use constants for this value */ if(level > 15) { - errorString.assign("Invalied loglevel"); - goto error; + m_output->println(reply); + m_output->println("result: Invalid loglevel %d", level); + m_output->println(""); + DBUG_VOID_RETURN; } - EventSubscribeReq req; - req.blockRef = 0; - req.noOfEntries = 1; - req.theData[0] = (category << 16) | level; - m_mgmsrv.m_log_level_requests.push_back(req); - - m_output->println("set cluster loglevel reply"); + LogLevel::EventCategory category= + (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + + m_mgmsrv.m_event_listner.lock(); + if (m_mgmsrv.m_event_listner[0].m_logLevel.setLogLevel(category,level)) + { + m_output->println(reply); + m_output->println("result: Invalid category %d", category); + m_output->println(""); + m_mgmsrv.m_event_listner.unlock(); + DBUG_VOID_RETURN; + } + m_mgmsrv.m_event_listner.unlock(); + + { + LogLevel ll; + ll.setLogLevel(category,level); + m_mgmsrv.m_event_listner.update_max_log_level(ll); + } + + m_output->println(reply); m_output->println("result: Ok"); m_output->println(""); - return; -error: - m_output->println("set cluster loglevel reply"); - m_output->println("result: %s", errorString.c_str()); - m_output->println(""); + DBUG_VOID_RETURN; } void MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &, Properties const &args) { - Uint32 node = 0, level = 0, category; + Uint32 node = 0, level = 0, cat; BaseString errorString; SetLogLevelOrd logLevel; int result; logLevel.clear(); args.get("node", &node); - args.get("category", &category); + args.get("category", &cat); args.get("level", &level); /* XXX should use constants for this value */ if(level > 15) { - errorString.assign("Invalied loglevel"); - goto error; + m_output->println("set loglevel reply"); + m_output->println("result: Invalid loglevel", errorString.c_str()); + m_output->println(""); + return; + } + + LogLevel::EventCategory category= + (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + + { + LogLevel ll; + ll.setLogLevel(category,level); + m_mgmsrv.m_event_listner.update_max_log_level(ll); } - EventSubscribeReq req; - req.blockRef = node; - req.noOfEntries = 1; - req.theData[0] = (category << 16) | level; - m_mgmsrv.m_log_level_requests.push_back(req); - m_output->println("set loglevel reply"); m_output->println("result: Ok"); m_output->println(""); - return; - error: - m_output->println("set loglevel reply"); - m_output->println("result: %s", errorString.c_str()); - m_output->println(""); } void @@ -838,7 +818,7 @@ MgmApiSession::stopSignalLog(Parser<MgmApiSession>::Context &, m_output->println("stop signallog"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -878,7 +858,7 @@ MgmApiSession::restart(Parser<MgmApiSession>::Context &, m_output->println("restart reply"); if(result != 0){ - m_output->println("result: %d-%s", result, m_mgmsrv.getErrorText(result)); + m_output->println("result: %d-%s", result, get_error_text(result)); } else m_output->println("result: Ok"); m_output->println("restarted: %d", restarted); @@ -902,7 +882,7 @@ MgmApiSession::restartAll(Parser<MgmApiSession>::Context &, m_output->println("restart reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println("restarted: %d", count); @@ -1033,7 +1013,7 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &, m_output->println("stop reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println("stopped: %d", stopped); @@ -1055,7 +1035,7 @@ MgmApiSession::stopAll(Parser<MgmApiSession>::Context &, m_output->println("stop reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println("stopped: %d", stopped); @@ -1071,7 +1051,7 @@ MgmApiSession::enterSingleUser(Parser<MgmApiSession>::Context &, int result = m_mgmsrv.enterSingleUser(&stopped, nodeId); m_output->println("enter single user reply"); if(result != 0) { - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); } else { m_output->println("result: Ok"); @@ -1086,7 +1066,7 @@ MgmApiSession::exitSingleUser(Parser<MgmApiSession>::Context &, int result = m_mgmsrv.exitSingleUser(&stopped, false); m_output->println("exit single user reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -1104,7 +1084,7 @@ MgmApiSession::startSignalLog(Parser<MgmApiSession>::Context &, m_output->println("start signallog reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -1149,7 +1129,7 @@ MgmApiSession::logSignals(Parser<MgmApiSession>::Context &, m_output->println("log signals reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -1166,7 +1146,7 @@ MgmApiSession::start(Parser<MgmApiSession>::Context &, m_output->println("start reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -1192,10 +1172,12 @@ void MgmApiSession::setLogFilter(Parser_t::Context &ctx, const class Properties &args) { Uint32 level; + Uint32 enable; args.get("level", &level); + args.get("enable", &enable); - int result = m_mgmsrv.setEventLogFilter(level); + int result = m_mgmsrv.setEventLogFilter(level, enable); m_output->println("set logfilter reply"); m_output->println("result: %d", result); @@ -1249,21 +1231,17 @@ operator<<(NdbOut& out, const LogLevel & ll) } void -MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ +Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId){ - Uint32 threshold = 0; - LogLevel::EventCategory cat= LogLevel::llInvalid; + Uint32 threshold; + LogLevel::EventCategory cat; + Logger::LoggerLevel severity; int i; + DBUG_ENTER("Ndb_mgmd_event_service::log"); + DBUG_PRINT("enter",("eventType=%d, nodeid=%d", eventType, nodeId)); - for(i = 0; (unsigned)i<EventLogger::matrixSize; i++){ - if(EventLogger::matrix[i].eventType == eventType){ - cat = EventLogger::matrix[i].eventCategory; - threshold = EventLogger::matrix[i].threshold; - break; - } - } - if (cat == LogLevel::llInvalid) - return; + if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity)) + DBUG_VOID_RETURN; char m_text[256]; EventLogger::getText(m_text, sizeof(m_text), eventType, theData, nodeId); @@ -1272,7 +1250,7 @@ MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ m_clients.lock(); for(i = m_clients.size() - 1; i >= 0; i--){ if(threshold <= m_clients[i].m_logLevel.getLogLevel(cat)){ - if(m_clients[i].m_socket >= 0 && + if(m_clients[i].m_socket != NDB_INVALID_SOCKET && println_socket(m_clients[i].m_socket, MAX_WRITE_TIMEOUT, m_text) == -1){ copy.push_back(m_clients[i].m_socket); @@ -1293,23 +1271,22 @@ MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ tmp.set_max(m_clients[i].m_logLevel); } m_clients.unlock(); - - if(!(tmp == m_logLevel)){ - m_logLevel = tmp; - EventSubscribeReq req; - req = tmp; - req.blockRef = 0; - m_mgmsrv->m_log_level_requests.push_back(req); - } + update_log_level(tmp); } + DBUG_VOID_RETURN; } void -MgmStatService::add_listener(const StatListener& client){ - m_clients.push_back(client); - LogLevel tmp = m_logLevel; - tmp.set_max(client.m_logLevel); - +Ndb_mgmd_event_service::update_max_log_level(const LogLevel &log_level) +{ + LogLevel tmp= m_logLevel; + tmp.set_max(log_level); + update_log_level(tmp); +} + +void +Ndb_mgmd_event_service::update_log_level(const LogLevel &tmp) +{ if(!(tmp == m_logLevel)){ m_logLevel = tmp; EventSubscribeReq req; @@ -1320,13 +1297,21 @@ MgmStatService::add_listener(const StatListener& client){ } void -MgmStatService::stopSessions(){ +Ndb_mgmd_event_service::add_listener(const Event_listener& client){ + m_clients.push_back(client); + update_max_log_level(client.m_logLevel); +} + +void +Ndb_mgmd_event_service::stop_sessions(){ + m_clients.lock(); for(int i = m_clients.size() - 1; i >= 0; i--){ - if(m_clients[i].m_socket >= 0){ + if(m_clients[i].m_socket != NDB_INVALID_SOCKET){ NDB_CLOSE_SOCKET(m_clients[i].m_socket); m_clients.erase(i); } } + m_clients.unlock(); } void @@ -1360,7 +1345,7 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx, int result = 0; BaseString msg; - MgmStatService::StatListener le; + Ndb_mgmd_event_service::Event_listener le; le.m_socket = m_socket; Vector<BaseString> list; @@ -1405,10 +1390,10 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx, goto done; } - m_mgmsrv.m_statisticsListner.add_listener(le); + m_mgmsrv.m_event_listner.add_listener(le); m_stop = true; - m_socket = -1; + m_socket = NDB_INVALID_SOCKET; done: m_output->println("listen event"); @@ -1418,6 +1403,55 @@ done: m_output->println(""); } +struct PurgeStruct +{ + NodeBitmask free_nodes;/* free nodes as reported + * by ndbd in apiRegReqConf + */ + BaseString *str; +}; + +void +MgmApiSession::stop_session_if_not_connected(SocketServer::Session *_s, void *data) +{ + MgmApiSession *s= (MgmApiSession *)_s; + struct PurgeStruct &ps= *(struct PurgeStruct *)data; + if (s->m_allocated_resources->is_reserved(ps.free_nodes)) + { + ps.str->appfmt(" %d", s->m_allocated_resources->get_nodeid()); + s->stopSession(); + } +} + +void +MgmApiSession::purge_stale_sessions(Parser_t::Context &ctx, + const class Properties &args) +{ + struct PurgeStruct ps; + BaseString str; + ps.str = &str; + + m_mgmsrv.get_connected_nodes(ps.free_nodes); + ps.free_nodes.bitXORC(NodeBitmask()); // invert connected_nodes to get free nodes + + m_mgmsrv.get_socket_server()->foreachSession(stop_session_if_not_connected,&ps); + + m_output->println("purge stale sessions reply"); + if (str.length() > 0) + m_output->println("purged:%s",str.c_str()); + m_output->println("result: Ok"); + m_output->println(""); +} + +void +MgmApiSession::check_connection(Parser_t::Context &ctx, + const class Properties &args) +{ + m_output->println("check connection reply"); + m_output->println("result: Ok"); + m_output->println(""); +} + template class MutexVector<int>; template class Vector<ParserRow<MgmApiSession> const*>; template class Vector<unsigned short>; diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp index e47820826b6..8627343b1cf 100644 --- a/ndb/src/mgmsrv/Services.hpp +++ b/ndb/src/mgmsrv/Services.hpp @@ -28,7 +28,9 @@ /** Undefine this to remove backwards compatibility for "GET CONFIG". */ #define MGM_GET_CONFIG_BACKWARDS_COMPAT -class MgmApiSession : public SocketServer::Session { +class MgmApiSession : public SocketServer::Session +{ + static void stop_session_if_not_connected(SocketServer::Session *_s, void *data); private: typedef Parser<MgmApiSession> Parser_t; @@ -37,10 +39,13 @@ private: OutputStream *m_output; Parser_t *m_parser; MgmtSrvr::Allocated_resources *m_allocated_resources; + char m_err_str[1024]; void getConfig_common(Parser_t::Context &ctx, const class Properties &args, bool compat = false); + const char *get_error_text(int err_no) + { return m_mgmsrv.getErrorText(err_no, m_err_str, sizeof(m_err_str)); } public: MgmApiSession(class MgmtSrvr & mgm, NDB_SOCKET_TYPE sock); @@ -84,6 +89,9 @@ public: void setParameter(Parser_t::Context &ctx, const class Properties &args); void listen_event(Parser_t::Context &ctx, const class Properties &args); + + void purge_stale_sessions(Parser_t::Context &ctx, const class Properties &args); + void check_connection(Parser_t::Context &ctx, const class Properties &args); void repCommand(Parser_t::Context &ctx, const class Properties &args); }; @@ -99,7 +107,7 @@ public: m_mgmsrv = mgmsrv; } - MgmApiSession * newSession(NDB_SOCKET_TYPE socket){ + SocketServer::Session * newSession(NDB_SOCKET_TYPE socket){ return new MgmApiSession(* m_mgmsrv, socket); } }; diff --git a/ndb/src/mgmsrv/SignalQueue.hpp b/ndb/src/mgmsrv/SignalQueue.hpp index 76acaf2289a..bacbad53415 100644 --- a/ndb/src/mgmsrv/SignalQueue.hpp +++ b/ndb/src/mgmsrv/SignalQueue.hpp @@ -47,8 +47,8 @@ public: NodeId nodeid = 0, Uint32 timeout = DEFAULT_TIMEOUT); template<class T> bool waitFor(Vector<T> &t, - T *&handler, - NdbApiSignal *&signal, + T **handler, + NdbApiSignal **signal, Uint32 timeout = DEFAULT_TIMEOUT); private: NdbMutex *m_mutex; /* Locks all data in SignalQueue */ @@ -75,8 +75,8 @@ private: template<class T> bool SignalQueue::waitFor(Vector<T> &t, - T *&handler, - NdbApiSignal *&signal, + T **handler, + NdbApiSignal **signal, Uint32 timeout) { Guard g(m_mutex); @@ -88,8 +88,8 @@ SignalQueue::waitFor(Vector<T> &t, for(size_t i = 0; i < t.size(); i++) { if(t[i].check(m_signalQueueHead->signal)) { - handler = &t[i]; - signal = pop(); + * handler = &t[i]; + * signal = pop(); return true; } } diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 5ee48e4cfcc..61b83b86538 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> +#include <ndb_opts.h> #include "MgmtSrvr.hpp" #include "EventLogger.hpp" @@ -33,7 +34,6 @@ #include <ndb_version.h> #include <ConfigRetriever.hpp> #include <mgmapi_config_parameters.h> -#include <getarg.h> #include <NdbAutoPtr.hpp> @@ -62,7 +62,6 @@ struct MgmGlobals { int non_interactive; int interactive; const char * config_filename; - const char * local_config_filename; /** Stuff found in environment or in local config */ NodeId localNodeId; @@ -70,9 +69,6 @@ struct MgmGlobals { char * interface_name; int port; - /** The configuration of the cluster */ - Config * cluster_config; - /** The Mgmt Server */ MgmtSrvr * mgmObject; @@ -83,55 +79,94 @@ struct MgmGlobals { int g_no_nodeid_checks= 0; static MgmGlobals glob; - /****************************************************************************** * Function prototypes ******************************************************************************/ -static bool readLocalConfig(); -static bool readGlobalConfig(); - /** * Global variables */ bool g_StopServer; -extern EventLogger g_EventLogger; +extern EventLogger g_eventLogger; extern int global_mgmt_server_check; -int _print_version = 0; -#ifndef DBUG_OFF -const char *debug_option= 0; + +enum ndb_mgmd_options { + OPT_INTERACTIVE = NDB_STD_OPTIONS_LAST, + OPT_NO_NODEID_CHECKS, + OPT_NO_DAEMON +}; +NDB_STD_OPTS_VARS; + +#if NDB_VERSION_MAJOR <= 4 +#undef OPT_NDB_CONNECTSTRING +#define OPT_NDB_CONNECTSTRING 1023 +#else + #endif -struct getargs args[] = { - { "version", 'v', arg_flag, &_print_version, - "Print ndb_mgmd version",""}, - { "config-file", 'c', arg_string, &glob.config_filename, - "Specify cluster configuration file (default config.ini if available)", - "filename"}, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options"}, +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_mgmd"), + { "config-file", 'f', "Specify cluster configuration file", + (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "daemon", 'd', "Run ndb_mgmd in daemon mode (default)", + (gptr*) &glob.daemon, (gptr*) &glob.daemon, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, + { "interactive", OPT_INTERACTIVE, + "Run interactive. Not supported but provided for testing purposes", + (gptr*) &glob.interactive, (gptr*) &glob.interactive, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "no-nodeid-checks", OPT_NO_NODEID_CHECKS, + "Do not provide any node id checks", + (gptr*) &g_no_nodeid_checks, (gptr*) &g_no_nodeid_checks, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "nodaemon", OPT_NO_DAEMON, + "Don't run as daemon, but don't read from stdin", + (gptr*) &glob.non_interactive, (gptr*) &glob.non_interactive, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, +#if NDB_VERSION_MAJOR <= 4 + { "config-file", 'c', + "-c provided for backwards compatability, will be removed in 5.0." + " Use -f instead", + (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, #endif - { "daemon", 'd', arg_flag, &glob.daemon, - "Run ndb_mgmd in daemon mode (default)",""}, - { NULL, 'l', arg_string, &glob.local_config_filename, - "Specify configuration file connect string (default Ndb.cfg if available)", - "filename"}, - { "interactive", 0, arg_flag, &glob.interactive, - "Run interactive. Not supported but provided for testing purposes", ""}, - { "no-nodeid-checks", 0, arg_flag, &g_no_nodeid_checks, - "Do not provide any node id checks", ""}, - { "nodaemon", 0, arg_flag, &glob.non_interactive, - "Don't run as daemon, but don't read from stdin", "non-interactive"} + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; - -int num_args = sizeof(args) / sizeof(args[0]); +static void short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS]\n", my_progname); +} +static void usage() +{ + short_usage_sub(); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_mgmd.trace"); +#if NDB_VERSION_MAJOR <= 4 + switch (optid) { + case 'c': + printf("Warning: -c will be removed in 5.0, use -f instead\n"); + break; + } +#endif + return 0; +} /* * MAIN */ -NDB_MAIN(mgmsrv){ - ndb_init(); +int main(int argc, char** argv) +{ + NDB_INIT(argv[0]); /** * OSE specific. Enable shared ownership of file system resources. @@ -144,57 +179,32 @@ NDB_MAIN(mgmsrv){ global_mgmt_server_check = 1; - int optind = 0; - if(getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, ""); - exit(1); - } + const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(ho_error); if (glob.interactive || glob.non_interactive) { glob.daemon= 0; } -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif - - if (_print_version) { - ndbPrintVersion(); - exit(0); - } - - if(glob.config_filename == NULL) { - glob.config_filename= "config.ini"; - } glob.socketServer = new SocketServer(); MgmApiService * mapi = new MgmApiService(); - /**************************** - * Read configuration files * - ****************************/ - LocalConfig local_config; - if(!local_config.init(0,glob.local_config_filename)){ - local_config.printError(); - goto error_end; - } - glob.localNodeId = local_config._ownNodeId; + glob.mgmObject = new MgmtSrvr(glob.socketServer, + glob.config_filename, + opt_connect_str); - if (!readGlobalConfig()) + if (glob.mgmObject->init()) goto error_end; - glob.mgmObject = new MgmtSrvr(glob.localNodeId, - BaseString(glob.config_filename), - local_config, - glob.cluster_config); + my_setwd(NdbConfig_get_path(0), MYF(0)); - chdir(NdbConfig_get_path(0)); - - glob.cluster_config = 0; glob.localNodeId= glob.mgmObject->getOwnNodeId(); - if (glob.localNodeId == 0) { goto error_end; } @@ -253,7 +263,9 @@ NDB_MAIN(mgmsrv){ } } +#ifndef NDB_WIN32 signal(SIGPIPE, SIG_IGN); +#endif { BaseString error_string; if(!glob.mgmObject->start(error_string)){ @@ -271,12 +283,12 @@ NDB_MAIN(mgmsrv){ BaseString::snprintf(msg, sizeof(msg), "NDB Cluster Management Server. %s", NDB_VERSION_STRING); ndbout_c(msg); - g_EventLogger.info(msg); + g_eventLogger.info(msg); BaseString::snprintf(msg, 256, "Id: %d, Command port: %d", glob.localNodeId, glob.port); ndbout_c(msg); - g_EventLogger.info(msg); + g_eventLogger.info(msg); g_StopServer = false; glob.socketServer->startServer(); @@ -292,10 +304,10 @@ NDB_MAIN(mgmsrv){ NdbSleep_MilliSleep(500); } - g_EventLogger.info("Shutting down server..."); + g_eventLogger.info("Shutting down server..."); glob.socketServer->stopServer(); glob.socketServer->stopSessions(); - g_EventLogger.info("Shutdown complete"); + g_eventLogger.info("Shutdown complete"); return 0; error_end: return 1; @@ -305,9 +317,7 @@ MgmGlobals::MgmGlobals(){ // Default values port = 0; config_filename = NULL; - local_config_filename = NULL; interface_name = 0; - cluster_config = 0; daemon = 1; non_interactive = 0; interactive = 0; @@ -320,27 +330,6 @@ MgmGlobals::~MgmGlobals(){ delete socketServer; if (mgmObject) delete mgmObject; - if (cluster_config) - delete cluster_config; if (interface_name) free(interface_name); } - -/** - * @fn readGlobalConfig - * @param glob : Global variables - * @return true if success, false otherwise. - */ -static bool -readGlobalConfig() { - if(glob.config_filename == NULL) - return false; - - /* Use config file */ - InitConfigFileParser parser; - glob.cluster_config = parser.parseConfig(glob.config_filename); - if(glob.cluster_config == 0){ - return false; - } - return true; -} diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index e10b2e1d82c..1fe0cedbd6c 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -54,7 +54,6 @@ runClusterMgr_C(void * me) #ifdef NDB_OSE NdbSleep_MilliSleep(50); #endif - NdbThread_Exit(0); return NULL; } @@ -560,10 +559,7 @@ extern "C" void* runArbitMgr_C(void* me) { - my_thread_init(); ((ArbitMgr*) me)->threadMain(); - my_thread_end(); - NdbThread_Exit(0); return NULL; } diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index 12300ce216f..afdb37aa53f 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -24,10 +24,12 @@ Ndb_local_table_info * Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz) { - void *data= malloc(sizeof(NdbTableImpl)+sz-1); + if (sz % 8 != 0) // round to Uint64 + sz += 8 - sz % 8; + void *data= malloc(sizeof(NdbTableImpl)+sz-8); if (data == 0) return 0; - memset(data,0,sizeof(NdbTableImpl)+sz-1); + memset(data,0,sizeof(NdbTableImpl)+sz-8); new (data) Ndb_local_table_info(table_impl); return (Ndb_local_table_info *) data; } diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index 0dc853306fa..58c08a93e61 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -25,6 +25,7 @@ #include <UtilBuffer.hpp> #include <NdbDictionary.hpp> #include <Ndb.hpp> +#include <NdbCondition.h> #include "NdbLinHash.hpp" class Ndb_local_table_info { @@ -32,7 +33,7 @@ public: static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0); static void destroy(Ndb_local_table_info *); NdbTableImpl *m_table_impl; - char m_local_data[1]; + Uint64 m_local_data[1]; private: Ndb_local_table_info(NdbTableImpl *table_impl); ~Ndb_local_table_info(); diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index 06128e047b6..9f8a851b995 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -47,3 +47,17 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbapi.dsp + +libndbapi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbapi_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/ndbapi/Makefile_old b/ndb/src/ndbapi/Makefile_old deleted file mode 100644 index 54de9ba96f4..00000000000 --- a/ndb/src/ndbapi/Makefile_old +++ /dev/null @@ -1,60 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -PIC_ARCHIVE := Y -NONPIC_ARCHIVE := Y -ARCHIVE_TARGET := ndbapi - -A_LIB := Y -SO_LIB := Y -PIC_LIB := Y -LIB_TARGET := NDB_API - -LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) \ - transporter \ - general \ - signaldataprint \ - mgmapi mgmsrvcommon \ - portlib \ - logger \ - trace - -DIRS := signal-sender - -CFLAGS_TransporterFacade.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) -CFLAGS_ClusterMgr.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - TransporterFacade.cpp \ - ClusterMgr.cpp \ - Ndb.cpp \ - NdbPoolImpl.cpp NdbPool.cpp \ - Ndblist.cpp \ - Ndbif.cpp \ - Ndbinit.cpp \ - ndberror.c Ndberr.cpp NdbErrorOut.cpp \ - NdbConnection.cpp \ - NdbConnectionScan.cpp \ - NdbOperation.cpp \ - NdbOperationSearch.cpp \ - NdbOperationInt.cpp \ - NdbOperationDefine.cpp \ - NdbOperationExec.cpp \ - NdbResultSet.cpp \ - NdbScanOperation.cpp NdbScanFilter.cpp \ - NdbIndexOperation.cpp \ - NdbEventOperation.cpp \ - NdbEventOperationImpl.cpp \ - NdbApiSignal.cpp \ - NdbRecAttr.cpp \ - NdbUtil.cpp \ - NdbReceiver.cpp \ - NdbDictionary.cpp NdbDictionaryImpl.cpp DictCache.cpp - NdbBlob.cpp - -include $(NDB_TOP)/Epilogue.mk - -### -# Backward compatible diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index d7b8a695fe2..b5493622b70 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -22,7 +22,7 @@ Name: Ndb.cpp ******************************************************************************/ #include <ndb_global.h> -#include <pthread.h> + #include "NdbApiSignal.hpp" #include "NdbImpl.hpp" @@ -46,7 +46,6 @@ Connect to any node which has no connection at the moment. NdbConnection* Ndb::doConnect(Uint32 tConNode) { Uint32 tNode; - Uint32 i = 0;; Uint32 tAnyAlive = 0; int TretCode; @@ -65,38 +64,51 @@ NdbConnection* Ndb::doConnect(Uint32 tConNode) // We will connect to any node. Make sure that we have connections to all // nodes. //**************************************************************************** - Uint32 tNoOfDbNodes = theNoOfDBnodes; - i = theCurrentConnectIndex; - UintR Tcount = 0; - do { - if (i >= tNoOfDbNodes) { - i = 0; - }//if - Tcount++; - tNode = theDBnodes[i]; - TretCode = NDB_connect(tNode); - if ((TretCode == 1) || (TretCode == 2)) { + if (theImpl->m_optimized_node_selection) + { + Ndb_cluster_connection_node_iter &node_iter= + theImpl->m_node_iter; + theImpl->m_ndb_cluster_connection.init_get_next_node(node_iter); + while ((tNode= theImpl->m_ndb_cluster_connection.get_next_node(node_iter))) + { + TretCode= NDB_connect(tNode); + if ((TretCode == 1) || + (TretCode == 2)) + { //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - if (theCurrentConnectIndex == i) { - theCurrentConnectCounter++; - if (theCurrentConnectCounter == 8) { - theCurrentConnectCounter = 1; - theCurrentConnectIndex++; - }//if - } else { - // Set to 2 because we have already connected to a node - // when we get here. - theCurrentConnectCounter = 2; - theCurrentConnectIndex = i; + return getConnectedNdbConnection(tNode); + } else if (TretCode != 0) { + tAnyAlive= 1; }//if - return getConnectedNdbConnection(tNode); - } else if (TretCode != 0) { - tAnyAlive = 1; - }//if - i++; - } while (Tcount < tNoOfDbNodes); + } + } + else // just do a regular round robin + { + Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes; + Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex; + UintR Tcount = 0; + do { + theCurrentConnectIndex++; + if (theCurrentConnectIndex >= tNoOfDbNodes) + theCurrentConnectIndex = 0; + + Tcount++; + tNode= theImpl->theDBnodes[theCurrentConnectIndex]; + TretCode= NDB_connect(tNode); + if ((TretCode == 1) || + (TretCode == 2)) + { +//**************************************************************************** +// We have connections now to the desired node. Return +//**************************************************************************** + return getConnectedNdbConnection(tNode); + } else if (TretCode != 0) { + tAnyAlive= 1; + }//if + } while (Tcount < tNoOfDbNodes); + } //**************************************************************************** // We were unable to find a free connection. If no node alive we will report // error code for cluster failure otherwise connection failure. @@ -161,8 +173,8 @@ Ndb::NDB_connect(Uint32 tNode) tReturnCode = tp->sendSignal(tSignal, tNode); releaseSignal(tSignal); if (tReturnCode != -1) { - theWaiter.m_node = tNode; - theWaiter.m_state = WAIT_TC_SEIZE; + theImpl->theWaiter.m_node = tNode; + theImpl->theWaiter.m_state = WAIT_TC_SEIZE; tReturnCode = receiveResponse(); }//if } else { @@ -211,8 +223,9 @@ Ndb::doDisconnect() NdbConnection* tNdbCon; CHECK_STATUS_MACRO_VOID; - DBUG_PRINT("info", ("theNoOfDBnodes=%d", theNoOfDBnodes)); - Uint32 tNoOfDbNodes = theNoOfDBnodes; + Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes; + Uint8 *theDBnodes= theImpl->theDBnodes; + DBUG_PRINT("info", ("theNoOfDBnodes=%d", tNoOfDbNodes)); UintR i; for (i = 0; i < tNoOfDbNodes; i++) { Uint32 tNode = theDBnodes[i]; @@ -254,50 +267,28 @@ Ndb::waitUntilReady(int timeout) DBUG_RETURN(-1); } - do { - if ((id = theNode) != 0) { - unsigned int foundAliveNode = 0; - TransporterFacade *tp = TransporterFacade::instance(); - tp->lock_mutex(); - for (unsigned int i = 0; i < theNoOfDBnodes; i++) { - const NodeId nodeId = theDBnodes[i]; - //************************************************ - // If any node is answering, ndb is answering - //************************************************ - if (tp->get_node_alive(nodeId) != 0) { - foundAliveNode++; - }//if - }//for - - tp->unlock_mutex(); - if (foundAliveNode == theNoOfDBnodes) { - DBUG_RETURN(0); - }//if - if (foundAliveNode > 0) { - noChecksSinceFirstAliveFound++; - }//if - if (noChecksSinceFirstAliveFound > 30) { - DBUG_RETURN(0); - }//if - }//if theNode != 0 + while (theNode == 0) { if (secondsCounter >= timeout) - break; + { + theError.code = 4269; + DBUG_RETURN(-1); + } NdbSleep_MilliSleep(100); milliCounter += 100; if (milliCounter >= 1000) { secondsCounter++; milliCounter = 0; }//if - } while (1); - if (id == 0) { - theError.code = 4269; + } + + if (theImpl->m_ndb_cluster_connection.wait_until_ready + (timeout-secondsCounter,30) < 0) + { + theError.code = 4009; DBUG_RETURN(-1); } - if (noChecksSinceFirstAliveFound > 0) { - DBUG_RETURN(0); - }//if - theError.code = 4009; - DBUG_RETURN(-1); + + DBUG_RETURN(0); } /***************************************************************************** @@ -322,8 +313,8 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen) */ Uint32 nodeId; if(keyData != 0) { - Uint32 fragmentId = computeFragmentId(keyData, keyLen); - nodeId = guessPrimaryNode(fragmentId); + nodeId = 0; // guess not supported + // nodeId = m_ndb_cluster_connection->guess_primary_node(keyData, keyLen); } else { nodeId = 0; }//if @@ -384,44 +375,6 @@ Ndb::hupp(NdbConnection* pBuddyTrans) }//if }//Ndb::hupp() -NdbConnection* -Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type) -{ - - char DGroup[4]; - if ((keyData == NULL) || - (type > 1)) { - theError.code = 4118; - return NULL; - }//if - if (theInitState == Initialised) { - theError.code = 0; - checkFailedNode(); - /** - * If the user supplied key data - * We will make a qualified quess to which node is the primary for the - * the fragment and contact that node - */ - Uint32 fragmentId; - if (type == 0) { - DGroup[0] = keyData[0]; - DGroup[1] = keyData[1]; - DGroup[2] = 0x30; - DGroup[3] = 0x30; - fragmentId = computeFragmentId(&DGroup[0], 4); - } else { - Uint32 hashValue = ((keyData[0] - 0x30) * 10) + (keyData[1] - 0x30); - fragmentId = getFragmentId(hashValue); - }//if - Uint32 nodeId = guessPrimaryNode(fragmentId); - NdbConnection* trans= startTransactionLocal(aPriority, nodeId); - DBUG_PRINT("exit", ("start DGroup trans: 0x%x transid: 0x%llx", - trans, trans ? trans->getTransactionId() : 0)); - return trans; - } else { - return NULL; - }//if -}//Ndb::startTransaction() NdbConnection* Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) @@ -1021,118 +974,6 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op) return ~0; } -static const Uint32 MAX_KEY_LEN_64_WORDS = 4; -static const Uint32 MAX_KEY_LEN_32_WORDS = 8; -static const Uint32 MAX_KEY_LEN_BYTES = 32; - -Uint32 -Ndb::computeFragmentId(const char * keyData, Uint32 keyLen) -{ - Uint64 tempData[MAX_KEY_LEN_64_WORDS]; - - const Uint32 usedKeyLen = (keyLen + 3) >> 2; // In words - const char * usedKeyData = 0; - - /** - * If key data buffer is not aligned (on 64 bit boundary) - * or key len is not a multiple of 4 - * Use temp data - */ - if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) { - usedKeyData = keyData; - } else { - memcpy(&tempData[0], keyData, keyLen); - const int slack = keyLen & 3; - if(slack > 0) { - memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack)); - }//if - usedKeyData = (char *)&tempData[0]; - }//if - - Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen); - - hashValue >>= startTransactionNodeSelectionData.kValue; - return getFragmentId(hashValue); -}//Ndb::computeFragmentId() - -Uint32 -Ndb::getFragmentId(Uint32 hashValue) -{ - Uint32 fragmentId = hashValue & - startTransactionNodeSelectionData.hashValueMask; - if(fragmentId < startTransactionNodeSelectionData.hashpointerValue) { - fragmentId = hashValue & - ((startTransactionNodeSelectionData.hashValueMask << 1) + 1); - }//if - return fragmentId; -} - -Uint32 -Ndb::guessPrimaryNode(Uint32 fragmentId){ - //ASSERT(((fragmentId > 0) && fragmentId < - // startTransactionNodeSelectionData.noOfFragments), "Invalid fragementId"); - - return startTransactionNodeSelectionData.fragment2PrimaryNodeMap[fragmentId]; -} - -void -Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes, - Uint32 nodeIds[]) { - kValue = 6; - noOfFragments = 2 * noOfNodes; - - /** - * Compute hashValueMask and hashpointerValue - */ - { - Uint32 topBit = (1 << 31); - for(int i = 31; i>=0; i--){ - if((noOfFragments & topBit) != 0) - break; - topBit >>= 1; - } - hashValueMask = topBit - 1; - hashpointerValue = noOfFragments - (hashValueMask + 1); - } - - /** - * This initialization depends on - * the fact that: - * primary node for fragment i = i % noOfNodes - * - * This algorithm should be implemented in Dbdih - */ - { - if (fragment2PrimaryNodeMap != 0) - abort(); - - fragment2PrimaryNodeMap = new Uint32[noOfFragments]; - Uint32 i; - for(i = 0; i<noOfNodes; i++){ - fragment2PrimaryNodeMap[i] = nodeIds[i]; - } - - // Sort them (bubble sort) - for(i = 0; i<noOfNodes-1; i++) - for(Uint32 j = i+1; j<noOfNodes; j++) - if(fragment2PrimaryNodeMap[i] > fragment2PrimaryNodeMap[j]){ - Uint32 tmp = fragment2PrimaryNodeMap[i]; - fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j]; - fragment2PrimaryNodeMap[j] = tmp; - } - - for(i = 0; i<noOfNodes; i++){ - fragment2PrimaryNodeMap[i+noOfNodes] = fragment2PrimaryNodeMap[i]; - } - } -} - -void -Ndb::StartTransactionNodeSelectionData::release(){ - delete [] fragment2PrimaryNodeMap; - fragment2PrimaryNodeMap = 0; -} - Uint32 convertEndian(Uint32 Data) { @@ -1386,6 +1227,7 @@ Ndb::printState(const char* fmt, ...) va_end(ap); NdbMutex_Lock(ndb_print_state_mutex); bool dups = false; + unsigned i; ndbout << buf << " ndb=" << hex << this << dec; #ifndef NDB_WIN32 ndbout << " thread=" << (int)pthread_self(); @@ -1406,21 +1248,21 @@ Ndb::printState(const char* fmt, ...) ndbout << "!! DUPS !!" << endl; dups = true; } - for (unsigned i = 0; i < theNoOfPreparedTransactions; i++) + for (i = 0; i < theNoOfPreparedTransactions; i++) thePreparedTransactionsArray[i]->printState(); ndbout << "sent: " << theNoOfSentTransactions<< endl; if (checkdups(theSentTransactionsArray, theNoOfSentTransactions)) { ndbout << "!! DUPS !!" << endl; dups = true; } - for (unsigned i = 0; i < theNoOfSentTransactions; i++) + for (i = 0; i < theNoOfSentTransactions; i++) theSentTransactionsArray[i]->printState(); ndbout << "completed: " << theNoOfCompletedTransactions<< endl; if (checkdups(theCompletedTransactionsArray, theNoOfCompletedTransactions)) { ndbout << "!! DUPS !!" << endl; dups = true; } - for (unsigned i = 0; i < theNoOfCompletedTransactions; i++) + for (i = 0; i < theNoOfCompletedTransactions; i++) theCompletedTransactionsArray[i]->printState(); NdbMutex_Unlock(ndb_print_state_mutex); } diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index feab95d8ca5..f72361b86ac 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -21,6 +21,7 @@ #include <NdbIndexOperation.hpp> #include <NdbRecAttr.hpp> #include <NdbBlob.hpp> +#include "NdbBlobImpl.hpp" #include <NdbScanOperation.hpp> #ifdef NDB_BLOB_DEBUG @@ -33,21 +34,24 @@ ndbout << prefix << " " << hex << (void*)this << " " << cname; \ ndbout << " " << dec << __LINE__ << " " << x << " " << *this << endl; \ } while (0) -#else -#define DBG(x) -#endif static char* ndb_blob_debug(const Uint32* data, unsigned size) { - static char buf[128 + 1]; // MT irrelevant + static char buf[200]; // MT irrelevant buf[0] = 0; - for (unsigned i = 0; i < size && i < 128 / 4; i++) { - sprintf(buf + strlen(buf), "%*s%08x", i != 0, "", data[i]); + for (unsigned i = 0; i < size; i++) { + unsigned n = strlen(buf); + if (n + 10 < sizeof(buf)) + sprintf(buf + n, "%*s%08x", i != 0, "", data[i]); } return buf; } +#else +#define DBG(x) +#endif + /* * Reading index table directly (as a table) is faster but there are * bugs or limitations. Keep the code and make possible to choose. @@ -82,34 +86,36 @@ void NdbBlob::getBlobTableName(char* btname, const NdbTableImpl* t, const NdbColumnImpl* c) { assert(t != 0 && c != 0 && c->getBlobType()); - memset(btname, 0, BlobTableNameSize); + memset(btname, 0, NdbBlobImpl::BlobTableNameSize); sprintf(btname, "NDB$BLOB_%d_%d", (int)t->m_tableId, (int)c->m_attrId); } void NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c) { - char btname[BlobTableNameSize]; + char btname[NdbBlobImpl::BlobTableNameSize]; getBlobTableName(btname, t, c); bt.setName(btname); bt.setLogging(t->getLogging()); bt.setFragmentType(t->getFragmentType()); - { NdbDictionary::Column bc("DIST"); + { NdbDictionary::Column bc("PK"); bc.setType(NdbDictionary::Column::Unsigned); + assert(t->m_sizeOfKeysInWords != 0); + bc.setLength(t->m_sizeOfKeysInWords); bc.setPrimaryKey(true); bc.setDistributionKey(true); bt.addColumn(bc); } - { NdbDictionary::Column bc("PART"); + { NdbDictionary::Column bc("DIST"); bc.setType(NdbDictionary::Column::Unsigned); bc.setPrimaryKey(true); + bc.setDistributionKey(true); bt.addColumn(bc); } - { NdbDictionary::Column bc("PK"); + { NdbDictionary::Column bc("PART"); bc.setType(NdbDictionary::Column::Unsigned); - assert(t->m_sizeOfKeysInWords != 0); - bc.setLength(t->m_sizeOfKeysInWords); bc.setPrimaryKey(true); + bc.setDistributionKey(false); bt.addColumn(bc); } { NdbDictionary::Column bc("DATA"); @@ -162,6 +168,7 @@ NdbBlob::init() theHead = NULL; theInlineData = NULL; theHeadInlineRecAttr = NULL; + theHeadInlineReadOp = NULL; theHeadInlineUpdateFlag = false; theNullFlag = -1; theLength = 0; @@ -206,6 +213,13 @@ NdbBlob::Buf::alloc(unsigned n) #endif } +void +NdbBlob::Buf::copyfrom(const NdbBlob::Buf& src) +{ + assert(size == src.size); + memcpy(data, src.data, size); +} + // classify operations (inline) inline bool @@ -226,6 +240,7 @@ NdbBlob::isKeyOp() return theNdbOp->theOperationType == NdbOperation::InsertRequest || theNdbOp->theOperationType == NdbOperation::UpdateRequest || + theNdbOp->theOperationType == NdbOperation::WriteRequest || theNdbOp->theOperationType == NdbOperation::ReadRequest || theNdbOp->theOperationType == NdbOperation::ReadExclusive || theNdbOp->theOperationType == NdbOperation::DeleteRequest; @@ -254,6 +269,13 @@ NdbBlob::isUpdateOp() } inline bool +NdbBlob::isWriteOp() +{ + return + theNdbOp->theOperationType == NdbOperation::WriteRequest; +} + +inline bool NdbBlob::isDeleteOp() { return @@ -373,9 +395,10 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; DBG("setPartKeyValue dist=" << getDistKey(part) << " part=" << part << " key=" << ndb_blob_debug(data, size)); - if (anOp->equal((Uint32)0, getDistKey(part)) == -1 || - anOp->equal((Uint32)1, part) == -1 || - anOp->equal((Uint32)2, theKeyBuf.data) == -1) { + // TODO use attr ids after compatibility with 4.1.7 not needed + if (anOp->equal("PK", theKeyBuf.data) == -1 || + anOp->equal("DIST", getDistKey(part)) == -1 || + anOp->equal("PART", part) == -1) { setErrorCode(anOp); return -1; } @@ -401,7 +424,7 @@ NdbBlob::getHeadFromRecAttr() theNullFlag = theHeadInlineRecAttr->isNULL(); assert(theNullFlag != -1); theLength = ! theNullFlag ? theHead->length : 0; - DBG("getHeadFromRecAttr out"); + DBG("getHeadFromRecAttr [out]"); } int @@ -428,15 +451,15 @@ NdbBlob::getValue(void* data, Uint32 bytes) { DBG("getValue data=" << hex << data << " bytes=" << dec << bytes); if (theGetFlag || theState != Prepared) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (! isReadOp() && ! isScanOp()) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } if (data == NULL && bytes != 0) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } theGetFlag = true; @@ -450,15 +473,15 @@ NdbBlob::setValue(const void* data, Uint32 bytes) { DBG("setValue data=" << hex << data << " bytes=" << dec << bytes); if (theSetFlag || theState != Prepared) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } - if (! isInsertOp() && ! isUpdateOp()) { - setErrorCode(ErrUsage); + if (! isInsertOp() && ! isUpdateOp() && ! isWriteOp()) { + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } if (data == NULL && bytes != 0) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } theSetFlag = true; @@ -466,11 +489,12 @@ NdbBlob::setValue(const void* data, Uint32 bytes) theGetSetBytes = bytes; if (isInsertOp()) { // write inline part now - if (theSetBuf != 0) { - unsigned n = theGetSetBytes; + if (theSetBuf != NULL) { + Uint32 n = theGetSetBytes; if (n > theInlineSize) n = theInlineSize; - if (writeDataPrivate(0, theSetBuf, n) == -1) + assert(thePos == 0); + if (writeDataPrivate(theSetBuf, n) == -1) return -1; } else { theNullFlag = true; @@ -489,7 +513,7 @@ NdbBlob::setActiveHook(ActiveHook activeHook, void* arg) { DBG("setActiveHook hook=" << hex << (void*)activeHook << " arg=" << hex << arg); if (theState != Prepared) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } theActiveHook = activeHook; @@ -508,7 +532,7 @@ NdbBlob::getNull(bool& isNull) return 0; } if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } isNull = theNullFlag; @@ -523,7 +547,7 @@ NdbBlob::setNull() if (theState == Prepared) { return setValue(0, 0); } - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (theNullFlag) @@ -545,7 +569,7 @@ NdbBlob::getLength(Uint64& len) return 0; } if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } len = theLength; @@ -555,9 +579,9 @@ NdbBlob::getLength(Uint64& len) int NdbBlob::truncate(Uint64 length) { - DBG("truncate length=" << length); + DBG("truncate [in] length=" << length); if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (theLength > length) { @@ -573,7 +597,10 @@ NdbBlob::truncate(Uint64 length) } theLength = length; theHeadInlineUpdateFlag = true; + if (thePos > length) + thePos = length; } + DBG("truncate [out]"); return 0; } @@ -582,7 +609,7 @@ NdbBlob::getPos(Uint64& pos) { DBG("getPos"); if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } pos = thePos; @@ -594,11 +621,11 @@ NdbBlob::setPos(Uint64 pos) { DBG("setPos pos=" << pos); if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (pos > theLength) { - setErrorCode(ErrSeek); + setErrorCode(NdbBlobImpl::ErrSeek); return -1; } thePos = pos; @@ -610,32 +637,20 @@ NdbBlob::setPos(Uint64 pos) int NdbBlob::readData(void* data, Uint32& bytes) { - if (readData(thePos, data, bytes) == -1) - return -1; - thePos += bytes; - assert(thePos <= theLength); - return 0; -} - -int -NdbBlob::readData(Uint64 pos, void* data, Uint32& bytes) -{ if (theState != Active) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } char* buf = static_cast<char*>(data); - return readDataPrivate(pos, buf, bytes); + return readDataPrivate(buf, bytes); } int -NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) +NdbBlob::readDataPrivate(char* buf, Uint32& bytes) { - DBG("readData pos=" << pos << " bytes=" << bytes); - if (pos > theLength) { - setErrorCode(ErrSeek); - return -1; - } + DBG("readData [in] bytes=" << bytes); + assert(thePos <= theLength); + Uint64 pos = thePos; if (bytes > theLength - pos) bytes = theLength - pos; Uint32 len = bytes; @@ -652,7 +667,7 @@ NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) } } if (len > 0 && thePartSize == 0) { - setErrorCode(ErrSeek); + setErrorCode(NdbBlobImpl::ErrSeek); return -1; } if (len > 0) { @@ -665,7 +680,6 @@ NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; Uint32 n = thePartSize - off; @@ -699,7 +713,6 @@ NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; memcpy(buf, thePartBuf.data, len); @@ -709,38 +722,29 @@ NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) len -= n; } assert(len == 0); - return 0; -} - -int -NdbBlob::writeData(const void* data, Uint32 bytes) -{ - if (writeData(thePos, data, bytes) == -1) - return -1; - thePos += bytes; + thePos = pos; assert(thePos <= theLength); + DBG("readData [out]"); return 0; } int -NdbBlob::writeData(Uint64 pos, const void* data, Uint32 bytes) +NdbBlob::writeData(const void* data, Uint32 bytes) { if (theState != Active) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } const char* buf = static_cast<const char*>(data); - return writeDataPrivate(pos, buf, bytes); + return writeDataPrivate(buf, bytes); } int -NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) +NdbBlob::writeDataPrivate(const char* buf, Uint32 bytes) { - DBG("writeData pos=" << pos << " bytes=" << bytes); - if (pos > theLength) { - setErrorCode(ErrSeek); - return -1; - } + DBG("writeData [in] bytes=" << bytes); + assert(thePos <= theLength); + Uint64 pos = thePos; Uint32 len = bytes; // any write makes blob not NULL if (theNullFlag) { @@ -761,7 +765,7 @@ NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) } } if (len > 0 && thePartSize == 0) { - setErrorCode(ErrSeek); + setErrorCode(NdbBlobImpl::ErrSeek); return -1; } if (len > 0) { @@ -771,14 +775,12 @@ NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) if (off != 0) { DBG("partial first block pos=" << pos << " len=" << len); // flush writes to guarantee correct read - DBG("execute pending part writes"); if (executePendingBlobWrites() == -1) return -1; Uint32 part = (pos - theInlineSize) / thePartSize; if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reafs"); if (executePendingBlobReads() == -1) return -1; Uint32 n = thePartSize - off; @@ -822,13 +824,11 @@ NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) Uint32 part = (pos - theInlineSize) / thePartSize; if (theLength > pos + len) { // flush writes to guarantee correct read - DBG("execute pending part writes"); if (executePendingBlobWrites() == -1) return -1; if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; memcpy(thePartBuf.data, buf, len); @@ -855,14 +855,16 @@ NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) theLength = pos; theHeadInlineUpdateFlag = true; } - DBG("writeData out"); + thePos = pos; + assert(thePos <= theLength); + DBG("writeData [out]"); return 0; } int NdbBlob::readParts(char* buf, Uint32 part, Uint32 count) { - DBG("readParts part=" << part << " count=" << count); + DBG("readParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -873,6 +875,7 @@ NdbBlob::readParts(char* buf, Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; buf += thePartSize; n++; thePendingBlobOps |= (1 << NdbOperation::ReadRequest); @@ -884,7 +887,7 @@ NdbBlob::readParts(char* buf, Uint32 part, Uint32 count) int NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count) { - DBG("insertParts part=" << part << " count=" << count); + DBG("insertParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -895,6 +898,7 @@ NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; buf += thePartSize; n++; thePendingBlobOps |= (1 << NdbOperation::InsertRequest); @@ -906,7 +910,7 @@ NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count) int NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count) { - DBG("updateParts part=" << part << " count=" << count); + DBG("updateParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -917,6 +921,7 @@ NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; buf += thePartSize; n++; thePendingBlobOps |= (1 << NdbOperation::UpdateRequest); @@ -928,7 +933,7 @@ NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count) int NdbBlob::deleteParts(Uint32 part, Uint32 count) { - DBG("deleteParts part=" << part << " count=" << count); + DBG("deleteParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -938,6 +943,7 @@ NdbBlob::deleteParts(Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; n++; thePendingBlobOps |= (1 << NdbOperation::DeleteRequest); theNdbCon->thePendingBlobOps |= (1 << NdbOperation::DeleteRequest); @@ -945,6 +951,59 @@ NdbBlob::deleteParts(Uint32 part, Uint32 count) return 0; } +/* + * Number of blob parts not known. Used to check for race condition + * when writeTuple is used for insert. Deletes all parts found. + */ +int +NdbBlob::deletePartsUnknown(Uint32 part) +{ + DBG("deletePartsUnknown [in] part=" << part << " count=all"); + static const unsigned maxbat = 256; + static const unsigned minbat = 1; + unsigned bat = minbat; + NdbOperation* tOpList[maxbat]; + Uint32 count = 0; + while (true) { + Uint32 n; + n = 0; + while (n < bat) { + NdbOperation*& tOp = tOpList[n]; // ref + tOp = theNdbCon->getNdbOperation(theBlobTable); + if (tOp == NULL || + tOp->deleteTuple() == -1 || + setPartKeyValue(tOp, part + count + n) == -1) { + setErrorCode(tOp); + return -1; + } + tOp->m_abortOption = AO_IgnoreError; + n++; + } + DBG("deletePartsUnknown: executeNoBlobs [in] bat=" << bat); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) + return -1; + DBG("deletePartsUnknown: executeNoBlobs [out]"); + n = 0; + while (n < bat) { + NdbOperation* tOp = tOpList[n]; + if (tOp->theError.code != 0) { + if (tOp->theError.code != 626) { + setErrorCode(tOp); + return -1; + } + // first non-existent part + DBG("deletePartsUnknown [out] count=" << count); + return 0; + } + n++; + count++; + } + bat *= 4; + if (bat > maxbat) + bat = maxbat; + } +} + // pending ops int @@ -952,8 +1011,10 @@ NdbBlob::executePendingBlobReads() { Uint8 flags = (1 << NdbOperation::ReadRequest); if (thePendingBlobOps & flags) { + DBG("executePendingBlobReads: executeNoBlobs [in]"); if (theNdbCon->executeNoBlobs(NoCommit) == -1) return -1; + DBG("executePendingBlobReads: executeNoBlobs [out]"); thePendingBlobOps = 0; theNdbCon->thePendingBlobOps = 0; } @@ -965,8 +1026,10 @@ NdbBlob::executePendingBlobWrites() { Uint8 flags = 0xFF & ~(1 << NdbOperation::ReadRequest); if (thePendingBlobOps & flags) { + DBG("executePendingBlobWrites: executeNoBlobs [in]"); if (theNdbCon->executeNoBlobs(NoCommit) == -1) return -1; + DBG("executePendingBlobWrites: executeNoBlobs [out]"); thePendingBlobOps = 0; theNdbCon->thePendingBlobOps = 0; } @@ -978,10 +1041,10 @@ NdbBlob::executePendingBlobWrites() int NdbBlob::invokeActiveHook() { - DBG("invokeActiveHook"); + DBG("invokeActiveHook [in]"); assert(theState == Active && theActiveHook != NULL); int ret = (*theActiveHook)(this, theActiveHookArg); - DBG("invokeActiveHook ret=" << ret); + DBG("invokeActiveHook [out] ret=" << ret); if (ret != 0) { // no error is set on blob level return -1; @@ -1007,7 +1070,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theTable = anOp->m_currentTable; theAccessTable = anOp->m_accessTable; theColumn = aColumn; - DBG("atPrepare"); + DBG("atPrepare [in]"); NdbDictionary::Column::Type partType = NdbDictionary::Column::Undefined; switch (theColumn->getType()) { case NdbDictionary::Column::Blob: @@ -1019,7 +1082,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theFillChar = 0x20; break; default: - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } // sizes @@ -1037,7 +1100,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* (bc = bt->getColumn("DATA")) == NULL || bc->getType() != partType || bc->getLength() != (int)thePartSize) { - setErrorCode(ErrTable); + setErrorCode(NdbBlobImpl::ErrTable); return -1; } theBlobTable = &NdbTableImpl::getImpl(*bt); @@ -1046,6 +1109,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theKeyBuf.alloc(theTable->m_sizeOfKeysInWords << 2); theAccessKeyBuf.alloc(theAccessTable->m_sizeOfKeysInWords << 2); theHeadInlineBuf.alloc(sizeof(Head) + theInlineSize); + theHeadInlineCopyBuf.alloc(sizeof(Head) + theInlineSize); thePartBuf.alloc(thePartSize); theHead = (Head*)theHeadInlineBuf.data; theInlineData = theHeadInlineBuf.data + sizeof(Head); @@ -1057,7 +1121,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; if (theNdbOp->getKeyFromTCREQ(data, size) == -1) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } } @@ -1066,7 +1130,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* Uint32* data = (Uint32*)theAccessKeyBuf.data; unsigned size = theAccessTable->m_sizeOfKeysInWords; if (theNdbOp->getKeyFromTCREQ(data, size) == -1) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } } @@ -1080,6 +1144,12 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theNullFlag = true; theLength = 0; } + if (isWriteOp()) { + // becomes NULL unless set before execute + theNullFlag = true; + theLength = 0; + theHeadInlineUpdateFlag = true; + } supportedOp = true; } if (isScanOp()) { @@ -1089,23 +1159,25 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* supportedOp = true; } if (! supportedOp) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } setState(Prepared); - DBG("atPrepare out"); + DBG("atPrepare [out]"); return 0; } /* * Before execute of prepared operation. May add new operations before * this one. May ask that this operation and all before it (a "batch") - * is executed immediately in no-commit mode. + * is executed immediately in no-commit mode. In this case remaining + * prepared operations are saved in a separate list. They are added + * back after postExecute. */ int NdbBlob::preExecute(ExecType anExecType, bool& batch) { - DBG("preExecute"); + DBG("preExecute [in]"); if (theState == Invalid) return -1; assert(theState == Prepared); @@ -1120,11 +1192,11 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) if (isInsertOp()) { if (theSetFlag && theGetSetBytes > theInlineSize) { // add ops to write rest of a setValue - assert(theSetBuf != 0); - Uint64 pos = theInlineSize; + assert(theSetBuf != NULL); const char* buf = theSetBuf + theInlineSize; Uint32 bytes = theGetSetBytes - theInlineSize; - if (writeDataPrivate(pos, buf, bytes) == -1) + assert(thePos == theInlineSize); + if (writeDataPrivate(buf, bytes) == -1) return -1; if (theHeadInlineUpdateFlag) { // add an operation to update head+inline @@ -1133,14 +1205,15 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) tOp->updateTuple() == -1 || setTableKeyValue(tOp) == -1 || setHeadInlineValue(tOp) == -1) { - setErrorCode(ErrAbort); + setErrorCode(NdbBlobImpl::ErrAbort); return -1; } + DBG("add op to update head+inline"); } } } if (isTableOp()) { - if (isUpdateOp() || isDeleteOp()) { + if (isUpdateOp() || isWriteOp() || isDeleteOp()) { // add operation before this one to read head+inline NdbOperation* tOp = theNdbCon->getNdbOperation(theTable, theNdbOp); if (tOp == NULL || @@ -1150,8 +1223,13 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) setErrorCode(tOp); return -1; } + if (isWriteOp()) { + tOp->m_abortOption = AO_IgnoreError; + } + theHeadInlineReadOp = tOp; // execute immediately batch = true; + DBG("add op before to read head+inline"); } } if (isIndexOp()) { @@ -1170,7 +1248,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) return -1; } } else { - NdbOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); + NdbIndexOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); if (tOp == NULL || tOp->readTuple() == -1 || setAccessKeyValue(tOp) == -1 || @@ -1180,6 +1258,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) } } } + DBG("added op before to read table key"); if (isUpdateOp() || isDeleteOp()) { // add op before this one to read head+inline via index NdbIndexOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); @@ -1190,15 +1269,43 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) setErrorCode(tOp); return -1; } + if (isWriteOp()) { + tOp->m_abortOption = AO_IgnoreError; + } + theHeadInlineReadOp = tOp; // execute immediately batch = true; + DBG("added index op before to read head+inline"); + } + if (isWriteOp()) { + // XXX until IgnoreError fixed for index op + batch = true; + } + } + if (isWriteOp()) { + if (theSetFlag) { + // write head+inline now + theNullFlag = true; + theLength = 0; + if (theSetBuf != NULL) { + Uint32 n = theGetSetBytes; + if (n > theInlineSize) + n = theInlineSize; + assert(thePos == 0); + if (writeDataPrivate(theSetBuf, n) == -1) + return -1; + } + if (setHeadInlineValue(theNdbOp) == -1) + return -1; + // the read op before us may overwrite + theHeadInlineCopyBuf.copyfrom(theHeadInlineBuf); } } if (theActiveHook != NULL) { // need blob head for callback batch = true; } - DBG("preExecute out batch=" << batch); + DBG("preExecute [out] batch=" << batch); return 0; } @@ -1211,15 +1318,16 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) int NdbBlob::postExecute(ExecType anExecType) { - DBG("postExecute type=" << anExecType); + DBG("postExecute [in] type=" << anExecType); if (theState == Invalid) return -1; if (theState == Active) { setState(anExecType == NoCommit ? Active : Closed); - DBG("postExecute skip"); + DBG("postExecute [skip]"); return 0; } assert(theState == Prepared); + setState(anExecType == NoCommit ? Active : Closed); assert(isKeyOp()); if (isIndexOp()) { NdbBlob* tFirstBlob = theNdbOp->theBlobList; @@ -1231,22 +1339,13 @@ NdbBlob::postExecute(ExecType anExecType) } if (isReadOp()) { getHeadFromRecAttr(); - if (theGetFlag && theGetSetBytes > 0) { - // copy inline bytes to user buffer - assert(theGetBuf != NULL); - unsigned n = theGetSetBytes; - if (n > theInlineSize) - n = theInlineSize; - memcpy(theGetBuf, theInlineData, n); - } - if (theGetFlag && theGetSetBytes > theInlineSize) { - // add ops to read rest of a getValue - assert(anExecType == NoCommit); - assert(theGetBuf != 0); - Uint64 pos = theInlineSize; - char* buf = theGetBuf + theInlineSize; - Uint32 bytes = theGetSetBytes - theInlineSize; - if (readDataPrivate(pos, buf, bytes) == -1) + if (setPos(0) == -1) + return -1; + if (theGetFlag) { + assert(theGetSetBytes == 0 || theGetBuf != 0); + assert(theGetSetBytes <= theInlineSize || anExecType == NoCommit); + Uint32 bytes = theGetSetBytes; + if (readDataPrivate(theGetBuf, bytes) == -1) return -1; } } @@ -1255,10 +1354,11 @@ NdbBlob::postExecute(ExecType anExecType) getHeadFromRecAttr(); if (theSetFlag) { // setValue overwrites everything - if (theSetBuf != 0) { + if (theSetBuf != NULL) { if (truncate(0) == -1) return -1; - if (writeDataPrivate(0, theSetBuf, theGetSetBytes) == -1) + assert(thePos == 0); + if (writeDataPrivate(theSetBuf, theGetSetBytes) == -1) return -1; } else { if (setNull() == -1) @@ -1266,6 +1366,57 @@ NdbBlob::postExecute(ExecType anExecType) } } } + if (isWriteOp() && isTableOp()) { + assert(anExecType == NoCommit); + if (theHeadInlineReadOp->theError.code == 0) { + int tNullFlag = theNullFlag; + Uint64 tLength = theLength; + Uint64 tPos = thePos; + getHeadFromRecAttr(); + DBG("tuple found"); + if (truncate(0) == -1) + return -1; + // restore previous head+inline + theHeadInlineBuf.copyfrom(theHeadInlineCopyBuf); + theNullFlag = tNullFlag; + theLength = tLength; + thePos = tPos; + } else { + if (theHeadInlineReadOp->theError.code != 626) { + setErrorCode(theHeadInlineReadOp); + return -1; + } + DBG("tuple not found"); + /* + * Read found no tuple but it is possible that a tuple was + * created after the read by another transaction. Delete all + * blob parts which may exist. + */ + if (deletePartsUnknown(0) == -1) + return -1; + } + if (theSetFlag && theGetSetBytes > theInlineSize) { + assert(theSetBuf != NULL); + const char* buf = theSetBuf + theInlineSize; + Uint32 bytes = theGetSetBytes - theInlineSize; + assert(thePos == theInlineSize); + if (writeDataPrivate(buf, bytes) == -1) + return -1; + } + } + if (isWriteOp() && isIndexOp()) { + // XXX until IgnoreError fixed for index op + if (deletePartsUnknown(0) == -1) + return -1; + if (theSetFlag && theGetSetBytes > theInlineSize) { + assert(theSetBuf != NULL); + const char* buf = theSetBuf + theInlineSize; + Uint32 bytes = theGetSetBytes - theInlineSize; + assert(thePos == theInlineSize); + if (writeDataPrivate(buf, bytes) == -1) + return -1; + } + } if (isDeleteOp()) { assert(anExecType == NoCommit); getHeadFromRecAttr(); @@ -1278,7 +1429,19 @@ NdbBlob::postExecute(ExecType anExecType) if (invokeActiveHook() == -1) return -1; } - DBG("postExecute out"); + if (anExecType == NoCommit && theHeadInlineUpdateFlag) { + NdbOperation* tOp = theNdbCon->getNdbOperation(theTable); + if (tOp == NULL || + tOp->updateTuple() == -1 || + setTableKeyValue(tOp) == -1 || + setHeadInlineValue(tOp) == -1) { + setErrorCode(NdbBlobImpl::ErrAbort); + return -1; + } + tOp->m_abortOption = AbortOnError; + DBG("added op to update head+inline"); + } + DBG("postExecute [out]"); return 0; } @@ -1289,12 +1452,12 @@ NdbBlob::postExecute(ExecType anExecType) int NdbBlob::preCommit() { - DBG("preCommit"); + DBG("preCommit [in]"); if (theState == Invalid) return -1; assert(theState == Active); assert(isKeyOp()); - if (isInsertOp() || isUpdateOp()) { + if (isInsertOp() || isUpdateOp() || isWriteOp()) { if (theHeadInlineUpdateFlag) { // add an operation to update head+inline NdbOperation* tOp = theNdbCon->getNdbOperation(theTable); @@ -1302,12 +1465,14 @@ NdbBlob::preCommit() tOp->updateTuple() == -1 || setTableKeyValue(tOp) == -1 || setHeadInlineValue(tOp) == -1) { - setErrorCode(ErrAbort); + setErrorCode(NdbBlobImpl::ErrAbort); return -1; } + tOp->m_abortOption = AbortOnError; + DBG("added op to update head+inline"); } } - DBG("preCommit out"); + DBG("preCommit [out]"); return 0; } @@ -1317,41 +1482,26 @@ NdbBlob::preCommit() int NdbBlob::atNextResult() { - DBG("atNextResult"); + DBG("atNextResult [in]"); if (theState == Invalid) return -1; assert(isScanOp()); - getHeadFromRecAttr(); - // reset position - thePos = 0; // get primary key { Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; if (((NdbScanOperation*)theNdbOp)->getKeyFromKEYINFO20(data, size) == -1) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } } - if (! theNullFlag) { - if (theGetFlag && theGetSetBytes > 0) { - // copy inline bytes to user buffer - assert(theGetBuf != NULL); - unsigned n = theGetSetBytes; - if (n > theLength) - n = theLength; - if (n > theInlineSize) - n = theInlineSize; - memcpy(theGetBuf, theInlineData, n); - } - if (theGetFlag && theGetSetBytes > theInlineSize && theLength > theInlineSize) { - // add ops to read rest of a getValue - assert(theGetBuf != 0); - Uint64 pos = theInlineSize; - char* buf = theGetBuf + theInlineSize; - Uint32 bytes = theGetSetBytes - theInlineSize; - if (readDataPrivate(pos, buf, bytes) == -1) - return -1; - } + getHeadFromRecAttr(); + if (setPos(0) == -1) + return -1; + if (theGetFlag) { + assert(theGetSetBytes == 0 || theGetBuf != 0); + Uint32 bytes = theGetSetBytes; + if (readDataPrivate(theGetBuf, bytes) == -1) + return -1; } setState(Active); // activation callback @@ -1359,7 +1509,7 @@ NdbBlob::atNextResult() if (invokeActiveHook() == -1) return -1; } - DBG("atNextResult out"); + DBG("atNextResult [out]"); return 0; } @@ -1396,7 +1546,7 @@ NdbBlob::setErrorCode(NdbOperation* anOp, bool invalidFlag) else if ((code = theNdb->theError.code) != 0) ; else - code = ErrUnknown; + code = NdbBlobImpl::ErrUnknown; setErrorCode(code, invalidFlag); } @@ -1409,7 +1559,7 @@ NdbBlob::setErrorCode(NdbConnection* aCon, bool invalidFlag) else if ((code = theNdb->theError.code) != 0) ; else - code = ErrUnknown; + code = NdbBlobImpl::ErrUnknown; setErrorCode(code, invalidFlag); } @@ -1444,7 +1594,8 @@ operator<<(NdbOut& out, const NdbBlob& blob) ndbout << dec << " n=" << blob.theNullFlag;; ndbout << dec << " l=" << blob.theLength; ndbout << dec << " p=" << blob.thePos; - ndbout << dec << " u=" << (Uint32) blob.theHeadInlineUpdateFlag; + ndbout << dec << " u=" << (Uint32)blob.theHeadInlineUpdateFlag; + ndbout << dec << " g=" << (Uint32)blob.theGetSetBytes; return out; } #endif diff --git a/ndb/src/ndbapi/NdbBlobImpl.hpp b/ndb/src/ndbapi/NdbBlobImpl.hpp new file mode 100644 index 00000000000..0030e910c52 --- /dev/null +++ b/ndb/src/ndbapi/NdbBlobImpl.hpp @@ -0,0 +1,39 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef NdbBlobImpl_H +#define NdbBlobImpl_H + +class NdbBlobImpl { +public: + STATIC_CONST( BlobTableNameSize = 40 ); + // "Invalid blob attributes or invalid blob parts table" + STATIC_CONST( ErrTable = 4263 ); + // "Invalid usage of blob attribute" + STATIC_CONST( ErrUsage = 4264 ); + // "Method is not valid in current blob state" + STATIC_CONST( ErrState = 4265 ); + // "Invalid blob seek position" + STATIC_CONST( ErrSeek = 4266 ); + // "Corrupted blob value" + STATIC_CONST( ErrCorrupt = 4267 ); + // "Error in blob head update forced rollback of transaction" + STATIC_CONST( ErrAbort = 4268 ); + // "Unknown blob error" + STATIC_CONST( ErrUnknown = 4269 ); +}; + +#endif diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index 1457792cf28..0a1c7303771 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -55,6 +55,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) : theFirstExecOpInList(NULL), theLastExecOpInList(NULL), theCompletedFirstOp(NULL), + theCompletedLastOp(NULL), theNoOfOpSent(0), theNoOfOpCompleted(0), theNoOfOpFetched(0), @@ -82,7 +83,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) : { theListState = NotInList; theError.code = 0; - theId = theNdb->theNdbObjectIdMap->map(this); + theId = theNdb->theImpl->theNdbObjectIdMap.map(this); #define CHECK_SZ(mask, sz) assert((sizeof(mask)/sizeof(mask[0])) == sz) @@ -98,7 +99,7 @@ Remark: Deletes the connection object. NdbConnection::~NdbConnection() { DBUG_ENTER("NdbConnection::~NdbConnection"); - theNdb->theNdbObjectIdMap->unmap(theId, this); + theNdb->theImpl->theNdbObjectIdMap.unmap(theId, this); DBUG_VOID_RETURN; }//NdbConnection::~NdbConnection() @@ -124,6 +125,7 @@ NdbConnection::init() theLastExecOpInList = NULL; theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; theGlobalCheckpointId = 0; theCommitStatus = Started; @@ -170,12 +172,14 @@ Remark: Sets an error code on the connection object from an operation object. *****************************************************************************/ void -NdbConnection::setOperationErrorCodeAbort(int error) +NdbConnection::setOperationErrorCodeAbort(int error, int abortOption) { DBUG_ENTER("NdbConnection::setOperationErrorCodeAbort"); + if (abortOption == -1) + abortOption = m_abortOption; if (theTransactionIsStarted == false) { theCommitStatus = Aborted; - } else if ((m_abortOption == AbortOnError) && + } else if ((abortOption == AbortOnError) && (theCommitStatus != Committed) && (theCommitStatus != Aborted)) { theCommitStatus = NeedAbort; @@ -254,6 +258,8 @@ NdbConnection::handleExecuteCompletion() if (tLastExecOp != NULL) { tLastExecOp->next(theCompletedFirstOp); theCompletedFirstOp = tFirstExecOp; + if (theCompletedLastOp == NULL) + theCompletedLastOp = tLastExecOp; theFirstExecOpInList = NULL; theLastExecOpInList = NULL; }//if @@ -290,6 +296,8 @@ NdbConnection::execute(ExecType aTypeOfExec, ExecType tExecType; NdbOperation* tPrepOp; + NdbOperation* tCompletedFirstOp = NULL; + NdbOperation* tCompletedLastOp = NULL; int ret = 0; do { @@ -312,6 +320,7 @@ NdbConnection::execute(ExecType aTypeOfExec, } tPrepOp = tPrepOp->next(); } + // save rest of prepared ops if batch NdbOperation* tRestOp= 0; NdbOperation* tLastOp= 0; @@ -321,6 +330,7 @@ NdbConnection::execute(ExecType aTypeOfExec, tLastOp = theLastOpInList; theLastOpInList = tPrepOp; } + if (tExecType == Commit) { NdbOperation* tOp = theCompletedFirstOp; while (tOp != NULL) { @@ -335,8 +345,28 @@ NdbConnection::execute(ExecType aTypeOfExec, tOp = tOp->next(); } } + + // completed ops are in unspecified order + if (theCompletedFirstOp != NULL) { + if (tCompletedFirstOp == NULL) { + tCompletedFirstOp = theCompletedFirstOp; + tCompletedLastOp = theCompletedLastOp; + } else { + tCompletedLastOp->next(theCompletedFirstOp); + tCompletedLastOp = theCompletedLastOp; + } + theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; + } + if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) ret = -1; +#ifdef ndb_api_crash_on_complex_blob_abort + assert(theFirstOpInList == NULL && theLastOpInList == NULL); +#else + theFirstOpInList = theLastOpInList = NULL; +#endif + { NdbOperation* tOp = theCompletedFirstOp; while (tOp != NULL) { @@ -352,6 +382,7 @@ NdbConnection::execute(ExecType aTypeOfExec, tOp = tOp->next(); } } + // add saved prepared ops if batch if (tPrepOp != NULL && tRestOp != NULL) { if (theFirstOpInList == NULL) @@ -360,8 +391,21 @@ NdbConnection::execute(ExecType aTypeOfExec, theLastOpInList->next(tRestOp); theLastOpInList = tLastOp; } + assert(theFirstOpInList == NULL || tExecType == NoCommit); } while (theFirstOpInList != NULL || tExecType != aTypeOfExec); + if (tCompletedFirstOp != NULL) { + tCompletedLastOp->next(theCompletedFirstOp); + theCompletedFirstOp = tCompletedFirstOp; + if (theCompletedLastOp == NULL) + theCompletedLastOp = tCompletedLastOp; + } +#if ndb_api_count_completed_ops_after_blob_execute + { NdbOperation* tOp; unsigned n = 0; + for (tOp = theCompletedFirstOp; tOp != NULL; tOp = tOp->next()) n++; + ndbout << "completed ops: " << n << endl; + } +#endif DBUG_RETURN(ret); } @@ -883,6 +927,7 @@ NdbConnection::releaseOperations() releaseOps(theFirstExecOpInList); theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; theFirstOpInList = NULL; theFirstExecOpInList = NULL; theLastOpInList = NULL; @@ -898,6 +943,7 @@ NdbConnection::releaseCompletedOperations() { releaseOps(theCompletedFirstOp); theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; }//NdbConnection::releaseOperations() /****************************************************************************** @@ -1075,8 +1121,11 @@ NdbConnection::getNdbIndexScanOperation(const NdbIndexImpl* index, if (indexTable != 0){ NdbIndexScanOperation* tOp = getNdbScanOperation((NdbTableImpl *) indexTable); - tOp->m_currentTable = table; - if(tOp) tOp->m_cursor_type = NdbScanOperation::IndexCursor; + if(tOp) + { + tOp->m_currentTable = table; + tOp->m_cursor_type = NdbScanOperation::IndexCursor; + } return tOp; } else { setOperationErrorCodeAbort(theNdb->theError.code); @@ -1567,13 +1616,10 @@ from other transactions. (theLastExecOpInList->theCommitIndicator == 1)){ - if (m_abortOption == IgnoreError && theError.code != 0){ + if (m_abortOption == AO_IgnoreError && theError.code != 0){ /** * There's always a TCKEYCONF when using IgnoreError */ -#ifdef VM_TRACE - ndbout_c("Not completing transaction 2"); -#endif return -1; } /**********************************************************************/ @@ -1806,11 +1852,12 @@ Parameters: aErrorCode: The error code. Remark: An operation was completed with failure. *******************************************************************************/ int -NdbConnection::OpCompleteFailure(Uint8 abortOption) +NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure) { Uint32 tNoComp = theNoOfOpCompleted; Uint32 tNoSent = theNoOfOpSent; - theCompletionStatus = NdbConnection::CompletedFailure; + if (setFailure) + theCompletionStatus = NdbConnection::CompletedFailure; tNoComp++; theNoOfOpCompleted = tNoComp; if (tNoComp == tNoSent) { @@ -1820,13 +1867,10 @@ NdbConnection::OpCompleteFailure(Uint8 abortOption) //decide the success of the whole transaction since a simple //operation is not really part of that transaction. //------------------------------------------------------------------------ - if (abortOption == IgnoreError){ + if (abortOption == AO_IgnoreError){ /** * There's always a TCKEYCONF when using IgnoreError */ -#ifdef VM_TRACE - ndbout_c("Not completing transaction"); -#endif return -1; } diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp index 3fe8993a42b..b0c546c512a 100644 --- a/ndb/src/ndbapi/NdbConnectionScan.cpp +++ b/ndb/src/ndbapi/NdbConnectionScan.cpp @@ -56,13 +56,19 @@ NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){ const ScanTabRef * ref = CAST_CONSTPTR(ScanTabRef, aSignal->getDataPtr()); if(checkState_TransId(&ref->transId1)){ - theScanningOp->theError.code = ref->errorCode; + theScanningOp->setErrorCode(ref->errorCode); + theScanningOp->execCLOSE_SCAN_REP(); if(!ref->closeNeeded){ - theScanningOp->execCLOSE_SCAN_REP(); return 0; } - assert(theScanningOp->m_sent_receivers_count); + + /** + * Setup so that close_impl will actually perform a close + * and not "close scan"-optimze it away + */ theScanningOp->m_conf_receivers_count++; + theScanningOp->m_conf_receivers[0] = theScanningOp->m_receivers[0]; + theScanningOp->m_conf_receivers[0]->m_tcPtrI = ~0; return 0; } else { #ifdef NDB_NO_DROPPED_SIGNAL @@ -97,7 +103,7 @@ NdbConnection::receiveSCAN_TABCONF(NdbApiSignal* aSignal, theScanningOp->execCLOSE_SCAN_REP(); return 0; } - + for(Uint32 i = 0; i<len; i += 3){ Uint32 opCount, totalLen; Uint32 ptrI = * ops++; @@ -109,24 +115,12 @@ NdbConnection::receiveSCAN_TABCONF(NdbApiSignal* aSignal, void * tPtr = theNdb->int2void(ptrI); assert(tPtr); // For now NdbReceiver* tOp = theNdb->void2rec(tPtr); - if (tOp && tOp->checkMagicNumber()){ - if(tOp->execSCANOPCONF(tcPtrI, totalLen, opCount)){ - /** - * - */ - theScanningOp->receiver_delivered(tOp); - } else if(info == ScanTabConf::EndOfData){ + if (tOp && tOp->checkMagicNumber()) + { + if (tcPtrI == RNIL && opCount == 0) theScanningOp->receiver_completed(tOp); - } - } - } - if (conf->requestInfo & ScanTabConf::EndOfData) { - if(theScanningOp->m_ordered) - theScanningOp->m_api_receivers_count = 0; - if(theScanningOp->m_api_receivers_count + - theScanningOp->m_conf_receivers_count + - theScanningOp->m_sent_receivers_count){ - abort(); + else if (tOp->execSCANOPCONF(tcPtrI, totalLen, opCount)) + theScanningOp->receiver_delivered(tOp); } } return 0; diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index c8414ec16a3..00db5704949 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -343,6 +343,18 @@ NdbDictionary::Table::getColumn(const int attrId) const { return m_impl.getColumn(attrId); } +NdbDictionary::Column* +NdbDictionary::Table::getColumn(const char * name) +{ + return m_impl.getColumn(name); +} + +NdbDictionary::Column* +NdbDictionary::Table::getColumn(const int attrId) +{ + return m_impl.getColumn(attrId); +} + void NdbDictionary::Table::setLogging(bool val){ m_impl.m_logging = val; @@ -761,14 +773,6 @@ NdbDictionary::Dictionary::removeCachedTable(const char * name){ m_impl.removeCachedObject(* t); } -NdbDictionary::Table -NdbDictionary::Dictionary::getTableForAlteration(const char * name){ - const NdbDictionary::Table * oldTable = getTable(name); - return (oldTable) ? - NdbDictionary::Table(*oldTable) - : NdbDictionary::Table(); -} - int NdbDictionary::Dictionary::createIndex(const Index & ind) { @@ -914,8 +918,11 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) case NdbDictionary::Column::Double: out << "Double"; break; - case NdbDictionary::Column::Decimal: - out << "Decimal(" << col.getScale() << "," << col.getPrecision() << ")"; + case NdbDictionary::Column::Olddecimal: + out << "Olddecimal(" << col.getPrecision() << "," << col.getScale() << ")"; + break; + case NdbDictionary::Column::Olddecimalunsigned: + out << "Olddecimalunsigned(" << col.getPrecision() << "," << col.getScale() << ")"; break; case NdbDictionary::Column::Char: out << "Char(" << col.getLength() << ";" << csname << ")"; @@ -932,8 +939,8 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) case NdbDictionary::Column::Datetime: out << "Datetime"; break; - case NdbDictionary::Column::Timespec: - out << "Timespec"; + case NdbDictionary::Column::Date: + out << "Date"; break; case NdbDictionary::Column::Blob: out << "Blob(" << col.getInlineSize() << "," << col.getPartSize() @@ -943,6 +950,15 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) out << "Text(" << col.getInlineSize() << "," << col.getPartSize() << ";" << col.getStripeSize() << ";" << csname << ")"; break; + case NdbDictionary::Column::Time: + out << "Time"; + break; + case NdbDictionary::Column::Year: + out << "Year"; + break; + case NdbDictionary::Column::Timestamp: + out << "Timestamp"; + break; case NdbDictionary::Column::Undefined: out << "Undefined"; break; @@ -956,6 +972,10 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) out << " NOT NULL"; else out << " NULL"; + + if (col.getDistributionKey()) + out << " DISTRIBUTION KEY"; + return out; } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index cf51a30fe0b..e88f76ef513 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -34,7 +34,8 @@ #include <AttributeList.hpp> #include <NdbEventOperation.hpp> #include "NdbEventOperationImpl.hpp" -#include "NdbBlob.hpp" +#include <NdbBlob.hpp> +#include "NdbBlobImpl.hpp" #include <AttributeHeader.hpp> #include <my_sys.h> @@ -47,13 +48,13 @@ * Column */ NdbColumnImpl::NdbColumnImpl() - : NdbDictionary::Column(* this), m_facade(this) + : NdbDictionary::Column(* this), m_attrId(-1), m_facade(this) { init(); } NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f) - : NdbDictionary::Column(* this), m_facade(&f) + : NdbDictionary::Column(* this), m_attrId(-1), m_facade(&f) { init(); } @@ -93,8 +94,7 @@ NdbColumnImpl::init(Type t) { // do not use default_charset_info as it may not be initialized yet // use binary collation until NDB tests can handle charsets - CHARSET_INFO* default_cs = &my_charset_latin1_bin; - m_attrId = -1; + CHARSET_INFO* default_cs = &my_charset_bin; m_type = t; switch (m_type) { case Tinyint: @@ -114,7 +114,8 @@ NdbColumnImpl::init(Type t) m_length = 1; m_cs = NULL; break; - case Decimal: + case Olddecimal: + case Olddecimalunsigned: m_precision = 10; m_scale = 0; m_length = 1; @@ -130,7 +131,7 @@ NdbColumnImpl::init(Type t) case Binary: case Varbinary: case Datetime: - case Timespec: + case Date: m_precision = 0; m_scale = 0; m_length = 1; @@ -148,6 +149,14 @@ NdbColumnImpl::init(Type t) m_length = 4; m_cs = default_cs; break; + case Time: + case Year: + case Timestamp: + m_precision = 0; + m_scale = 0; + m_length = 1; + m_cs = NULL; + break; case Undefined: assert(false); break; @@ -276,7 +285,7 @@ void NdbTableImpl::init(){ clearNewProperties(); m_frm.clear(); - m_fragmentType = NdbDictionary::Object::FragAllMedium; + m_fragmentType = NdbDictionary::Object::FragAllSmall; m_logging = true; m_kvalue = 6; m_minLoadFactor = 78; @@ -937,6 +946,12 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal, if(m_waiter.m_state == WAIT_NODE_FAILURE) continue; + if(m_waiter.m_state == WST_WAIT_TIMEOUT) + { + m_error.code = 4008; + DBUG_RETURN(-1); + } + if ( (temporaryMask & m_error.code) != 0 ) { continue; } @@ -1168,15 +1183,19 @@ columnTypeMapping[] = { { DictTabInfo::ExtBigunsigned, NdbDictionary::Column::Bigunsigned }, { DictTabInfo::ExtFloat, NdbDictionary::Column::Float }, { DictTabInfo::ExtDouble, NdbDictionary::Column::Double }, - { DictTabInfo::ExtDecimal, NdbDictionary::Column::Decimal }, + { DictTabInfo::ExtOlddecimal, NdbDictionary::Column::Olddecimal }, + { DictTabInfo::ExtOlddecimalunsigned, NdbDictionary::Column::Olddecimalunsigned }, { DictTabInfo::ExtChar, NdbDictionary::Column::Char }, { DictTabInfo::ExtVarchar, NdbDictionary::Column::Varchar }, { DictTabInfo::ExtBinary, NdbDictionary::Column::Binary }, { DictTabInfo::ExtVarbinary, NdbDictionary::Column::Varbinary }, { DictTabInfo::ExtDatetime, NdbDictionary::Column::Datetime }, - { DictTabInfo::ExtTimespec, NdbDictionary::Column::Timespec }, + { DictTabInfo::ExtDate, NdbDictionary::Column::Date }, { DictTabInfo::ExtBlob, NdbDictionary::Column::Blob }, { DictTabInfo::ExtText, NdbDictionary::Column::Text }, + { DictTabInfo::ExtTime, NdbDictionary::Column::Time }, + { DictTabInfo::ExtYear, NdbDictionary::Column::Year }, + { DictTabInfo::ExtTimestamp, NdbDictionary::Column::Timestamp }, { -1, -1 } }; @@ -1386,7 +1405,7 @@ NdbDictionaryImpl::addBlobTables(NdbTableImpl &t) if (! c.getBlobType() || c.getPartSize() == 0) continue; n--; - char btname[NdbBlob::BlobTableNameSize]; + char btname[NdbBlobImpl::BlobTableNameSize]; NdbBlob::getBlobTableName(btname, &t, &c); // Save BLOB table handle NdbTableImpl * cachedBlobTable = getTable(btname); @@ -1412,15 +1431,14 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) const char * originalInternalName = internalName.c_str(); BaseString externalName = impl.m_externalName; const char * originalExternalName = externalName.c_str(); - NdbTableImpl * oldTab = getTable(originalExternalName); - - if(!oldTab){ + + DBUG_ENTER("NdbDictionaryImpl::alterTable"); + if(!get_local_table_info(originalInternalName, false)){ m_error.code = 709; - return -1; + DBUG_RETURN(-1); } // Alter the table int ret = m_receiver.alterTable(m_ndb, impl); - if(ret == 0){ // Remove cached information and let it be refreshed at next access if (m_localHash.get(originalInternalName) != NULL) { @@ -1434,7 +1452,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) m_globalHash->unlock(); } } - return ret; + DBUG_RETURN(ret); } int @@ -1449,15 +1467,16 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, NdbTableImpl & impl, bool alter) { + DBUG_ENTER("NdbDictInterface::createOrAlterTable"); unsigned i; if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){ m_error.code = 4317; - return -1; + DBUG_RETURN(-1); } unsigned sz = impl.m_columns.size(); if (sz > NDB_MAX_ATTRIBUTES_IN_TABLE){ m_error.code = 4318; - return -1; + DBUG_RETURN(-1); } impl.copyNewProperties(); @@ -1492,7 +1511,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, // Check max length of frm data if (impl.m_frm.length() > MAX_FRM_DATA_SIZE){ m_error.code = 1229; - return -1; + DBUG_RETURN(-1); } tmpTab.FrmLen = impl.m_frm.length(); memcpy(tmpTab.FrmData, impl.m_frm.get_data(), impl.m_frm.length()); @@ -1544,12 +1563,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, // charset is defined exactly for char types if (col->getCharType() != (col->m_cs != NULL)) { m_error.code = 703; - return -1; + DBUG_RETURN(-1); } // primary key type check if (col->m_pk && ! NdbSqlUtil::usable_in_pk(col->m_type, col->m_cs)) { m_error.code = 743; - return -1; + DBUG_RETURN(-1); } // charset in upper half of precision if (col->getCharType()) { @@ -1572,7 +1591,13 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, NdbApiSignal tSignal(m_reference); tSignal.theReceiversBlockNumber = DBDICT; - if (alter) { + + LinearSectionPtr ptr[3]; + ptr[0].p = (Uint32*)m_buffer.get_data(); + ptr[0].sz = m_buffer.length() / 4; + int ret; + if (alter) + { AlterTableReq * const req = CAST_PTR(AlterTableReq, tSignal.getDataPtrSend()); @@ -1583,8 +1608,10 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, req->tableVersion = impl.m_version;; tSignal.theVerId_signalNumber = GSN_ALTER_TABLE_REQ; tSignal.theLength = AlterTableReq::SignalLength; + ret= alterTable(&tSignal, ptr); } - else { + else + { CreateTableReq * const req = CAST_PTR(CreateTableReq, tSignal.getDataPtrSend()); @@ -1592,28 +1619,24 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, req->senderData = 0; tSignal.theVerId_signalNumber = GSN_CREATE_TABLE_REQ; tSignal.theLength = CreateTableReq::SignalLength; - } - - LinearSectionPtr ptr[3]; - ptr[0].p = (Uint32*)m_buffer.get_data(); - ptr[0].sz = m_buffer.length() / 4; - - int ret = (alter) ? - alterTable(&tSignal, ptr) - : createTable(&tSignal, ptr); - - if (!alter && haveAutoIncrement) { - if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), - autoIncrementValue)) { - if (ndb.theError.code == 0) { - m_error.code = 4336; - ndb.theError = m_error; - } else - m_error= ndb.theError; - ret = -1; // errorcode set in initialize_autoincrement + ret= createTable(&tSignal, ptr); + + if (ret) + return ret; + + if (haveAutoIncrement) { + if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), + autoIncrementValue)) { + if (ndb.theError.code == 0) { + m_error.code = 4336; + ndb.theError = m_error; + } else + m_error= ndb.theError; + ret = -1; // errorcode set in initialize_autoincrement + } } } - return ret; + DBUG_RETURN(ret); } int @@ -1672,17 +1695,17 @@ NdbDictInterface::alterTable(NdbApiSignal* signal, LinearSectionPtr ptr[3]) int errCodes[noErrCodes] = {AlterTableRef::NotMaster, AlterTableRef::Busy}; - int r = dictSignal(signal,ptr,1, - 1/*use masternode id*/, - 100,WAIT_ALTER_TAB_REQ, - WAITFOR_RESPONSE_TIMEOUT, - errCodes, noErrCodes); - if(m_error.code == AlterTableRef::InvalidTableVersion) { - // Clear caches and try again - return INCOMPATIBLE_VERSION; - } + int r = dictSignal(signal,ptr,1, + 1/*use masternode id*/, + 100,WAIT_ALTER_TAB_REQ, + WAITFOR_RESPONSE_TIMEOUT, + errCodes, noErrCodes); + if(m_error.code == AlterTableRef::InvalidTableVersion) { + // Clear caches and try again + return INCOMPATIBLE_VERSION; + } - return r; + return r; } void @@ -1790,7 +1813,7 @@ NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t) NdbColumnImpl & c = *t.m_columns[i]; if (! c.getBlobType() || c.getPartSize() == 0) continue; - char btname[NdbBlob::BlobTableNameSize]; + char btname[NdbBlobImpl::BlobTableNameSize]; NdbBlob::getBlobTableName(btname, &t, &c); if (dropTable(btname) != 0) { if (m_error.code != 709){ @@ -2076,8 +2099,8 @@ int NdbDictInterface::createIndex(NdbApiSignal* signal, LinearSectionPtr ptr[3]) { - const int noErrCodes = 1; - int errCodes[noErrCodes] = {CreateIndxRef::Busy}; + const int noErrCodes = 2; + int errCodes[noErrCodes] = {CreateIndxRef::Busy, CreateIndxRef::NotMaster}; return dictSignal(signal,ptr,2, 1 /*use masternode id*/, 100, @@ -2101,6 +2124,8 @@ NdbDictInterface::execCREATE_INDX_REF(NdbApiSignal * signal, { const CreateIndxRef* const ref = CAST_CONSTPTR(CreateIndxRef, signal->getDataPtr()); m_error.code = ref->getErrorCode(); + if(m_error.code == ref->NotMaster) + m_masterNodeId= ref->masterNodeId; m_waiter.signal(NO_WAIT); } @@ -2197,8 +2222,8 @@ NdbDictInterface::dropIndex(const NdbIndexImpl & impl, int NdbDictInterface::dropIndex(NdbApiSignal* signal, LinearSectionPtr ptr[3]) { - const int noErrCodes = 1; - int errCodes[noErrCodes] = {DropIndxRef::Busy}; + const int noErrCodes = 2; + int errCodes[noErrCodes] = {DropIndxRef::Busy, DropIndxRef::NotMaster}; int r = dictSignal(signal,NULL,0, 1/*Use masternode id*/, 100, @@ -2225,6 +2250,8 @@ NdbDictInterface::execDROP_INDX_REF(NdbApiSignal * signal, { const DropIndxRef* const ref = CAST_CONSTPTR(DropIndxRef, signal->getDataPtr()); m_error.code = ref->getErrorCode(); + if(m_error.code == ref->NotMaster) + m_masterNodeId= ref->masterNodeId; m_waiter.signal(NO_WAIT); } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 12f0946ab67..602a2d6b6ca 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -28,7 +28,7 @@ #include <Bitmask.hpp> #include <AttributeList.hpp> #include <Ndb.hpp> -#include "NdbImpl.hpp" +#include "NdbWaiter.hpp" #include "DictCache.hpp" class NdbDictObjectImpl { @@ -321,7 +321,7 @@ private: friend class Ndb; static void execSignal(void* dictImpl, class NdbApiSignal* signal, - class LinearSectionPtr ptr[3]); + struct LinearSectionPtr ptr[3]); static void execNodeStatus(void* dictImpl, Uint32, bool alive, bool nfCompleted); @@ -637,11 +637,9 @@ NdbDictionaryImpl::get_local_table_info(const char * internalTableName, return 0; } } - if (do_add_blob_tables && - info->m_table_impl->m_noOfBlobs && - addBlobTables(*(info->m_table_impl))) { - return 0; - } + if (do_add_blob_tables && info->m_table_impl->m_noOfBlobs) + addBlobTables(*(info->m_table_impl)); + return info; // autoincrement already initialized } diff --git a/ndb/src/ndbapi/NdbEventOperation.cpp b/ndb/src/ndbapi/NdbEventOperation.cpp index 506a6c8d86d..d209293f8b0 100644 --- a/ndb/src/ndbapi/NdbEventOperation.cpp +++ b/ndb/src/ndbapi/NdbEventOperation.cpp @@ -121,5 +121,5 @@ NdbEventOperation::wait(void *p, int aMillisecondNumber) } NdbEventOperation::NdbEventOperation(NdbEventOperationImpl& impl) - : m_impl(impl) {}; + : m_impl(impl) {} diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 1fb1969b589..00a8ef19f3a 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -17,7 +17,19 @@ #ifndef NDB_IMPL_HPP #define NDB_IMPL_HPP -#include <Vector.hpp> +#include <ndb_global.h> +#include <Ndb.hpp> +#include <NdbOut.hpp> +#include <NdbError.hpp> +#include <NdbCondition.h> +#include <NdbReceiver.hpp> +#include <NdbOperation.hpp> +#include <kernel/ndb_limits.h> + +#include <NdbTick.h> + +#include "ndb_cluster_connection_impl.hpp" +#include "NdbDictionaryImpl.hpp" #include "ObjectMap.hpp" /** @@ -25,19 +37,29 @@ */ class NdbImpl { public: - Vector<class NdbTableImpl *> m_invalidTables; + NdbImpl(Ndb_cluster_connection *, Ndb&); + ~NdbImpl(); - void checkErrorCode(Uint32 i); - void checkInvalidTable(class NdbDictionaryImpl * dict); -}; + Ndb_cluster_connection_impl &m_ndb_cluster_connection; -#include <Ndb.hpp> -#include <NdbError.hpp> -#include <NdbCondition.h> -#include <NdbReceiver.hpp> -#include <NdbOperation.hpp> + NdbDictionaryImpl m_dictionary; -#include <NdbTick.h> + // Ensure good distribution of connects + Uint32 theCurrentConnectIndex; + Ndb_cluster_connection_node_iter m_node_iter; + + NdbObjectIdMap theNdbObjectIdMap; + + Uint32 theNoOfDBnodes; // The number of DB nodes + Uint8 theDBnodes[MAX_NDB_NODES]; // The node number of the DB nodes + + // 1 indicates to release all connections to node + Uint32 the_release_ind[MAX_NDB_NODES]; + + NdbWaiter theWaiter; + + int m_optimized_node_selection; +}; #ifdef VM_TRACE #define TRACE_DEBUG(x) ndbout << x << endl; @@ -57,7 +79,7 @@ public: inline void * Ndb::int2void(Uint32 val){ - return theNdbObjectIdMap->getObject(val); + return theImpl->theNdbObjectIdMap.getObject(val); } inline @@ -104,26 +126,6 @@ Ndb::checkInitState() Uint32 convertEndian(Uint32 Data); -enum WaitSignalType { - NO_WAIT = 0, - WAIT_NODE_FAILURE = 1, // Node failure during wait - WAIT_TIMEOUT = 2, // Timeout during wait - - WAIT_TC_SEIZE = 3, - WAIT_TC_RELEASE = 4, - WAIT_NDB_TAMPER = 5, - WAIT_SCAN = 6, - - // DICT stuff - WAIT_GET_TAB_INFO_REQ = 11, - WAIT_CREATE_TAB_REQ = 12, - WAIT_DROP_TAB_REQ = 13, - WAIT_ALTER_TAB_REQ = 14, - WAIT_CREATE_INDX_REQ = 15, - WAIT_DROP_INDX_REQ = 16, - WAIT_LIST_TABLES_CONF = 17 -}; - enum LockMode { Read, Update, @@ -131,44 +133,4 @@ enum LockMode { Delete }; -#include <NdbOut.hpp> - -inline -void -NdbWaiter::wait(int waitTime) -{ - const bool forever = (waitTime == -1); - const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; - while (1) { - if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE) - break; - if (forever) { - NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); - } else { - if (waitTime <= 0) { - m_state = WAIT_TIMEOUT; - break; - } - NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); - waitTime = maxTime - NdbTick_CurrentMillisecond(); - } - } -} - -inline -void -NdbWaiter::nodeFail(Uint32 aNodeId){ - if (m_state != NO_WAIT && m_node == aNodeId){ - m_state = WAIT_NODE_FAILURE; - NdbCondition_Signal(m_condition); - } -} - -inline -void -NdbWaiter::signal(Uint32 state){ - m_state = state; - NdbCondition_Signal(m_condition); -} - #endif diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 9abde639914..23af646c4c7 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -71,6 +71,7 @@ NdbIndexOperation::indxInit(const NdbIndexImpl * anIndex, return -1; } m_theIndex = anIndex; + m_thePrimaryTable = aTable; m_accessTable = anIndex->m_table; m_theIndexLen = 0; m_theNoOfIndexDefined = 0; @@ -102,6 +103,12 @@ int NdbIndexOperation::readTuple(NdbOperation::LockMode lm) }; } +int NdbIndexOperation::insertTuple() +{ + setErrorCode(4200); + return -1; +} + int NdbIndexOperation::readTuple() { // First check that index is unique @@ -265,7 +272,7 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, CHARSET_INFO* cs = tAttrInfo->m_cs; if (cs != 0) { // current limitation: strxfrm does not increase length - assert(cs->strxfrm_multiply == 1); + assert(cs->strxfrm_multiply <= 1); unsigned n = (*cs->coll->strnxfrm)(cs, (uchar*)xfrmData, sizeof(xfrmData), @@ -341,12 +348,11 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, theDistrGroupIndicator = 1; }//if /************************************************************************** - * If the operation is an insert request and the attribute is stored then + * If the operation is a write request and the attribute is stored then * we also set the value in the stored part through putting the * information in the INDXATTRINFO signals. *************************************************************************/ - if ((tOpType == InsertRequest) || - (tOpType == WriteRequest)) { + if ((tOpType == WriteRequest)) { if (!tAttrInfo->m_indexOnly){ // invalid data can crash kernel if (cs != NULL && @@ -357,7 +363,13 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, goto equal_error4; Uint32 ahValue; Uint32 sz = totalSizeInWords; - AttributeHeader::init(&ahValue, tAttrId, sz); + /* + * XXX should be linked in metadata but cannot now because + * things can be defined in arbitrary order + */ + const NdbColumnImpl* primaryCol = m_thePrimaryTable->getColumn(tAttrInfo->m_name.c_str()); + assert(primaryCol != NULL); + AttributeHeader::init(&ahValue, primaryCol->m_attrId, sz); insertATTRINFO( ahValue ); insertATTRINFOloop((Uint32*)aValueToWrite, sizeInWords); if (bitsInLastWord != 0) { @@ -369,7 +381,6 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, }//if }//if }//if - /************************************************************************** * Store the Key information in the TCINDXREQ and INDXKEYINFO signals. *************************************************************************/ @@ -734,13 +745,10 @@ NdbIndexOperation::receiveTCINDXREF( NdbApiSignal* aSignal) }//if theStatus = Finished; - + theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; Uint32 errorCode = tcIndxRef->errorCode; theError.code = errorCode; theNdbCon->setOperationErrorCodeAbort(errorCode); return theNdbCon->OpCompleteFailure(theNdbCon->m_abortOption); }//NdbIndexOperation::receiveTCINDXREF() - - - diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index b0b95d0ff43..88d8a000d50 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -78,7 +78,8 @@ NdbOperation::NdbOperation(Ndb* aNdb) : m_tcReqGSN(GSN_TCKEYREQ), m_keyInfoGSN(GSN_KEYINFO), m_attrInfoGSN(GSN_ATTRINFO), - theBlobList(NULL) + theBlobList(NULL), + m_abortOption(-1) { theReceiver.init(NdbReceiver::NDB_OPERATION, this); theError.code = 0; @@ -167,6 +168,7 @@ NdbOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection){ theTotalNrOfKeyWordInSignal = 8; theMagicNumber = 0xABCDEF01; theBlobList = NULL; + m_abortOption = -1; tSignal = theNdb->getSignal(); if (tSignal == NULL) diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp index 35abb15b00d..c4aaffb3119 100644 --- a/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -528,7 +528,9 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, CHARSET_INFO* cs = tAttrInfo->m_cs; // invalid data can crash kernel if (cs != NULL && - (*cs->cset->well_formed_len)(cs, + // fast fix bug#7340 + tAttrInfo->m_type != NdbDictionary::Column::Text && + (*cs->cset->well_formed_len)(cs, aValue, aValue + sizeInBytes, sizeInBytes) != sizeInBytes) { diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index f1338ae01e4..afa3609e11c 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -191,14 +191,15 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) Uint8 tDirtyIndicator = theDirtyIndicator; OperationType tOperationType = theOperationType; Uint32 tTupKeyLen = theTupKeyLen; - Uint8 abortOption = theNdbCon->m_abortOption; + Uint8 abortOption = + m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption; tcKeyReq->setDirtyFlag(tReqInfo, tDirtyIndicator); tcKeyReq->setOperationType(tReqInfo, tOperationType); tcKeyReq->setKeyLength(tReqInfo, tTupKeyLen); // A simple read is always ignore error - abortOption = tSimpleIndicator ? IgnoreError : abortOption; + abortOption = tSimpleIndicator ? AO_IgnoreError : abortOption; tcKeyReq->setAbortOption(tReqInfo, abortOption); Uint8 tDistrKeyIndicator = theDistrKeyIndicator; @@ -541,17 +542,20 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) return -1; }//if - AbortOption ao = (AbortOption)theNdbCon->m_abortOption; + AbortOption ao = (AbortOption) + (m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption); theReceiver.m_received_result_length = ~0; theStatus = Finished; - theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; + // blobs want this + if (m_abortOption != AO_IgnoreError) + theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; theError.code = aSignal->readData(4); - theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4)); + theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), m_abortOption); if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read - return theNdbCon->OpCompleteFailure(ao); + return theNdbCon->OpCompleteFailure(ao, m_abortOption != AO_IgnoreError); /** * If TCKEYCONF has arrived diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp index ee7b8132cd1..ace90e35ca4 100644 --- a/ndb/src/ndbapi/NdbOperationInt.cpp +++ b/ndb/src/ndbapi/NdbOperationInt.cpp @@ -15,21 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/************************************************************************************************ -Name: NdbOperationInt.C -Include: -Link: -Author: UABRONM Mikael Ronström UAB/M/MT -Date: 991029 -Version: 0.1 -Description: Interpreted operations in NDB API -Documentation: -Adjust: 991029 UABRONM First version. -************************************************************************************************/ -#include "NdbOperation.hpp" +#include <ndb_global.h> +#include <NdbOperation.hpp> #include "NdbApiSignal.hpp" -#include "NdbConnection.hpp" -#include "Ndb.hpp" +#include <NdbConnection.hpp> +#include <Ndb.hpp> #include "NdbRecAttr.hpp" #include "NdbUtil.hpp" #include "Interpreter.hpp" diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp index 69b4e803acd..28a70abcb9b 100644 --- a/ndb/src/ndbapi/NdbOperationSearch.cpp +++ b/ndb/src/ndbapi/NdbOperationSearch.cpp @@ -142,7 +142,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, CHARSET_INFO* cs = tAttrInfo->m_cs; if (cs != 0) { // current limitation: strxfrm does not increase length - assert(cs->strxfrm_multiply == 1); + assert(cs->strxfrm_multiply <= 1); unsigned n = (*cs->coll->strnxfrm)(cs, (uchar*)xfrmData, sizeof(xfrmData), diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index bcd91292fcd..db83e9c5fcf 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -156,10 +156,12 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) return out; } - if (r.arraySize() > 1) + const NdbDictionary::Column* c = r.getColumn(); + uint length = c->getLength(); + if (length > 1) out << "["; - for (Uint32 j = 0; j < r.arraySize(); j++) + for (Uint32 j = 0; j < length; j++) { if (j > 0) out << " "; @@ -192,14 +194,14 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) break; case NdbDictionary::Column::Char: out.print("%.*s", r.arraySize(), r.aRef()); - j = r.arraySize(); + j = length; break; case NdbDictionary::Column::Varchar: { short len = ntohs(r.u_short_value()); out.print("%.*s", len, r.aRef()+2); } - j = r.arraySize(); + j = length; break; case NdbDictionary::Column::Float: out << r.float_value(); @@ -207,6 +209,98 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) case NdbDictionary::Column::Double: out << r.double_value(); break; + case NdbDictionary::Column::Olddecimal: + { + short len = 1 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Olddecimalunsigned: + { + short len = 0 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + // for dates cut-and-paste from field.cc + case NdbDictionary::Column::Datetime: + { + ulonglong tmp=r.u_64_value(); + long part1,part2,part3; + part1=(long) (tmp/LL(1000000)); + part2=(long) (tmp - (ulonglong) part1*LL(1000000)); + char buf[40]; + char* pos=(char*) buf+19; + *pos--=0; + *pos--= (char) ('0'+(char) (part2%10)); part2/=10; + *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) part3); + *pos--= '/'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= '-'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); + *pos--= '-'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos=(char) ('0'+(char) part3); + out << buf; + } + break; + case NdbDictionary::Column::Date: + { + uint32 tmp=(uint32) uint3korr(r.aRef()); + int part; + char buf[40]; + char *pos=(char*) buf+10; + *pos--=0; + part=(int) (tmp & 31); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 5 & 15); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 9); + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos= (char) ('0'+part); + out << buf; + } + break; + case NdbDictionary::Column::Time: + { + long tmp=(long) sint3korr(r.aRef()); + int hour=(uint) (tmp/10000); + int minute=(uint) (tmp/100 % 100); + int second=(uint) (tmp % 100); + char buf[40]; + sprintf(buf, "%02d:%02d:%02d", hour, minute, second); + out << buf; + } + break; + case NdbDictionary::Column::Year: + { + uint year = 1900 + r.u_char_value(); + char buf[40]; + sprintf(buf, "%04d", year); + out << buf; + } + break; + case NdbDictionary::Column::Timestamp: + { + time_t time = r.u_32_value(); + out << (uint)time; + } + break; case NdbDictionary::Column::Blob: { const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); @@ -215,7 +309,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) unsigned n = r.arraySize() - sizeof(*h); for (unsigned k = 0; k < n && k < h->length; k++) out.print("%02X", (int)p[k]); - j = r.arraySize(); + j = length; } break; case NdbDictionary::Column::Text: @@ -226,22 +320,54 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) unsigned n = r.arraySize() - sizeof(*h); for (unsigned k = 0; k < n && k < h->length; k++) out.print("%c", (int)p[k]); - j = r.arraySize(); + j = length; } break; default: /* no print functions for the rest, just print type */ out << (int) r.getType(); - j = r.arraySize(); + j = length; if (j > 1) out << " " << j << " times"; break; } } - if (r.arraySize() > 1) + if (length > 1) { out << "]"; } return out; } + +Int64 +NdbRecAttr::int64_value() const +{ + Int64 val; + memcpy(&val,theRef,8); + return val; +} + +Uint64 +NdbRecAttr::u_64_value() const +{ + Uint64 val; + memcpy(&val,theRef,8); + return val; +} + +float +NdbRecAttr::float_value() const +{ + float val; + memcpy(&val,theRef,sizeof(val)); + return val; +} + +double +NdbRecAttr::double_value() const +{ + double val; + memcpy(&val,theRef,sizeof(val)); + return val; +} diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp index 14f8d4b8440..cad247512b2 100644 --- a/ndb/src/ndbapi/NdbReceiver.cpp +++ b/ndb/src/ndbapi/NdbReceiver.cpp @@ -40,7 +40,7 @@ NdbReceiver::~NdbReceiver() { DBUG_ENTER("NdbReceiver::~NdbReceiver"); if (m_id != NdbObjectIdMap::InvalidId) { - m_ndb->theNdbObjectIdMap->unmap(m_id, this); + m_ndb->theImpl->theNdbObjectIdMap.unmap(m_id, this); } delete[] m_rows; DBUG_VOID_RETURN; @@ -54,7 +54,7 @@ NdbReceiver::init(ReceiverType type, void* owner) m_owner = owner; if (m_id == NdbObjectIdMap::InvalidId) { if (m_ndb) - m_id = m_ndb->theNdbObjectIdMap->map(this); + m_id = m_ndb->theImpl->theNdbObjectIdMap.map(this); } theFirstRecAttr = NULL; diff --git a/ndb/src/ndbapi/NdbResultSet.cpp b/ndb/src/ndbapi/NdbResultSet.cpp index f270584d227..d9d71464026 100644 --- a/ndb/src/ndbapi/NdbResultSet.cpp +++ b/ndb/src/ndbapi/NdbResultSet.cpp @@ -44,10 +44,10 @@ void NdbResultSet::init() { } -int NdbResultSet::nextResult(bool fetchAllowed) +int NdbResultSet::nextResult(bool fetchAllowed, bool forceSend) { int res; - if ((res = m_operation->nextResult(fetchAllowed)) == 0) { + if ((res = m_operation->nextResult(fetchAllowed, forceSend)) == 0) { // handle blobs NdbBlob* tBlob = m_operation->theBlobList; while (tBlob != 0) { @@ -67,9 +67,9 @@ int NdbResultSet::nextResult(bool fetchAllowed) return res; } -void NdbResultSet::close() +void NdbResultSet::close(bool forceSend) { - m_operation->closeScan(); + m_operation->closeScan(forceSend); } NdbOperation* @@ -98,6 +98,6 @@ NdbResultSet::deleteTuple(NdbConnection * takeOverTrans){ } int -NdbResultSet::restart(){ - return m_operation->restart(); +NdbResultSet::restart(bool forceSend){ + return m_operation->restart(forceSend); } diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index 38b1c70c047..0c851427ba5 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -397,7 +397,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, (m_operation->* branch)(4, 5, m_current.m_ownLabel); return 0; -}; +} int NdbScanFilter::eq(int AttrId, Uint32 value){ @@ -478,7 +478,7 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){ Branch1 branch = table2[op].m_branches[m_current.m_group]; (m_operation->* branch)(AttrId, m_current.m_ownLabel); return 0; -}; +} int NdbScanFilter::isnull(int AttrId){ diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index fd63ce96f25..670a18f72a0 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -35,6 +35,8 @@ #include <signaldata/AttrInfo.hpp> #include <signaldata/TcKeyReq.hpp> +#define DEBUG_NEXT_RESULT 0 + NdbScanOperation::NdbScanOperation(Ndb* aNdb) : NdbOperation(aNdb), m_resultSet(0), @@ -239,17 +241,17 @@ NdbScanOperation::fix_receivers(Uint32 parallel){ if(parallel > m_allocated_receivers){ const Uint32 sz = parallel * (4*sizeof(char*)+sizeof(Uint32)); - Uint32 * tmp = new Uint32[(sz+3)/4]; + Uint64 * tmp = new Uint64[(sz+7)/8]; // Save old receivers - memcpy(tmp+parallel, m_receivers, m_allocated_receivers*sizeof(char*)); + memcpy(tmp, m_receivers, m_allocated_receivers*sizeof(char*)); delete[] m_array; - m_array = tmp; + m_array = (Uint32*)tmp; - m_prepared_receivers = tmp; - m_receivers = (NdbReceiver**)(tmp + parallel); + m_receivers = (NdbReceiver**)tmp; m_api_receivers = m_receivers + parallel; m_conf_receivers = m_api_receivers + parallel; m_sent_receivers = m_conf_receivers + parallel; + m_prepared_receivers = (Uint32*)(m_sent_receivers + parallel); // Only get/init "new" receivers NdbReceiver* tScanRec; @@ -275,6 +277,9 @@ NdbScanOperation::fix_receivers(Uint32 parallel){ void NdbScanOperation::receiver_delivered(NdbReceiver* tRec){ if(theError.code == 0){ + if(DEBUG_NEXT_RESULT) + ndbout_c("receiver_delivered"); + Uint32 idx = tRec->m_list_index; Uint32 last = m_sent_receivers_count - 1; if(idx != last){ @@ -298,6 +303,9 @@ NdbScanOperation::receiver_delivered(NdbReceiver* tRec){ void NdbScanOperation::receiver_completed(NdbReceiver* tRec){ if(theError.code == 0){ + if(DEBUG_NEXT_RESULT) + ndbout_c("receiver_completed"); + Uint32 idx = tRec->m_list_index; Uint32 last = m_sent_receivers_count - 1; if(idx != last){ @@ -445,12 +453,12 @@ NdbScanOperation::executeCursor(int nodeId){ return -1; } -#define DEBUG_NEXT_RESULT 0 -int NdbScanOperation::nextResult(bool fetchAllowed) +int NdbScanOperation::nextResult(bool fetchAllowed, bool forceSend) { if(m_ordered) - return ((NdbIndexScanOperation*)this)->next_result_ordered(fetchAllowed); + return ((NdbIndexScanOperation*)this)->next_result_ordered(fetchAllowed, + forceSend); /** * Check current receiver @@ -486,8 +494,12 @@ int NdbScanOperation::nextResult(bool fetchAllowed) Uint32 nodeId = theNdbCon->theDBnode; TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); + if(theError.code) + return -1; + Uint32 seq = theNdbCon->theNodeSequence; - if(seq == tp->getNodeSequence(nodeId) && send_next_scan(idx, false) == 0){ + if(seq == tp->getNodeSequence(nodeId) && send_next_scan(idx, false, + forceSend) == 0){ idx = m_current_api_receiver; last = m_api_receivers_count; @@ -516,8 +528,8 @@ int NdbScanOperation::nextResult(bool fetchAllowed) /** * No completed... */ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { continue; @@ -578,8 +590,9 @@ int NdbScanOperation::nextResult(bool fetchAllowed) } int -NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ - if(cnt > 0 || stopScanFlag){ +NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag, + bool forceSend){ + if(cnt > 0){ NdbApiSignal tSignal(theNdb->theMyRef); tSignal.setSignal(GSN_SCAN_NEXTREQ); @@ -595,38 +608,57 @@ NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ */ Uint32 last = m_sent_receivers_count; Uint32 * prep_array = (cnt > 21 ? m_prepared_receivers : theData + 4); + Uint32 sent = 0; for(Uint32 i = 0; i<cnt; i++){ NdbReceiver * tRec = m_api_receivers[i]; - m_sent_receivers[last+i] = tRec; - tRec->m_list_index = last+i; - prep_array[i] = tRec->m_tcPtrI; - tRec->prepareSend(); + if((prep_array[sent] = tRec->m_tcPtrI) != RNIL) + { + m_sent_receivers[last+sent] = tRec; + tRec->m_list_index = last+sent; + tRec->prepareSend(); + sent++; + } } - memcpy(&m_api_receivers[0], &m_api_receivers[cnt], cnt * sizeof(char*)); + memmove(m_api_receivers, m_api_receivers+cnt, + (theParallelism-cnt) * sizeof(char*)); - Uint32 nodeId = theNdbCon->theDBnode; - TransporterFacade * tp = TransporterFacade::instance(); - int ret; - if(cnt > 21){ - tSignal.setLength(4); - LinearSectionPtr ptr[3]; - ptr[0].p = prep_array; - ptr[0].sz = cnt; - ret = tp->sendFragmentedSignal(&tSignal, nodeId, ptr, 1); - } else { - tSignal.setLength(4+cnt); - ret = tp->sendSignal(&tSignal, nodeId); + int ret = 0; + if(sent) + { + Uint32 nodeId = theNdbCon->theDBnode; + TransporterFacade * tp = TransporterFacade::instance(); + if(cnt > 21){ + tSignal.setLength(4); + LinearSectionPtr ptr[3]; + ptr[0].p = prep_array; + ptr[0].sz = sent; + ret = tp->sendSignal(&tSignal, nodeId, ptr, 1); + } else { + tSignal.setLength(4+sent); + ret = tp->sendSignal(&tSignal, nodeId); + } } + + if (!ret) checkForceSend(forceSend); - m_sent_receivers_count = last + cnt + stopScanFlag; + m_sent_receivers_count = last + sent; m_api_receivers_count -= cnt; m_current_api_receiver = 0; - + return ret; } return 0; } +void NdbScanOperation::checkForceSend(bool forceSend) +{ + if (forceSend) { + TransporterFacade::instance()->forceSend(theNdb->theNdbBlockNumber); + } else { + TransporterFacade::instance()->checkForceSend(theNdb->theNdbBlockNumber); + }//if +} + int NdbScanOperation::prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId) { @@ -642,7 +674,7 @@ NdbScanOperation::doSend(int ProcessorId) return 0; } -void NdbScanOperation::closeScan() +void NdbScanOperation::closeScan(bool forceSend) { if(m_transConnection){ if(DEBUG_NEXT_RESULT) @@ -657,7 +689,7 @@ void NdbScanOperation::closeScan() TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); - close_impl(tp); + close_impl(tp, forceSend); } while(0); @@ -670,7 +702,6 @@ void NdbScanOperation::closeScan() void NdbScanOperation::execCLOSE_SCAN_REP(){ - m_api_receivers_count = 0; m_conf_receivers_count = 0; m_sent_receivers_count = 0; } @@ -803,7 +834,7 @@ NdbScanOperation::doSendScan(int aProcessorId) LinearSectionPtr ptr[3]; ptr[0].p = m_prepared_receivers; ptr[0].sz = theParallelism; - if (tp->sendFragmentedSignal(tSignal, aProcessorId, ptr, 1) == -1) { + if (tp->sendSignal(tSignal, aProcessorId, ptr, 1) == -1) { setErrorCode(4002); return -1; } @@ -850,6 +881,14 @@ NdbScanOperation::doSendScan(int aProcessorId) tSignal = tSignal->next(); } theStatus = WaitResponse; + + m_sent_receivers_count = theParallelism; + if(m_ordered) + { + m_current_api_receiver = theParallelism; + m_api_receivers_count = theParallelism; + } + return tSignalCount; }//NdbOperation::doSendScan() @@ -1083,7 +1122,7 @@ NdbIndexScanOperation::setBound(const NdbColumnImpl* tAttrInfo, Uint32 xfrmData[2000]; if (cs != NULL && aValue != NULL) { // current limitation: strxfrm does not increase length - assert(cs->strxfrm_multiply == 1); + assert(cs->strxfrm_multiply <= 1); unsigned n = (*cs->coll->strnxfrm)(cs, (uchar*)xfrmData, sizeof(xfrmData), @@ -1285,7 +1324,8 @@ NdbIndexScanOperation::compare(Uint32 skip, Uint32 cols, } int -NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ +NdbIndexScanOperation::next_result_ordered(bool fetchAllowed, + bool forceSend){ Uint32 u_idx = 0, u_last = 0; Uint32 s_idx = m_current_api_receiver; // first sorted @@ -1309,19 +1349,29 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ if(DEBUG_NEXT_RESULT) ndbout_c("performing fetch..."); TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); + if(theError.code) + return -1; Uint32 seq = theNdbCon->theNodeSequence; Uint32 nodeId = theNdbCon->theDBnode; - if(seq == tp->getNodeSequence(nodeId) && !send_next_scan_ordered(s_idx)){ + if(seq == tp->getNodeSequence(nodeId) && + !send_next_scan_ordered(s_idx, forceSend)){ Uint32 tmp = m_sent_receivers_count; s_idx = m_current_api_receiver; while(m_sent_receivers_count > 0 && !theError.code){ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { continue; } if(DEBUG_NEXT_RESULT) ndbout_c("return -1"); + setErrorCode(4028); + return -1; + } + + if(theError.code){ + setErrorCode(theError.code); + if(DEBUG_NEXT_RESULT) ndbout_c("return -1"); return -1; } @@ -1331,11 +1381,9 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ memcpy(arr, m_conf_receivers, u_last * sizeof(char*)); if(DEBUG_NEXT_RESULT) ndbout_c("sent: %d recv: %d", tmp, u_last); - if(theError.code){ - setErrorCode(theError.code); - if(DEBUG_NEXT_RESULT) ndbout_c("return -1"); - return -1; - } + } else { + setErrorCode(4028); + return -1; } } else { if(DEBUG_NEXT_RESULT) ndbout_c("return 2"); @@ -1400,14 +1448,26 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ } int -NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx){ +NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx, bool forceSend){ if(idx == theParallelism) return 0; + NdbReceiver* tRec = m_api_receivers[idx]; NdbApiSignal tSignal(theNdb->theMyRef); tSignal.setSignal(GSN_SCAN_NEXTREQ); + Uint32 last = m_sent_receivers_count; Uint32* theData = tSignal.getDataPtrSend(); + Uint32* prep_array = theData + 4; + + m_current_api_receiver = idx + 1; + if((prep_array[0] = tRec->m_tcPtrI) == RNIL) + { + if(DEBUG_NEXT_RESULT) + ndbout_c("receiver completed, don't send"); + return 0; + } + theData[0] = theNdbCon->theTCConPtr; theData[1] = 0; Uint64 transId = theNdbCon->theTransactionId; @@ -1417,37 +1477,37 @@ NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx){ /** * Prepare ops */ - Uint32 last = m_sent_receivers_count; - Uint32 * prep_array = theData + 4; - - NdbReceiver * tRec = m_api_receivers[idx]; m_sent_receivers[last] = tRec; tRec->m_list_index = last; - prep_array[0] = tRec->m_tcPtrI; tRec->prepareSend(); - m_sent_receivers_count = last + 1; - m_current_api_receiver = idx + 1; Uint32 nodeId = theNdbCon->theDBnode; TransporterFacade * tp = TransporterFacade::instance(); tSignal.setLength(4+1); - return tp->sendSignal(&tSignal, nodeId); + int ret= tp->sendSignal(&tSignal, nodeId); + if (!ret) checkForceSend(forceSend); + return ret; } int -NdbScanOperation::close_impl(TransporterFacade* tp){ +NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ Uint32 seq = theNdbCon->theNodeSequence; Uint32 nodeId = theNdbCon->theDBnode; - if(seq != tp->getNodeSequence(nodeId)){ + if(seq != tp->getNodeSequence(nodeId)) + { theNdbCon->theReleaseOnClose = true; return -1; } - while(theError.code == 0 && m_sent_receivers_count){ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + /** + * Wait for outstanding + */ + while(theError.code == 0 && m_sent_receivers_count) + { + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); switch(return_code){ case 0: @@ -1463,20 +1523,61 @@ NdbScanOperation::close_impl(TransporterFacade* tp){ } } - if(m_api_receivers_count+m_conf_receivers_count){ - // Send close scan - if(send_next_scan(0, true) == -1){ // Close scan - theNdbCon->theReleaseOnClose = true; - return -1; - } + if(theError.code) + { + m_api_receivers_count = 0; + m_current_api_receiver = m_ordered ? theParallelism : 0; + } + + + /** + * move all conf'ed into api + * so that send_next_scan can check if they needs to be closed + */ + Uint32 api = m_api_receivers_count; + Uint32 conf = m_conf_receivers_count; + + if(m_ordered) + { + /** + * Ordered scan, keep the m_api_receivers "to the right" + */ + memmove(m_api_receivers, m_api_receivers+m_current_api_receiver, + (theParallelism - m_current_api_receiver) * sizeof(char*)); + api = (theParallelism - m_current_api_receiver); + m_api_receivers_count = api; + } + + if(DEBUG_NEXT_RESULT) + ndbout_c("close_impl: [order api conf sent curr parr] %d %d %d %d %d %d", + m_ordered, api, conf, + m_sent_receivers_count, m_current_api_receiver, theParallelism); + + if(api+conf) + { + /** + * There's something to close + * setup m_api_receivers (for send_next_scan) + */ + memcpy(m_api_receivers+api, m_conf_receivers, conf * sizeof(char*)); + m_api_receivers_count = api + conf; + m_conf_receivers_count = 0; + } + + // Send close scan + if(send_next_scan(api+conf, true, forceSend) == -1) + { + theNdbCon->theReleaseOnClose = true; + return -1; } /** * wait for close scan conf */ - while(m_sent_receivers_count+m_api_receivers_count+m_conf_receivers_count){ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + while(m_sent_receivers_count+m_api_receivers_count+m_conf_receivers_count) + { + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); switch(return_code){ case 0: @@ -1491,6 +1592,7 @@ NdbScanOperation::close_impl(TransporterFacade* tp){ return -1; } } + return 0; } @@ -1507,17 +1609,12 @@ NdbScanOperation::reset_receivers(Uint32 parallell, Uint32 ordered){ m_api_receivers_count = 0; m_current_api_receiver = 0; - m_sent_receivers_count = parallell; + m_sent_receivers_count = 0; m_conf_receivers_count = 0; - - if(ordered){ - m_current_api_receiver = parallell; - m_api_receivers_count = parallell; - } } int -NdbScanOperation::restart() +NdbScanOperation::restart(bool forceSend) { TransporterFacade* tp = TransporterFacade::instance(); @@ -1526,7 +1623,7 @@ NdbScanOperation::restart() { int res; - if((res= close_impl(tp))) + if((res= close_impl(tp, forceSend))) { return res; } @@ -1545,13 +1642,13 @@ NdbScanOperation::restart() } int -NdbIndexScanOperation::reset_bounds(){ +NdbIndexScanOperation::reset_bounds(bool forceSend){ int res; { TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); - res= close_impl(tp); + res= close_impl(tp, forceSend); } if(!res) diff --git a/ndb/src/ndbapi/NdbWaiter.hpp b/ndb/src/ndbapi/NdbWaiter.hpp new file mode 100644 index 00000000000..8b7b2a75879 --- /dev/null +++ b/ndb/src/ndbapi/NdbWaiter.hpp @@ -0,0 +1,102 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef NDB_WAITER_HPP +#define NDB_WAITER_HPP + +#include <ndb_global.h> +#include <NdbOut.hpp> +#include <NdbError.hpp> +#include <NdbCondition.h> +#include <NdbReceiver.hpp> +#include <NdbOperation.hpp> +#include <kernel/ndb_limits.h> + +#include <NdbTick.h> + +enum WaitSignalType { + NO_WAIT = 0, + WAIT_NODE_FAILURE = 1, // Node failure during wait + WST_WAIT_TIMEOUT = 2, // Timeout during wait + + WAIT_TC_SEIZE = 3, + WAIT_TC_RELEASE = 4, + WAIT_NDB_TAMPER = 5, + WAIT_SCAN = 6, + + // DICT stuff + WAIT_GET_TAB_INFO_REQ = 11, + WAIT_CREATE_TAB_REQ = 12, + WAIT_DROP_TAB_REQ = 13, + WAIT_ALTER_TAB_REQ = 14, + WAIT_CREATE_INDX_REQ = 15, + WAIT_DROP_INDX_REQ = 16, + WAIT_LIST_TABLES_CONF = 17 +}; + +class NdbWaiter { +public: + NdbWaiter(); + ~NdbWaiter(); + + void wait(int waitTime); + void nodeFail(Uint32 node); + void signal(Uint32 state); + + Uint32 m_node; + Uint32 m_state; + void * m_mutex; + struct NdbCondition * m_condition; +}; + +inline +void +NdbWaiter::wait(int waitTime) +{ + const bool forever = (waitTime == -1); + const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; + while (1) { + if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE) + break; + if (forever) { + NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); + } else { + if (waitTime <= 0) { + m_state = WST_WAIT_TIMEOUT; + break; + } + NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); + waitTime = maxTime - NdbTick_CurrentMillisecond(); + } + } +} + +inline +void +NdbWaiter::nodeFail(Uint32 aNodeId){ + if (m_state != NO_WAIT && m_node == aNodeId){ + m_state = WAIT_NODE_FAILURE; + NdbCondition_Signal(m_condition); + } +} + +inline +void +NdbWaiter::signal(Uint32 state){ + m_state = state; + NdbCondition_Signal(m_condition); +} + +#endif diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index c011c1a6a26..a4f233709c4 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -92,8 +92,8 @@ Ndb::init(int aMaxNoOfTransactions) theDictionary->setTransporter(this, theFacade); - aNrOfCon = theNoOfDBnodes; - aNrOfOp = 2*theNoOfDBnodes; + aNrOfCon = theImpl->theNoOfDBnodes; + aNrOfOp = 2*theImpl->theNoOfDBnodes; // Create connection object in a linked list if((createConIdleList(aNrOfCon)) == -1){ @@ -192,14 +192,14 @@ void Ndb::connected(Uint32 ref) } TransporterFacade * theFacade = TransporterFacade::instance(); - int i; - theNoOfDBnodes= 0; + int i, n= 0; for (i = 1; i < MAX_NDB_NODES; i++){ if (theFacade->getIsDbNode(i)){ - theDBnodes[theNoOfDBnodes] = i; - theNoOfDBnodes++; + theImpl->theDBnodes[n] = i; + n++; } } + theImpl->theNoOfDBnodes= n; theFirstTransId = ((Uint64)tBlockNo << 52)+ ((Uint64)tmpTheNode << 40); theFirstTransId += theFacade->m_max_trans_id; @@ -207,9 +207,8 @@ void Ndb::connected(Uint32 ref) DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id=%lx", theMyRef, tmpTheNode, - theNoOfDBnodes, + theImpl->theNoOfDBnodes, theFirstTransId)); - startTransactionNodeSelectionData.init(theNoOfDBnodes, theDBnodes); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; @@ -247,8 +246,10 @@ Ndb::report_node_failure(Uint32 node_id) * * This method is only called by ClusterMgr (via lots of methods) */ - the_release_ind[node_id] = 1; - theWaiter.nodeFail(node_id); + theImpl->the_release_ind[node_id] = 1; + // must come after + theImpl->the_release_ind[0] = 1; + theImpl->theWaiter.nodeFail(node_id); return; }//Ndb::report_node_failure() @@ -327,7 +328,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) NdbConnection* tCon; int tReturnCode = -1; const Uint32* tDataPtr = aSignal->getDataPtr(); - const Uint32 tWaitState = theWaiter.m_state; + const Uint32 tWaitState = theImpl->theWaiter.m_state; const Uint32 tSignalNumber = aSignal->readSignalNumber(); const Uint32 tFirstData = *tDataPtr; const Uint32 tLen = aSignal->getLength(); @@ -398,7 +399,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) break; case NdbReceiver::NDB_SCANRECEIVER: tCon->theScanningOp->receiver_delivered(tRec); - theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? + theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? (Uint32) NO_WAIT : tWaitState); break; default: @@ -595,7 +596,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCSEIZECONF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } else { goto InvalidSignal; }//if @@ -615,7 +616,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCSEIZEREF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } else { return; }//if @@ -635,7 +636,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCRELEASECONF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; }//if break; } @@ -653,7 +654,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCRELEASEREF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; }//if break; } @@ -705,7 +706,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) return; tReturnCode = tCon->receiveDIHNDBTAMPER(aSignal); if (tReturnCode != -1) - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; break; } case GSN_SCAN_TABCONF: @@ -727,7 +728,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) tLen - ScanTabConf::SignalLength); } if (tReturnCode != -1 && tWaitState == WAIT_SCAN) - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; break; } else { goto InvalidSignal; @@ -746,7 +747,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) if (tCon->checkMagicNumber() == 0){ tReturnCode = tCon->receiveSCAN_TABREF(aSignal); if (tReturnCode != -1 && tWaitState == WAIT_SCAN){ - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } break; } @@ -771,7 +772,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) switch(com){ case 1: tCon->theScanningOp->receiver_delivered(tRec); - theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? + theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? (Uint32) NO_WAIT : tWaitState); break; case 0: @@ -835,16 +836,16 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) goto InvalidSignal; }//switch - if (theWaiter.m_state == NO_WAIT) { + if (theImpl->theWaiter.m_state == NO_WAIT) { // Wake up the thread waiting for response - NdbCondition_Signal(theWaiter.m_condition); + NdbCondition_Signal(theImpl->theWaiter.m_condition); }//if return; InvalidSignal: #ifdef VM_TRACE ndbout_c("Ndbif: Error Ndb::handleReceivedSignal " - "(GSN=%d, theWaiter.m_state=%d)" + "(GSN=%d, theImpl->theWaiter.m_state=%d)" " sender = (Block: %d Node: %d)", tSignalNumber, tWaitState, @@ -892,7 +893,7 @@ Ndb::completedTransaction(NdbConnection* aCon) if ((theMinNoOfEventsToWakeUp != 0) && (theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) { theMinNoOfEventsToWakeUp = 0; - NdbCondition_Signal(theWaiter.m_condition); + NdbCondition_Signal(theImpl->theWaiter.m_condition); return; }//if } else { @@ -1152,9 +1153,9 @@ void Ndb::waitCompletedTransactions(int aMilliSecondsToWait, int noOfEventsToWaitFor) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; /** - * theWaiter.m_state = NO_WAIT; + * theImpl->theWaiter.m_state = NO_WAIT; * To ensure no messup with synchronous node fail handling * (see ReportFailure) */ @@ -1163,8 +1164,8 @@ Ndb::waitCompletedTransactions(int aMilliSecondsToWait, theMinNoOfEventsToWakeUp = noOfEventsToWaitFor; do { if (waitTime < 1000) waitTime = 1000; - NdbCondition_WaitTimeout(theWaiter.m_condition, - (NdbMutex*)theWaiter.m_mutex, + NdbCondition_WaitTimeout(theImpl->theWaiter.m_condition, + (NdbMutex*)theImpl->theWaiter.m_mutex, waitTime); if (theNoOfCompletedTransactions >= (Uint32)noOfEventsToWaitFor) { break; @@ -1270,23 +1271,23 @@ Ndb::receiveResponse(int waitTime){ int tResultCode; TransporterFacade::instance()->checkForceSend(theNdbBlockNumber); - theWaiter.wait(waitTime); + theImpl->theWaiter.wait(waitTime); - if(theWaiter.m_state == NO_WAIT) { + if(theImpl->theWaiter.m_state == NO_WAIT) { tResultCode = 0; } else { #ifdef VM_TRACE - ndbout << "ERR: receiveResponse - theWaiter.m_state = "; - ndbout << theWaiter.m_state << endl; + ndbout << "ERR: receiveResponse - theImpl->theWaiter.m_state = "; + ndbout << theImpl->theWaiter.m_state << endl; #endif - if (theWaiter.m_state == WAIT_NODE_FAILURE){ + if (theImpl->theWaiter.m_state == WAIT_NODE_FAILURE){ tResultCode = -2; } else { tResultCode = -1; } - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } return tResultCode; }//Ndb::receiveResponse() @@ -1318,8 +1319,8 @@ Ndb::sendRecSignal(Uint16 node_id, if (tp->check_send_size(node_id, send_size)) { return_code = tp->sendSignal(aSignal, node_id); if (return_code != -1) { - theWaiter.m_node = node_id; - theWaiter.m_state = aWaitState; + theImpl->theWaiter.m_node = node_id; + theImpl->theWaiter.m_state = aWaitState; return_code = receiveResponse(); } else { return_code = -3; diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 698bbcde4c6..a11dd842495 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -50,7 +50,9 @@ Ndb(const char* aDataBase); Parameters: aDataBase : Name of the database. Remark: Connect to the database. ***************************************************************************/ -Ndb::Ndb( const char* aDataBase , const char* aSchema) { +Ndb::Ndb( const char* aDataBase , const char* aSchema) + : theImpl(NULL) +{ DBUG_ENTER("Ndb::Ndb()"); DBUG_PRINT("enter",("(old)Ndb::Ndb this=0x%x", this)); if (theNoOfNdbObjects < 0) @@ -58,7 +60,7 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) { theNoOfNdbObjects++; if (global_ndb_cluster_connection == 0) { global_ndb_cluster_connection= new Ndb_cluster_connection(ndbConnectString); - global_ndb_cluster_connection->connect(); + global_ndb_cluster_connection->connect(12,5,1); } setup(global_ndb_cluster_connection, aDataBase, aSchema); DBUG_VOID_RETURN; @@ -66,6 +68,7 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) { Ndb::Ndb( Ndb_cluster_connection *ndb_cluster_connection, const char* aDataBase , const char* aSchema) + : theImpl(NULL) { DBUG_ENTER("Ndb::Ndb()"); DBUG_PRINT("enter",("Ndb::Ndb this=0x%x", this)); @@ -82,8 +85,10 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, { DBUG_ENTER("Ndb::setup"); - theNdbObjectIdMap= 0; - m_ndb_cluster_connection= ndb_cluster_connection; + assert(theImpl == NULL); + theImpl= new NdbImpl(ndb_cluster_connection,*this); + theDictionary= &(theImpl->m_dictionary); + thePreparedTransactionsArray= NULL; theSentTransactionsArray= NULL; theCompletedTransactionsArray= NULL; @@ -94,8 +99,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theMaxNoOfTransactions= 0; theMinNoOfEventsToWakeUp= 0; prefixEnd= NULL; - theImpl= NULL; - theDictionary= NULL; theConIdleList= NULL; theOpIdleList= NULL; theScanOpIdleList= NULL; @@ -110,9 +113,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theCallList= NULL; theScanList= NULL; theNdbBlobIdleList= NULL; - theNoOfDBnodes= 0; - theDBnodes= NULL; - the_release_ind= NULL; the_last_check_time= 0; theFirstTransId= 0; theRestartGCI= 0; @@ -134,19 +134,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theError.code = 0; - theNdbObjectIdMap = new NdbObjectIdMap(1024,1024); theConnectionArray = new NdbConnection * [MAX_NDB_NODES]; - theDBnodes = new Uint32[MAX_NDB_NODES]; - the_release_ind = new Uint8[MAX_NDB_NODES]; theCommitAckSignal = NULL; - theCurrentConnectCounter = 1; - theCurrentConnectIndex = 0; int i; for (i = 0; i < MAX_NDB_NODES ; i++) { theConnectionArray[i] = NULL; - the_release_ind[i] = 0; - theDBnodes[i] = 0; }//forg for (i = 0; i < 2048 ; i++) { theFirstTupleId[i] = 0; @@ -164,14 +157,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, prefixEnd = prefixName + (len < (int) sizeof(prefixName) ? len : sizeof(prefixName) - 1); - theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr; + theImpl->theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr; // Signal that the constructor has finished OK if (theInitState == NotConstructed) theInitState = NotInitialised; - theImpl = new NdbImpl(); - { NdbGlobalEventBufferHandle *h= NdbGlobalEventBuffer_init(NDB_MAX_ACTIVE_EVENTS); @@ -182,11 +173,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theGlobalEventBufferHandle = h; } - theDictionary = new NdbDictionaryImpl(*this); - if (theDictionary == NULL) { - ndbout_c("Ndb cailed to allocate dictionary"); - exit(-1); - } DBUG_VOID_RETURN; } @@ -212,23 +198,12 @@ Ndb::~Ndb() DBUG_PRINT("enter",("Ndb::~Ndb this=0x%x",this)); doDisconnect(); - delete theDictionary; - delete theImpl; - NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle); if (TransporterFacade::instance() != NULL && theNdbBlockNumber > 0){ TransporterFacade::instance()->close(theNdbBlockNumber, theFirstTransId); } - if (global_ndb_cluster_connection != 0) { - theNoOfNdbObjects--; - if(theNoOfNdbObjects == 0){ - delete global_ndb_cluster_connection; - global_ndb_cluster_connection= 0; - } - }//if - // if (theSchemaConToNdbList != NULL) // closeSchemaTransaction(theSchemaConToNdbList); while ( theConIdleList != NULL ) @@ -257,18 +232,27 @@ Ndb::~Ndb() freeSignal(); releaseTransactionArrays(); - startTransactionNodeSelectionData.release(); delete []theConnectionArray; - delete []theDBnodes; - delete []the_release_ind; if(theCommitAckSignal != NULL){ delete theCommitAckSignal; theCommitAckSignal = NULL; } - if(theNdbObjectIdMap != 0) - delete theNdbObjectIdMap; + delete theImpl; + + /** + * This needs to be put after delete theImpl + * as TransporterFacade::instance is delete by global_ndb_cluster_connection + * and used by theImpl + */ + if (global_ndb_cluster_connection != 0) { + theNoOfNdbObjects--; + if(theNoOfNdbObjects == 0){ + delete global_ndb_cluster_connection; + global_ndb_cluster_connection= 0; + } + }//if /** * This sleep is to make sure that the transporter @@ -307,4 +291,23 @@ NdbWaiter::~NdbWaiter(){ NdbCondition_Destroy(m_condition); } +NdbImpl::NdbImpl(Ndb_cluster_connection *ndb_cluster_connection, + Ndb& ndb) + : m_ndb_cluster_connection(ndb_cluster_connection->m_impl), + m_dictionary(ndb), + theCurrentConnectIndex(0), + theNdbObjectIdMap(1024,1024), + theNoOfDBnodes(0) +{ + int i; + for (i = 0; i < MAX_NDB_NODES; i++) { + the_release_ind[i] = 0; + } + m_optimized_node_selection= + m_ndb_cluster_connection.m_optimized_node_selection; +} + +NdbImpl::~NdbImpl() +{ +} diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index a5f2a4801d5..5902aa413dc 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -30,10 +30,18 @@ void Ndb::checkFailedNode() { DBUG_ENTER("Ndb::checkFailedNode"); - DBUG_PRINT("enter", ("theNoOfDBnodes: %d", theNoOfDBnodes)); + Uint32 *the_release_ind= theImpl->the_release_ind; + if (the_release_ind[0] == 0) + { + DBUG_VOID_RETURN; + } + Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes; + Uint8 *theDBnodes= theImpl->theDBnodes; + + DBUG_PRINT("enter", ("theNoOfDBnodes: %d", tNoOfDbNodes)); - DBUG_ASSERT(theNoOfDBnodes < MAX_NDB_NODES); - for (Uint32 i = 0; i < theNoOfDBnodes; i++){ + DBUG_ASSERT(tNoOfDbNodes < MAX_NDB_NODES); + for (Uint32 i = 0; i < tNoOfDbNodes; i++){ const NodeId node_id = theDBnodes[i]; DBUG_PRINT("info", ("i: %d, node_id: %d", i, node_id)); @@ -56,31 +64,6 @@ Ndb::checkFailedNode() DBUG_VOID_RETURN; } -#if 0 -void -NdbImpl::checkInvalidTable(NdbDictionaryImpl * dict){ - Uint32 sz = m_invalidTables.size(); - for(Int32 i = sz - 1; i >= 0; i--){ - NdbTableImpl * tab = m_invalidTables[i]; - m_invalidTables.erase(i); - dict->tableDropped(* tab); - } -} - -void -NdbImpl::checkErrorCode(Uint32 i, NdbTableImpl * tab){ - switch(i){ - case 241: - case 283: - case 284: - case 285: - case 1225: - case 1226: - - } -} -#endif - /*************************************************************************** * int createConIdleList(int aNrOfCon); * diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index 12bede3aa3f..21407279f0b 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -29,7 +29,7 @@ class NdbObjectIdMap //: NdbLockable { public: - STATIC_CONST( InvalidId = ~0 ); + STATIC_CONST( InvalidId = ~(Uint32)0 ); NdbObjectIdMap(Uint32 initalSize = 128, Uint32 expandSize = 10); ~NdbObjectIdMap(); diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index bc24110ea14..5582143be44 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -34,6 +34,7 @@ #include <NdbConfig.h> #include <ndb_version.h> #include <SignalLoggerManager.hpp> +#include <kernel/ndb_limits.h> //#define REPORT_TRANSPORTER //#define API_TRACE; @@ -404,11 +405,8 @@ extern "C" void* runSendRequest_C(void * me) { - my_thread_init(); ((TransporterFacade*) me)->threadMainSend(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } void TransporterFacade::threadMainSend(void) @@ -442,11 +440,8 @@ extern "C" void* runReceiveResponse_C(void * me) { - my_thread_init(); ((TransporterFacade*) me)->threadMainReceive(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } void TransporterFacade::threadMainReceive(void) @@ -475,7 +470,8 @@ TransporterFacade::TransporterFacade() : theTransporterRegistry(0), theStopReceive(0), theSendThread(NULL), - theReceiveThread(NULL) + theReceiveThread(NULL), + m_fragmented_signal_id(0) { theOwnId = 0; @@ -624,6 +620,9 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId) * After the restart the node is up again and the Ndb object * might not have noticed the failure. */ + + DBUG_ENTER("TransporterFacade::ReportNodeFailureComplete"); + DBUG_PRINT("enter",("nodeid= %d", tNodeId)); Uint32 sz = m_threads.m_statusNext.size(); for (Uint32 i = 0; i < sz ; i ++) { if (m_threads.getInUse(i)){ @@ -632,6 +631,7 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId) (*RegPC) (obj, tNodeId, false, true); } } + DBUG_VOID_RETURN; } void @@ -833,9 +833,129 @@ TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){ return (ss == SEND_OK ? 0 : -1); } +#define CHUNK_SZ NDB_SECTION_SEGMENT_SZ*64 // related to MAX_MESSAGE_SIZE int TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, - LinearSectionPtr ptr[3], Uint32 secs){ + LinearSectionPtr ptr[3], Uint32 secs) +{ + if(getIsNodeSendable(aNode) != true) + return -1; + +#ifdef API_TRACE + if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){ + Uint32 tmp = aSignal->theSendersBlockRef; + aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId); + signalLogger.sendSignal(* aSignal, + 1, + aSignal->getDataPtrSend(), + aNode, + ptr, secs); + aSignal->theSendersBlockRef = tmp; + } +#endif + + NdbApiSignal tmp_signal(*(SignalHeader*)aSignal); + LinearSectionPtr tmp_ptr[3]; + Uint32 unique_id= m_fragmented_signal_id++; // next unique id + unsigned i; + for (i= 0; i < secs; i++) + tmp_ptr[i]= ptr[i]; + + unsigned start_i= 0; + unsigned chunk_sz= 0; + unsigned fragment_info= 0; + Uint32 *tmp_data= tmp_signal.getDataPtrSend(); + for (i= 0; i < secs;) { + unsigned save_sz= tmp_ptr[i].sz; + tmp_data[i-start_i]= i; + if (chunk_sz + save_sz > CHUNK_SZ) { + // truncate + unsigned send_sz= CHUNK_SZ - chunk_sz; + if (i != start_i) // first piece of a new section has to be a multiple of NDB_SECTION_SEGMENT_SZ + { + send_sz= + NDB_SECTION_SEGMENT_SZ + *(send_sz+NDB_SECTION_SEGMENT_SZ-1) + /NDB_SECTION_SEGMENT_SZ; + if (send_sz > save_sz) + send_sz= save_sz; + } + tmp_ptr[i].sz= send_sz; + + if (fragment_info < 2) // 1 = first fragment, 2 = middle fragments + fragment_info++; + + // send tmp_signal + tmp_data[i-start_i+1]= unique_id; + tmp_signal.setLength(i-start_i+2); + tmp_signal.m_fragmentInfo= fragment_info; + tmp_signal.m_noOfSections= i-start_i+1; + // do prepare send + { + SendStatus ss = theTransporterRegistry->prepareSend + (&tmp_signal, + 1, /*JBB*/ + tmp_data, + aNode, + &tmp_ptr[start_i]); + assert(ss != SEND_MESSAGE_TOO_BIG); + if (ss != SEND_OK) return -1; + } + // setup variables for next signal + start_i= i; + chunk_sz= 0; + tmp_ptr[i].sz= save_sz-send_sz; + tmp_ptr[i].p+= send_sz; + if (tmp_ptr[i].sz == 0) + i++; + } + else + { + chunk_sz+=save_sz; + i++; + } + } + + unsigned a_sz= aSignal->getLength(); + + if (fragment_info > 0) { + // update the original signal to include section info + Uint32 *a_data= aSignal->getDataPtrSend(); + unsigned tmp_sz= i-start_i; + memcpy(a_data+a_sz, + tmp_data, + tmp_sz*sizeof(Uint32)); + a_data[a_sz+tmp_sz]= unique_id; + aSignal->setLength(a_sz+tmp_sz+1); + + // send last fragment + aSignal->m_fragmentInfo= 3; // 3 = last fragment + aSignal->m_noOfSections= i-start_i; + } else { + aSignal->m_noOfSections= secs; + } + + // send aSignal + int ret; + { + SendStatus ss = theTransporterRegistry->prepareSend + (aSignal, + 1/*JBB*/, + aSignal->getDataPtrSend(), + aNode, + &tmp_ptr[start_i]); + assert(ss != SEND_MESSAGE_TOO_BIG); + ret = (ss == SEND_OK ? 0 : -1); + } + aSignal->m_noOfSections = 0; + aSignal->m_fragmentInfo = 0; + aSignal->setLength(a_sz); + return ret; +} + +int +TransporterFacade::sendSignal(NdbApiSignal* aSignal, NodeId aNode, + LinearSectionPtr ptr[3], Uint32 secs){ aSignal->m_noOfSections = secs; if(getIsNodeSendable(aNode) == true){ #ifdef API_TRACE @@ -865,39 +985,6 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, return -1; } - - -int -TransporterFacade::sendFragmentedSignalUnCond(NdbApiSignal* aSignal, - NodeId aNode, - LinearSectionPtr ptr[3], - Uint32 secs){ - aSignal->m_noOfSections = secs; - -#ifdef API_TRACE - if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){ - Uint32 tmp = aSignal->theSendersBlockRef; - aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId); - signalLogger.sendSignal(* aSignal, - 1, - aSignal->getDataPtrSend(), - aNode, - ptr, secs); - aSignal->theSendersBlockRef = tmp; - } -#endif - SendStatus ss = theTransporterRegistry->prepareSend(aSignal, - 1, // JBB - aSignal->getDataPtrSend(), - aNode, - ptr); - assert(ss != SEND_MESSAGE_TOO_BIG); - aSignal->m_noOfSections = 0; - return (ss == SEND_OK ? 0 : -1); -} - - - /****************************************************************************** * CONNECTION METHODS Etc ******************************************************************************/ diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp index 5f473975585..99edea846c1 100644 --- a/ndb/src/ndbapi/TransporterFacade.hpp +++ b/ndb/src/ndbapi/TransporterFacade.hpp @@ -69,14 +69,11 @@ public: // Only sends to nodes which are alive int sendSignal(NdbApiSignal * signal, NodeId nodeId); + int sendSignal(NdbApiSignal*, NodeId, + LinearSectionPtr ptr[3], Uint32 secs); int sendFragmentedSignal(NdbApiSignal*, NodeId, LinearSectionPtr ptr[3], Uint32 secs); - //Dirrrrty - int sendFragmentedSignalUnCond(NdbApiSignal*, NodeId, - LinearSectionPtr ptr[3], Uint32 secs); - - // Is node available for running transactions bool get_node_alive(NodeId nodeId) const; bool get_node_stopping(NodeId nodeId) const; @@ -130,7 +127,7 @@ private: friend class ExtSender; ///< @todo Hack to be able to sendSignalUnCond friend class GrepSS; friend class Ndb; - friend class Ndb_cluster_connection; + friend class Ndb_cluster_connection_impl; int sendSignalUnCond(NdbApiSignal *, NodeId nodeId); @@ -224,7 +221,8 @@ private: } m_threads; Uint32 m_max_trans_id; - + Uint32 m_fragmented_signal_id; + /** * execute function */ diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 4c42fe1aeef..4fcf4d08396 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -18,7 +18,9 @@ #include <my_pthread.h> #include <my_sys.h> -#include <ndb_cluster_connection.hpp> +#include "ndb_cluster_connection_impl.hpp" +#include <mgmapi_configuration.hpp> +#include <mgmapi_config_parameters.h> #include <TransporterFacade.hpp> #include <NdbOut.hpp> #include <NdbSleep.h> @@ -26,6 +28,11 @@ #include <ndb_limits.h> #include <ConfigRetriever.hpp> #include <ndb_version.h> +#include <Vector.hpp> +#include <md5_hash.hpp> + +#include <EventLogger.hpp> +EventLogger g_eventLogger; static int g_run_connect_thread= 0; @@ -35,17 +42,221 @@ NdbMutex *ndb_global_event_buffer_mutex= NULL; NdbMutex *ndb_print_state_mutex= NULL; #endif +/* + * Ndb_cluster_connection + */ + Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) + : m_impl(* new Ndb_cluster_connection_impl(connect_string)) +{ +} + +Ndb_cluster_connection::Ndb_cluster_connection +(Ndb_cluster_connection_impl& impl) : m_impl(impl) +{ +} + +Ndb_cluster_connection::~Ndb_cluster_connection() +{ + Ndb_cluster_connection_impl *tmp = &m_impl; + if (this != tmp) + delete tmp; +} + +int Ndb_cluster_connection::get_connected_port() const +{ + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_mgmd_port(); + return -1; +} + +const char *Ndb_cluster_connection::get_connected_host() const +{ + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_mgmd_host(); + return 0; +} + +const char *Ndb_cluster_connection::get_connectstring(char *buf, + int buf_sz) const +{ + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_connectstring(buf,buf_sz); + return 0; +} + +extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) +{ + g_run_connect_thread= 1; + ((Ndb_cluster_connection_impl*) me)->connect_thread(); + return me; +} + +int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void)) +{ + int r; + DBUG_ENTER("Ndb_cluster_connection::start_connect_thread"); + m_impl.m_connect_callback= connect_callback; + if ((r = connect(0,0,0)) == 1) + { + DBUG_PRINT("info",("starting thread")); + m_impl.m_connect_thread= + NdbThread_Create(run_ndb_cluster_connection_connect_thread, + (void**)&m_impl, 32768, "ndb_cluster_connection", + NDB_THREAD_PRIO_LOW); + } + else if (r < 0) + { + DBUG_RETURN(-1); + } + else if (m_impl.m_connect_callback) + { + (*m_impl.m_connect_callback)(); + } + DBUG_RETURN(0); +} + +void Ndb_cluster_connection::set_optimized_node_selection(int val) +{ + m_impl.m_optimized_node_selection= val; +} + +void +Ndb_cluster_connection_impl::init_get_next_node +(Ndb_cluster_connection_node_iter &iter) +{ + if (iter.scan_state != (Uint8)~0) + iter.cur_pos= iter.scan_state; + if (iter.cur_pos >= no_db_nodes()) + iter.cur_pos= 0; + iter.init_pos= iter.cur_pos; + iter.scan_state= 0; + // fprintf(stderr,"[init %d]",iter.init_pos); + return; +} + +Uint32 +Ndb_cluster_connection_impl::get_next_node(Ndb_cluster_connection_node_iter &iter) +{ + Uint32 cur_pos= iter.cur_pos; + if (cur_pos >= no_db_nodes()) + return 0; + + Ndb_cluster_connection_impl::Node *nodes= m_impl.m_all_nodes.getBase(); + Ndb_cluster_connection_impl::Node &node= nodes[cur_pos]; + + if (iter.scan_state != (Uint8)~0) + { + assert(iter.scan_state < no_db_nodes()); + if (nodes[iter.scan_state].group == node.group) + iter.scan_state= ~0; + else + return nodes[iter.scan_state++].id; + } + + // fprintf(stderr,"[%d]",node.id); + + cur_pos++; + Uint32 init_pos= iter.init_pos; + if (cur_pos == node.next_group) + { + cur_pos= nodes[init_pos].this_group; + } + + // fprintf(stderr,"[cur_pos %d]",cur_pos); + if (cur_pos != init_pos) + iter.cur_pos= cur_pos; + else + { + iter.cur_pos= node.next_group; + iter.init_pos= node.next_group; + } + return node.id; +} + +unsigned +Ndb_cluster_connection::no_db_nodes() +{ + return m_impl.m_all_nodes.size(); +} + + +int +Ndb_cluster_connection::wait_until_ready(int timeout, + int timeout_after_first_alive) +{ + DBUG_ENTER("Ndb_cluster_connection::wait_until_ready"); + TransporterFacade *tp = TransporterFacade::instance(); + if (tp == 0) + { + DBUG_RETURN(-1); + } + if (tp->ownId() == 0) + { + DBUG_RETURN(-1); + } + int secondsCounter = 0; + int milliCounter = 0; + int noChecksSinceFirstAliveFound = 0; + do { + unsigned int foundAliveNode = 0; + tp->lock_mutex(); + for(unsigned i= 0; i < no_db_nodes(); i++) + { + //************************************************ + // If any node is answering, ndb is answering + //************************************************ + if (tp->get_node_alive(m_impl.m_all_nodes[i].id) != 0) { + foundAliveNode++; + } + } + tp->unlock_mutex(); + + if (foundAliveNode == no_db_nodes()) + { + DBUG_RETURN(0); + } + else if (foundAliveNode > 0) + { + noChecksSinceFirstAliveFound++; + // 100 ms delay -> 10* + if (noChecksSinceFirstAliveFound > 10*timeout_after_first_alive) + DBUG_RETURN(1); + } + else if (secondsCounter >= timeout) + { // no alive nodes and timed out + DBUG_RETURN(-1); + } + NdbSleep_MilliSleep(100); + milliCounter += 100; + if (milliCounter >= 1000) { + secondsCounter++; + milliCounter = 0; + }//if + } while (1); +} + + + +/* + * Ndb_cluster_connection_impl + */ + +Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * + connect_string) + : Ndb_cluster_connection(*this), + m_optimized_node_selection(1) { DBUG_ENTER("Ndb_cluster_connection"); DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); - m_facade= TransporterFacade::theFacadeInstance= new TransporterFacade(); - if (connect_string) - m_connect_string= my_strdup(connect_string,MYF(MY_WME)); - else - m_connect_string= 0; - m_config_retriever= 0; - m_local_config= 0; + + g_eventLogger.createConsoleHandler(); + g_eventLogger.setCategory("NdbApi"); + g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); + + m_transporter_facade= + TransporterFacade::theFacadeInstance= new TransporterFacade(); + m_connect_thread= 0; m_connect_callback= 0; @@ -59,117 +270,229 @@ Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) ndb_print_state_mutex= NdbMutex_Create(); } #endif + m_config_retriever= + new ConfigRetriever(connect_string, NDB_VERSION, NODE_TYPE_API); + if (m_config_retriever->hasError()) + { + printf("Could not connect initialize handle to management server: %s", + m_config_retriever->getErrorString()); + delete m_config_retriever; + m_config_retriever= 0; + } + DBUG_VOID_RETURN; } -extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) +Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl() { - my_thread_init(); - g_run_connect_thread= 1; - ((Ndb_cluster_connection*) me)->connect_thread(); - my_thread_end(); - NdbThread_Exit(0); - return me; + DBUG_ENTER("~Ndb_cluster_connection"); + DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this)); + TransporterFacade::stop_instance(); + if (m_connect_thread) + { + void *status; + g_run_connect_thread= 0; + NdbThread_WaitFor(m_connect_thread, &status); + NdbThread_Destroy(&m_connect_thread); + m_connect_thread= 0; + } + if (m_transporter_facade != 0) + { + delete m_transporter_facade; + if (m_transporter_facade != TransporterFacade::theFacadeInstance) + abort(); + TransporterFacade::theFacadeInstance= 0; + } + if (m_config_retriever) + delete m_config_retriever; + + // fragmentToNodeMap.release(); + + DBUG_VOID_RETURN; } -void Ndb_cluster_connection::connect_thread() +void +Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, + const ndb_mgm_configuration + &config) { - DBUG_ENTER("Ndb_cluster_connection::connect_thread"); - int r; - do { - NdbSleep_SecSleep(1); - if ((r = connect(1)) == 0) + DBUG_ENTER("Ndb_cluster_connection_impl::init_nodes_vector"); + ndb_mgm_configuration_iterator iter(config, CFG_SECTION_CONNECTION); + + for(iter.first(); iter.valid(); iter.next()) + { + Uint32 nodeid1, nodeid2, remoteNodeId, group= 5; + const char * remoteHostName= 0, * localHostName= 0; + if(iter.get(CFG_CONNECTION_NODE_1, &nodeid1)) continue; + if(iter.get(CFG_CONNECTION_NODE_2, &nodeid2)) continue; + + if(nodeid1 != nodeid && nodeid2 != nodeid) continue; + remoteNodeId = (nodeid == nodeid1 ? nodeid2 : nodeid1); + + iter.get(CFG_CONNECTION_GROUP, &group); + + { + const char * host1= 0, * host2= 0; + iter.get(CFG_CONNECTION_HOSTNAME_1, &host1); + iter.get(CFG_CONNECTION_HOSTNAME_2, &host2); + localHostName = (nodeid == nodeid1 ? host1 : host2); + remoteHostName = (nodeid == nodeid1 ? host2 : host1); + } + + Uint32 type = ~0; + if(iter.get(CFG_TYPE_OF_SECTION, &type)) continue; + + switch(type){ + case CONNECTION_TYPE_SHM:{ break; - if (r == -1) { - printf("Ndb_cluster_connection::connect_thread error\n"); - DBUG_ASSERT(false); - g_run_connect_thread= 0; - } else { - // Wait before making a new connect attempt - NdbSleep_SecSleep(1); } - } while (g_run_connect_thread); - if (m_connect_callback) - (*m_connect_callback)(); - DBUG_VOID_RETURN; -} + case CONNECTION_TYPE_SCI:{ + break; + } + case CONNECTION_TYPE_TCP:{ + // connecting through localhost + // check if config_hostname is local + if (SocketServer::tryBind(0,remoteHostName)) + group--; // upgrade group value + break; + } + case CONNECTION_TYPE_OSE:{ + break; + } + } + m_impl.m_all_nodes.push_back(Node(group,remoteNodeId)); + DBUG_PRINT("info",("saved %d %d", group,remoteNodeId)); + for (int i= m_impl.m_all_nodes.size()-2; + i >= 0 && m_impl.m_all_nodes[i].group > m_impl.m_all_nodes[i+1].group; + i--) + { + Node tmp= m_impl.m_all_nodes[i]; + m_impl.m_all_nodes[i]= m_impl.m_all_nodes[i+1]; + m_impl.m_all_nodes[i+1]= tmp; + } + } -int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void)) -{ - int r; - DBUG_ENTER("Ndb_cluster_connection::start_connect_thread"); - m_connect_callback= connect_callback; - if ((r = connect(1)) == 1) + int i; + Uint32 cur_group, i_group= 0; + cur_group= ~0; + for (i= (int)m_impl.m_all_nodes.size()-1; i >= 0; i--) { - DBUG_PRINT("info",("starting thread")); - m_connect_thread= - NdbThread_Create(run_ndb_cluster_connection_connect_thread, - (void**)this, 32768, "ndb_cluster_connection", - NDB_THREAD_PRIO_LOW); + if (m_impl.m_all_nodes[i].group != cur_group) + { + cur_group= m_impl.m_all_nodes[i].group; + i_group= i+1; + } + m_impl.m_all_nodes[i].next_group= i_group; } - else if (r < 0) + cur_group= ~0; + for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++) { - DBUG_RETURN(-1); + if (m_impl.m_all_nodes[i].group != cur_group) + { + cur_group= m_impl.m_all_nodes[i].group; + i_group= i; + } + m_impl.m_all_nodes[i].this_group= i_group; } - else if (m_connect_callback) - { - (*m_connect_callback)(); +#if 0 + for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++) + { + fprintf(stderr, "[%d] %d %d %d %d\n", + i, + m_impl.m_all_nodes[i].id, + m_impl.m_all_nodes[i].group, + m_impl.m_all_nodes[i].this_group, + m_impl.m_all_nodes[i].next_group); } - DBUG_RETURN(0); + + do_test(); +#endif + DBUG_VOID_RETURN; } -int Ndb_cluster_connection::connect(int reconnect) +void +Ndb_cluster_connection_impl::do_test() { - DBUG_ENTER("Ndb_cluster_connection::connect"); - const char* error = 0; - do { - if (m_config_retriever == 0) + Ndb_cluster_connection_node_iter iter; + int n= no_db_nodes()+5; + Uint32 *nodes= new Uint32[n+1]; + + for (int g= 0; g < n; g++) + { + for (int h= 0; h < n; h++) { - if (m_local_config == 0) { - m_local_config= new LocalConfig(); - if (!m_local_config->init(m_connect_string,0)) { - ndbout_c("Configuration error: Unable to retrieve local config"); - m_local_config->printError(); - m_local_config->printUsage(); - DBUG_RETURN(-1); + Uint32 id; + Ndb_cluster_connection_node_iter iter2; + { + for (int j= 0; j < g; j++) + { + nodes[j]= get_next_node(iter2); } } - m_config_retriever= - new ConfigRetriever(*m_local_config, NDB_VERSION, NODE_TYPE_API); - } - else - if (reconnect == 0) - DBUG_RETURN(0); - if (reconnect) - { - int r= m_config_retriever->do_connect(1); - if (r == 1) - DBUG_RETURN(1); // mgmt server not up yet - if (r == -1) - break; - } - else - if(m_config_retriever->do_connect() == -1) - break; - Uint32 nodeId = m_config_retriever->allocNodeId(); - for(Uint32 i = 0; nodeId == 0 && i<5; i++){ - NdbSleep_SecSleep(3); - nodeId = m_config_retriever->allocNodeId(); + for (int i= 0; i < n; i++) + { + init_get_next_node(iter); + fprintf(stderr, "%d dead:(", g); + id= 0; + while (id == 0) + { + if ((id= get_next_node(iter)) == 0) + break; + for (int j= 0; j < g; j++) + { + if (nodes[j] == id) + { + fprintf(stderr, " %d", id); + id= 0; + break; + } + } + } + fprintf(stderr, ")"); + if (id == 0) + { + break; + } + fprintf(stderr, " %d\n", id); + } + fprintf(stderr, "\n"); } + } + delete [] nodes; +} + +int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, + int verbose) +{ + DBUG_ENTER("Ndb_cluster_connection::connect"); + const char* error = 0; + do { + if (m_impl.m_config_retriever == 0) + DBUG_RETURN(-1); + if (m_impl.m_config_retriever->do_connect(no_retries, + retry_delay_in_seconds, + verbose)) + DBUG_RETURN(1); // mgmt server not up yet + + Uint32 nodeId = m_impl.m_config_retriever->allocNodeId(4/*retries*/, + 3/*delay*/); if(nodeId == 0) break; - ndb_mgm_configuration * props = m_config_retriever->getConfig(); + ndb_mgm_configuration * props = m_impl.m_config_retriever->getConfig(); if(props == 0) break; - m_facade->start_instance(nodeId, props); + m_impl.m_transporter_facade->start_instance(nodeId, props); + + m_impl.init_nodes_vector(nodeId, *props); + ndb_mgm_destroy_configuration(props); - m_facade->connected(); + m_impl.m_transporter_facade->connected(); DBUG_RETURN(0); } while(0); ndbout << "Configuration error: "; - const char* erString = m_config_retriever->getErrorString(); + const char* erString = m_impl.m_config_retriever->getErrorString(); if (erString == 0) { erString = "No error specified!"; } @@ -177,32 +500,132 @@ int Ndb_cluster_connection::connect(int reconnect) DBUG_RETURN(-1); } -Ndb_cluster_connection::~Ndb_cluster_connection() +void Ndb_cluster_connection_impl::connect_thread() { - DBUG_ENTER("~Ndb_cluster_connection"); - DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this)); - TransporterFacade::stop_instance(); - if (m_connect_thread) + DBUG_ENTER("Ndb_cluster_connection_impl::connect_thread"); + int r; + do { + NdbSleep_SecSleep(1); + if ((r = connect(0,0,0)) == 0) + break; + if (r == -1) { + printf("Ndb_cluster_connection::connect_thread error\n"); + DBUG_ASSERT(false); + g_run_connect_thread= 0; + } else { + // Wait before making a new connect attempt + NdbSleep_SecSleep(1); + } + } while (g_run_connect_thread); + if (m_connect_callback) + (*m_connect_callback)(); + DBUG_VOID_RETURN; +} + +/* + * Hint handling to select node + * ToDo: fix this + */ + +void +Ndb_cluster_connection_impl::FragmentToNodeMap::init(Uint32 noOfNodes, + Uint8 nodeIds[]) +{ + kValue = 6; + noOfFragments = 2 * noOfNodes; + + /** + * Compute hashValueMask and hashpointerValue + */ { - void *status; - g_run_connect_thread= 0; - NdbThread_WaitFor(m_connect_thread, &status); - NdbThread_Destroy(&m_connect_thread); - m_connect_thread= 0; + Uint32 topBit = (1 << 31); + for(int i = 31; i>=0; i--){ + if((noOfFragments & topBit) != 0) + break; + topBit >>= 1; + } + hashValueMask = topBit - 1; + hashpointerValue = noOfFragments - (hashValueMask + 1); } - if (m_facade != 0) + + /** + * This initialization depends on + * the fact that: + * primary node for fragment i = i % noOfNodes + * + * This algorithm should be implemented in Dbdih + */ { - delete m_facade; - if (m_facade != TransporterFacade::theFacadeInstance) + if (fragment2PrimaryNodeMap != 0) abort(); - TransporterFacade::theFacadeInstance= 0; + + fragment2PrimaryNodeMap = new Uint32[noOfFragments]; + Uint32 i; + for(i = 0; i<noOfNodes; i++){ + fragment2PrimaryNodeMap[i] = nodeIds[i]; + } + + // Sort them (bubble sort) + for(i = 0; i<noOfNodes-1; i++) + for(Uint32 j = i+1; j<noOfNodes; j++) + if(fragment2PrimaryNodeMap[i] > fragment2PrimaryNodeMap[j]){ + Uint32 tmp = fragment2PrimaryNodeMap[i]; + fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j]; + fragment2PrimaryNodeMap[j] = tmp; + } + + for(i = 0; i<noOfNodes; i++){ + fragment2PrimaryNodeMap[i+noOfNodes] = fragment2PrimaryNodeMap[i]; + } } - my_free(m_connect_string,MYF(MY_ALLOW_ZERO_PTR)); - if (m_config_retriever) - delete m_config_retriever; - if (m_local_config) - delete m_local_config; - DBUG_VOID_RETURN; } +void +Ndb_cluster_connection_impl::FragmentToNodeMap::release(){ + delete [] fragment2PrimaryNodeMap; + fragment2PrimaryNodeMap = 0; +} + +static const Uint32 MAX_KEY_LEN_64_WORDS = 4; +Uint32 +Ndb_cluster_connection_impl::guess_primary_node(const char *keyData, + Uint32 keyLen) +{ + Uint64 tempData[MAX_KEY_LEN_64_WORDS]; + + const Uint32 usedKeyLen = (keyLen + 3) >> 2; // In words + const char * usedKeyData = 0; + + /** + * If key data buffer is not aligned (on 64 bit boundary) + * or key len is not a multiple of 4 + * Use temp data + */ + if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) { + usedKeyData = keyData; + } else { + memcpy(&tempData[0], keyData, keyLen); + const int slack = keyLen & 3; + if(slack > 0) { + memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack)); + }//if + usedKeyData = (char *)&tempData[0]; + }//if + + Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen); + + hashValue >>= fragmentToNodeMap.kValue; + + Uint32 fragmentId = hashValue & + fragmentToNodeMap.hashValueMask; + + if(fragmentId < fragmentToNodeMap.hashpointerValue) { + fragmentId = hashValue & + ((fragmentToNodeMap.hashValueMask << 1) + 1); + }//if + return fragmentId; +} + + +template class Vector<Ndb_cluster_connection_impl::Node>; diff --git a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp new file mode 100644 index 00000000000..620eac296a3 --- /dev/null +++ b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp @@ -0,0 +1,100 @@ +/* Copyright (C) 2003 MySQL 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 */ + + +#ifndef CLUSTER_CONNECTION_IMPL_HPP +#define CLUSTER_CONNECTION_IMPL_HPP + +#include <ndb_cluster_connection.hpp> +#include <Vector.hpp> + +class TransporterFacade; +class ConfigRetriever; +class NdbThread; +class ndb_mgm_configuration; + +struct Ndb_cluster_connection_node_iter { + Ndb_cluster_connection_node_iter() : scan_state(~0), + init_pos(0), + cur_pos(0) {}; + Uint8 scan_state; + Uint8 init_pos; + Uint8 cur_pos; +}; + +extern "C" { + void* run_ndb_cluster_connection_connect_thread(void*); +} + +class Ndb_cluster_connection_impl : public Ndb_cluster_connection +{ + Ndb_cluster_connection_impl(const char *connectstring); + ~Ndb_cluster_connection_impl(); + + void do_test(); + + void init_get_next_node(Ndb_cluster_connection_node_iter &iter); + Uint32 get_next_node(Ndb_cluster_connection_node_iter &iter); + +private: + friend class Ndb; + friend class NdbImpl; + friend void* run_ndb_cluster_connection_connect_thread(void*); + friend class Ndb_cluster_connection; + + /** + * Structure containing values for guessing primary node + */ + struct FragmentToNodeMap { + FragmentToNodeMap(): + fragment2PrimaryNodeMap(0) {}; + Uint32 kValue; + Uint32 hashValueMask; + Uint32 hashpointerValue; + Uint32 noOfFragments; + Uint32 *fragment2PrimaryNodeMap; + + void init(Uint32 noOfNodes, Uint8 nodeIds[]); + void release(); + } fragmentToNodeMap; + + struct Node + { + Node(Uint32 _g= 0, Uint32 _id= 0) : this_group(0), + next_group(0), + group(_g), + id(_id) {}; + Uint32 this_group; + Uint32 next_group; + Uint32 group; + Uint32 id; + }; + + Vector<Node> m_all_nodes; + void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); + Uint32 guess_primary_node(const char * keyData, Uint32 keyLen); + + void connect_thread(); + + TransporterFacade *m_transporter_facade; + ConfigRetriever *m_config_retriever; + NdbThread *m_connect_thread; + int (*m_connect_callback)(void); + + int m_optimized_node_selection; +}; + +#endif diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 20661b89517..d4ad9cd6f1c 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -17,6 +17,7 @@ #include <ndb_global.h> #include <ndberror.h> +#include <m_string.h> typedef struct ErrorBundle { int code; @@ -35,6 +36,7 @@ typedef struct ErrorBundle { #define NE ndberror_cl_none #define AE ndberror_cl_application +#define CE ndberror_cl_configuration #define ND ndberror_cl_no_data_found #define CV ndberror_cl_constraint_violation #define SE ndberror_cl_schema_error @@ -53,8 +55,32 @@ typedef struct ErrorBundle { #define NI ndberror_cl_function_not_implemented #define UE ndberror_cl_unknown_error_code +static const char REDO_BUFFER_MSG[]= +"REDO log buffers overloaded, consult online manual (increase RedoBuffer, and|or decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)"; + static const char* empty_string = ""; +/* + * Error code ranges are reserved for respective block + * + * 200 - TC + * 300 - DIH + * 400 - LQH + * 600 - ACC + * 700 - DICT + * 800 - TUP + * 1200 - LQH + * 1300 - BACKUP + * 4000 - API + * 4100 - "" + * 4200 - "" + * 4300 - "" + * 4400 - "" + * 4500 - "" + * 4600 - "" + * 5000 - Management server + */ + static const ErrorBundle ErrorCodes[] = { @@ -124,7 +150,8 @@ ErrorBundle ErrorCodes[] = { { 217, TR, "217" }, { 218, TR, "218" }, { 219, TR, "219" }, - { 233, TR, "Out of operation records in transaction coordinator" }, + { 233, TR, + "Out of operation records in transaction coordinator (increase MaxNoOfConcurrentOperations)" }, { 275, TR, "275" }, { 279, TR, "Out of transaction markers in transaction coordinator" }, { 414, TR, "414" }, @@ -136,9 +163,8 @@ ErrorBundle ErrorCodes[] = { { 805, TR, "Out of attrinfo records in tuple manager" }, { 830, TR, "Out of add fragment operation records" }, { 873, TR, "Out of attrinfo records for scan in tuple manager" }, - { 1217, TR, "1217" }, - { 1219, TR, "Out of operation records in local data manager" }, - { 1220, TR, "1220" }, + { 1217, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" }, + { 1220, TR, REDO_BUFFER_MSG }, { 1222, TR, "Out of transaction markers in LQH" }, { 4021, TR, "Out of Send Buffer space in NDB API" }, { 4022, TR, "Out of Send Buffer space in NDB API" }, @@ -149,9 +175,10 @@ ErrorBundle ErrorCodes[] = { */ { 623, IS, "623" }, { 624, IS, "624" }, - { 625, IS, "Out of memory in Ndb Kernel, index part" }, - { 826, IS, "826" }, - { 827, IS, "Out of memory in Ndb Kernel, data part" }, + { 625, IS, "Out of memory in Ndb Kernel, index part (increase IndexMemory)" }, + { 800, IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" }, + { 826, IS, "Too many tables and attributes (increase MaxNoOfAttributes or MaxNoOfTables)" }, + { 827, IS, "Out of memory in Ndb Kernel, data part (increase DataMemory)" }, { 832, IS, "832" }, /** @@ -163,15 +190,14 @@ ErrorBundle ErrorCodes[] = { { 297, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout, temporary!! */ { 237, TO, "Transaction had timed out when trying to commit it" }, - /** * OverloadError */ - { 410, OL, "Out of log file space temporarily" }, - { 677, OL, "Index UNDO buffers overloaded" }, - { 891, OL, "Data UNDO buffers overloaded" }, - { 1221, OL, "REDO log buffers overloaded" }, - { 4006, OL, "Connect failure - out of connection objects" }, + { 410, OL, REDO_BUFFER_MSG }, + { 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" }, + { 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" }, + { 1221, OL, REDO_BUFFER_MSG }, + { 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" }, @@ -238,12 +264,13 @@ ErrorBundle ErrorCodes[] = { { 877, AE, "877" }, { 878, AE, "878" }, { 879, AE, "879" }, + { 880, AE, "Tried to read too much - too many getValue calls" }, { 884, AE, "Stack overflow in interpreter" }, { 885, AE, "Stack underflow in interpreter" }, { 886, AE, "More than 65535 instructions executed in interpreter" }, - { 4256, AE, "Must call Ndb::init() before this function" }, - { 880, AE, "Tried to read too much - too many getValue calls" }, - { 4257, AE, "Tried to read too much - too many getValue calls" }, + { 897, AE, "Update attempt of primary key via ndbcluster internal api (if this occurs via the MySQL server it is a bug, please report)" }, + { 4256, AE, "Must call Ndb::init() before this function" }, + { 4257, AE, "Tried to read too much - too many getValue calls" }, /** * Scan application errors @@ -288,7 +315,7 @@ ErrorBundle ErrorCodes[] = { { 283, SE, "Table is being dropped" }, { 284, SE, "Table not defined in transaction coordinator" }, { 285, SE, "Unknown table error in transaction coordinator" }, - { 881, SE, "Unable to create table, out of data pages" }, + { 881, SE, "Unable to create table, out of data pages (increase DataMemory) " }, { 1225, SE, "Table not defined in local query handler" }, { 1226, SE, "Table is being dropped" }, { 1228, SE, "Cannot use drop table for drop index" }, @@ -300,6 +327,36 @@ ErrorBundle ErrorCodes[] = { { 4003, NI, "Function not implemented yet" }, /** + * Backup error codes + */ + + { 1300, IE, "Undefined error" }, + { 1301, IE, "Backup issued to not master (reissue command to master)" }, + { 1302, IE, "Out of backup record" }, + { 1303, IS, "Out of resources" }, + { 1304, IE, "Sequence failure" }, + { 1305, IE, "Backup definition not implemented" }, + { 1306, AE, "Backup not supported in diskless mode (change Diskless)" }, + + { 1321, IE, "Backup aborted by application" }, + { 1322, IE, "Backup already completed" }, + { 1323, IE, "1323" }, + { 1324, IE, "Backup log buffer full" }, + { 1325, IE, "File or scan error" }, + { 1326, IE, "Backup abortet due to node failure" }, + { 1327, IE, "1327" }, + + { 1340, IE, "Backup undefined error" }, + { 1342, AE, "Backup failed to allocate buffers (check configuration)" }, + { 1343, AE, "Backup failed to setup fs buffers (check configuration)" }, + { 1344, AE, "Backup failed to allocate tables (check configuration)" }, + { 1345, AE, "Backup failed to insert file header (check configuration)" }, + { 1346, AE, "Backup failed to insert table list (check configuration)" }, + { 1347, AE, "Backup failed to allocate table memory (check configuration)" }, + { 1348, AE, "Backup failed to allocate file record (check configuration)" }, + { 1349, AE, "Backup failed to allocate attribute record (check configuration)" }, + + /** * Still uncategorized */ { 720, AE, "Attribute name reused in table definition" }, @@ -344,17 +401,11 @@ ErrorBundle ErrorCodes[] = { { 4327, AE, "Distribution Group with 1 byte attribute is not allowed" }, { 4328, AE, "Disk memory attributes not yet supported" }, { 4329, AE, "Variable stored attributes not yet supported" }, - { 4330, AE, "Table names limited to 127 bytes" }, - { 4331, AE, "Attribute names limited to 31 bytes" }, - { 4332, AE, "Maximum 2000 attributes in a table" }, - { 4333, AE, "Maximum 4092 bytes long keys allowed" }, - { 4334, AE, "Attribute properties length limited to 127 bytes" }, { 4400, AE, "Status Error in NdbSchemaCon" }, { 4401, AE, "Only one schema operation per schema transaction" }, { 4402, AE, "No schema operation defined before calling execute" }, - { 4500, AE, "Cannot handle more than 2048 tables in NdbApi" }, { 4501, AE, "Insert in hash table failed when getting table information from Ndb" }, { 4502, AE, "GetValue not allowed in Update operation" }, { 4503, AE, "GetValue not allowed in Insert operation" }, @@ -429,7 +480,8 @@ ErrorBundle ErrorCodes[] = { { 4267, IE, "Corrupted blob value" }, { 4268, IE, "Error in blob head update forced rollback of transaction" }, { 4268, IE, "Unknown blob error" }, - { 4269, IE, "No connection to ndb management server" } + { 4269, IE, "No connection to ndb management server" }, + { 4335, AE, "Only one autoincrement column allowed per table. Having a table without primary key uses an autoincremented hidden key, i.e. a table without a primary key can not have an autoincremented column" } }; static @@ -468,6 +520,7 @@ const ErrorStatusClassification StatusClassificationMapping[] = { { ST_S, NE, "No error"}, { ST_P, AE, "Application error"}, + { ST_P, CE, "Configuration or application error"}, { ST_P, ND, "No data found"}, { ST_P, CV, "Constraint violation"}, { ST_P, SE, "Schema error"}, @@ -594,10 +647,10 @@ int ndb_error_string(int err_no, char *str, unsigned int size) ndberror_update(&error); len = - snprintf(str, size-1, "%s: %s: %s", error.message, - ndberror_status_message(error.status), - ndberror_classification_message(error.classification)); + my_snprintf(str, size-1, "%s: %s: %s", error.message, + ndberror_status_message(error.status), + ndberror_classification_message(error.classification)); str[size-1]= '\0'; - + return len; } diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am index 2e0f30df9d4..b8753668c60 100644 --- a/ndb/test/Makefile.am +++ b/ndb/test/Makefile.am @@ -4,3 +4,5 @@ EXTRA_DIST = include dist-hook: -rm -rf `find $(distdir) -type d -name SCCS` + +windoze-dsp: diff --git a/ndb/src/mgmclient/CpcClient.hpp b/ndb/test/include/CpcClient.hpp index 1655bc57b56..1655bc57b56 100644 --- a/ndb/src/mgmclient/CpcClient.hpp +++ b/ndb/test/include/CpcClient.hpp diff --git a/ndb/test/include/HugoOperations.hpp b/ndb/test/include/HugoOperations.hpp index fe22e4b5649..a23d3018f47 100644 --- a/ndb/test/include/HugoOperations.hpp +++ b/ndb/test/include/HugoOperations.hpp @@ -30,6 +30,8 @@ public: int closeTransaction(Ndb*); NdbConnection* getTransaction(); void refresh(); + + void setTransactionId(Uint64); int pkInsertRecord(Ndb*, int recordNo, @@ -98,7 +100,7 @@ protected: struct RsPair { NdbResultSet* m_result_set; int records; }; Vector<RsPair> m_result_sets; Vector<RsPair> m_executed_result_sets; -private: + NdbConnection* pTrans; }; diff --git a/ndb/test/include/HugoTransactions.hpp b/ndb/test/include/HugoTransactions.hpp index 19e4cb43336..b833f2ac629 100644 --- a/ndb/test/include/HugoTransactions.hpp +++ b/ndb/test/include/HugoTransactions.hpp @@ -36,15 +36,21 @@ public: bool allowConstraintViolation = true, int doSleep = 0, bool oneTrans = false); + int scanReadRecords(Ndb*, int records, int abort = 0, int parallelism = 0, - bool committed = false); - int scanReadCommittedRecords(Ndb*, - int records, - int abort = 0, - int parallelism = 0); + NdbOperation::LockMode = NdbOperation::LM_Read); + + int scanReadRecords(Ndb*, + const NdbDictionary::Index*, + int records, + int abort = 0, + int parallelism = 0, + NdbOperation::LockMode = NdbOperation::LM_Read, + bool sorted = false); + int pkReadRecords(Ndb*, int records, int batchsize = 1, diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index b0b5fe15960..a60228c1a5d 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -188,7 +188,7 @@ public: NDBT_TestCase(NDBT_TestSuite* psuite, const char* name, const char* comment); - virtual ~NDBT_TestCase(){} + virtual ~NDBT_TestCase() {} // This is the default executor of a test case // When a test case is executed it will need to be suplied with a number of @@ -225,6 +225,8 @@ protected: void stopTimer(NDBT_Context*); void printTimer(NDBT_Context*); + BaseString _name; + BaseString _comment; const char* name; const char* comment; NDBT_TestSuite* suite; @@ -392,10 +394,10 @@ C##suitname():NDBT_TestSuite(#suitname){ \ // Add a number of equal steps to the testcase #define STEPS(stepfunc, num) \ - for (int i = 0; i < num; i++){ \ + { int i; for (i = 0; i < num; i++){ \ pts = new NDBT_ParallelStep(pt, #stepfunc, stepfunc); \ pt->addStep(pts);\ - } + } } #define VERIFIER(stepfunc) \ ptv = new NDBT_Verifier(pt, #stepfunc, stepfunc); \ diff --git a/ndb/test/include/NdbRestarter.hpp b/ndb/test/include/NdbRestarter.hpp index 114726f6a2b..19a88b4f8ad 100644 --- a/ndb/test/include/NdbRestarter.hpp +++ b/ndb/test/include/NdbRestarter.hpp @@ -87,8 +87,6 @@ protected: bool connected; BaseString addr; - BaseString host; - int port; NdbMgmHandle handle; ndb_mgm_configuration * m_config; protected: diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index 43f76c8c253..e8ab542b00a 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -303,6 +303,7 @@ public: * * @deprecated do not use! */ +#ifndef NDB_WIN32 inline int createTable( const char* aTableName, Uint32 aTableSize, KeyType aTupleKey, @@ -324,6 +325,7 @@ public: aMemoryType, (aStoredTable == 1 ? true : false)); } +#endif /** * Add a new attribute to a database table. @@ -565,7 +567,8 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type) case NdbDictionary::Column::Unsigned: return UnSigned; case NdbDictionary::Column::Float: - case NdbDictionary::Column::Decimal: + case NdbDictionary::Column::Olddecimal: + case NdbDictionary::Column::Olddecimalunsigned: case NdbDictionary::Column::Double: return Float; case NdbDictionary::Column::Char: @@ -573,9 +576,6 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type) case NdbDictionary::Column::Binary: case NdbDictionary::Column::Varbinary: return String; - case NdbDictionary::Column::Datetime: - case NdbDictionary::Column::Timespec: - case NdbDictionary::Column::Undefined: default: return NoAttrTypeDef; } diff --git a/ndb/test/include/UtilTransactions.hpp b/ndb/test/include/UtilTransactions.hpp index 37cd99550a5..23902f3b317 100644 --- a/ndb/test/include/UtilTransactions.hpp +++ b/ndb/test/include/UtilTransactions.hpp @@ -53,11 +53,11 @@ public: int selectCount(Ndb*, int parallelism = 0, int* count_rows = NULL, - ScanLock lock = SL_Read, + NdbOperation::LockMode lm = NdbOperation::LM_CommittedRead, NdbConnection* pTrans = NULL); int scanReadRecords(Ndb*, int parallelism, - bool exclusive, + NdbOperation::LockMode lm, int records, int noAttribs, int* attrib_list, diff --git a/ndb/include/util/getarg.h b/ndb/test/include/getarg.h index 03ed25f6828..03ed25f6828 100644 --- a/ndb/include/util/getarg.h +++ b/ndb/test/include/getarg.h diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 787589dd9b6..0c84db8c068 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -30,7 +30,8 @@ testSystemRestart \ testTimeout \ testTransactions \ testDeadlock \ -test_event ndbapi_slow_select testReadPerf testLcp +test_event ndbapi_slow_select testReadPerf testLcp \ +DbCreate DbAsyncGenerator #flexTimedAsynch #testBlobs @@ -69,6 +70,8 @@ test_event_SOURCES = test_event.cpp ndbapi_slow_select_SOURCES = slow_select.cpp testReadPerf_SOURCES = testReadPerf.cpp testLcp_SOURCES = testLcp.cpp +DbCreate_SOURCES= bench/mainPopulate.cpp bench/dbPopulate.cpp bench/userInterface.cpp +DbAsyncGenerator_SOURCES= bench/mainAsyncGenerator.cpp bench/asyncGenerator.cpp bench/ndb_async2.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel @@ -84,4 +87,65 @@ testBackup_LDADD = $(LDADD) bank/libbank.a # Don't update the files from bitkeeper %::SCCS/s.% +windoze-dsp: flexBench.dsp testBasic.dsp testBlobs.dsp \ + testScan.dsp +flexBench.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ flexBench + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(flexBench_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testBasic.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testBasic + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testBasic_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testOIBasic.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testOIBasic + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testOIBasic_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testBlobs.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testBlobs + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testBlobs_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testScan.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testScan + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testScan_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/test/ndbapi/Makefile_old b/ndb/test/ndbapi/Makefile_old deleted file mode 100644 index c3198096ec0..00000000000 --- a/ndb/test/ndbapi/Makefile_old +++ /dev/null @@ -1,49 +0,0 @@ -include .defs.mk - - -ifeq ($(NDB_OS), OSE) -DIRS = basic flexBench flexAsynch -else -DIRS = lmc-bench ronja -BIN_DIRS = \ - flexAsynch \ - flexBench \ - flexHammer \ - flexTT \ - create_tab \ - create_all_tabs \ - drop_all_tabs \ - bulk_copy \ - restarter2 restarter \ - restarts testScan testNdbApi \ - testScanInterpreter testIndex \ - testInterpreter \ - testOIBasic \ - testBackup \ - testBasic \ - basicAsynch \ - testNodeRestart \ - testOperations testTransactions \ - testSystemRestart \ - testTimeout \ - testMgm \ - testRestartGci \ - testDataBuffers \ - testDict \ - acid \ - telco \ - indexTest \ - test_event \ - indexTest2 \ - testGrep \ - testBlobs - -ifeq ($(NDB_OS), SOLARIS) -ifeq ($(NDB_COMPILER), FORTE6) - DIRS += flexTimedAsynch -endif -endif -endif - -include ${NDB_TOP}/Epilogue.mk - diff --git a/ndb/test/ndbapi/ScanFunctions.hpp b/ndb/test/ndbapi/ScanFunctions.hpp index 2ff4b751c33..6964f8c73a8 100644 --- a/ndb/test/ndbapi/ScanFunctions.hpp +++ b/ndb/test/ndbapi/ScanFunctions.hpp @@ -286,36 +286,36 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attr = new Attrib; attr->numAttribs = 0; attriblist.push_back(attr); - - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + int i; + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; a<i; a++) attr->attribs[a] = a; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns()-1; i > 0; i--){ + for(i = pTab->getNoOfColumns()-1; i > 0; i--){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; a<i; a++) attr->attribs[a] = a; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns(); i > 0; i--){ + for(i = pTab->getNoOfColumns(); i > 0; i--){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = 2; for(int a = 0; a<2; a++){ @@ -345,11 +345,11 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attriblist.push_back(attr); #if 1 - for(size_t i = 0; i < attriblist.size(); i++){ + for(size_t j = 0; j < attriblist.size(); j++){ - g_info << attriblist[i]->numAttribs << ": " ; - for(int a = 0; a < attriblist[i]->numAttribs; a++) - g_info << attriblist[i]->attribs[a] << ", "; + g_info << attriblist[j]->numAttribs << ": " ; + for(int a = 0; a < attriblist[j]->numAttribs; a++) + g_info << attriblist[j]->attribs[a] << ", "; g_info << endl; } #endif diff --git a/ndb/test/ndbapi/bank/Makefile.am b/ndb/test/ndbapi/bank/Makefile.am index 886d664aefb..d4f82a7f9c4 100644 --- a/ndb/test/ndbapi/bank/Makefile.am +++ b/ndb/test/ndbapi/bank/Makefile.am @@ -20,3 +20,5 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/test/ndbapi/bank/Makefile_old b/ndb/test/ndbapi/bank/Makefile_old deleted file mode 100644 index f710f9e6612..00000000000 --- a/ndb/test/ndbapi/bank/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -DIRS = src bankCreator \ - bankSumAccounts \ - bankTransactionMaker \ - bankValidateAllGLs \ - bankMakeGL \ - bankTimer \ - testBank - - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/test/ndbapi/bench/asyncGenerator.cpp b/ndb/test/ndbapi/bench/asyncGenerator.cpp new file mode 100644 index 00000000000..d91e38dff1a --- /dev/null +++ b/ndb/test/ndbapi/bench/asyncGenerator.cpp @@ -0,0 +1,571 @@ +/* Copyright (C) 2003 MySQL 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 */ + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include <ndb_global.h> + +#include "dbGenerator.h" +#include <NdbApi.hpp> +#include <NdbOut.hpp> +#include <NdbSleep.h> + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +static void getRandomSubscriberNumber(SubscriberNumber number); +static void getRandomServerId(ServerId *serverId); +static void getRandomChangedBy(ChangedBy changedBy); +static void getRandomChangedTime(ChangedTime changedTime); + +static void clearTransaction(TransactionDefinition *trans); +static void initGeneratorStatistics(GeneratorStatistics *gen); + +static void doOneTransaction(ThreadData * td, + int parallellism, + int millisSendPoll, + int minEventSendPoll, + int forceSendPoll); +static void doTransaction_T1(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T2(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T3(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T4(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T5(Ndb * pNDB, ThreadData * td, int async); + +/*************************************************************** +* L O C A L D A T A * +***************************************************************/ + +static SequenceValues transactionDefinition[] = { + {25, 1}, + {25, 2}, + {20, 3}, + {15, 4}, + {15, 5}, + {0, 0} +}; + +static SequenceValues rollbackDefinition[] = { + {98, 0}, + {2 , 1}, + {0, 0} +}; + +static int maxsize = 0; + +/*************************************************************** +* P U B L I C D A T A * +***************************************************************/ + +/*************************************************************** +**************************************************************** +* L O C A L F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +static void getRandomSubscriberNumber(SubscriberNumber number) +{ + uint32 tmp; + char sbuf[SUBSCRIBER_NUMBER_LENGTH + 1]; + tmp = myRandom48(NO_OF_SUBSCRIBERS); + sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_LENGTH, tmp); + memcpy(number, sbuf, SUBSCRIBER_NUMBER_LENGTH); +} + +static void getRandomServerId(ServerId *serverId) +{ + *serverId = myRandom48(NO_OF_SERVERS); +} + +static void getRandomChangedBy(ChangedBy changedBy) +{ + memset(changedBy, myRandom48(26)+'A', CHANGED_BY_LENGTH); + changedBy[CHANGED_BY_LENGTH] = 0; +} + +static void getRandomChangedTime(ChangedTime changedTime) +{ + memset(changedTime, myRandom48(26)+'A', CHANGED_TIME_LENGTH); + changedTime[CHANGED_TIME_LENGTH] = 0; +} + +static void clearTransaction(TransactionDefinition *trans) +{ + trans->count = 0; + trans->branchExecuted = 0; + trans->rollbackExecuted = 0; + trans->latencyCounter = myRandom48(127); + trans->latency.reset(); +} + +static int listFull(SessionList *list) +{ + return(list->numberInList == SESSION_LIST_LENGTH); +} + +static int listEmpty(SessionList *list) +{ + return(list->numberInList == 0); +} + +static void insertSession(SessionList *list, + SubscriberNumber number, + ServerId serverId) +{ + SessionElement *e; + if( listFull(list) ) return; + + e = &list->list[list->writeIndex]; + + strcpy(e->subscriberNumber, number); + e->serverId = serverId; + + list->writeIndex = (list->writeIndex + 1) % SESSION_LIST_LENGTH; + list->numberInList++; + + if( list->numberInList > maxsize ) + maxsize = list->numberInList; +} + +static SessionElement *getNextSession(SessionList *list) +{ + if( listEmpty(list) ) return(0); + + return(&list->list[list->readIndex]); +} + +static void deleteSession(SessionList *list) +{ + if( listEmpty(list) ) return; + + list->readIndex = (list->readIndex + 1) % SESSION_LIST_LENGTH; + list->numberInList--; +} + +static void initGeneratorStatistics(GeneratorStatistics *gen) +{ + int i; + + if( initSequence(&gen->transactionSequence, + transactionDefinition) != 0 ) { + ndbout_c("could not set the transaction types"); + exit(0); + } + + if( initSequence(&gen->rollbackSequenceT4, + rollbackDefinition) != 0 ) { + ndbout_c("could not set the rollback sequence"); + exit(0); + } + + if( initSequence(&gen->rollbackSequenceT5, + rollbackDefinition) != 0 ) { + ndbout_c("could not set the rollback sequence"); + exit(0); + } + + for(i = 0; i < NUM_TRANSACTION_TYPES; i++ ) + clearTransaction(&gen->transactions[i]); + + gen->totalTransactions = 0; + + gen->activeSessions.numberInList = 0; + gen->activeSessions.readIndex = 0; + gen->activeSessions.writeIndex = 0; +} + + +static +void +doOneTransaction(ThreadData * td, int p, int millis, int minEvents, int force) +{ + int i; + unsigned int transactionType; + int async = 1; + if (p == 1) { + async = 0; + }//if + for(i = 0; i<p; i++){ + if(td[i].runState == Runnable){ + transactionType = getNextRandom(&td[i].generator.transactionSequence); + + switch(transactionType) { + case 1: + doTransaction_T1(td[i].pNDB, &td[i], async); + break; + case 2: + doTransaction_T2(td[i].pNDB, &td[i], async); + break; + case 3: + doTransaction_T3(td[i].pNDB, &td[i], async); + break; + case 4: + doTransaction_T4(td[i].pNDB, &td[i], async); + break; + case 5: + doTransaction_T5(td[i].pNDB, &td[i], async); + break; + default: + ndbout_c("Unknown transaction type: %d", transactionType); + } + } + } + if (async == 1) { + td[0].pNDB->sendPollNdb(millis, minEvents, force); + }//if +} + +static +void +doTransaction_T1(Ndb * pNDB, ThreadData * td, int async) +{ + /*----------------*/ + /* Init arguments */ + /*----------------*/ + getRandomSubscriberNumber(td->transactionData.number); + getRandomChangedBy(td->transactionData.changed_by); + BaseString::snprintf(td->transactionData.changed_time, + sizeof(td->transactionData.changed_time), + "%ld - %d", td->changedTime++, myRandom48(65536*1024)); + //getRandomChangedTime(td->transactionData.changed_time); + td->transactionData.location = td->transactionData.changed_by[0]; + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[0].startLatency(); + + start_T1(pNDB, td, async); +} + +static +void +doTransaction_T2(Ndb * pNDB, ThreadData * td, int async) +{ + /*----------------*/ + /* Init arguments */ + /*----------------*/ + getRandomSubscriberNumber(td->transactionData.number); + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[1].startLatency(); + + start_T2(pNDB, td, async); +} + +static +void +doTransaction_T3(Ndb * pNDB, ThreadData * td, int async) +{ + SessionElement *se; + + /*----------------*/ + /* Init arguments */ + /*----------------*/ + se = getNextSession(&td->generator.activeSessions); + if( se ) { + strcpy(td->transactionData.number, se->subscriberNumber); + td->transactionData.server_id = se->serverId; + td->transactionData.sessionElement = 1; + } else { + getRandomSubscriberNumber(td->transactionData.number); + getRandomServerId(&td->transactionData.server_id); + td->transactionData.sessionElement = 0; + } + + td->transactionData.server_bit = (1 << td->transactionData.server_id); + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[2].startLatency(); + start_T3(pNDB, td, async); +} + +static +void +doTransaction_T4(Ndb * pNDB, ThreadData * td, int async) +{ + /*----------------*/ + /* Init arguments */ + /*----------------*/ + getRandomSubscriberNumber(td->transactionData.number); + getRandomServerId(&td->transactionData.server_id); + + td->transactionData.server_bit = (1 << td->transactionData.server_id); + td->transactionData.do_rollback = + getNextRandom(&td->generator.rollbackSequenceT4); + +#if 0 + memset(td->transactionData.session_details, + myRandom48(26)+'A', SESSION_DETAILS_LENGTH); +#endif + td->transactionData.session_details[SESSION_DETAILS_LENGTH] = 0; + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[3].startLatency(); + start_T4(pNDB, td, async); +} + +static +void +doTransaction_T5(Ndb * pNDB, ThreadData * td, int async) +{ + SessionElement * se; + se = getNextSession(&td->generator.activeSessions); + if( se ) { + strcpy(td->transactionData.number, se->subscriberNumber); + td->transactionData.server_id = se->serverId; + td->transactionData.sessionElement = 1; + } + else { + getRandomSubscriberNumber(td->transactionData.number); + getRandomServerId(&td->transactionData.server_id); + td->transactionData.sessionElement = 0; + } + + td->transactionData.server_bit = (1 << td->transactionData.server_id); + td->transactionData.do_rollback + = getNextRandom(&td->generator.rollbackSequenceT5); + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[4].startLatency(); + start_T5(pNDB, td, async); +} + +void +complete_T1(ThreadData * data){ + data->generator.transactions[0].stopLatency(); + data->generator.transactions[0].count++; + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +void +complete_T2(ThreadData * data){ + data->generator.transactions[1].stopLatency(); + data->generator.transactions[1].count++; + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +void +complete_T3(ThreadData * data){ + + data->generator.transactions[2].stopLatency(); + data->generator.transactions[2].count++; + + if(data->transactionData.branchExecuted) + data->generator.transactions[2].branchExecuted++; + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +void +complete_T4(ThreadData * data){ + + data->generator.transactions[3].stopLatency(); + data->generator.transactions[3].count++; + + if(data->transactionData.branchExecuted) + data->generator.transactions[3].branchExecuted++; + if(data->transactionData.do_rollback) + data->generator.transactions[3].rollbackExecuted++; + + if(data->transactionData.branchExecuted && + !data->transactionData.do_rollback){ + insertSession(&data->generator.activeSessions, + data->transactionData.number, + data->transactionData.server_id); + } + + data->runState = Runnable; + data->generator.totalTransactions++; + +} +void +complete_T5(ThreadData * data){ + + data->generator.transactions[4].stopLatency(); + data->generator.transactions[4].count++; + + if(data->transactionData.branchExecuted) + data->generator.transactions[4].branchExecuted++; + if(data->transactionData.do_rollback) + data->generator.transactions[4].rollbackExecuted++; + + if(data->transactionData.sessionElement && + !data->transactionData.do_rollback){ + deleteSession(&data->generator.activeSessions); + } + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +/*************************************************************** +**************************************************************** +* P U B L I C F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ +void +asyncGenerator(ThreadData *data, + int parallellism, + int millisSendPoll, + int minEventSendPoll, + int forceSendPoll) +{ + ThreadData * startUp; + + GeneratorStatistics *st; + double periodStop; + double benchTimeStart; + double benchTimeEnd; + int i, j, done; + + myRandom48Init(data->randomSeed); + + for(i = 0; i<parallellism; i++){ + initGeneratorStatistics(&data[i].generator); + } + + startUp = (ThreadData*)malloc(parallellism * sizeof(ThreadData)); + memcpy(startUp, data, (parallellism * sizeof(ThreadData))); + + /*----------------*/ + /* warm up period */ + /*----------------*/ + periodStop = userGetTime() + (double)data[0].warmUpSeconds; + + while(userGetTime() < periodStop){ + doOneTransaction(startUp, parallellism, + millisSendPoll, minEventSendPoll, forceSendPoll); + } + + ndbout_c("Waiting for startup to finish"); + + /** + * Wait for all transactions + */ + done = 0; + while(!done){ + done = 1; + for(i = 0; i<parallellism; i++){ + if(startUp[i].runState != Runnable){ + done = 0; + break; + } + } + if(!done){ + startUp[0].pNDB->sendPollNdb(); + } + } + ndbout_c("Benchmark period starts"); + + /*-------------------------*/ + /* normal benchmark period */ + /*-------------------------*/ + benchTimeStart = userGetTime(); + + periodStop = benchTimeStart + (double)data[0].testSeconds; + while(userGetTime() < periodStop) + doOneTransaction(data, parallellism, + millisSendPoll, minEventSendPoll, forceSendPoll); + + benchTimeEnd = userGetTime(); + + ndbout_c("Benchmark period done"); + + /** + * Wait for all transactions + */ + done = 0; + while(!done){ + done = 1; + for(i = 0; i<parallellism; i++){ + if(data[i].runState != Runnable){ + done = 0; + break; + } + } + if(!done){ + data[0].pNDB->sendPollNdb(); + } + } + + /*------------------*/ + /* cool down period */ + /*------------------*/ + periodStop = userGetTime() + (double)data[0].coolDownSeconds; + while(userGetTime() < periodStop){ + doOneTransaction(startUp, parallellism, + millisSendPoll, minEventSendPoll, forceSendPoll); + } + + done = 0; + while(!done){ + done = 1; + for(i = 0; i<parallellism; i++){ + if(startUp[i].runState != Runnable){ + done = 0; + break; + } + } + if(!done){ + startUp[0].pNDB->sendPollNdb(); + } + } + + + /*---------------------------------------------------------*/ + /* add the times for all transaction for inner loop timing */ + /*---------------------------------------------------------*/ + for(j = 0; j<parallellism; j++){ + st = &data[j].generator; + + st->outerLoopTime = benchTimeEnd - benchTimeStart; + st->outerTps = getTps(st->totalTransactions, st->outerLoopTime); + } + /* ndbout_c("maxsize = %d\n",maxsize); */ + + free(startUp); +} + diff --git a/ndb/test/ndbapi/bench/dbGenerator.h b/ndb/test/ndbapi/bench/dbGenerator.h new file mode 100644 index 00000000000..2256498e151 --- /dev/null +++ b/ndb/test/ndbapi/bench/dbGenerator.h @@ -0,0 +1,63 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef DBGENERATOR_H +#define DBGENERATOR_H + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include "testData.h" +#include "userInterface.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void asyncGenerator(ThreadData *d, int parallellism, + int millisSendPoll, + int minEventSendPoll, + int forceSendPoll); + +#ifdef __cplusplus +} +#endif + +/*************************************************************** +* E X T E R N A L D A T A * +***************************************************************/ + + + +#endif /* DBGENERATOR_H */ + diff --git a/ndb/test/ndbapi/bench/dbPopulate.cpp b/ndb/test/ndbapi/bench/dbPopulate.cpp new file mode 100644 index 00000000000..42fbb52f3b2 --- /dev/null +++ b/ndb/test/ndbapi/bench/dbPopulate.cpp @@ -0,0 +1,244 @@ +/* Copyright (C) 2003 MySQL 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 */ + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include <ndb_global.h> + +#include "userInterface.h" + +#include "dbPopulate.h" +#include <NdbOut.hpp> +#include <random.h> + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +static void getRandomSubscriberData(int subscriberNo, + SubscriberNumber number, + SubscriberName name); + +static void populate(char *title, + int count, + void (*func)(UserHandle*,int), + UserHandle *uh); + +static void populateServers(UserHandle *uh, int count); +static void populateSubscribers(UserHandle *uh, int count); +static void populateGroups(UserHandle *uh, int count); + +/*************************************************************** +* L O C A L D A T A * +***************************************************************/ + +static SequenceValues permissionsDefinition[] = { + {90, 1}, + {10, 0}, + {0, 0} +}; + +/*************************************************************** +* P U B L I C D A T A * +***************************************************************/ + + +/*************************************************************** +**************************************************************** +* L O C A L F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +static void getRandomSubscriberData(int subscriberNo, + SubscriberNumber number, + SubscriberName name) +{ + char sbuf[SUBSCRIBER_NUMBER_LENGTH + 1]; + sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_LENGTH, subscriberNo); + memcpy(number, sbuf, SUBSCRIBER_NUMBER_LENGTH); + + memset(name, myRandom48(26)+'A', SUBSCRIBER_NAME_LENGTH); +} + +static void populate(char *title, + int count, + void (*func)(UserHandle*, int), + UserHandle *uh) +{ + ndbout_c("Populating %d '%s' ... ",count, title); + /* fflush(stdout); */ + func(uh,count); + ndbout_c("done"); +} + +static void populateServers(UserHandle *uh, int count) +{ + int i, j; + int len; + char tmp[80]; + int suffix_length = 1; + ServerName serverName; + SubscriberSuffix suffix; + + int commitCount = 0; + + for(i = 0; i < SUBSCRIBER_NUMBER_SUFFIX_LENGTH; i++) + suffix_length *= 10; + + for(i = 0; i < count; i++) { + sprintf(tmp, "-Server %d-", i); + + len = strlen(tmp); + for(j = 0; j < SERVER_NAME_LENGTH; j++){ + serverName[j] = tmp[j % len]; + } + /* serverName[j] = 0; not null-terminated */ + + for(j = 0; j < suffix_length; j++){ + char sbuf[SUBSCRIBER_NUMBER_SUFFIX_LENGTH + 1]; + sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, j); + memcpy(suffix, sbuf, SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + userDbInsertServer(uh, i, suffix, serverName); + commitCount ++; + if((commitCount % OP_PER_TRANS) == 0) + userDbCommit(uh); + } + } + if((commitCount % OP_PER_TRANS) != 0) + userDbCommit(uh); +} + +static void populateSubscribers(UserHandle *uh, int count) +{ + SubscriberNumber number; + SubscriberName name; + int i, j, k; + int res; + + SequenceValues values[NO_OF_GROUPS+1]; + RandomSequence seq; + + for(i = 0; i < NO_OF_GROUPS; i++) { + values[i].length = 1; + values[i].value = i; + } + + values[i].length = 0; + values[i].value = 0; + + if( initSequence(&seq, values) != 0 ) { + ndbout_c("could not set the sequence of random groups"); + exit(0); + } + +#define RETRIES 25 + + for(i = 0; i < count; i+= OP_PER_TRANS) { + for(j = 0; j<RETRIES; j++){ + for(k = 0; k<OP_PER_TRANS && i+k < count; k++){ + getRandomSubscriberData(i+k, number, name); + userDbInsertSubscriber(uh, number, getNextRandom(&seq), name); + } + res = userDbCommit(uh); + if(res == 0) + break; + if(res != 1){ + ndbout_c("Terminating"); + exit(0); + } + } + if(j == RETRIES){ + ndbout_c("Terminating"); + exit(0); + } + } +} + +static void populateGroups(UserHandle *uh, int count) +{ + int i; + int j; + int len; + RandomSequence seq; + Permission allow[NO_OF_GROUPS]; + ServerBit serverBit; + GroupName groupName; + char tmp[80]; + int commitCount = 0; + + if( initSequence(&seq, permissionsDefinition) != 0 ) { + ndbout_c("could not set the sequence of random permissions"); + exit(0); + } + + for(i = 0; i < NO_OF_GROUPS; i++) + allow[i] = 0; + + for(i = 0; i < NO_OF_SERVERS; i++) { + serverBit = 1 << i; + + for(j = 0; j < NO_OF_GROUPS; j++ ) { + if( getNextRandom(&seq) ) + allow[j] |= serverBit; + } + } + + for(i = 0; i < NO_OF_GROUPS; i++) { + sprintf(tmp, "-Group %d-", i); + + len = strlen(tmp); + + for(j = 0; j < GROUP_NAME_LENGTH; j++) { + groupName[j] = tmp[j % len]; + } + /* groupName[j] = 0; not null-terminated */ + + userDbInsertGroup(uh, + i, + groupName, + allow[i], + allow[i], + allow[i]); + commitCount ++; + if((commitCount % OP_PER_TRANS) == 0) + userDbCommit(uh); + } + if((commitCount % OP_PER_TRANS) != 0) + userDbCommit(uh); +} + +/*************************************************************** +**************************************************************** +* P U B L I C F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +void dbPopulate(UserHandle *uh) +{ + populate("servers", NO_OF_SERVERS, populateServers, uh); + populate("subscribers", NO_OF_SUBSCRIBERS, populateSubscribers, uh); + populate("groups", NO_OF_GROUPS, populateGroups, uh); +} diff --git a/ndb/test/ndbapi/bench/dbPopulate.h b/ndb/test/ndbapi/bench/dbPopulate.h new file mode 100644 index 00000000000..1916720e141 --- /dev/null +++ b/ndb/test/ndbapi/bench/dbPopulate.h @@ -0,0 +1,59 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef DBPOPULATE_H +#define DBPOPULATE_H + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include "userInterface.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void dbPopulate(UserHandle *uh); + +#ifdef __cplusplus +} +#endif + +/*************************************************************** +* E X T E R N A L D A T A * +***************************************************************/ + + + +#endif /* DBPOPULATE_H */ + diff --git a/ndb/test/ndbapi/bench/macros.h b/ndb/test/ndbapi/bench/macros.h new file mode 100644 index 00000000000..22b7f564490 --- /dev/null +++ b/ndb/test/ndbapi/bench/macros.h @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef MACROS_H +#define MACROS_H + +#include <ndb_global.h> +#include <NdbOut.hpp> + +#define ERROR(x) {ndbout_c((x));} +#define ERROR1(x,y) {ndbout_c((x), (y));} +#define ERROR2(x,y,z) {ndbout_c((x), (y), (z));} +#define ERROR3(x,y,z,u) {ndbout_c((x), (y), (z), (u));} +#define ERROR4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));} + +#define INIT_RANDOM(x) srand48((x)) +#define UI_RANDOM(x) ((unsigned int)(lrand48()%(x))) + +#define ASSERT(cond, message) \ + { if(!(cond)) { ERROR(message); exit(-1); }} + +#ifdef DEBUG_ON +#define DEBUG(x) {ndbout_c((x));} +#define DEBUG1(x,y) {ndbout_c((x), (y));} +#define DEBUG2(x,y,z) {ndbout_c((x), (y), (z));} +#define DEBUG3(x,y,z,u) {ndbout_c((x), (y), (z), (u));} +#define DEBUG4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));} +#define DEBUG5(x,y,z,u,w, v) {ndbout_c((x), (y), (z), (u), (w), (v));} +#else +#define DEBUG(x) +#define DEBUG1(x,y) +#define DEBUG2(x,y,z) +#define DEBUG3(x,y,z,u) +#define DEBUG4(x,y,z,u,w) +#define DEBUG5(x,y,z,u,w, v) +#endif + +#endif diff --git a/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp b/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp new file mode 100644 index 00000000000..828b924582f --- /dev/null +++ b/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp @@ -0,0 +1,503 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include <ndb_global.h> + +#include <NdbHost.h> +#include <NdbSleep.h> +#include <NdbThread.h> +#include <NdbMain.h> +#include <NdbOut.hpp> +#include <NdbEnv.h> +#include <NdbTest.hpp> + +#include "userInterface.h" +#include "dbGenerator.h" + +static int numProcesses; +static int numSeconds; +static int numWarmSeconds; +static int parallellism; +static int millisSendPoll; +static int minEventSendPoll; +static int forceSendPoll; + +static ThreadData *data; +static Ndb_cluster_connection *g_cluster_connection= 0; + + +static void usage(const char *prog) +{ + const char *progname; + + /*--------------------------------------------*/ + /* Get the name of the program (without path) */ + /*--------------------------------------------*/ + progname = strrchr(prog, '/'); + + if (progname == 0) + progname = prog; + else + ++progname; + + ndbout_c( + "Usage: %s [-proc <num>] [-warm <num>] [-time <num>] [ -p <num>] " + "[-t <num> ] [ -e <num> ] [ -f <num>] \n" + " -proc <num> Specifies that <num> is the number of\n" + " threads. The default is 1.\n" + " -time <num> Specifies that the test will run for <num> sec.\n" + " The default is 10 sec\n" + " -warm <num> Specifies the warm-up/cooldown period of <num> " + "sec.\n" + " The default is 10 sec\n" + " -p <num> The no of parallell transactions started by " + "one thread\n" + " -e <num> Minimum no of events before wake up in call to " + "sendPoll\n" + " Default is 1\n" + " -f <num> force parameter to sendPoll\n" + " Default is 0\n", + progname); +} + +static +int +parse_args(int argc, const char **argv) +{ + int i; + + numProcesses = 1; + numSeconds = 10; + numWarmSeconds = 10; + parallellism = 1; + millisSendPoll = 10000; + minEventSendPoll = 1; + forceSendPoll = 0; + + + i = 1; + while (i < argc){ + if (strcmp("-proc",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &numProcesses) == -1 || + numProcesses <= 0 || numProcesses > 127) { + ndbout_c("-proc flag requires a positive integer argument [1..127]"); + return 1; + } + i += 2; + } else if (strcmp("-p", argv[i]) == 0){ + if(i + 1 >= argc){ + usage(argv[0]); + return 1; + } + if (sscanf(argv[i+1], "%d", ¶llellism) == -1 || + parallellism <= 0){ + ndbout_c("-p flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-time",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &numSeconds) == -1 || + numSeconds < 0) { + ndbout_c("-time flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-warm",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &numWarmSeconds) == -1 || + numWarmSeconds < 0) { + ndbout_c("-warm flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-e",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &minEventSendPoll) == -1 || + minEventSendPoll < 0) { + ndbout_c("-e flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-f",argv[i]) == 0) { + if (i + 1 >= argc) { + usage(argv[0]); + return 1; + } + if (sscanf(argv[i+1], "%d", &forceSendPoll) == -1 || + forceSendPoll < 0) { + ndbout_c("-f flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else { + return 1; + } + } + + if(minEventSendPoll > parallellism){ + ndbout_c("minEventSendPoll(%d) > parallellism(%d)", + minEventSendPoll, parallellism); + ndbout_c("not very good..."); + ndbout_c("very bad..."); + ndbout_c("exiting..."); + return 1; + } + return 0; +} + +static +void +print_transaction(const char *header, + unsigned long totalCount, + TransactionDefinition *trans, + unsigned int printBranch, + unsigned int printRollback) +{ + double f; + + ndbout_c(" %s: %d (%.2f%%) " + "Latency(ms) avg: %d min: %d max: %d std: %d n: %d", + header, + trans->count, + (double)trans->count / (double)totalCount * 100.0, + (int)trans->latency.getMean(), + (int)trans->latency.getMin(), + (int)trans->latency.getMax(), + (int)trans->latency.getStddev(), + (int)trans->latency.getCount() + ); + + if( printBranch ){ + if( trans->count == 0 ) + f = 0.0; + else + f = (double)trans->branchExecuted / (double)trans->count * 100.0; + ndbout_c(" Branches Executed: %d (%.2f%%)", trans->branchExecuted, f); + } + + if( printRollback ){ + if( trans->count == 0 ) + f = 0.0; + else + f = (double)trans->rollbackExecuted / (double)trans->count * 100.0; + ndbout_c(" Rollback Executed: %d (%.2f%%)",trans->rollbackExecuted,f); + } +} + +void +print_stats(const char *title, + unsigned int length, + unsigned int transactionFlag, + GeneratorStatistics *gen, + int numProc, int parallellism) +{ + int i; + char buf[10]; + char name[MAXHOSTNAMELEN]; + + name[0] = 0; + NdbHost_GetHostName(name); + + ndbout_c("\n------ %s ------",title); + ndbout_c("Length : %d %s", + length, + transactionFlag ? "Transactions" : "sec"); + ndbout_c("Processor : %s", name); + ndbout_c("Number of Proc: %d",numProc); + ndbout_c("Parallellism : %d", parallellism); + ndbout_c("\n"); + + if( gen->totalTransactions == 0 ) { + ndbout_c(" No Transactions for this test"); + } + else { + for(i = 0; i < 5; i++) { + sprintf(buf, "T%d",i+1); + print_transaction(buf, + gen->totalTransactions, + &gen->transactions[i], + i >= 2, + i >= 3 ); + } + + ndbout_c("\n"); + ndbout_c(" Overall Statistics:"); + ndbout_c(" Transactions: %d", gen->totalTransactions); + ndbout_c(" Outer : %.0f TPS",gen->outerTps); + ndbout_c("\n"); + } +} + +static +void * +threadRoutine(void *arg) +{ + int i; + ThreadData *data = (ThreadData *)arg; + Ndb * pNDB; + + pNDB = asyncDbConnect(parallellism); + /* NdbSleep_MilliSleep(rand() % 10); */ + + for(i = 0; i<parallellism; i++){ + data[i].pNDB = pNDB; + } + millisSendPoll = 30000; + asyncGenerator(data, parallellism, + millisSendPoll, minEventSendPoll, forceSendPoll); + + asyncDbDisconnect(pNDB); + + return NULL; +} + +NDB_COMMAND(DbAsyncGenerator, "DbAsyncGenerator", + "DbAsyncGenerator", "DbAsyncGenerator", 65535) +{ + ndb_init(); + int i; + int j; + int k; + struct NdbThread* pThread = NULL; + GeneratorStatistics stats; + GeneratorStatistics *p; + char threadName[32]; + int rc = NDBT_OK; + void* tmp = NULL; + if(parse_args(argc,argv) != 0){ + usage(argv[0]); + return NDBT_ProgramExit(NDBT_WRONGARGS); + } + + + ndbout_c("\nStarting Test with %d process(es) for %d %s parallellism %d", + numProcesses, + numSeconds, + "sec", + parallellism); + + ndbout_c(" WarmUp/coolDown = %d sec", numWarmSeconds); + + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + ndbout << "Unable to connect to management server." << endl; + return 0; + } + if (con.wait_until_ready(30,0) < 0) + { + ndbout << "Cluster nodes not ready in 30 seconds." << endl; + return 0; + } + + g_cluster_connection= &con; + data = (ThreadData*)malloc((numProcesses*parallellism)*sizeof(ThreadData)); + + for(i = 0; i < numProcesses; i++) { + for(j = 0; j<parallellism; j++){ + data[i*parallellism+j].warmUpSeconds = numWarmSeconds; + data[i*parallellism+j].testSeconds = numSeconds; + data[i*parallellism+j].coolDownSeconds = numWarmSeconds; + data[i*parallellism+j].randomSeed = + NdbTick_CurrentMillisecond()+i+j; + data[i*parallellism+j].changedTime = 0; + data[i*parallellism+j].runState = Runnable; + } + sprintf(threadName, "AsyncThread[%d]", i); + pThread = NdbThread_Create(threadRoutine, + (void**)&data[i*parallellism], + 65535, + threadName, + NDB_THREAD_PRIO_LOW); + if(pThread != 0 && pThread != NULL){ + (&data[i*parallellism])->pThread = pThread; + } else { + perror("Failed to create thread"); + rc = NDBT_FAILED; + } + } + + showTime(); + + /*--------------------------------*/ + /* Wait for all processes to exit */ + /*--------------------------------*/ + for(i = 0; i < numProcesses; i++) { + NdbThread_WaitFor(data[i*parallellism].pThread, &tmp); + NdbThread_Destroy(&data[i*parallellism].pThread); + } + + ndbout_c("All threads have finished"); + + /*-------------------------------------------*/ + /* Clear all structures for total statistics */ + /*-------------------------------------------*/ + stats.totalTransactions = 0; + stats.outerTps = 0.0; + + for(i = 0; i < NUM_TRANSACTION_TYPES; i++ ) { + stats.transactions[i].count = 0; + stats.transactions[i].branchExecuted = 0; + stats.transactions[i].rollbackExecuted = 0; + stats.transactions[i].latency.reset(); + } + + /*--------------------------------*/ + /* Add the values for all Threads */ + /*--------------------------------*/ + for(i = 0; i < numProcesses; i++) { + for(k = 0; k<parallellism; k++){ + p = &data[i*parallellism+k].generator; + + stats.totalTransactions += p->totalTransactions; + stats.outerTps += p->outerTps; + + for(j = 0; j < NUM_TRANSACTION_TYPES; j++ ) { + stats.transactions[j].count += + p->transactions[j].count; + stats.transactions[j].branchExecuted += + p->transactions[j].branchExecuted; + stats.transactions[j].rollbackExecuted += + p->transactions[j].rollbackExecuted; + stats.transactions[j].latency += + p->transactions[j].latency; + } + } + } + + print_stats("Test Results", + numSeconds, + 0, + &stats, + numProcesses, + parallellism); + + free(data); + + NDBT_ProgramExit(rc); +} +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <time.h> + +#include "ndb_schema.hpp" +#include "ndb_error.hpp" +#include "userInterface.h" +#include <NdbMutex.h> +#include <NdbThread.h> +#include <NdbTick.h> +#include <NdbApi.hpp> +#include <NdbOut.hpp> + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +#ifndef NDB_WIN32 +#include <unistd.h> +#endif + +Ndb* +asyncDbConnect(int parallellism){ + Ndb * pNDB = new Ndb(g_cluster_connection, "TEST_DB"); + + pNDB->init(parallellism + 1); + + while(pNDB->waitUntilReady() != 0){ + } + + return pNDB; +} + +void +asyncDbDisconnect(Ndb* pNDB) +{ + delete pNDB; +} + +double +userGetTime(void) +{ + static bool initialized = false; + static NDB_TICKS initSecs = 0; + static Uint32 initMicros = 0; + double timeValue = 0; + + if ( !initialized ) { + initialized = true; + NdbTick_CurrentMicrosecond(&initSecs, &initMicros); + timeValue = 0.0; + } else { + NDB_TICKS secs = 0; + Uint32 micros = 0; + + NdbTick_CurrentMicrosecond(&secs, µs); + double s = (double)secs - (double)initSecs; + double us = (double)micros - (double)initMicros; + + timeValue = s + (us / 1000000.0); + } + return timeValue; +} + +void showTime() +{ + char buf[128]; + struct tm* tm_now; + time_t now; + now = ::time((time_t*)NULL); + tm_now = ::gmtime(&now); + + ::snprintf(buf, 128, + "%d-%.2d-%.2d %.2d:%.2d:%.2d", + tm_now->tm_year + 1900, + tm_now->tm_mon, + tm_now->tm_mday, + tm_now->tm_hour, + tm_now->tm_min, + tm_now->tm_sec); + + ndbout_c("Time: %s", buf); +} + diff --git a/ndb/test/ndbapi/bench/mainPopulate.cpp b/ndb/test/ndbapi/bench/mainPopulate.cpp new file mode 100644 index 00000000000..5ab1a5b015d --- /dev/null +++ b/ndb/test/ndbapi/bench/mainPopulate.cpp @@ -0,0 +1,81 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include <ndb_global.h> +#include <ndb_opts.h> + +#include "userInterface.h" +#include "dbPopulate.h" +#include <NdbMain.h> +#include <NdbOut.hpp> +#include <random.h> +#include <NDBT.hpp> + +#ifdef __cplusplus +extern "C" { +#endif +int useTableLogging; +#ifdef __cplusplus +} +#endif + + +static void usage() +{ +} + +static +void usage(const char *prog) +{ + + ndbout_c( + "Usage: %s [-l]\n" + " -l Use logging and checkpointing on tables\n", + prog); + + exit(1); +} + +NDB_STD_OPTS_VARS; + +NDB_COMMAND(DbCreate, "DbCreate", "DbCreate", "DbCreate", 16384) +{ + ndb_init(); + int i; + UserHandle *uh; + + useTableLogging = 0; + + for(i = 1; i<argc; i++){ + if(strcmp(argv[i], "-l") == 0){ + useTableLogging = 1; + } else { + usage(argv[0]); + return 0; + } + } + + ndbout_c("Using %s tables", + useTableLogging ? "logging" : "temporary"); + + myRandom48Init(0x3e6f); + + uh = userDbConnect(1, "TEST_DB"); + dbPopulate(uh); + userDbDisconnect(uh); + + return NDBT_ProgramExit(NDBT_OK); +} diff --git a/ndb/test/ndbapi/bench/ndb_async1.cpp b/ndb/test/ndbapi/bench/ndb_async1.cpp new file mode 100644 index 00000000000..2a84f6b2aca --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_async1.cpp @@ -0,0 +1,647 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +#include "userInterface.h" + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include <NdbApi.hpp> + +inline +NdbConnection * +startTransaction(Ndb * pNDB, + ServerId inServerId, + const SubscriberNumber inNumber){ + + const int keyDataLenBytes = sizeof(ServerId)+SUBSCRIBER_NUMBER_LENGTH; + const int keyDataLen_64Words = keyDataLenBytes >> 3; + + Uint64 keyDataBuf[keyDataLen_64Words+1]; // The "+1" is for rounding... + + char * keyDataBuf_charP = (char *)&keyDataBuf[0]; + Uint32 * keyDataBuf_wo32P = (Uint32 *)&keyDataBuf[0]; + + // Server Id comes first + keyDataBuf_wo32P[0] = inServerId; + // Then subscriber number + memcpy(&keyDataBuf_charP[sizeof(ServerId)], inNumber, + SUBSCRIBER_NUMBER_LENGTH); + + return pNDB->startTransaction(0, keyDataBuf_charP, keyDataLenBytes); +} + +void T1_Callback(int result, NdbConnection * pCon, void * threadData); +void T2_Callback(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_3(int result, NdbConnection * pCon, void * threadData); + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +void +start_T1(Ndb * pNDB, ThreadData * td){ + + DEBUG2("T1(%.*s): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + int check; + NdbConnection * pCON = pNDB->startTransaction(); + if (pCON != NULL) { + NdbOperation *MyOp = pCON->getNdbOperation(SUBSCRIBER_TABLE); + if (MyOp != NULL) { + MyOp->updateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + pCON->executeAsynchPrepare( Commit , T1_Callback, td); + } else { + CHECK_NULL(MyOp, "T1: getNdbOperation", pCON); + }//if + } else { + error_handler("T1-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + }//if +} + +void +T1_Callback(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + + DEBUG2("T1(%.*s): - Completing\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + CHECK_MINUS_ONE(result, "T1: Commit", + pCON); + td->pNDB->closeTransaction(pCON); + complete_T1(td); +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +void +start_T2(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T2(%.*s, %p): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = pNDB->startTransaction(); + if (pCON == NULL) + error_handler("T2-1: startTransaction", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_NAME, + td->transactionData.name); + pCON->executeAsynchPrepare( Commit, T2_Callback, td ); +} + +void +T2_Callback(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T2(%.*s, %p): - Completing\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + CHECK_MINUS_ONE(result, "T2: Commit", pCON); + td->pNDB->closeTransaction(pCON); + complete_T2(td); +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +void +start_T3(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T3(%.*s, %.2d): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = startTransaction(pNDB, + td->transactionData.server_id, + td->transactionData.number); + if (pCON == NULL) + error_handler("T3-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T3-1: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + pCON->executeAsynchPrepare( NoCommit , T3_Callback_1, td); +} + +void +T3_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Callback 1\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + CHECK_MINUS_ONE(result, "T3-1: NoCommit", pCON); + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T3-2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_READ, + (char *)&td->transactionData.permission); + pCON->executeAsynchPrepare( NoCommit, T3_Callback_2, td ); +} + +void +T3_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + + CHECK_MINUS_ONE(result, "T3-2: NoCommit", pCON); + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number + [SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + DEBUG5("T3(%.*s, %.2d): - Callback 2 - reading(%.*s)\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T3-3: getNdbOperation", + pCON); + + MyOp->simpleRead(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->getValue(IND_SESSION_DATA, + (char *)td->transactionData.session_details); + + /* Operation 4 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T3-4: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_READS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + DEBUG3("T3(%.*s, %.2d): - Callback 2 - no read\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + td->transactionData.branchExecuted = 0; + } + pCON->executeAsynchPrepare( Commit, T3_Callback_3, td ); +} + +void +T3_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Completing\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + CHECK_MINUS_ONE(result, "T3-3: Commit", pCON); + + td->pNDB->closeTransaction(pCON); + complete_T3(td); +} + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T4(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T4(%.*s, %.2d): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = startTransaction(pNDB, + td->transactionData.server_id, + td->transactionData.number); + if (pCON == NULL) + error_handler("T4-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T4-1: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + pCON->executeAsynchPrepare( NoCommit , T4_Callback_1, td); +} + +void +T4_Callback_1(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T4-1: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T4(%.*s, %.2d): - Callback 1\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T4-2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&td->transactionData.permission); + pCON->executeAsynchPrepare( NoCommit , T4_Callback_2, td); +} + +void +T4_Callback_2(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T4-2: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == 0)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number + [SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T4(%.*s, %.2d): - Callback 2 - inserting(%.*s)\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T4-3: getNdbOperation", + pCON); + + MyOp->insertTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->setValue(SESSION_DATA, + (char *)td->transactionData.session_details); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T4-5: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_INSERTS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + DEBUG5("T4(%.*s, %.2d): - Callback 2 - %s %s\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + pCON->executeAsynchPrepare(Commit, T4_Callback_3, td); + } else { + pCON->executeAsynchPrepare(Rollback, T4_Callback_3, td); + } +} + +void +T4_Callback_3(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T4-3: Commit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T4(%.*s, %.2d): - Completing\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T4(td); +} + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T5(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T5(%.*s, %.2d): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = pNDB->startTransaction(); + if (pCON == NULL) + error_handler("T5-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation * MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T5-1: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + pCON->executeAsynchPrepare( NoCommit, T5_Callback_1, td ); +} + +void +T5_Callback_1(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T5-1: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T5(%.*s, %.2d): - Callback 1\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T5-2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&td->transactionData.permission); + pCON->executeAsynchPrepare( NoCommit, T5_Callback_2, td ); +} + +void +T5_Callback_2(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T5-2: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number + [SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - deleting(%.*s)\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T5-3: getNdbOperation", + pCON); + + MyOp->deleteTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T5-5: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_DELETES, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - no delete - %s %s\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + pCON->executeAsynchPrepare(Commit, T5_Callback_3, td); + } else { + pCON->executeAsynchPrepare(Rollback, T5_Callback_3, td); + } +} + +void +T5_Callback_3(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T5-3: Commit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T5(%.*s, %.2d): - Completing\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T5(td); +} diff --git a/ndb/test/ndbapi/bench/ndb_async2.cpp b/ndb/test/ndbapi/bench/ndb_async2.cpp new file mode 100644 index 00000000000..31cf1d8310a --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_async2.cpp @@ -0,0 +1,757 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +#include <string.h> +#include "userInterface.h" + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" +#include <NdbSleep.h> + +#include <NdbApi.hpp> + +void T1_Callback(int result, NdbConnection * pCon, void * threadData); +void T2_Callback(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_3(int result, NdbConnection * pCon, void * threadData); + +static int stat_async = 0; + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ + +#define SFX_START (SUBSCRIBER_NUMBER_LENGTH - SUBSCRIBER_NUMBER_SUFFIX_LENGTH) + +inline +NdbConnection * +startTransaction(Ndb * pNDB, ThreadData * td){ + return pNDB->startTransaction(); +#ifdef OLD_CODE + return pNDB->startTransactionDGroup (0, + &td->transactionData.number[SFX_START], + 1); +#endif +} + +void +start_T1(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG2("T1(%.*s): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + NdbConnection * pCON = 0; + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp = pCON->getNdbOperation(SUBSCRIBER_TABLE); + if (MyOp != NULL) { + MyOp->updateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + if (async == 1) { + pCON->executeAsynchPrepare( Commit , T1_Callback, td); + } else { + int result = pCON->execute(Commit); + T1_Callback(result, pCON, (void*)td); + return; + }//if + } else { + CHECK_NULL(MyOp, "T1: getNdbOperation", td, pCON->getNdbError()); + }//if +} + +void +T1_Callback(int result, NdbConnection * pCON, void * threadData) { + ThreadData * td = (ThreadData *)threadData; + + DEBUG2("T1(%.*s): - Completing", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T1: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T1(td->pNDB, td, stat_async); + return; + }//if + td->pNDB->closeTransaction(pCON); + complete_T1(td); +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +void +start_T2(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T2(%.*s, %d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + NdbConnection * pCON = 0; + + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T2-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_NAME, + td->transactionData.name); + if (async == 1) { + pCON->executeAsynchPrepare( Commit , T2_Callback, td); + } else { + int result = pCON->execute(Commit); + T2_Callback(result, pCON, (void*)td); + return; + }//if +} + +void +T2_Callback(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T2(%.*s, %d): - Completing", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T2: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T2(td->pNDB, td, stat_async); + return; + }//if + td->pNDB->closeTransaction(pCON); + complete_T2(td); +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +void +start_T3(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T3(%.*s, %.2d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbConnection * pCON = 0; + + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T3-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T3-1: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + stat_async = async; + if (async == 1) { + pCON->executeAsynchPrepare( NoCommit , T3_Callback_1, td); + } else { + int result = pCON->execute( NoCommit ); + T3_Callback_1(result, pCON, (void*)td); + return; + }//if +} + +void +T3_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Callback 1", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T3-1: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T3(td->pNDB, td, stat_async); + return; + }//if + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T3-2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_READ, + (char *)&td->transactionData.permission); + if (stat_async == 1) { + pCON->executeAsynchPrepare( NoCommit , T3_Callback_2, td); + } else { + int result = pCON->execute( NoCommit ); + T3_Callback_2(result, pCON, (void*)td); + return; + }//if +} + +void +T3_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + + if (result == -1) { + CHECK_ALLOWED_ERROR("T3-2: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T3(td->pNDB, td, stat_async); + return; + }//if + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number[SFX_START], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + DEBUG5("T3(%.*s, %.2d): - Callback 2 - reading(%.*s)", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T3-3: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->simpleRead(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->getValue(IND_SESSION_DATA, + (char *)td->transactionData.session_details); + + /* Operation 4 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T3-4: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_READS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + DEBUG3("T3(%.*s, %.2d): - Callback 2 - no read", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + td->transactionData.branchExecuted = 0; + } + if (stat_async == 1) { + pCON->executeAsynchPrepare( Commit , T3_Callback_3, td); + } else { + int result = pCON->execute( Commit ); + T3_Callback_3(result, pCON, (void*)td); + return; + }//if +} + +void +T3_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Completing", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T3-3: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T3(td->pNDB, td, stat_async); + return; + }//if + td->pNDB->closeTransaction(pCON); + complete_T3(td); +} + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T4(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T4(%.*s, %.2d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbConnection * pCON = 0; + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T4-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T4-1: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + stat_async = async; + if (async == 1) { + pCON->executeAsynchPrepare( NoCommit , T4_Callback_1, td); + } else { + int result = pCON->execute( NoCommit ); + T4_Callback_1(result, pCON, (void*)td); + return; + }//if +} + +void +T4_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T4-1: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T4(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T4(%.*s, %.2d): - Callback 1", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T4-2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&td->transactionData.permission); + if (stat_async == 1) { + pCON->executeAsynchPrepare( NoCommit , T4_Callback_2, td); + } else { + int result = pCON->execute( NoCommit ); + T4_Callback_2(result, pCON, (void*)td); + return; + }//if +} + +void +T4_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T4-2: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T4(td->pNDB, td, stat_async); + return; + }//if + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == 0)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number[SFX_START], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T4(%.*s, %.2d): - Callback 2 - inserting(%.*s)", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T4-3: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->insertTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->setValue(SESSION_DATA, + (char *)td->transactionData.session_details); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T4-5: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_INSERTS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + DEBUG5("T4(%.*s, %.2d): - Callback 2 - %s %s", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + if (stat_async == 1) { + pCON->executeAsynchPrepare( Commit , T4_Callback_3, td); + } else { + int result = pCON->execute( Commit ); + T4_Callback_3(result, pCON, (void*)td); + return; + }//if + } else { + if (stat_async == 1) { + pCON->executeAsynchPrepare( Rollback , T4_Callback_3, td); + } else { + int result = pCON->execute( Rollback ); + T4_Callback_3(result, pCON, (void*)td); + return; + }//if + } +} + +void +T4_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T4-3: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T4(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T4(%.*s, %.2d): - Completing", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T4(td); +} + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T5(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T5(%.*s, %.2d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbConnection * pCON = 0; + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T5-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation * MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T5-1: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + stat_async = async; + if (async == 1) { + pCON->executeAsynchPrepare( NoCommit , T5_Callback_1, td); + } else { + int result = pCON->execute( NoCommit ); + T5_Callback_1(result, pCON, (void*)td); + return; + }//if +} + +void +T5_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T5-1: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T5(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T5(%.*s, %.2d): - Callback 1", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T5-2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&td->transactionData.permission); + if (stat_async == 1) { + pCON->executeAsynchPrepare( NoCommit , T5_Callback_2, td); + } else { + int result = pCON->execute( NoCommit ); + T5_Callback_2(result, pCON, (void*)td); + return; + }//if +} + +void +T5_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T5-2: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T5(td->pNDB, td, stat_async); + return; + }//if + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number[SFX_START], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - deleting(%.*s)", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T5-3: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->deleteTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T5-5: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_DELETES, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - no delete - %s %s", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + if (stat_async == 1) { + pCON->executeAsynchPrepare( Commit , T5_Callback_3, td); + } else { + int result = pCON->execute( Commit ); + T5_Callback_3(result, pCON, (void*)td); + return; + }//if + } else { + if (stat_async == 1) { + pCON->executeAsynchPrepare( Rollback , T5_Callback_3, td); + } else { + int result = pCON->execute( Rollback ); + T5_Callback_3(result, pCON, (void*)td); + return; + }//if + } +} + +void +T5_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T5-3: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T5(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T5(%.*s, %.2d): - Completing", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T5(td); +} diff --git a/ndb/test/ndbapi/bench/ndb_error.hpp b/ndb/test/ndbapi/bench/ndb_error.hpp new file mode 100644 index 00000000000..d90f5506813 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_error.hpp @@ -0,0 +1,81 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef NDB_ERROR_H +#define NDB_ERROR_H + +#include <ndb_global.h> +#include <NdbOut.hpp> +#include "userInterface.h" +#include <NdbError.hpp> +#include <NdbApi.hpp> + +#define error_handler(x,y, z) { \ + ndbout << x << " " << y << endl; \ + exit(-1); } + +#define CHECK_MINUS_ONE(x, y, z) if(x == -1) \ + error_handler(y,(z->getNdbError()), 0) + +inline +void +CHECK_ALLOWED_ERROR(const char * str, + const ThreadData * td, + const struct NdbError & error){ + + char buf[100]; + snprintf(buf, sizeof(buf), "subscriber = %.*s ", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + ndbout << str << " " << error << endl + << buf; + showTime(); + + switch(error.classification) { + case NdbError::TimeoutExpired: + case NdbError::OverloadError: + case NdbError::TemporaryResourceError: + case NdbError::NodeRecoveryError: + break; + default: + if(error.status != NdbError::TemporaryError) + exit(-1); + } +} + +inline +void +CHECK_NULL(void * null, + const char * str, + const ThreadData * td, + const struct NdbError & err){ + if(null == 0){ + CHECK_ALLOWED_ERROR(str, td, err); + exit(-1); + } +} + +inline +void +CHECK_NULL(void * null, const char* msg, NdbConnection* obj) +{ + if(null == 0) + { + error_handler(msg, obj->getNdbError(), 0); + } +} + +#endif diff --git a/ndb/test/ndbapi/bench/ndb_schema.hpp b/ndb/test/ndbapi/bench/ndb_schema.hpp new file mode 100644 index 00000000000..af08bc2eecd --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_schema.hpp @@ -0,0 +1,78 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef NDB_SCHEMA_H +#define NDB_SCHEMA_H + +#include "testDefinitions.h" + +#define SUBSCRIBER_TABLE "SUBSCRIBER" +#define SUBSCRIBER_NUMBER "NUMBER" +#define SUBSCRIBER_LOCATION "LOCATION" +#define SUBSCRIBER_NAME "NAME" +#define SUBSCRIBER_GROUP "GROUP_ID" +#define SUBSCRIBER_SESSIONS "SESSIONS" +#define SUBSCRIBER_CHANGED_BY "CHANGED_BY" +#define SUBSCRIBER_CHANGED_TIME "CHANGED_TIME" + +#define SERVER_TABLE "SERVER" +#define SERVER_ID "SERVER_ID" +#define SERVER_SUBSCRIBER_SUFFIX "SUFFIX" +#define SERVER_NAME "NAME" +#define SERVER_READS "NO_OF_READ" +#define SERVER_INSERTS "NO_OF_INSERT" +#define SERVER_DELETES "NO_OF_DELETE" + +#define GROUP_TABLE "GROUP" +#define GROUP_ID "GROUP_ID" +#define GROUP_NAME "GROUP_NAME" +#define GROUP_ALLOW_READ "ALLOW_READ" +#define GROUP_ALLOW_INSERT "ALLOW_INSERT" +#define GROUP_ALLOW_DELETE "ALLOW_DELETE" + +#define SESSION_TABLE "SESSION" +#define SESSION_SERVER "SERVER_ID" +#define SESSION_SUBSCRIBER "NUMBER" +#define SESSION_DATA "DATA" + +/** Numbers */ + +#define IND_SUBSCRIBER_NUMBER (unsigned)0 +#define IND_SUBSCRIBER_NAME (unsigned)1 +#define IND_SUBSCRIBER_GROUP (unsigned)2 +#define IND_SUBSCRIBER_LOCATION (unsigned)3 +#define IND_SUBSCRIBER_SESSIONS (unsigned)4 +#define IND_SUBSCRIBER_CHANGED_BY (unsigned)5 +#define IND_SUBSCRIBER_CHANGED_TIME (unsigned)6 + +#define IND_SERVER_SUBSCRIBER_SUFFIX (unsigned)0 +#define IND_SERVER_ID (unsigned)1 +#define IND_SERVER_NAME (unsigned)2 +#define IND_SERVER_READS (unsigned)3 +#define IND_SERVER_INSERTS (unsigned)4 +#define IND_SERVER_DELETES (unsigned)5 + +#define IND_GROUP_ID (unsigned)0 +#define IND_GROUP_NAME (unsigned)1 +#define IND_GROUP_ALLOW_READ (unsigned)2 +#define IND_GROUP_ALLOW_INSERT (unsigned)3 +#define IND_GROUP_ALLOW_DELETE (unsigned)4 + +#define IND_SESSION_SUBSCRIBER (unsigned)0 +#define IND_SESSION_SERVER (unsigned)1 +#define IND_SESSION_DATA (unsigned)2 + +#endif diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction.cpp new file mode 100644 index 00000000000..182f1f99586 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction.cpp @@ -0,0 +1,825 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include <time.h> +#include <NdbApi.hpp> + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-4: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbOperation * MyOperation = 0; + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-4: equal number", + MyTransaction); + + check = MyOperation->incValue(SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-4: equal number", + MyTransaction); + + check = MyOperation->subValue(SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp new file mode 100644 index 00000000000..df3c7a7989e --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp @@ -0,0 +1,825 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include <time.h> +#include <NdbApi.hpp> + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-4: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbOperation * MyOperation = 0; + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-4: equal number", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-4: equal number", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp new file mode 100644 index 00000000000..d2c92ecd424 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp @@ -0,0 +1,793 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include <time.h> +#include <NdbApi.hpp> + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + /* Operation 4 */ + + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbOperation * MyOperation = 0; + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-4: equal number", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-4: equal number", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp new file mode 100644 index 00000000000..e652c7bfed8 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp @@ -0,0 +1,770 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include <time.h> +#include <NdbApi.hpp> + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T1(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T2(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit..."); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + DEBUG("done\n"); + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp new file mode 100644 index 00000000000..86580008d10 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp @@ -0,0 +1,769 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include <time.h> +#include <NdbApi.hpp> + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T1(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T2(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->simpleRead(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit..."); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + DEBUG("done\n"); + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp new file mode 100644 index 00000000000..262f38e9ffb --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp @@ -0,0 +1,561 @@ +/* Copyright (C) 2003 MySQL 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 */ + +//#define DEBUG_ON + +#include <string.h> +#include "userHandle.h" +#include "userInterface.h" + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include <NdbApi.hpp> + + +void +userCheckpoint(UserHandle *uh){ +} + +inline +NdbConnection * +startTransaction(Ndb * pNDB, ServerId inServerId, const SubscriberNumber inNumber){ + + const int keyDataLenBytes = sizeof(ServerId)+SUBSCRIBER_NUMBER_LENGTH; + const int keyDataLen_64Words = keyDataLenBytes >> 3; + + Uint64 keyDataBuf[keyDataLen_64Words+1]; // The "+1" is for rounding... + + char * keyDataBuf_charP = (char *)&keyDataBuf[0]; + Uint32 * keyDataBuf_wo32P = (Uint32 *)&keyDataBuf[0]; + + // Server Id comes first + keyDataBuf_wo32P[0] = inServerId; + // Then subscriber number + memcpy(&keyDataBuf_charP[sizeof(ServerId)], inNumber, SUBSCRIBER_NUMBER_LENGTH); + + return pNDB->startTransaction(0, keyDataBuf_charP, keyDataLenBytes); +} + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +void +userTransaction_T1(UserHandle * uh, + SubscriberNumber number, + Location new_location, + ChangedBy changed_by, + ChangedTime changed_time){ + Ndb * pNDB = uh->pNDB; + + DEBUG2("T1(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction != NULL) { + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + if (MyOperation != NULL) { + MyOperation->updateTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + check = MyTransaction->execute( Commit ); + if (check != -1) { + pNDB->closeTransaction(MyTransaction); + return; + } else { + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + }//if + } else { + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + }//if + } else { + error_handler("T1-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + }//if +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +void +userTransaction_T2(UserHandle * uh, + SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName){ + Ndb * pNDB = uh->pNDB; + + DEBUG2("T2(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2-1: startTransaction", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + pNDB->closeTransaction(MyTransaction); +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +void +userTransaction_T3(UserHandle * uh, + SubscriberNumber inNumber, + ServerId inServerId, + ServerBit inServerBit, + SessionDetails outSessionDetails, + BranchExecuted * outBranchExecuted){ + Ndb * pNDB = uh->pNDB; + + char outChangedBy [sizeof(ChangedBy) +(4-(sizeof(ChangedBy) & 3))]; + char outChangedTime [sizeof(ChangedTime)+(4-(sizeof(ChangedTime) & 3))]; + Location outLocation; + GroupId groupId; + ActiveSessions sessions; + Permission permission; + SubscriberSuffix inSuffix; + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = startTransaction(pNDB, inServerId, inNumber); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&outLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + MyOperation->readTuple(); + MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + memcpy(inSuffix, + &inNumber[SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + DEBUG2("reading(%.*s) - ", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, inSuffix); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + MyOperation->simpleRead(); + + MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + MyOperation->incValue(IND_SERVER_READS, (uint32)1); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit..."); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + DEBUG("done\n"); +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +userTransaction_T4(UserHandle * uh, + SubscriberNumber inNumber, + ServerId inServerId, + ServerBit inServerBit, + SessionDetails inSessionDetails, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted){ + + Ndb * pNDB = uh->pNDB; + + char outChangedBy [sizeof(ChangedBy) +(4-(sizeof(ChangedBy) & 3))]; + char outChangedTime [sizeof(ChangedTime)+(4-(sizeof(ChangedTime) & 3))]; + Location outLocation; + GroupId groupId; + ActiveSessions sessions; + Permission permission; + SubscriberSuffix inSuffix; + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = startTransaction(pNDB, inServerId, inNumber); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&outLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + check = MyTransaction->execute( NoCommit ); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + memcpy(inSuffix, + &inNumber[SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG2("inserting(%.*s) - ", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, inSuffix); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + MyOperation->insertTuple(); + MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +userTransaction_T5(UserHandle * uh, + SubscriberNumber inNumber, + ServerId inServerId, + ServerBit inServerBit, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted){ + Ndb * pNDB = uh->pNDB; + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + char outChangedBy [sizeof(ChangedBy) +(4-(sizeof(ChangedBy) & 3))]; + char outChangedTime [sizeof(ChangedTime)+(4-(sizeof(ChangedTime) & 3))]; + Location outLocation; + GroupId groupId; + ActiveSessions sessions; + Permission permission; + SubscriberSuffix inSuffix; + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&outLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + &outChangedBy[0]); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + &outChangedTime[0]); + MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + MyTransaction->execute( NoCommit ); + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + memcpy(inSuffix, + &inNumber[SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG2("deleting(%.*s) - ", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, inSuffix); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + MyOperation->deleteTuple(); + MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); +} + diff --git a/ndb/test/ndbapi/bench/testData.h b/ndb/test/ndbapi/bench/testData.h new file mode 100644 index 00000000000..3db85e7342e --- /dev/null +++ b/ndb/test/ndbapi/bench/testData.h @@ -0,0 +1,156 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef TESTDATA_H +#define TESTDATA_H + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ +#include <NdbTick.h> +#include <NdbThread.h> +#include <NDBT_Stats.hpp> +#include <random.h> +#include "testDefinitions.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +#define NUM_TRANSACTION_TYPES 5 +#define SESSION_LIST_LENGTH 1000 + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +typedef struct { + SubscriberNumber subscriberNumber; + ServerId serverId; +} SessionElement; + +typedef struct { + SessionElement list[SESSION_LIST_LENGTH]; + unsigned int readIndex; + unsigned int writeIndex; + unsigned int numberInList; +} SessionList; + +typedef struct { + unsigned int count; + unsigned int branchExecuted; + unsigned int rollbackExecuted; + + /** + * Latency measures + */ + NDB_TICKS startTime; + NDBT_Stats latency; + unsigned int latencyCounter; + + inline void startLatency(){ + if((latencyCounter & 127) == 127) + startTime = NdbTick_CurrentMillisecond(); + } + + inline void stopLatency(){ + if((latencyCounter & 127) == 127){ + const NDB_TICKS tmp = NdbTick_CurrentMillisecond() - startTime; + latency.addObservation(tmp); + } + latencyCounter++; + } +} TransactionDefinition; + +typedef struct { + RandomSequence transactionSequence; + RandomSequence rollbackSequenceT4; + RandomSequence rollbackSequenceT5; + + TransactionDefinition transactions[NUM_TRANSACTION_TYPES]; + + unsigned int totalTransactions; + + double outerLoopTime; + double outerTps; + + SessionList activeSessions; + +} GeneratorStatistics; + +typedef enum{ + Runnable, + Running +} RunState ; + +typedef struct { + SubscriberNumber number; + SubscriberSuffix suffix; + SubscriberName name; + Location location; + ChangedBy changed_by; + ChangedTime changed_time; + ServerId server_id; + ServerBit server_bit; + SessionDetails session_details; + + GroupId group_id; + ActiveSessions sessions; + Permission permission; + + unsigned int do_rollback; + + unsigned int branchExecuted; + unsigned int sessionElement; +} TransactionData ; + +typedef struct { + struct NdbThread* pThread; + + unsigned long randomSeed; + unsigned long changedTime; + + unsigned int warmUpSeconds; + unsigned int testSeconds; + unsigned int coolDownSeconds; + + GeneratorStatistics generator; + + /** + * For async execution + */ + RunState runState; + double startTime; + TransactionData transactionData; + struct Ndb * pNDB; +} ThreadData; + +/*************************************************************** + * P U B L I C F U N C T I O N S * + ***************************************************************/ + +/*************************************************************** + * E X T E R N A L D A T A * + ***************************************************************/ + + + +#endif /* TESTDATA_H */ + diff --git a/ndb/test/ndbapi/bench/testDefinitions.h b/ndb/test/ndbapi/bench/testDefinitions.h new file mode 100644 index 00000000000..2f4aeb30975 --- /dev/null +++ b/ndb/test/ndbapi/bench/testDefinitions.h @@ -0,0 +1,90 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef TESTDEFINITIONS_H +#define TESTDEFINITIONS_H + +/***************************************************************/ +/* I N C L U D E D F I L E S */ +/***************************************************************/ + +#include <ndb_types.h> + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +#define OP_PER_TRANS 200 +#define NO_OF_SUBSCRIBERS 500000 +#define NO_OF_GROUPS 100 +#define NO_OF_SERVERS 20 + +#define SUBSCRIBER_NUMBER_LENGTH 12 +#define SUBSCRIBER_NUMBER_SUFFIX_LENGTH 2 + +#define SUBSCRIBER_NAME_LENGTH 32 +#define CHANGED_BY_LENGTH 32 +#define CHANGED_TIME_LENGTH 32 +#define SESSION_DETAILS_LENGTH 2000 +#define SERVER_NAME_LENGTH 32 +#define GROUP_NAME_LENGTH 32 + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +#define PADDING 4 + +typedef char SubscriberNumber[SUBSCRIBER_NUMBER_LENGTH]; +typedef char SubscriberSuffix[SUBSCRIBER_NUMBER_SUFFIX_LENGTH + 2]; +typedef char SubscriberName[SUBSCRIBER_NAME_LENGTH]; +typedef char ServerName[SERVER_NAME_LENGTH]; +typedef char GroupName[GROUP_NAME_LENGTH]; +typedef char ChangedBy[CHANGED_BY_LENGTH]; +typedef char ChangedTime[CHANGED_TIME_LENGTH]; +typedef char SessionDetails[SESSION_DETAILS_LENGTH]; +typedef Uint32 ServerId; +typedef Uint32 ServerBit; +typedef Uint32 GroupId; +typedef Uint32 Location; +typedef Uint32 Permission; + +typedef Uint32 Counter; +typedef Uint32 ActiveSessions; +typedef unsigned int BranchExecuted; +typedef unsigned int DoRollback; + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef __cplusplus +} +#endif + +/*************************************************************** +* E X T E R N A L D A T A * +***************************************************************/ + + + +#endif /* TESTDEFINITIONS_H */ + diff --git a/ndb/test/ndbapi/bench/userInterface.cpp b/ndb/test/ndbapi/bench/userInterface.cpp new file mode 100644 index 00000000000..683552c3133 --- /dev/null +++ b/ndb/test/ndbapi/bench/userInterface.cpp @@ -0,0 +1,744 @@ +/* Copyright (C) 2003 MySQL 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 */ + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include <ndb_global.h> +#ifndef NDB_WIN32 +#include <sys/time.h> +#endif + +#include "ndb_error.hpp" +#include "userInterface.h" +#include <NdbThread.h> +#include <NdbTick.h> +#include <NdbMutex.h> +#include <NdbSleep.h> +#include "ndb_schema.hpp" +#include <NDBT.hpp> +#include <NdbSchemaCon.hpp> + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +extern int localDbPrepare(UserHandle *uh); + +static int dbCreate(UserHandle *uh); + +/*************************************************************** +* L O C A L D A T A * +***************************************************************/ + +/*************************************************************** +* P U B L I C D A T A * +***************************************************************/ + + +/*************************************************************** +**************************************************************** +* L O C A L F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +/*************************************************************** +**************************************************************** +* P U B L I C F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +/*-----------------------------------*/ +/* Time related Functions */ +/* */ +/* Returns a double value in seconds */ +/*-----------------------------------*/ +double userGetTimeSync(void) +{ + static int initialized = 0; + static NDB_TICKS initSecs = 0; + static Uint32 initMicros = 0; + double timeValue = 0; + + if ( !initialized ) { + initialized = 1; + NdbTick_CurrentMicrosecond(&initSecs, &initMicros); + timeValue = 0.0; + } else { + NDB_TICKS secs = 0; + Uint32 micros = 0; + + NdbTick_CurrentMicrosecond(&secs, µs); + + double s = (double)secs - (double)initSecs; + double us = (double)secs - (double)initMicros; + + timeValue = s + (us / 1000000.0); + } + + return timeValue; +} + +// 0 - OK +// 1 - Retry transaction +// 2 - Permanent +int +userDbCommit(UserHandle *uh){ + if(uh->pCurrTrans != 0){ + int check = uh->pCurrTrans->execute( Commit ); + NdbError err = uh->pCurrTrans->getNdbError(); + uh->pNDB->closeTransaction(uh->pCurrTrans); + uh->pCurrTrans = 0; + + if(err.status != NdbError::Success) + ndbout << err << endl; + + if(err.status == NdbError::TemporaryError && + err.classification == NdbError::OverloadError){ + NdbSleep_SecSleep(3); + } + + return err.status; + } + return 2; +} + +/** + * TRUE - Normal table + * FALSE - Table w.o. checkpoing and logging + */ + +#ifdef __cplusplus +extern "C" { +#endif +extern int useTableLogging; +#ifdef __cplusplus +} +#endif + + +int +create_table_server(Ndb * pNdb){ + int check; + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( SERVER_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,DistributionGroup, + 6, + 78, + 80, + 1, + useTableLogging + ); + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute + ( SERVER_SUBSCRIBER_SUFFIX, + TupleKey, + sizeof(char) << 3, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + String, + MMBased, + NotNullAttribute, + NormalStorageAttribute, + 0, + 1, + 16); + if( check == -1 ) + error_handler("createAttribute (subscriber suffix)", + MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute( SERVER_ID, + TupleKey, + sizeof(ServerId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (serverid)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SERVER_NAME, + NoKey, + sizeof(char) << 3, + SERVER_NAME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server name)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SERVER_READS, + NoKey, + sizeof(Counter) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server reads)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SERVER_INSERTS, + NoKey, + sizeof(Counter) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server inserts)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SERVER_DELETES, + NoKey, + sizeof(Counter) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server deletes)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +int +create_table_group(Ndb * pNdb){ + int check; + + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( GROUP_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,All, + 6, + 78, + 80, + 1, + useTableLogging + ); + + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute( GROUP_ID, + TupleKey, + sizeof(GroupId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group id)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( GROUP_NAME, + NoKey, + sizeof(char) << 3, + GROUP_NAME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group name)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( GROUP_ALLOW_READ, + NoKey, + sizeof(Permission) << 3, + 1, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group read)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( GROUP_ALLOW_INSERT, + NoKey, + sizeof(Permission) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group insert)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( GROUP_ALLOW_DELETE, + NoKey, + sizeof(Permission) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group delete)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +int +create_table_subscriber(Ndb * pNdb){ + int check; + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( SUBSCRIBER_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,DistributionGroup, + 6, + 78, + 80, + 1, + useTableLogging + ); + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute + ( SUBSCRIBER_NUMBER, + TupleKey, + sizeof(char) << 3, + SUBSCRIBER_NUMBER_LENGTH, + String, + MMBased, + NotNullAttribute, + NormalStorageAttribute, + 0, + 1, + 16); + if( check == -1 ) + error_handler("createAttribute (subscriber number)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_NAME, + NoKey, + sizeof(char) << 3, + SUBSCRIBER_NAME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber name)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SUBSCRIBER_GROUP, + NoKey, + sizeof(GroupId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_group)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SUBSCRIBER_LOCATION, + NoKey, + sizeof(Location) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server reads)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_SESSIONS, + NoKey, + sizeof(ActiveSessions) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_sessions)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_CHANGED_BY, + NoKey, + sizeof(char) << 3, + CHANGED_BY_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_changed_by)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_CHANGED_TIME, + NoKey, + sizeof(char) << 3, + CHANGED_TIME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_changed_time)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +int +create_table_session(Ndb * pNdb){ + int check; + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", + MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( SESSION_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,DistributionGroup, + 6, + 78, + 80, + 1, + useTableLogging + ); + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SESSION_SUBSCRIBER, + TupleKey, + sizeof(char) << 3, + SUBSCRIBER_NUMBER_LENGTH, + String, + MMBased, + NotNullAttribute, + NormalStorageAttribute, + 0, + 1, + 16); + if( check == -1 ) + error_handler("createAttribute (session_subscriber)", + MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute( SESSION_SERVER, + TupleKey, + sizeof(ServerId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (session_server)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SESSION_DATA, + NoKey, + sizeof(char) << 3, + SESSION_DETAILS_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (session_data)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +void +create_table(const char * name, int (* function)(Ndb * pNdb), Ndb* pNdb){ + printf("creating table %s...", name); + if(pNdb->getDictionary()->getTable(name) != 0){ + printf(" it already exists\n"); + return; + } else { + printf("\n"); + } + function(pNdb); + printf("creating table %s... done\n", name); +} + +static int dbCreate(Ndb * pNdb) +{ + create_table(SUBSCRIBER_TABLE, create_table_subscriber, pNdb); + create_table(GROUP_TABLE , create_table_group, pNdb); + create_table(SESSION_TABLE , create_table_session, pNdb); + create_table(SERVER_TABLE , create_table_server, pNdb); + return 0; +} + +#ifndef NDB_WIN32 +#include <unistd.h> +#endif + +UserHandle* +userDbConnect(uint32 createDb, char *dbName) +{ + Ndb_cluster_connection *con= new Ndb_cluster_connection(); + if(con->connect(12, 5, 1) != 0) + { + ndbout << "Unable to connect to management server." << endl; + return 0; + } + if (con->wait_until_ready(30,0) < 0) + { + ndbout << "Cluster nodes not ready in 30 seconds." << endl; + return 0; + } + + Ndb * pNdb = new Ndb(con, dbName); + + //printf("Initializing...\n"); + pNdb->init(); + + //printf("Waiting..."); + while(pNdb->waitUntilReady() != 0){ + //printf("..."); + } + // printf("done\n"); + + if( createDb ) + dbCreate(pNdb); + + + UserHandle * uh = new UserHandle; + uh->pNCC = con; + uh->pNDB = pNdb; + uh->pCurrTrans = 0; + + return uh; +} + +void userDbDisconnect(UserHandle *uh) +{ + delete uh; +} + +int userDbInsertServer(UserHandle *uh, + ServerId serverId, + SubscriberSuffix suffix, + ServerName name) +{ + int check; + + uint32 noOfRead = 0; + uint32 noOfInsert = 0; + uint32 noOfDelete = 0; + + NdbConnection * MyTransaction = 0; + if(uh->pCurrTrans != 0){ + MyTransaction = uh->pCurrTrans; + } else { + uh->pCurrTrans = MyTransaction = uh->pNDB->startTransaction(); + } + if (MyTransaction == NULL) + error_handler("startTranscation", uh->pNDB->getNdbError(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "getNdbOperation", MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "insert tuple", MyTransaction); + + check = MyOperation->equal(SERVER_ID, (char*)&serverId); + CHECK_MINUS_ONE(check, "setValue id", MyTransaction); + + check = MyOperation->setValue(SERVER_SUBSCRIBER_SUFFIX, suffix); + CHECK_MINUS_ONE(check, "setValue suffix", MyTransaction); + + check = MyOperation->setValue(SERVER_NAME, name); + CHECK_MINUS_ONE(check, "setValue name", MyTransaction); + + check = MyOperation->setValue(SERVER_READS, (char*)&noOfRead); + CHECK_MINUS_ONE(check, "setValue reads", MyTransaction); + + check = MyOperation->setValue(SERVER_INSERTS, (char*)&noOfInsert); + CHECK_MINUS_ONE(check, "setValue inserts", MyTransaction); + + check = MyOperation->setValue(SERVER_DELETES, (char*)&noOfDelete); + CHECK_MINUS_ONE(check, "setValue deletes", MyTransaction); + + return 0; +} + +int userDbInsertSubscriber(UserHandle *uh, + SubscriberNumber number, + uint32 groupId, + SubscriberName name) +{ + int check; + uint32 activeSessions = 0; + Location l = 0; + ChangedBy changedBy; snprintf(changedBy, sizeof(changedBy), "ChangedBy"); + ChangedTime changedTime; snprintf(changedTime, sizeof(changedTime), "ChangedTime"); + + NdbConnection * MyTransaction = 0; + if(uh->pCurrTrans != 0){ + MyTransaction = uh->pCurrTrans; + } else { + uh->pCurrTrans = MyTransaction = uh->pNDB->startTransaction(); + } + if (MyTransaction == NULL) + error_handler("startTranscation", uh->pNDB->getNdbError(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "getNdbOperation", MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "insertTuple", MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, number); + CHECK_MINUS_ONE(check, "equal", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_NAME, name); + CHECK_MINUS_ONE(check, "setValue name", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_GROUP, (char*)&groupId); + CHECK_MINUS_ONE(check, "setValue group", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_LOCATION, (char*)&l); + CHECK_MINUS_ONE(check, "setValue location", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_SESSIONS, (char*)&activeSessions); + CHECK_MINUS_ONE(check, "setValue sessions", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_BY, changedBy); + CHECK_MINUS_ONE(check, "setValue changedBy", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_TIME, changedTime); + CHECK_MINUS_ONE(check, "setValue changedTime", MyTransaction); + + return 0; +} + +int userDbInsertGroup(UserHandle *uh, + GroupId groupId, + GroupName name, + Permission allowRead, + Permission allowInsert, + Permission allowDelete) +{ + int check; + + NdbConnection * MyTransaction = 0; + if(uh->pCurrTrans != 0){ + MyTransaction = uh->pCurrTrans; + } else { + uh->pCurrTrans = MyTransaction = uh->pNDB->startTransaction(); + } + if (MyTransaction == NULL) + error_handler("startTranscation", uh->pNDB->getNdbError(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "getNdbOperation", MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "insertTuple", MyTransaction); + + check = MyOperation->equal(GROUP_ID, (char*)&groupId); + CHECK_MINUS_ONE(check, "equal", MyTransaction); + + check = MyOperation->setValue(GROUP_NAME, name); + CHECK_MINUS_ONE(check, "setValue name", MyTransaction); + + check = MyOperation->setValue(GROUP_ALLOW_READ, (char*)&allowRead); + CHECK_MINUS_ONE(check, "setValue allowRead", MyTransaction); + + check = MyOperation->setValue(GROUP_ALLOW_INSERT, (char*)&allowInsert); + CHECK_MINUS_ONE(check, "setValue allowInsert", MyTransaction); + + check = MyOperation->setValue(GROUP_ALLOW_DELETE, (char*)&allowDelete); + CHECK_MINUS_ONE(check, "setValue allowDelete", MyTransaction); + + return 0; +} + diff --git a/ndb/test/ndbapi/bench/userInterface.h b/ndb/test/ndbapi/bench/userInterface.h new file mode 100644 index 00000000000..9e3b6f8f2a5 --- /dev/null +++ b/ndb/test/ndbapi/bench/userInterface.h @@ -0,0 +1,151 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#ifndef DBINTERFACE_H +#define DBINTERFACE_H + +/***************************************************************/ +/* I N C L U D E D F I L E S */ +/***************************************************************/ + +#include "testDefinitions.h" +#include "testData.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +/*-----------------------*/ +/* Default Database Name */ +/*-----------------------*/ +#define DEFAULTDB "TestDbClient" + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +typedef struct Ndb Ndb; + +#ifdef __cplusplus +extern "C" { +#endif + extern void showTime(); + extern double userGetTime(void); + extern Ndb *asyncDbConnect(int parallellism); + extern void asyncDbDisconnect(Ndb* pNDB); + + extern void start_T1(Ndb * uh, ThreadData * data, int async); + extern void start_T2(Ndb * uh, ThreadData * data, int async); + extern void start_T3(Ndb * uh, ThreadData * data, int async); + extern void start_T4(Ndb * uh, ThreadData * data, int async); + extern void start_T5(Ndb * uh, ThreadData * data, int async); + + extern void complete_T1(ThreadData * data); + extern void complete_T2(ThreadData * data); + extern void complete_T3(ThreadData * data); + extern void complete_T4(ThreadData * data); + extern void complete_T5(ThreadData * data); + + + +#ifdef __cplusplus +} +#endif + + + +/***************************************************************/ +/* I N C L U D E D F I L E S */ +/***************************************************************/ + +#include "testDefinitions.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +/*-----------------------*/ +/* Default Database Name */ +/*-----------------------*/ +#define DEFAULTDB "TestDbClient" + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +typedef struct { + struct Ndb_cluster_connection* pNCC; + struct Ndb * pNDB; + struct NdbConnection * pCurrTrans; +} UserHandle; + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern double userGetTimeSync(void); + +extern void userCheckpoint(UserHandle *uh); + +extern UserHandle *userDbConnect(uint32 createDb, char *dbName); +extern void userDbDisconnect(UserHandle *uh); + +extern int userDbInsertServer(UserHandle *uh, + ServerId serverId, + SubscriberSuffix suffix, + ServerName name); + +extern int userDbInsertSubscriber(UserHandle *uh, + SubscriberNumber number, + uint32 groupId, + SubscriberName name); + +extern int userDbInsertGroup(UserHandle *uh, + GroupId groupId, + GroupName name, + Permission allowRead, + Permission allowInsert, + Permission allowDelete); + + extern int userDbCommit(UserHandle *uh); + extern int userDbRollback(UserHandle *uh); + +#ifdef __cplusplus +} +#endif + +/*************************************************************** +* E X T E R N A L D A T A * +***************************************************************/ + +#endif /* DBINTERFACE_H */ + diff --git a/ndb/test/ndbapi/benchronja.cpp b/ndb/test/ndbapi/benchronja.cpp index 91b2a041186..a7523e8e416 100644 --- a/ndb/test/ndbapi/benchronja.cpp +++ b/ndb/test/ndbapi/benchronja.cpp @@ -984,7 +984,6 @@ void* ThreadExec(void* ThreadData){ delete pMyNdb; pMyNdb = NULL ; ThreadReady[thread_no] = 1; - NdbThread_Exit(0) ; return 0 ; }//if @@ -1197,7 +1196,6 @@ void* ThreadExec(void* ThreadData){ } // for(;;) delete pMyNdb ; - NdbThread_Exit(0) ; - return 0 ; // Compiler is happy now + return 0 ; } diff --git a/ndb/test/ndbapi/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch.cpp index 1953444d640..4b87b2c70ed 100644 --- a/ndb/test/ndbapi/flexAsynch.cpp +++ b/ndb/test/ndbapi/flexAsynch.cpp @@ -494,8 +494,7 @@ threadLoop(void* ThreadData) delete localNdb; ThreadReady[threadNo] = 1; - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; }//threadLoop() static diff --git a/ndb/test/ndbapi/flexBench.cpp b/ndb/test/ndbapi/flexBench.cpp index 2a2388109a1..cc2bfb391da 100644 --- a/ndb/test/ndbapi/flexBench.cpp +++ b/ndb/test/ndbapi/flexBench.cpp @@ -617,7 +617,7 @@ static void* flexBenchThread(void* pArg) free(attrRefValue) ; free(pOps) ; delete pNdb ; - NdbThread_Exit(0) ; + return 0; // thread exits } pNdb->init(); @@ -934,8 +934,7 @@ static void* flexBenchThread(void* pArg) free(longKeyAttrValue); } // if - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; // Thread exits } diff --git a/ndb/test/ndbapi/flexHammer.cpp b/ndb/test/ndbapi/flexHammer.cpp index 688e70d501a..13cd2d5e561 100644 --- a/ndb/test/ndbapi/flexHammer.cpp +++ b/ndb/test/ndbapi/flexHammer.cpp @@ -612,10 +612,7 @@ flexHammerThread(void* pArg) flexHammerErrorData->resetErrorCounters(); - // And exit using NDBT - NdbThread_Exit(0); - - return NULL; + return NULL; // thread exits } // flexHammerThread diff --git a/ndb/test/ndbapi/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp index c7f4041a525..4d2c85d6955 100644 --- a/ndb/test/ndbapi/flexScan.cpp +++ b/ndb/test/ndbapi/flexScan.cpp @@ -701,8 +701,7 @@ flexScanThread(void* ThreadData) free(pkValue); } // if - NdbThread_Exit(0); - return NULL; + return NULL; // thread exits } // flexScanThread diff --git a/ndb/test/ndbapi/flexTT.cpp b/ndb/test/ndbapi/flexTT.cpp index 3b976f9f87e..8d5be2bb399 100644 --- a/ndb/test/ndbapi/flexTT.cpp +++ b/ndb/test/ndbapi/flexTT.cpp @@ -389,8 +389,7 @@ threadLoop(void* ThreadData) delete localNdb; ThreadReady[loc_threadNo] = 1; - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; // Thread exits }//threadLoop() static diff --git a/ndb/test/ndbapi/flexTimedAsynch.cpp b/ndb/test/ndbapi/flexTimedAsynch.cpp index 27380cc79fd..2b8c0bdd5f8 100644 --- a/ndb/test/ndbapi/flexTimedAsynch.cpp +++ b/ndb/test/ndbapi/flexTimedAsynch.cpp @@ -406,9 +406,8 @@ threadLoop(void* ThreadData) delete localNdb; ThreadReady[threadNo] = 1; - NdbThread_Exit(0); - return NULL; + return NULL; // thread exits } void executeThread(StartType aType, Ndb* aNdbObject, ThreadNdb* threadInfo) diff --git a/ndb/test/ndbapi/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql.cpp index c8d4d85bedf..c15175bfb00 100644 --- a/ndb/test/ndbapi/flex_bench_mysql.cpp +++ b/ndb/test/ndbapi/flex_bench_mysql.cpp @@ -710,7 +710,7 @@ static void* flexBenchThread(void* pArg) the_socket_name, 0) == NULL ) { ndbout << "failed" << endl; - NdbThread_Exit(0) ; + return 0; } ndbout << "ok" << endl; @@ -722,7 +722,7 @@ static void* flexBenchThread(void* pArg) if (r) { ndbout << "autocommit on/off failed" << endl; - NdbThread_Exit(0) ; + return 0; } } #endif @@ -741,7 +741,7 @@ static void* flexBenchThread(void* pArg) ndbout << threadNo << endl ; ndbout << "Thread #" << threadNo << " will now exit" << endl ; tResult = 13 ; - NdbThread_Exit(0) ; + return 0; } if (use_ndb) { @@ -750,7 +750,7 @@ static void* flexBenchThread(void* pArg) ndbout << "Failed to get an NDB object" << endl; ndbout << "Thread #" << threadNo << " will now exit" << endl ; tResult = 13; - NdbThread_Exit(0) ; + return 0; } pNdb->waitUntilReady(); return_ndb_object(pNdb, ndb_id); @@ -900,11 +900,11 @@ static void* flexBenchThread(void* pArg) prep_insert[i] = mysql_prepare(&mysql, buf, pos); if (prep_insert[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_insert[i], bind_insert)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } @@ -926,11 +926,11 @@ static void* flexBenchThread(void* pArg) prep_update[i] = mysql_prepare(&mysql, buf, pos); if (prep_update[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_update[i], bind_update)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } @@ -953,15 +953,15 @@ static void* flexBenchThread(void* pArg) prep_read[i] = mysql_prepare(&mysql, buf, pos); if (prep_read[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_read[i], bind_read)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_result(prep_read[i], &bind_read[1])) { ndbout << "mysql_bind_result: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } @@ -978,11 +978,11 @@ static void* flexBenchThread(void* pArg) prep_delete[i] = mysql_prepare(&mysql, buf, pos); if (prep_delete[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_delete[i], bind_delete)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } } @@ -1431,8 +1431,7 @@ static void* flexBenchThread(void* pArg) ndbout << "I got here " << endl; return_ndb_object(pNdb, ndb_id); } - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; } diff --git a/ndb/test/ndbapi/mainAsyncGenerator.cpp b/ndb/test/ndbapi/mainAsyncGenerator.cpp index 16cb50e160f..73a8b98ab57 100644 --- a/ndb/test/ndbapi/mainAsyncGenerator.cpp +++ b/ndb/test/ndbapi/mainAsyncGenerator.cpp @@ -274,8 +274,6 @@ threadRoutine(void *arg) asyncDbDisconnect(pNDB); - NdbThread_Exit(0); - return NULL; } diff --git a/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old b/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old deleted file mode 100644 index bfff5cd161a..00000000000 --- a/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := ndbapitest - -BIN_TARGET := flexBench - -# Source files of non-templated classes (.C files) -SOURCES = flexBench.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index 41bb82f3e06..7b30777456f 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -22,13 +22,15 @@ #include <NdbMain.h> #include <NdbOut.hpp> #include <NdbTest.hpp> +#include <NdbTick.h> +#include <ndb/src/ndbapi/NdbBlobImpl.hpp> struct Bcol { bool m_nullable; unsigned m_inline; unsigned m_partsize; unsigned m_stripe; - char m_btname[NdbBlob::BlobTableNameSize]; + char m_btname[NdbBlobImpl::BlobTableNameSize]; Bcol(bool a, unsigned b, unsigned c, unsigned d) : m_nullable(a), m_inline(b), @@ -42,13 +44,14 @@ struct Opt { bool m_core; bool m_dbg; bool m_dbgall; + const char* m_dbug; bool m_full; unsigned m_loop; unsigned m_parts; unsigned m_rows; unsigned m_seed; const char* m_skip; - const char* m_style; + const char* m_test; // metadata const char* m_tname; const char* m_x1name; // hash index @@ -58,6 +61,9 @@ struct Opt { bool m_oneblob; Bcol m_blob1; Bcol m_blob2; + // perf + const char* m_tnameperf; + unsigned m_rowsperf; // bugs int m_bug; int (*m_bugtest)(); @@ -66,13 +72,14 @@ struct Opt { m_core(false), m_dbg(false), m_dbgall(false), + m_dbug(0), m_full(false), m_loop(1), m_parts(10), m_rows(100), m_seed(0), - m_skip(""), - m_style("012"), + m_skip(0), + m_test(0), // metadata m_tname("TBLOB1"), m_x1name("TBLOB1X1"), @@ -82,6 +89,9 @@ struct Opt { m_oneblob(false), m_blob1(false, 7, 1137, 10), m_blob2(true, 99, 55, 1), + // perf + m_tnameperf("TBLOB2"), + m_rowsperf(10000), // bugs m_bug(0), m_bugtest(0) { @@ -100,48 +110,51 @@ printusage() << " -core dump core on error" << endl << " -dbg print debug" << endl << " -dbgall print also NDB API debug (if compiled in)" << endl + << " -dbug opt dbug options" << endl << " -full read/write only full blob values" << endl - << " -inline read/write only blobs which fit inline" << endl << " -loop N loop N times 0=forever [" << d.m_loop << "]" << endl << " -parts N max parts in blob value [" << d.m_parts << "]" << endl << " -rows N number of rows [" << d.m_rows << "]" << endl + << " -rowsperf N rows for performace test [" << d.m_rowsperf << "]" << endl << " -seed N random seed 0=loop number [" << d.m_seed << "]" << endl - << " -skip xxx skip these tests (see list) [" << d.m_skip << endl - << " -style xxx access styles to test (see list) [" << d.m_style << "]" << endl + << " -skip xxx skip given tests (see list) [no tests]" << endl + << " -test xxx only given tests (see list) [all tests]" << endl << "metadata" << endl << " -pk2len N length of PK2 [" << d.m_pk2len << "/" << g_max_pk2len <<"]" << endl << " -oneblob only 1 blob attribute [default 2]" << endl - << "testcases for -skip" << endl + << "testcases for test/skip" << endl << " k primary key ops" << endl << " i hash index ops" << endl << " s table scans" << endl << " r ordered index scans" << endl - << " u update blob value" << endl - << "access styles for -style" << endl + << " p performance test" << endl + << "additional flags for test/skip" << endl + << " u update existing blob value" << endl + << " n normal insert and update" << endl + << " w insert and update using writeTuple" << endl << " 0 getValue / setValue" << endl << " 1 setActiveHook" << endl << " 2 readData / writeData" << endl << "bug tests (no blob test)" << endl << " -bug 4088 ndb api hang with mixed ops on index table" << endl - << " -bug 2222 delete + write gives 626" << endl - << " -bug 3333 acc crash on delete and long key" << endl + << " -bug nnnn delete + write gives 626" << endl + << " -bug nnnn acc crash on delete and long key" << endl ; } static Opt g_opt; static bool -skipcase(int x) +testcase(char x) { - return strchr(g_opt.m_skip, x) != 0; -} - -static bool -skipstyle(int x) -{ - return strchr(g_opt.m_style, '0' + x) == 0; + if (x < 10) + x += '0'; + return + (g_opt.m_test == 0 || strchr(g_opt.m_test, x) != 0) && + (g_opt.m_skip == 0 || strchr(g_opt.m_skip, x) == 0); } +static Ndb_cluster_connection* g_ncc = 0; static Ndb* g_ndb = 0; static NdbDictionary::Dictionary* g_dic = 0; static NdbConnection* g_con = 0; @@ -435,7 +448,9 @@ getBlobLength(NdbBlob* h, unsigned& len) CHK(h->getLength(len2) == 0); len = (unsigned)len2; assert(len == len2); - DBG("getBlobLength " << h->getColumn()->getName() << " len=" << len); + bool isNull; + CHK(h->getNull(isNull) == 0); + DBG("getBlobLength " << h->getColumn()->getName() << " len=" << len << " null=" << isNull); return 0; } @@ -912,6 +927,41 @@ updatePk(int style) } static int +writePk(int style) +{ + DBG("--- writePk " << stylename[style] << " ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("writePk pk1=" << hex << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->writeTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opr) == 0); + if (style == 0) { + CHK(setBlobValue(tup) == 0); + } else if (style == 1) { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); + CHK(setBlobWriteHook(tup) == 0); + } else { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); + CHK(g_con->execute(NoCommit) == 0); + CHK(writeBlobData(tup) == 0); + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + tup.m_exists = true; + } + return 0; +} + +static int deletePk() { DBG("--- deletePk ---"); @@ -996,6 +1046,39 @@ updateIdx(int style) } static int +writeIdx(int style) +{ + DBG("--- writeIdx " << stylename[style] << " ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("writeIdx pk1=" << hex << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0); + CHK(g_opx->writeTuple() == 0); + CHK(g_opx->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opx) == 0); + if (style == 0) { + CHK(setBlobValue(tup) == 0); + } else if (style == 1) { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); + CHK(setBlobWriteHook(tup) == 0); + } else { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); + CHK(g_con->execute(NoCommit) == 0); + CHK(writeBlobData(tup) == 0); + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opx = 0; + g_con = 0; + tup.m_exists = true; + } + return 0; +} + +static int deleteIdx() { DBG("--- deleteIdx ---"); @@ -1167,11 +1250,17 @@ deleteScan(bool idx) // main +// from here on print always +#undef DBG +#define DBG(x) \ + do { \ + ndbout << "line " << __LINE__ << " " << x << endl; \ + } while (0) + static int testmain() { - int style; - g_ndb = new Ndb("TEST_DB"); + g_ndb = new Ndb(g_ncc, "TEST_DB"); CHK(g_ndb->init() == 0); CHK(g_ndb->waitUntilReady() == 0); g_dic = g_ndb->getDictionary(); @@ -1194,55 +1283,88 @@ testmain() if (g_opt.m_seed != 0) srandom(g_opt.m_seed); for (g_loop = 0; g_opt.m_loop == 0 || g_loop < g_opt.m_loop; g_loop++) { + int style; DBG("=== loop " << g_loop << " ==="); if (g_opt.m_seed == 0) srandom(g_loop); // pk for (style = 0; style <= 2; style++) { - if (skipcase('k') || skipstyle(style)) + if (! testcase('k') || ! testcase(style)) continue; DBG("--- pk ops " << stylename[style] << " ---"); - calcTups(false); - CHK(insertPk(style) == 0); - CHK(verifyBlob() == 0); - CHK(readPk(style) == 0); - if (! skipcase('u')) { - calcTups(style); - CHK(updatePk(style) == 0); + if (testcase('n')) { + calcTups(false); + CHK(insertPk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(updatePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + } + CHK(deletePk() == 0); + CHK(verifyBlob() == 0); + } + if (testcase('w')) { + calcTups(false); + CHK(writePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(writePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + } + CHK(deletePk() == 0); CHK(verifyBlob() == 0); } - CHK(readPk(style) == 0); - CHK(deletePk() == 0); - CHK(verifyBlob() == 0); } // hash index for (style = 0; style <= 2; style++) { - if (skipcase('i') || skipstyle(style)) + if (! testcase('i') || ! testcase(style)) continue; DBG("--- idx ops " << stylename[style] << " ---"); - calcTups(false); - CHK(insertPk(style) == 0); - CHK(verifyBlob() == 0); - CHK(readIdx(style) == 0); - calcTups(style); - if (! skipcase('u')) { - CHK(updateIdx(style) == 0); + if (testcase('n')) { + calcTups(false); + CHK(insertPk(style) == 0); CHK(verifyBlob() == 0); CHK(readIdx(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(updateIdx(style) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(style) == 0); + } + CHK(deleteIdx() == 0); + CHK(verifyBlob() == 0); + } + if (testcase('w')) { + calcTups(false); + CHK(writePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(writeIdx(style) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(style) == 0); + } + CHK(deleteIdx() == 0); + CHK(verifyBlob() == 0); } - CHK(deleteIdx() == 0); - CHK(verifyBlob() == 0); } // scan table for (style = 0; style <= 2; style++) { - if (skipcase('s') || skipstyle(style)) + if (! testcase('s') || ! testcase(style)) continue; DBG("--- table scan " << stylename[style] << " ---"); calcTups(false); CHK(insertPk(style) == 0); CHK(verifyBlob() == 0); CHK(readScan(style, false) == 0); - if (! skipcase('u')) { + if (testcase('u')) { CHK(updateScan(style, false) == 0); CHK(verifyBlob() == 0); } @@ -1251,14 +1373,14 @@ testmain() } // scan index for (style = 0; style <= 2; style++) { - if (skipcase('r') || skipstyle(style)) + if (! testcase('r') || ! testcase(style)) continue; DBG("--- index scan " << stylename[style] << " ---"); calcTups(false); CHK(insertPk(style) == 0); CHK(verifyBlob() == 0); CHK(readScan(style, true) == 0); - if (! skipcase('u')) { + if (testcase('u')) { CHK(updateScan(style, true) == 0); CHK(verifyBlob() == 0); } @@ -1270,6 +1392,292 @@ testmain() return 0; } +// separate performance test + +struct Tmr { // stolen from testOIBasic + Tmr() { + clr(); + } + void clr() { + m_on = m_ms = m_cnt = m_time[0] = m_text[0] = 0; + } + void on() { + assert(m_on == 0); + m_on = NdbTick_CurrentMillisecond(); + } + void off(unsigned cnt = 0) { + NDB_TICKS off = NdbTick_CurrentMillisecond(); + assert(m_on != 0 && off >= m_on); + m_ms += off - m_on; + m_cnt += cnt; + m_on = 0; + } + const char* time() { + if (m_cnt == 0) + sprintf(m_time, "%u ms", m_ms); + else + sprintf(m_time, "%u ms per %u ( %u ms per 1000 )", m_ms, m_cnt, (1000 * m_ms) / m_cnt); + return m_time; + } + const char* pct (const Tmr& t1) { + if (0 < t1.m_ms) + sprintf(m_text, "%u pct", (100 * m_ms) / t1.m_ms); + else + sprintf(m_text, "[cannot measure]"); + return m_text; + } + const char* over(const Tmr& t1) { + if (0 < t1.m_ms) { + if (t1.m_ms <= m_ms) + sprintf(m_text, "%u pct", (100 * (m_ms - t1.m_ms)) / t1.m_ms); + else + sprintf(m_text, "-%u pct", (100 * (t1.m_ms - m_ms)) / t1.m_ms); + } else + sprintf(m_text, "[cannot measure]"); + return m_text; + } + NDB_TICKS m_on; + unsigned m_ms; + unsigned m_cnt; + char m_time[100]; + char m_text[100]; +}; + +static int +testperf() +{ + if (! testcase('p')) + return 0; + DBG("=== perf test ==="); + g_ndb = new Ndb(g_ncc, "TEST_DB"); + CHK(g_ndb->init() == 0); + CHK(g_ndb->waitUntilReady() == 0); + g_dic = g_ndb->getDictionary(); + NdbDictionary::Table tab(g_opt.m_tnameperf); + if (g_dic->getTable(tab.getName()) != 0) + CHK(g_dic->dropTable(tab) == 0); + // col A - pk + { NdbDictionary::Column col("A"); + col.setType(NdbDictionary::Column::Unsigned); + col.setPrimaryKey(true); + tab.addColumn(col); + } + // col B - char 20 + { NdbDictionary::Column col("B"); + col.setType(NdbDictionary::Column::Char); + col.setLength(20); + col.setNullable(true); + tab.addColumn(col); + } + // col C - text + { NdbDictionary::Column col("C"); + col.setType(NdbDictionary::Column::Text); + col.setInlineSize(20); + col.setPartSize(512); + col.setStripeSize(1); + col.setNullable(true); + tab.addColumn(col); + } + // create + CHK(g_dic->createTable(tab) == 0); + Uint32 cA = 0, cB = 1, cC = 2; + // timers + Tmr t1; + Tmr t2; + // insert char (one trans) + { + DBG("--- insert char ---"); + t1.on(); + CHK((g_con = g_ndb->startTransaction()) != 0); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->insertTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->setValue(cB, "b") == 0); + CHK(g_con->execute(NoCommit) == 0); + } + t1.off(g_opt.m_rowsperf); + CHK(g_con->execute(Rollback) == 0); + DBG(t1.time()); + g_opr = 0; + g_con = 0; + } + // insert text (one trans) + { + DBG("--- insert text ---"); + t2.on(); + CHK((g_con = g_ndb->startTransaction()) != 0); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->insertTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0); + CHK((g_bh1->setValue("c", 1) == 0)); + CHK(g_con->execute(NoCommit) == 0); + } + t2.off(g_opt.m_rowsperf); + CHK(g_con->execute(Rollback) == 0); + DBG(t2.time()); + g_bh1 = 0; + g_opr = 0; + g_con = 0; + } + // insert overhead + DBG("insert overhead: " << t2.over(t1)); + t1.clr(); + t2.clr(); + // insert + { + DBG("--- insert for read test ---"); + unsigned n = 0; + CHK((g_con = g_ndb->startTransaction()) != 0); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->insertTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->setValue(cB, "b") == 0); + CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0); + CHK((g_bh1->setValue("c", 1) == 0)); + if (++n == g_opt.m_batch) { + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + CHK((g_con = g_ndb->startTransaction()) != 0); + n = 0; + } + } + if (n != 0) { + CHK(g_con->execute(Commit) == 0); + n = 0; + } + g_bh1 = 0; + g_opr = 0; + g_con = 0; + } + // pk read char (one trans) + { + DBG("--- pk read char ---"); + CHK((g_con = g_ndb->startTransaction()) != 0); + Uint32 a; + char b[20]; + t1.on(); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->getValue(cA, (char*)&a) != 0); + CHK(g_opr->getValue(cB, b) != 0); + a = (Uint32)-1; + b[0] = 0; + CHK(g_con->execute(NoCommit) == 0); + CHK(a == k && strcmp(b, "b") == 0); + } + CHK(g_con->execute(Commit) == 0); + t1.off(g_opt.m_rowsperf); + DBG(t1.time()); + g_opr = 0; + g_con = 0; + } + // pk read text (one trans) + { + DBG("--- pk read text ---"); + CHK((g_con = g_ndb->startTransaction()) != 0); + Uint32 a; + char c[20]; + t2.on(); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->getValue(cA, (char*)&a) != 0); + CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0); + a = (Uint32)-1; + c[0] = 0; + CHK(g_con->execute(NoCommit) == 0); + Uint32 m = 20; + CHK(g_bh1->readData(c, m) == 0); + CHK(a == k && m == 1 && strcmp(c, "c") == 0); + } + CHK(g_con->execute(Commit) == 0); + t2.off(g_opt.m_rowsperf); + DBG(t2.time()); + g_opr = 0; + g_con = 0; + } + // pk read overhead + DBG("pk read overhead: " << t2.over(t1)); + t1.clr(); + t2.clr(); + // scan read char + { + DBG("--- scan read char ---"); + NdbResultSet* rs; + Uint32 a; + char b[20]; + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_ops = g_con->getNdbScanOperation(tab.getName())) != 0); + CHK((rs = g_ops->readTuples(NdbScanOperation::LM_Read)) != 0); + CHK(g_ops->getValue(cA, (char*)&a) != 0); + CHK(g_ops->getValue(cB, b) != 0); + CHK(g_con->execute(NoCommit) == 0); + unsigned n = 0; + t1.on(); + while (1) { + a = (Uint32)-1; + b[0] = 0; + int ret; + CHK((ret = rs->nextResult(true)) == 0 || ret == 1); + if (ret == 1) + break; + CHK(a < g_opt.m_rowsperf && strcmp(b, "b") == 0); + n++; + } + CHK(n == g_opt.m_rowsperf); + t1.off(g_opt.m_rowsperf); + DBG(t1.time()); + g_ops = 0; + g_con = 0; + } + // scan read text + { + DBG("--- read text ---"); + NdbResultSet* rs; + Uint32 a; + char c[20]; + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_ops = g_con->getNdbScanOperation(tab.getName())) != 0); + CHK((rs = g_ops->readTuples(NdbScanOperation::LM_Read)) != 0); + CHK(g_ops->getValue(cA, (char*)&a) != 0); + CHK((g_bh1 = g_ops->getBlobHandle(cC)) != 0); + CHK(g_con->execute(NoCommit) == 0); + unsigned n = 0; + t2.on(); + while (1) { + a = (Uint32)-1; + c[0] = 0; + int ret; + CHK((ret = rs->nextResult(true)) == 0 || ret == 1); + if (ret == 1) + break; + Uint32 m = 20; + CHK(g_bh1->readData(c, m) == 0); + CHK(a < g_opt.m_rowsperf && m == 1 && strcmp(c, "c") == 0); + n++; + } + CHK(n == g_opt.m_rowsperf); + t2.off(g_opt.m_rowsperf); + DBG(t2.time()); + g_bh1 = 0; + g_ops = 0; + g_con = 0; + } + // scan read overhead + DBG("scan read overhead: " << t2.over(t1)); + t1.clr(); + t2.clr(); + delete g_ndb; + return 0; +} + // bug tests static int @@ -1331,9 +1739,7 @@ static struct { int m_bug; int (*m_test)(); } g_bugtest[] = { - { 4088, bugtest_4088 }, - { 2222, bugtest_2222 }, - { 3333, bugtest_3333 } + { 4088, bugtest_4088 } }; NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) @@ -1361,6 +1767,12 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) putenv(strdup("NDB_BLOB_DEBUG=1")); continue; } + if (strcmp(arg, "-dbug") == 0) { + if (++argv, --argc > 0) { + g_opt.m_dbug = strdup(argv[0]); + continue; + } + } if (strcmp(arg, "-full") == 0) { g_opt.m_full = true; continue; @@ -1383,6 +1795,12 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) continue; } } + if (strcmp(arg, "-rowsperf") == 0) { + if (++argv, --argc > 0) { + g_opt.m_rowsperf = atoi(argv[0]); + continue; + } + } if (strcmp(arg, "-seed") == 0) { if (++argv, --argc > 0) { g_opt.m_seed = atoi(argv[0]); @@ -1395,9 +1813,9 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) continue; } } - if (strcmp(arg, "-style") == 0) { + if (strcmp(arg, "-test") == 0) { if (++argv, --argc > 0) { - g_opt.m_style = strdup(argv[0]); + g_opt.m_test = strdup(argv[0]); continue; } } @@ -1431,17 +1849,25 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) printusage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } + if (g_opt.m_dbug != 0) { + DBUG_PUSH(g_opt.m_dbug); + } if (g_opt.m_pk2len == 0) { char b[100]; - strcpy(b, g_opt.m_skip); + b[0] = 0; + if (g_opt.m_skip != 0) + strcpy(b, g_opt.m_skip); strcat(b, "i"); strcat(b, "r"); g_opt.m_skip = strdup(b); } - if (testmain() == -1) { + g_ncc = new Ndb_cluster_connection(); + if (g_ncc->connect(30) != 0 || testmain() == -1 || testperf() == -1) { ndbout << "line " << __LINE__ << " FAIL loop=" << g_loop << endl; return NDBT_ProgramExit(NDBT_FAILED); } + delete g_ncc; + g_ncc = 0; return NDBT_ProgramExit(NDBT_OK); } diff --git a/ndb/test/ndbapi/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp index 04602f51d5f..03d52252334 100644 --- a/ndb/test/ndbapi/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers.cpp @@ -123,15 +123,15 @@ chkerror(char const* fmt, ...) // alignment of addresses and data sizes -static bool isAligned(unsigned x) +static bool isAligned(UintPtr x) { return ((x & 3) == 0); } static bool isAligned(char* p) { - return isAligned(unsigned(p)); + return isAligned(UintPtr(p)); } -static unsigned toAligned(unsigned x) +static unsigned toAligned(UintPtr x) { while (! isAligned(x)) x++; @@ -223,10 +223,10 @@ testcase(int flag) noRandom = ! (flag & 8); ndbout << (noRandom ? "simple sizes" : "randomize sizes") << endl; - int smax = 0, stot = 0; + int smax = 0, stot = 0, i; if (xverbose) ndbout << "- define table " << tab << endl; - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; memset(&c, 0, sizeof(c)); sprintf(c.aAttrName, "C%d", i); @@ -266,7 +266,7 @@ testcase(int flag) return ndberror("getNdbSchemaOp"); if (top->createTable(tab) < 0) return ndberror("createTable"); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (top->createAttribute( c.aAttrName, @@ -299,7 +299,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->deleteTuple() < 0) return ndberror("deleteTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -329,7 +329,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->insertTuple() < 0) return ndberror("insertTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -362,7 +362,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->readTuple() < 0) return ndberror("readTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -371,7 +371,7 @@ testcase(int flag) if (xverbose) { char tmp[20]; if (useBuf) - sprintf(tmp, "0x%x", int(c.buf + off)); + sprintf(tmp, "0x%p", c.buf + off); else strcpy(tmp, "ndbapi"); ndbout << "--- column " << i << " addr=" << tmp << endl; @@ -388,23 +388,24 @@ testcase(int flag) } if (con->execute(Commit) != 0) return ndberror("execute key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { } else if (useBuf) { - for (int j = 0; j < off; j++) { + int j; + for (j = 0; j < off; j++) { if (c.buf[j] != 'B') { return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'B', c.buf[j]); } } - for (int j = 0; j < c.aArraySize; j++) { + for (j = 0; j < c.aArraySize; j++) { if (c.buf[j + off] != byteVal(key, i, j)) { return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, byteVal(key, i, j), c.buf[j]); } } - for (int j = c.aArraySize + off; j < c.bufsiz; j++) { + for (j = c.aArraySize + off; j < c.bufsiz; j++) { if (c.buf[j] != 'B') { return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'B', c.buf[j]); @@ -431,7 +432,8 @@ testcase(int flag) if (xverbose) ndbout << "- scan" << endl; char found[MaxOper]; - for (int k = 0; k < opercnt; k++) + int k; + for (k = 0; k < opercnt; k++) found[k] = 0; for (key = 0; key < opercnt; key++) { int off = makeOff(key); @@ -459,7 +461,7 @@ testcase(int flag) if (op->interpret_exit_ok() < 0) return ndberror("interpret_exit_ok"); } - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->getValue(c.aAttrName, (char*)&newkey) < 0) @@ -468,7 +470,7 @@ testcase(int flag) if (xverbose) { char tmp[20]; if (useBuf) - sprintf(tmp, "0x%x", int(c.buf + off)); + sprintf(tmp, "0x%p", c.buf + off); else strcpy(tmp, "ndbapi"); ndbout << "--- column " << i << " addr=" << tmp << endl; @@ -489,22 +491,23 @@ testcase(int flag) while ((ret = rs->nextResult()) == 0) { if (key != newkey) return ndberror("unexpected key=%d newkey=%d", key, newkey); - for (int i = 1; i < attrcnt; i++) { + for (i = 1; i < attrcnt; i++) { col& c = ccol[i]; if (useBuf) { - for (int j = 0; j < off; j++) { + int j; + for (j = 0; j < off; j++) { if (c.buf[j] != 'C') { return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'C', c.buf[j]); } } - for (int j = 0; j < c.aArraySize; j++) { + for (j = 0; j < c.aArraySize; j++) { if (c.buf[j + off] != byteVal(key, i, j)) { return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, byteVal(key, i, j), c.buf[j]); } } - for (int j = c.aArraySize + off; j < c.bufsiz; j++) { + for (j = c.aArraySize + off; j < c.bufsiz; j++) { if (c.buf[j] != 'C') { return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'C', c.buf[j]); @@ -533,7 +536,7 @@ testcase(int flag) } con = 0; op = 0; - for (int k = 0; k < opercnt; k++) + for (k = 0; k < opercnt; k++) if (! found[k]) return ndberror("key %d not found", k); ndbout << "scanned " << key << endl; @@ -545,6 +548,7 @@ testcase(int flag) NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuffers", 65535) { + int i; ndb_init(); while (++argv, --argc > 0) { char const* p = argv[0]; @@ -602,7 +606,7 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff } } unsigned ok = true; - for (int i = 1; 0 == loopcnt || i <= loopcnt; i++) { + for (i = 1; 0 == loopcnt || i <= loopcnt; i++) { ndbout << "=== loop " << i << " ===" << endl; for (int flag = 0; flag < (1<<testbits); flag++) { if (testcase(flag) < 0) { diff --git a/ndb/test/ndbapi/testDeadlock.cpp b/ndb/test/ndbapi/testDeadlock.cpp index 66fa48173cc..eb985e815ac 100644 --- a/ndb/test/ndbapi/testDeadlock.cpp +++ b/ndb/test/ndbapi/testDeadlock.cpp @@ -459,7 +459,8 @@ wl1822_main(char scantx) static const unsigned thrcount = 2; // create threads for tx1 and tx2 Thr* thrlist[2]; - for (int n = 0; n < thrcount; n++) { + int n; + for (n = 0; n < thrcount; n++) { Thr& thr = *(thrlist[n] = new Thr(1 + n)); CHK(thr.m_ret == 0); } @@ -472,7 +473,7 @@ wl1822_main(char scantx) if (runstep != 0) thr.start(runstep); } - for (int n = 0; n < thrcount; n++) { + for (n = 0; n < thrcount; n++) { Thr& thr = *thrlist[n]; Runstep runstep = wl1822_step[i][n]; if (runstep != 0) @@ -480,7 +481,7 @@ wl1822_main(char scantx) } } // delete threads - for (int n = 0; n < thrcount; n++) { + for (n = 0; n < thrcount; n++) { Thr& thr = *thrlist[n]; thr.exit(); thr.join(); diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index 89232de2535..5f88342705a 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -1211,7 +1211,7 @@ runTableRename(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); @@ -1280,7 +1280,7 @@ runTableRenameNF(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); @@ -1377,7 +1377,7 @@ runTableRenameSR(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); @@ -1431,11 +1431,12 @@ int runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ Vector<char*> cols; Vector<const NdbDictionary::Table*> tabs; + int i; Ndb* pNdb = GETNDB(step); const Uint32 count = NDBT_Tables::getNumTables(); - for (int i=0; i < count; i++){ + for (i=0; i < count; i++){ const NdbDictionary::Table * tab = NDBT_Tables::getTable(i); pNdb->getDictionary()->createTable(* tab); @@ -1458,7 +1459,7 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ Uint32 size = cols.size() / 2; char ** columns = &cols[0]; Uint64 start = NdbTick_CurrentMillisecond(); - for(int i = 0; i<times; i++){ + for(i = 0; i<times; i++){ int j = 2 * (rand() % size); const NdbDictionary::Table* tab = (const NdbDictionary::Table*)tcols[j]; const char * col = tcols[j+1]; @@ -1478,6 +1479,84 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){ + static int acclst[] = { 3001 }; + static int tuplst[] = { 4007, 4008, 4009, 4010, 4011, 4012 }; + static int tuxlst[] = { 12001, 12002, 12003, 12004, 12005, 12006 }; + static unsigned acccnt = sizeof(acclst)/sizeof(acclst[0]); + static unsigned tupcnt = sizeof(tuplst)/sizeof(tuplst[0]); + static unsigned tuxcnt = sizeof(tuxlst)/sizeof(tuxlst[0]); + + NdbRestarter restarter; + int nodeId = restarter.getMasterNodeId(); + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDic = pNdb->getDictionary(); + NdbDictionary::Table tab(*ctx->getTab()); + tab.setFragmentType(NdbDictionary::Object::FragAllLarge); + + // ordered index on first few columns + NdbDictionary::Index idx("X"); + idx.setTable(tab.getName()); + idx.setType(NdbDictionary::Index::OrderedIndex); + idx.setLogging(false); + for (int i_hate_broken_compilers = 0; + i_hate_broken_compilers < 3 && + i_hate_broken_compilers < tab.getNoOfColumns(); + i_hate_broken_compilers++) { + idx.addColumn(*tab.getColumn(i_hate_broken_compilers)); + } + + const int loops = ctx->getNumLoops(); + int result = NDBT_OK; + (void)pDic->dropTable(tab.getName()); + + for (int l = 0; l < loops; l++) { + for (unsigned i0 = 0; i0 < acccnt; i0++) { + unsigned j = (l == 0 ? i0 : myRandom48(acccnt)); + int errval = acclst[j]; + g_info << "insert error node=" << nodeId << " value=" << errval << endl; + CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, + "failed to set error insert"); + CHECK2(pDic->createTable(tab) != 0, + "failed to fail after error insert " << errval); + CHECK2(pDic->createTable(tab) == 0, + pDic->getNdbError()); + CHECK2(pDic->dropTable(tab.getName()) == 0, + pDic->getNdbError()); + } + for (unsigned i1 = 0; i1 < tupcnt; i1++) { + unsigned j = (l == 0 ? i1 : myRandom48(tupcnt)); + int errval = tuplst[j]; + g_info << "insert error node=" << nodeId << " value=" << errval << endl; + CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, + "failed to set error insert"); + CHECK2(pDic->createTable(tab) != 0, + "failed to fail after error insert " << errval); + CHECK2(pDic->createTable(tab) == 0, + pDic->getNdbError()); + CHECK2(pDic->dropTable(tab.getName()) == 0, + pDic->getNdbError()); + } + for (unsigned i2 = 0; i2 < tuxcnt; i2++) { + unsigned j = (l == 0 ? i2 : myRandom48(tuxcnt)); + int errval = tuxlst[j]; + g_info << "insert error node=" << nodeId << " value=" << errval << endl; + CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, + "failed to set error insert"); + CHECK2(pDic->createTable(tab) == 0, + pDic->getNdbError()); + CHECK2(pDic->createIndex(idx) != 0, + "failed to fail after error insert " << errval); + CHECK2(pDic->createIndex(idx) == 0, + pDic->getNdbError()); + CHECK2(pDic->dropTable(tab.getName()) == 0, + pDic->getNdbError()); + } + } +end: + return result; +} + NDBT_TESTSUITE(testDict); TESTCASE("CreateAndDrop", "Try to create and drop the table loop number of times\n"){ @@ -1573,6 +1652,10 @@ TESTCASE("DictionaryPerf", ""){ INITIALIZER(runTestDictionaryPerf); } +TESTCASE("FailAddFragment", + "Fail add fragment or attribute in ACC or TUP or TUX\n"){ + INITIALIZER(runFailAddFragment); +} NDBT_TESTSUITE_END(testDict); int main(int argc, const char** argv){ @@ -1582,5 +1665,3 @@ int main(int argc, const char** argv){ myRandom48Init(NdbTick_CurrentMillisecond()); return testDict.execute(argc, argv); } - - diff --git a/ndb/test/ndbapi/testIndex.cpp b/ndb/test/ndbapi/testIndex.cpp index ed9e114fd92..6623ad35a7f 100644 --- a/ndb/test/ndbapi/testIndex.cpp +++ b/ndb/test/ndbapi/testIndex.cpp @@ -58,7 +58,9 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ // Build attrib definitions that describes which attributes to build index // Try to build strange combinations, not just "all" or all PK's - for(int i = 1; i <= pTab->getNoOfColumns(); i++){ + int i; + + for(i = 1; i <= pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; a<i; a++) @@ -66,7 +68,7 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attriblist.push_back(attr); } int b = 0; - for(int i = pTab->getNoOfColumns()-1; i > 0; i--){ + for(i = pTab->getNoOfColumns()-1; i > 0; i--){ attr = new Attrib; attr->numAttribs = i; b++; @@ -74,21 +76,21 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attr->attribs[a] = a+b; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns(); i > 0; i--){ + for(i = pTab->getNoOfColumns(); i > 0; i--){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = 2; for(int a = 0; a<2; a++){ @@ -226,8 +228,8 @@ int runCreateIndexes(NDBT_Context* ctx, NDBT_Step* step){ while (l < loops && result == NDBT_OK){ - - for (unsigned int i = 0; i < attrList.attriblist.size(); i++){ + unsigned int i; + for (i = 0; i < attrList.attriblist.size(); i++){ // Try to create index if (create_index(ctx, i, pTab, pNdb, attrList.attriblist[i], logged) == NDBT_FAILED) @@ -235,7 +237,7 @@ int runCreateIndexes(NDBT_Context* ctx, NDBT_Step* step){ } // Now drop all indexes that where created - for (unsigned int i = 0; i < attrList.attriblist.size(); i++){ + for (i = 0; i < attrList.attriblist.size(); i++){ // Try to drop index if (drop_index(i, pNdb, pTab, attrList.attriblist[i]) != NDBT_OK) @@ -1083,8 +1085,8 @@ runUniqueNullTransactions(NDBT_Context* ctx, NDBT_Step* step){ else pIdx.setType(NdbDictionary::Index::UniqueHashIndex); pIdx.setStoredIndex(logged); - - for (int c = 0; c< pTab->getNoOfColumns(); c++){ + int c; + for (c = 0; c< pTab->getNoOfColumns(); c++){ const NdbDictionary::Column * col = pTab->getColumn(c); if(col->getPrimaryKey()){ pIdx.addIndexColumn(col->getName()); @@ -1093,7 +1095,7 @@ runUniqueNullTransactions(NDBT_Context* ctx, NDBT_Step* step){ } int colId = -1; - for (int c = 0; c< pTab->getNoOfColumns(); c++){ + for (c = 0; c< pTab->getNoOfColumns(); c++){ const NdbDictionary::Column * col = pTab->getColumn(c); if(col->getNullable()){ pIdx.addIndexColumn(col->getName()); diff --git a/ndb/test/ndbapi/testLcp.cpp b/ndb/test/ndbapi/testLcp.cpp index c92be091a97..d11692db761 100644 --- a/ndb/test/ndbapi/testLcp.cpp +++ b/ndb/test/ndbapi/testLcp.cpp @@ -85,7 +85,8 @@ main(int argc, char ** argv){ g_info << " where ZLCP_OP_WRITE_RT_BREAK is finished before SAVE_PAGES" << endl; require(!pause_lcp()); - for(size_t j = 0; j<g_rows; j++){ + size_t j; + for(j = 0; j<g_rows; j++){ require(!do_op(j)); } require(!continue_lcp(5900)); @@ -98,7 +99,7 @@ main(int argc, char ** argv){ << endl; require(!load_table()); require(!pause_lcp()); - for(size_t j = 0; j<g_rows; j++){ + for(j = 0; j<g_rows; j++){ require(!do_op(j)); } require(!continue_lcp(5901)); @@ -109,7 +110,7 @@ main(int argc, char ** argv){ g_info << "Testing pre LCP operations, undo-ed at commit" << endl; require(!load_table()); require(!pause_lcp()); - for(size_t j = 0; j<g_rows; j++){ + for(j = 0; j<g_rows; j++){ require(!do_op(j)); } require(!continue_lcp(5902)); diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp index 74cb1f8bcd0..69e534e6860 100644 --- a/ndb/test/ndbapi/testNdbApi.cpp +++ b/ndb/test/ndbapi/testNdbApi.cpp @@ -88,10 +88,10 @@ int runTestMaxNdb(NDBT_Context* ctx, NDBT_Step* step){ oldi = i; - for(size_t i = 0; i < ndbVector.size(); i++){ - delete ndbVector[i]; - if(((i+1) % 250) == 0){ - ndbout << "Deleted " << (Uint64) i << " ndb objects " << endl; + for(size_t j = 0; j < ndbVector.size(); j++){ + delete ndbVector[j]; + if(((j+1) % 250) == 0){ + ndbout << "Deleted " << (Uint64) j << " ndb objects " << endl; } } ndbVector.clear(); @@ -142,14 +142,22 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){ 4); break; case 2: + ndbout_c("startTransactionDGroup not supported"); + abort(); + /* pCon = pNdb->startTransactionDGroup(1, "TEST", 0); + */ break; case 3: + ndbout_c("startTransactionDGroup not supported"); + abort(); + /* pCon = pNdb->startTransactionDGroup(2, "TEST", 1); + */ break; default: @@ -178,8 +186,8 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){ oldi = i; - for(size_t i = 0; i < conVector.size(); i++){ - pNdb->closeTransaction(conVector[i]); + for(size_t j = 0; j < conVector.size(); j++){ + pNdb->closeTransaction(conVector[j]); } conVector.clear(); l++; @@ -537,8 +545,8 @@ int runTestDeleteNdb(NDBT_Context* ctx, NDBT_Step* step){ } // Delete the ndb objects - for(size_t i = 0; i < ndbVector.size(); i++) - delete ndbVector[i]; + for(size_t j = 0; j < ndbVector.size(); j++) + delete ndbVector[j]; ndbVector.clear(); l++; } diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 21862e02328..e6d3844d18e 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -59,7 +59,7 @@ struct Opt { unsigned m_subloop; const char* m_table; unsigned m_threads; - unsigned m_v; + int m_v; Opt() : m_batch(32), m_bound("01234"), @@ -407,10 +407,11 @@ Col::verify(const void* addr) const const unsigned char* p = (const unsigned char*)addr; unsigned n = (p[0] << 8) | p[1]; assert(n <= m_length); - for (unsigned i = 0; i < n; i++) { + unsigned i; + for (i = 0; i < n; i++) { assert(p[2 + i] != 0); } - for (unsigned i = n; i < m_length; i++) { + for (i = n; i < m_length; i++) { assert(p[2 + i] == 0); } } @@ -671,6 +672,8 @@ tabcount = sizeof(tablist) / sizeof(tablist[0]); // connections +static Ndb_cluster_connection* g_ncc = 0; + struct Con { Ndb* m_ndb; NdbDictionary::Dictionary* m_dic; @@ -719,7 +722,7 @@ int Con::connect() { assert(m_ndb == 0); - m_ndb = new Ndb("TEST_DB"); + m_ndb = new Ndb(g_ncc, "TEST_DB"); CHKCON(m_ndb->init() == 0, *this); CHKCON(m_ndb->waitUntilReady(30) == 0, *this); m_tx = 0, m_op = 0; @@ -3021,7 +3024,8 @@ runstep(Par par, const char* fname, TFunc func, unsigned mode) { LL2(fname); const int threads = (mode & ST ? 1 : par.m_threads); - for (int n = 0; n < threads; n++) { + int n; + for (n = 0; n < threads; n++) { LL4("start " << n); Thr& thr = *g_thrlist[n]; thr.m_par.m_tab = par.m_tab; @@ -3033,7 +3037,7 @@ runstep(Par par, const char* fname, TFunc func, unsigned mode) thr.start(); } unsigned errs = 0; - for (int n = threads - 1; n >= 0; n--) { + for (n = threads - 1; n >= 0; n--) { LL4("stop " << n); Thr& thr = *g_thrlist[n]; thr.stopped(); @@ -3301,10 +3305,11 @@ runtest(Par par) CHK(con.connect() == 0); par.m_con = &con; g_thrlist = new Thr* [par.m_threads]; - for (unsigned n = 0; n < par.m_threads; n++) { + unsigned n; + for (n = 0; n < par.m_threads; n++) { g_thrlist[n] = 0; } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { g_thrlist[n] = new Thr(par, n); Thr& thr = *g_thrlist[n]; assert(thr.m_thread != 0); @@ -3330,11 +3335,11 @@ runtest(Par par) } } } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { Thr& thr = *g_thrlist[n]; thr.exit(); } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { Thr& thr = *g_thrlist[n]; thr.join(); delete &thr; @@ -3511,8 +3516,11 @@ NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535) } { Par par(g_opt); - if (runtest(par) < 0) + g_ncc = new Ndb_cluster_connection(); + if (g_ncc->connect(30) != 0 || runtest(par) < 0) goto failed; + delete g_ncc; + g_ncc = 0; } // always exit with NDBT code ok: diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp index f31906dd737..e254aff58dc 100644 --- a/ndb/test/ndbapi/testOperations.cpp +++ b/ndb/test/ndbapi/testOperations.cpp @@ -98,6 +98,15 @@ OperationTestCase matrix[] = { result = NDBT_FAILED; \ break; } +#define C3(b) if (!(b)) { \ + g_err << "ERR: "<< step->getName() \ + << " failed on line " << __LINE__ << endl; \ + abort(); return NDBT_FAILED; } + +#define C3(b) if (!(b)) { \ + g_err << "ERR: failed on line " << __LINE__ << endl; \ + return NDBT_FAILED; } + int runOp(HugoOperations & hugoOps, Ndb * pNdb, @@ -171,7 +180,7 @@ runTwoOperations(NDBT_Context* ctx, NDBT_Step* step){ // Insert, read CHECK(hugoOps.startTransaction(pNdb) == 0); CHECK(runOp(hugoOps, pNdb, op1, val1) == 0); - AbortOption oa = (res1 == 0) ? AbortOnError : IgnoreError; + AbortOption oa = (res1 == 0) ? AbortOnError : AO_IgnoreError; CHECK(hugoOps.execute_NoCommit(pNdb, oa) == res1); CHECK(checkVal(hugoOps, op1, val1, res1) == 0); @@ -228,11 +237,369 @@ runClearTable(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +enum OPS { o_DONE= 0, o_INS= 1, o_UPD= 2, o_DEL= 3 }; +typedef Vector<OPS> Sequence; + +static +bool +valid(const Sequence& s) +{ + if(s.size() == 0) + return false; + + for(size_t i = 1; i<s.size(); i++) + { + switch(s[i]){ + case o_INS: + if(s[i-1] != o_DEL) + return false; + break; + case o_UPD: + case o_DEL: + if(s[i-1] == o_DEL) + return false; + break; + case o_DONE: + return true; + } + } + return true; +} + +static +NdbOut& operator<<(NdbOut& out, const Sequence& s) +{ + out << "[ "; + for(size_t i = 0; i<s.size(); i++) + { + switch(s[i]){ + case o_INS: + out << "INS "; + break; + case o_DEL: + out << "DEL "; + break; + case o_UPD: + out << "UPD "; + break; + case o_DONE: + abort(); + } + } + out << "]"; + return out; +} + +static +void +generate(Sequence& out, int no) +{ + while(no & 3) + { + out.push_back((OPS)(no & 3)); + no >>= 2; + } +} + +static +void +generate(Vector<int>& out, size_t len) +{ + int max= 1; + while(len) + { + max <<= 2; + len--; + } + + len= 1; + for(int i = 0; i<max; i++) + { + Sequence tmp; + generate(tmp, i); + + if(tmp.size() >= len && valid(tmp)) + { + out.push_back(i); + len= tmp.size(); + } + else + { + //ndbout << "DISCARD: " << tmp << endl; + } + } +} + +static const Uint32 DUMMY = 0; +static const Uint32 ROW = 1; + +int +verify_other(NDBT_Context* ctx, + Ndb* pNdb, int seq, OPS latest, bool initial_row, bool commit) +{ + Uint32 no_wait = NdbOperation::LM_CommittedRead* + ctx->getProperty("NoWait", (Uint32)1); + + for(size_t j = no_wait; j<3; j++) + { + HugoOperations other(*ctx->getTab()); + C3(other.startTransaction(pNdb) == 0); + C3(other.pkReadRecord(pNdb, ROW, 1, (NdbOperation::LockMode)j) == 0); + int tmp= other.execute_Commit(pNdb); + if(seq == 0){ + if(j == NdbOperation::LM_CommittedRead) + { + C3(initial_row? tmp==0 && other.verifyUpdatesValue(0) == 0 : tmp==626); + } + else + { + C3(tmp == 266); + } + } + else if(commit) + { + switch(latest){ + case o_INS: + case o_UPD: + C3(tmp == 0 && other.verifyUpdatesValue(seq) == 0); + break; + case o_DEL: + C3(tmp == 626); + break; + case o_DONE: + abort(); + } + } + else + { + // rollback + C3(initial_row? tmp==0 && other.verifyUpdatesValue(0) == 0 : tmp==626); + } + } + + return NDBT_OK; +} + +int +verify_savepoint(NDBT_Context* ctx, + Ndb* pNdb, int seq, OPS latest, + Uint64 transactionId) +{ + bool initial_row= (seq == 0) && latest == o_INS; + + for(size_t j = 0; j<3; j++) + { + const NdbOperation::LockMode lm= (NdbOperation::LockMode)j; + + HugoOperations same(*ctx->getTab()); + C3(same.startTransaction(pNdb) == 0); + same.setTransactionId(transactionId); // Cheat + + /** + * Increase savepoint to <em>k</em> + */ + for(size_t l = 1; l<=seq; l++) + { + C3(same.pkReadRecord(pNdb, DUMMY, 1, lm) == 0); // Read dummy row + C3(same.execute_NoCommit(pNdb) == 0); + g_info << "savepoint: " << l << endl; + } + + g_info << "op(" << seq << "): " + << " lock mode " << lm << endl; + + C3(same.pkReadRecord(pNdb, ROW, 1, lm) == 0); // Read real row + int tmp= same.execute_Commit(pNdb); + if(seq == 0) + { + if(initial_row) + { + C3(tmp == 0 && same.verifyUpdatesValue(0) == 0); + } else + { + C3(tmp == 626); + } + } + else + { + switch(latest){ + case o_INS: + case o_UPD: + C3(tmp == 0 && same.verifyUpdatesValue(seq) == 0); + break; + case o_DEL: + C3(tmp == 626); + break; + case o_DONE: + abort(); + } + } + } + return NDBT_OK; +} + +int +runOperations(NDBT_Context* ctx, NDBT_Step* step) +{ + int tmp; + Ndb* pNdb = GETNDB(step); + + Uint32 seqNo = ctx->getProperty("Sequence", (Uint32)0); + Uint32 commit= ctx->getProperty("Commit", (Uint32)1); + + if(seqNo == 0) + { + return NDBT_FAILED; + } + + Sequence seq; + generate(seq, seqNo); + + { + // Dummy row + HugoOperations hugoOps(*ctx->getTab()); + C3(hugoOps.startTransaction(pNdb) == 0); + C3(hugoOps.pkInsertRecord(pNdb, DUMMY, 1, 0) == 0); + C3(hugoOps.execute_Commit(pNdb) == 0); + } + + const bool initial_row= (seq[0] != o_INS); + if(initial_row) + { + HugoOperations hugoOps(*ctx->getTab()); + C3(hugoOps.startTransaction(pNdb) == 0); + C3(hugoOps.pkInsertRecord(pNdb, ROW, 1, 0) == 0); + C3(hugoOps.execute_Commit(pNdb) == 0); + } + + HugoOperations trans1(*ctx->getTab()); + C3(trans1.startTransaction(pNdb) == 0); + for(size_t i = 0; i<seq.size(); i++) + { + /** + * Perform operation + */ + switch(seq[i]){ + case o_INS: + C3(trans1.pkInsertRecord(pNdb, ROW, 1, i+1) == 0); + break; + case o_UPD: + C3(trans1.pkUpdateRecord(pNdb, ROW, 1, i+1) == 0); + break; + case o_DEL: + C3(trans1.pkDeleteRecord(pNdb, ROW, 1) == 0); + break; + case o_DONE: + abort(); + } + C3(trans1.execute_NoCommit(pNdb) == 0); + + /** + * Verify other transaction + */ + if(verify_other(ctx, pNdb, 0, seq[0], initial_row, commit) != NDBT_OK) + return NDBT_FAILED; + + /** + * Verify savepoint read + */ + Uint64 transactionId= trans1.getTransaction()->getTransactionId(); + + for(size_t k=0; k<=i+1; k++) + { + if(verify_savepoint(ctx, pNdb, k, + k>0 ? seq[k-1] : initial_row ? o_INS : o_DONE, + transactionId) != NDBT_OK) + return NDBT_FAILED; + } + } + + if(commit) + { + C3(trans1.execute_Commit(pNdb) == 0); + } + else + { + C3(trans1.execute_Rollback(pNdb) == 0); + } + + if(verify_other(ctx, pNdb, seq.size(), seq.back(), + initial_row, commit) != NDBT_OK) + return NDBT_FAILED; + + return NDBT_OK; +} + int main(int argc, const char** argv){ ndb_init(); + Vector<int> tmp; + generate(tmp, 5); + NDBT_TestSuite ts("testOperations"); + for(size_t i = 0; i<tmp.size(); i++) + { + BaseString name; + Sequence s; + generate(s, tmp[i]); + for(size_t j = 0; j<s.size(); j++){ + switch(s[j]){ + case o_INS: + name.append("_INS"); + break; + case o_DEL: + name.append("_DEL"); + break; + case o_UPD: + name.append("_UPD"); + break; + case o_DONE: + abort(); + } + } + + BaseString n1; + n1.append(name); + n1.append("_COMMIT"); + + NDBT_TestCaseImpl1 *pt = new NDBT_TestCaseImpl1(&ts, + n1.c_str()+1, ""); + + pt->setProperty("Sequence", tmp[i]); + pt->addInitializer(new NDBT_Initializer(pt, + "runClearTable", + runClearTable)); + + pt->addStep(new NDBT_ParallelStep(pt, + "run", + runOperations)); + + pt->addFinalizer(new NDBT_Finalizer(pt, + "runClearTable", + runClearTable)); + + ts.addTest(pt); + + name.append("_ABORT"); + pt = new NDBT_TestCaseImpl1(&ts, name.c_str()+1, ""); + pt->setProperty("Sequence", tmp[i]); + pt->setProperty("Commit", (Uint32)0); + pt->addInitializer(new NDBT_Initializer(pt, + "runClearTable", + runClearTable)); + + pt->addStep(new NDBT_ParallelStep(pt, + "run", + runOperations)); + + pt->addFinalizer(new NDBT_Finalizer(pt, + "runClearTable", + runClearTable)); + + ts.addTest(pt); + } + for(Uint32 i = 0; i<sizeof(matrix)/sizeof(matrix[0]); i++){ NDBT_TestCaseImpl1 *pt = new NDBT_TestCaseImpl1(&ts, matrix[i].name, ""); @@ -270,3 +637,5 @@ main(int argc, const char** argv){ return ts.execute(argc, argv); } +template class Vector<OPS>; +template class Vector<Sequence>; diff --git a/ndb/test/ndbapi/testReadPerf.cpp b/ndb/test/ndbapi/testReadPerf.cpp index 8d0d78cbe8c..3adcb5a2d9b 100644 --- a/ndb/test/ndbapi/testReadPerf.cpp +++ b/ndb/test/ndbapi/testReadPerf.cpp @@ -99,7 +99,8 @@ main(int argc, const char** argv){ { "verbose", 'v', arg_flag, &verbose, "Print verbose status", "verbose" } }; const int num_args = 1 + P_MAX; - for(int i = 0; i<P_MAX; i++){ + int i; + for(i = 0; i<P_MAX; i++){ args[i+1].long_name = g_paramters[i].name; args[i+1].short_name = * g_paramters[i].name; args[i+1].type = arg_integer; @@ -127,7 +128,7 @@ main(int argc, const char** argv){ g_err << "Wait until ready failed" << endl; goto error; } - for(int i = optind; i<argc; i++){ + for(i = optind; i<argc; i++){ const char * T = argv[i]; g_info << "Testing " << T << endl; BaseString::snprintf(g_table, sizeof(g_table), T); @@ -390,8 +391,15 @@ run_read(){ void print_result(){ + int tmp = 1; + tmp *= g_paramters[P_RANGE].value; + tmp *= g_paramters[P_LOOPS].value; + + int t, t2; for(int i = 0; i<P_OP_TYPES; i++){ - g_err.println("%s avg: %u us/row", g_ops[i], - (1000*g_times[i])/(g_paramters[P_RANGE].value*g_paramters[P_LOOPS].value)); + g_err << g_ops[i] << " avg: " + << (int)((1000*g_times[i])/tmp) + << " us/row (" + << (1000 * tmp)/g_times[i] << " rows / sec)" << endl; } } diff --git a/ndb/test/ndbapi/testRestartGci.cpp b/ndb/test/ndbapi/testRestartGci.cpp index e817245af55..4e541d1f38f 100644 --- a/ndb/test/ndbapi/testRestartGci.cpp +++ b/ndb/test/ndbapi/testRestartGci.cpp @@ -132,7 +132,8 @@ int runVerifyInserts(NDBT_Context* ctx, NDBT_Step* step){ // RULE1: The vector with saved records should have exactly as many // records with lower or same gci as there are in DB int recordsWithLowerOrSameGci = 0; - for (unsigned i = 0; i < savedRecords.size(); i++){ + unsigned i; + for (i = 0; i < savedRecords.size(); i++){ if (savedRecords[i].m_gci <= restartGCI) recordsWithLowerOrSameGci++; } @@ -144,7 +145,7 @@ int runVerifyInserts(NDBT_Context* ctx, NDBT_Step* step){ // RULE2: The records found in db should have same or lower // gci as in the vector - for (unsigned i = 0; i < savedRecords.size(); i++){ + for (i = 0; i < savedRecords.size(); i++){ CHECK(hugoOps.startTransaction(pNdb) == 0); CHECK(hugoOps.pkReadRecord(pNdb, i) == 0); if (hugoOps.execute_Commit(pNdb) != 0){ diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp index 0cd30dfefde..f1018d29846 100644 --- a/ndb/test/ndbapi/testScan.cpp +++ b/ndb/test/ndbapi/testScan.cpp @@ -35,7 +35,8 @@ getTable(Ndb* pNdb, int i){ int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ - int records = ctx->getNumRecords(); + int records = ctx->getProperty("Rows", ctx->getNumRecords()); + HugoTransactions hugoTrans(*ctx->getTab()); if (hugoTrans.loadTable(GETNDB(step), records) != 0){ return NDBT_FAILED; @@ -90,11 +91,59 @@ int runLoadAllTables(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +char orderedPkIdxName[255]; + +int createOrderedPkIndex(NDBT_Context* ctx, NDBT_Step* step){ + + const NdbDictionary::Table* pTab = ctx->getTab(); + Ndb* pNdb = GETNDB(step); + + // Create index + BaseString::snprintf(orderedPkIdxName, sizeof(orderedPkIdxName), + "IDC_O_PK_%s", pTab->getName()); + NdbDictionary::Index pIdx(orderedPkIdxName); + pIdx.setTable(pTab->getName()); + pIdx.setType(NdbDictionary::Index::OrderedIndex); + pIdx.setLogging(false); + + for (int c = 0; c< pTab->getNoOfColumns(); c++){ + const NdbDictionary::Column * col = pTab->getColumn(c); + if(col->getPrimaryKey()){ + pIdx.addIndexColumn(col->getName()); + } + } + + if (pNdb->getDictionary()->createIndex(pIdx) != 0){ + ndbout << "FAILED! to create index" << endl; + const NdbError err = pNdb->getDictionary()->getNdbError(); + ERR(err); + return NDBT_FAILED; + } + + return NDBT_OK; +} + +int createOrderedPkIndex_Drop(NDBT_Context* ctx, NDBT_Step* step){ + const NdbDictionary::Table* pTab = ctx->getTab(); + Ndb* pNdb = GETNDB(step); + + // Drop index + if (pNdb->getDictionary()->dropIndex(orderedPkIdxName, + pTab->getName()) != 0){ + ndbout << "FAILED! to drop index" << endl; + ERR(pNdb->getDictionary()->getNdbError()); + return NDBT_FAILED; + } + + return NDBT_OK; +} + + int runScanReadRandomTable(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; while (i<loops) { @@ -216,9 +265,9 @@ int runVerifyTable(NDBT_Context* ctx, NDBT_Step* step){ int runScanRead(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); - int records = ctx->getNumRecords(); + int records = ctx->getProperty("Rows", ctx->getNumRecords()); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); @@ -232,18 +281,66 @@ int runScanRead(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +int runRandScanRead(NDBT_Context* ctx, NDBT_Step* step){ + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + int parallelism = ctx->getProperty("Parallelism", 240); + int abort = ctx->getProperty("AbortProb", 5); + + int i = 0; + HugoTransactions hugoTrans(*ctx->getTab()); + while (i<loops && !ctx->isTestStopped()) { + g_info << i << ": "; + NdbOperation::LockMode lm = (NdbOperation::LockMode)(rand() % 3); + if (hugoTrans.scanReadRecords(GETNDB(step), + records, abort, parallelism, + lm) != 0){ + return NDBT_FAILED; + } + i++; + } + return NDBT_OK; +} + +int runScanReadIndex(NDBT_Context* ctx, NDBT_Step* step){ + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + int parallelism = ctx->getProperty("Parallelism", 240); + int abort = ctx->getProperty("AbortProb", 5); + const NdbDictionary::Index * pIdx = + GETNDB(step)->getDictionary()->getIndex(orderedPkIdxName, + ctx->getTab()->getName()); + + int i = 0; + HugoTransactions hugoTrans(*ctx->getTab()); + while (pIdx && i<loops && !ctx->isTestStopped()) { + g_info << i << ": "; + bool sort = (rand() % 100) > 50 ? true : false; + NdbOperation::LockMode lm = (NdbOperation::LockMode)(rand() % 3); + if (hugoTrans.scanReadRecords(GETNDB(step), pIdx, + records, abort, parallelism, + lm, + sort) != 0){ + return NDBT_FAILED; + } + i++; + } + return NDBT_OK; +} + int runScanReadCommitted(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); while (i<loops && !ctx->isTestStopped()) { g_info << i << ": "; - if (hugoTrans.scanReadCommittedRecords(GETNDB(step), records, - abort, parallelism) != 0){ + if (hugoTrans.scanReadRecords(GETNDB(step), records, + abort, parallelism, + NdbOperation::LM_CommittedRead) != 0){ return NDBT_FAILED; } i++; @@ -279,7 +376,20 @@ int runScanReadError(NDBT_Context* ctx, NDBT_Step* step){ restarter.insertErrorInAllNodes(0); return result; } - + +int +runInsertError(NDBT_Context* ctx, NDBT_Step* step){ + int error = ctx->getProperty("ErrorCode"); + NdbRestarter restarter; + + ctx->setProperty("ErrorCode", (Uint32)0); + if (restarter.insertErrorInAllNodes(error) != 0){ + ndbout << "Could not insert error in all nodes "<<endl; + return NDBT_FAILED; + } + return NDBT_OK; +} + int runScanReadErrorOneNode(NDBT_Context* ctx, NDBT_Step* step){ int result = NDBT_OK; int loops = ctx->getNumLoops(); @@ -424,7 +534,7 @@ int runScanUpdate(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 1); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); while (i<loops) { @@ -464,7 +574,7 @@ int runScanUpdate2(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); while (i<loops) { @@ -639,7 +749,7 @@ int runCheckGetValue(NDBT_Context* ctx, NDBT_Step* step){ g_info << (unsigned)i << endl; if(utilTrans.scanReadRecords(GETNDB(step), parallelism, - false, + NdbOperation::LM_Read, records, alist.attriblist[i]->numAttribs, alist.attriblist[i]->attribs) != 0){ @@ -647,7 +757,7 @@ int runCheckGetValue(NDBT_Context* ctx, NDBT_Step* step){ } if(utilTrans.scanReadRecords(GETNDB(step), parallelism, - true, + NdbOperation::LM_Read, records, alist.attriblist[i]->numAttribs, alist.attriblist[i]->attribs) != 0){ @@ -1079,7 +1189,30 @@ TESTCASE("ScanRead488", "When this limit is exceeded the scan will be aborted with errorcode "\ "488."){ INITIALIZER(runLoadTable); - STEPS(runScanRead, 70); + STEPS(runRandScanRead, 70); + FINALIZER(runClearTable); +} +TESTCASE("ScanRead488O", + "Verify scan requirement: It's only possible to have 11 concurrent "\ + "scans per fragment running in Ndb kernel at the same time. "\ + "When this limit is exceeded the scan will be aborted with errorcode "\ + "488."){ + INITIALIZER(createOrderedPkIndex); + INITIALIZER(runLoadTable); + STEPS(runScanReadIndex, 70); + FINALIZER(createOrderedPkIndex_Drop); + FINALIZER(runClearTable); +} +TESTCASE("ScanRead488_Mixed", + "Verify scan requirement: It's only possible to have 11 concurrent "\ + "scans per fragment running in Ndb kernel at the same time. "\ + "When this limit is exceeded the scan will be aborted with errorcode "\ + "488."){ + INITIALIZER(createOrderedPkIndex); + INITIALIZER(runLoadTable); + STEPS(runRandScanRead, 50); + STEPS(runScanReadIndex, 50); + FINALIZER(createOrderedPkIndex_Drop); FINALIZER(runClearTable); } TESTCASE("ScanRead488Timeout", @@ -1102,6 +1235,16 @@ TESTCASE("ScanRead100", STEPS(runScanRead, 100); FINALIZER(runClearTable); } +TESTCASE("Scan-bug8262", + ""){ + TC_PROPERTY("Rows", 1); + TC_PROPERTY("ErrorCode", 8035); + INITIALIZER(runLoadTable); + INITIALIZER(runInsertError); // Will reset error code + STEPS(runScanRead, 25); + FINALIZER(runInsertError); + FINALIZER(runClearTable); +} TESTCASE("ScanRead40RandomTable", "Verify scan requirement: Scan with 40 simultaneous threads. "\ "Use random table for the scan"){ diff --git a/ndb/test/ndbapi/testScanPerf.cpp b/ndb/test/ndbapi/testScanPerf.cpp index c1334125978..45f0468bc70 100644 --- a/ndb/test/ndbapi/testScanPerf.cpp +++ b/ndb/test/ndbapi/testScanPerf.cpp @@ -39,8 +39,9 @@ struct Parameter { #define P_LOOPS 8 #define P_CREATE 9 #define P_LOAD 10 +#define P_RESET 11 -#define P_MAX 11 +#define P_MAX 12 static Parameter @@ -55,7 +56,8 @@ g_paramters[] = { { "size", 1000000, 1, ~0 }, { "iterations", 3, 1, ~0 }, { "create_drop", 1, 0, 1 }, - { "data", 1, 0, 1 } + { "data", 1, 0, 1 }, + { "q-reset bounds", 0, 1, 0 } }; static Ndb* g_ndb = 0; @@ -80,7 +82,8 @@ main(int argc, const char** argv){ { "verbose", 'v', arg_flag, &verbose, "Print verbose status", "verbose" } }; const int num_args = 1 + P_MAX; - for(int i = 0; i<P_MAX; i++){ + int i; + for(i = 0; i<P_MAX; i++){ args[i+1].long_name = g_paramters[i].name; args[i+1].short_name = * g_paramters[i].name; args[i+1].type = arg_integer; @@ -107,7 +110,7 @@ main(int argc, const char** argv){ g_err << "Wait until ready failed" << endl; goto error; } - for(int i = optind; i<argc; i++){ + for(i = optind; i<argc; i++){ const char * T = argv[i]; g_info << "Testing " << T << endl; BaseString::snprintf(g_tablename, sizeof(g_tablename), T); @@ -218,21 +221,30 @@ run_scan(){ NDB_TICKS start1, stop; int sum_time= 0; + int sample_rows = 0; + int tot_rows = 0; + NDB_TICKS sample_start = NdbTick_CurrentMillisecond(); + Uint32 tot = g_paramters[P_ROWS].value; + if(g_paramters[P_BOUND].value == 2 || g_paramters[P_FILT].value == 2) + iter *= g_paramters[P_ROWS].value; + + NdbScanOperation * pOp = 0; + NdbIndexScanOperation * pIOp = 0; + NdbConnection * pTrans = 0; + NdbResultSet * rs = 0; + int check = 0; + for(int i = 0; i<iter; i++){ start1 = NdbTick_CurrentMillisecond(); - NdbConnection * pTrans = g_ndb->startTransaction(); + pTrans = pTrans ? pTrans : g_ndb->startTransaction(); if(!pTrans){ g_err << "Failed to start transaction" << endl; err(g_ndb->getNdbError()); return -1; } - NdbScanOperation * pOp; - NdbIndexScanOperation * pIOp; - - NdbResultSet * rs; int par = g_paramters[P_PARRA].value; int bat = g_paramters[P_BATCH].value; NdbScanOperation::LockMode lm; @@ -255,9 +267,17 @@ run_scan(){ assert(pOp); rs = pOp->readTuples(lm, bat, par); } else { - pOp = pIOp = pTrans->getNdbIndexScanOperation(g_indexname, g_tablename); - bool ord = g_paramters[P_ACCESS].value == 2; - rs = pIOp->readTuples(lm, bat, par, ord); + if(g_paramters[P_RESET].value == 0 || pIOp == 0) + { + pOp= pIOp= pTrans->getNdbIndexScanOperation(g_indexname, g_tablename); + bool ord = g_paramters[P_ACCESS].value == 2; + rs = pIOp->readTuples(lm, bat, par, ord); + } + else + { + pIOp->reset_bounds(); + } + switch(g_paramters[P_BOUND].value){ case 0: // All break; @@ -267,20 +287,22 @@ run_scan(){ case 2: { // 1 row default: assert(g_table->getNoOfPrimaryKeys() == 1); // only impl. so far - abort(); -#if 0 int tot = g_paramters[P_ROWS].value; int row = rand() % tot; +#if 0 fix_eq_bound(pIOp, row); +#else + pIOp->setBound((Uint32)0, NdbIndexScanOperation::BoundEQ, &row); #endif break; } } + if(g_paramters[P_RESET].value == 2) + goto execute; } assert(pOp); assert(rs); - int check = 0; switch(g_paramters[P_FILT].value){ case 0: // All check = pOp->interpret_exit_ok(); @@ -309,10 +331,13 @@ run_scan(){ } assert(check == 0); + if(g_paramters[P_RESET].value == 1) + g_paramters[P_RESET].value = 2; + for(int i = 0; i<g_table->getNoOfColumns(); i++){ pOp->getValue(i); } - +execute: int rows = 0; check = pTrans->execute(NoCommit); assert(check == 0); @@ -333,19 +358,30 @@ run_scan(){ return -1; } assert(check == 1); - g_info << "Found " << rows << " rows" << endl; - - pTrans->close(); - + if(g_paramters[P_RESET].value == 0) + { + pTrans->close(); + pTrans = 0; + } stop = NdbTick_CurrentMillisecond(); + int time_passed= (int)(stop - start1); - g_err.println("Time: %d ms = %u rows/sec", time_passed, - (1000*tot)/time_passed); + sample_rows += rows; sum_time+= time_passed; + tot_rows+= rows; + + if(sample_rows >= tot) + { + int sample_time = (int)(stop - sample_start); + g_info << "Found " << sample_rows << " rows" << endl; + g_err.println("Time: %d ms = %u rows/sec", sample_time, + (1000*sample_rows)/sample_time); + sample_rows = 0; + sample_start = stop; + } } - sum_time= sum_time / iter; - g_err.println("Avg time: %d ms = %u rows/sec", sum_time, - (1000*tot)/sum_time); + g_err.println("Avg time: %d ms = %u rows/sec", sum_time/tot_rows, + (1000*tot_rows)/sum_time); return 0; } diff --git a/ndb/test/ndbapi/testSystemRestart.cpp b/ndb/test/ndbapi/testSystemRestart.cpp index f8f2b84acc4..35016896495 100644 --- a/ndb/test/ndbapi/testSystemRestart.cpp +++ b/ndb/test/ndbapi/testSystemRestart.cpp @@ -452,7 +452,7 @@ int runSystemRestart3(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -561,7 +561,7 @@ int runSystemRestart4(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -691,7 +691,7 @@ int runSystemRestart5(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -821,7 +821,7 @@ int runSystemRestart6(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -877,7 +877,7 @@ int runSystemRestart7(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); int a_nodeIds[64]; @@ -952,7 +952,7 @@ int runSystemRestart8(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); int a_nodeIds[64]; diff --git a/ndb/test/odbc/tpcb/Makefile b/ndb/test/odbc/tpcb/Makefile deleted file mode 100644 index 8ab429c8ea1..00000000000 --- a/ndb/test/odbc/tpcb/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -include .defs.mk - -TYPE = * - -BIN_TARGET = tpcb - -SOURCES = ttTime.c tpcb.cpp - -CCFLAGS_LOC += \ - -I$(NDB_TOP)/include \ - -I$(NDB_TOP)/include/ndbapi \ - -I$(NDB_TOP)/include/portlib \ - -I$(NDB_TOP)/include/util \ - -I$(NDB_TOP)/test/include \ - -I/usr/local/include - -CCFLAGS_WARNINGS += -Wno-unused -Wno-sign-compare -Wformat - -CCFLAGS_TOP += -DndbODBC - -BIN_TARGET_LIBS = NDB_API_pic NDB_ODBC_pic NDBT - -ifeq ($(NDB_OS),SOLARIS) -BIN_TARGET_LIBS += dmallocthcxx -CCFLAGS_TOP += -DDMALLOC -endif - -include $(NDB_TOP)/Epilogue.mk - -$(BIN_DIR)$(BIN_TARGET): Makefile diff --git a/ndb/test/odbc/tpcb/Makefile_mysql b/ndb/test/odbc/tpcb/Makefile_mysql deleted file mode 100644 index 4e1b9a25fe2..00000000000 --- a/ndb/test/odbc/tpcb/Makefile_mysql +++ /dev/null @@ -1,33 +0,0 @@ -include $(NDB_TOP)/Defs.mk - -TYPE = odbcclient - -BIN_TARGET = tpcb - -SOURCES = ttTime.c tpcb.cpp - -CCFLAGS_LOC += -I/usr/local/include \ - -I$(NDB_TOP)/test/include \ - -I$(NDB_TOP)/include \ - -I$(NDB_TOP)/include/util \ - -I$(NDB_TOP)/src/client/odbc/common - - - - -#CCFLAGS_WARNINGS += -Wno-unused - -LIBS_LOC += -L/usr/local/lib -BIN_TARGET_LIBS_DIRS += /usr/local/lib -BIN_TARGET_LIBS += odbc odbcinst - -#LIBS_SPEC += -pg -# -lNDBT \ -# -lodbc \ -# -lodbcinst \ -# -lportlib - - - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/test/odbc/tpcb/Makefile_ndb b/ndb/test/odbc/tpcb/Makefile_ndb deleted file mode 100644 index 85960413ef0..00000000000 --- a/ndb/test/odbc/tpcb/Makefile_ndb +++ /dev/null @@ -1,30 +0,0 @@ -include $(NDB_TOP)/Defs.mk - -TYPE = * - -BIN_TARGET = tpcb - -SOURCES = ttTime.c tpcb.cpp - -CCFLAGS_LOC += \ - -I$(NDB_TOP)/include \ - -I$(NDB_TOP)/include/ndbapi \ - -I$(NDB_TOP)/include/portlib \ - -I$(NDB_TOP)/include/util \ - -I$(NDB_TOP)/test/include \ - -I/usr/local/include - -CCFLAGS_WARNINGS += -Wno-unused -Wno-sign-compare -Wformat - -CCFLAGS_TOP += -DndbODBC - -BIN_TARGET_LIBS = NDB_API_pic NDB_ODBC_pic NDBT - -ifeq ($(NDB_OS),SOLARIS) -BIN_TARGET_LIBS += dmallocthcxx -CCFLAGS_TOP += -DDMALLOC -endif - -include $(NDB_TOP)/Epilogue.mk - -$(BIN_DIR)$(BIN_TARGET): Makefile diff --git a/ndb/test/odbc/tpcb/readme.txt b/ndb/test/odbc/tpcb/readme.txt deleted file mode 100644 index 008cafb9d2f..00000000000 --- a/ndb/test/odbc/tpcb/readme.txt +++ /dev/null @@ -1,15 +0,0 @@ -'tpcb' requires an .odbc.ini file in -/etc/ -or in -/home/user/ - -The .odbc.ini file must contain a DSN entry called ndb: - -#--------- .odbc.ini example -------------------- - -[ndb] -Driver = /path_to_installation/lib/libNDB_ODBC.so - -#--------- End of example ----------------------- - - diff --git a/ndb/test/odbc/tpcb/timesten.h b/ndb/test/odbc/tpcb/timesten.h deleted file mode 100644 index 45579f9d277..00000000000 --- a/ndb/test/odbc/tpcb/timesten.h +++ /dev/null @@ -1,188 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -/* - * $Revision: 1.1 $ - * (c) Copyright 1997-2003, TimesTen, Inc. - * All rights reserved. - */ - -#ifndef TIMESTEN_H_INCLUDED -#define TIMESTEN_H_INCLUDED - -#ifdef _WIN32 -#include <windows.h> -#endif - -#include <sql.h> -#include <sqltypes.h> -#include <sqlext.h> -/* - * TimesTen extension to application data types; only usable - * when application directly linked to the TimesTen driver. - */ -#define SQL_C_ADDR 100 - -#ifndef SQL_C_SBIGINT -#if (ODBCVER < 0x0300) -#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) -#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) -#endif -#endif - -#define SQL_C_BIGINT SQL_C_SBIGINT - -#if (ODBCVER < 0x0300) -#ifdef _WIN32 -typedef __int64 SQLBIGINT; -/* On Unix platforms SQLBIGINT is defined in odbcinclude directory*/ -#endif -#endif - -#define BIGINT SQLBIGINT - -#ifdef _WIN32 -#define UBIGINT unsigned __int64 -#else -#define UBIGINT unsigned long long -#endif - - -#define SQL_WCHAR (-8) -#define SQL_WVARCHAR (-9) -#define SQL_WLONGVARCHAR (-10) -#define SQL_C_WCHAR SQL_WCHAR - -/* SQLGetInfo() InfoTypes */ -#define SQL_CONVERT_WCHAR 122 -#define SQL_CONVERT_WLONGVARCHAR 125 -#define SQL_CONVERT_WVARCHAR 126 - -/* TimesTen specific SQLGetInfo types */ -#define TT_REPLICATION_INVALID (SQL_INFO_DRIVER_START + 2000) - -/* SQLGetInfo() return value bitmasks */ -#ifndef SQL_CVT_WCHAR -/* -** These definitions differ from Microsoft in that they are not -** specified as long (e.g. 0x00200000L), hence they are protected -** by the ifndef above. -*/ -#define SQL_CVT_WCHAR 0x00200000 -#define SQL_CVT_WLONGVARCHAR 0x00400000 -#define SQL_CVT_WVARCHAR 0x00800000 -#endif - -/* -** The Microsoft Driver Manager SQLBindParameter() will not pass SQL_WCHAR -** through. Use this hack to get around it. -*/ -#define SQL_WCHAR_DM_SQLBINDPARAMETER_BYPASS -888 - -/* This is an extension to ODBC's isolation levels. It reflects an - * earlier implementation of read-committed that released locks on - * next fetch, rather than releasing locks before returning value to - * application. */ -#define SQL_TXN_CURSOR_STABILITY 0x00001000 -#define SQL_TXN_NOBLOCK_DELETE 0x00002000 - -/* TimesTen-specific connection option */ -#define TT_PREFETCH_CLOSE 10001 -#define TT_PREFETCH_CLOSE_OFF 0 -#define TT_PREFETCH_CLOSE_ON 1 - -/* Adding a new sql connection option */ -#define TT_PREFETCH_COUNT 10003 -#define TT_PREFETCH_COUNT_MAX 128 - -/* - * Platform specific data types for integers that scale - * with pointer size - */ - -#ifdef _IA64_ -typedef signed __int64 tt_ptrint; -typedef unsigned __int64 tt_uptrint; -#else -#ifdef _WIN32 -typedef signed long tt_ptrint; -typedef unsigned long tt_uptrint; -#else -typedef signed long tt_ptrint; -typedef unsigned long tt_uptrint; -#endif -#endif - -#ifdef _WIN32 -typedef signed __int64 tt_int8; -typedef unsigned __int64 tt_uint8; -#else -typedef signed long long tt_int8; -typedef unsigned long long tt_uint8; -#endif - -/* printf formats for pointer-sized integers */ -#ifdef _IA64_ /* 64-bit NT */ -#define PTRINT_FMT "I64d" -#define UPTRINT_FMT "I64u" -#define xPTRINT_FMT "I64x" -#define XPTRINT_FMT "I64X" -#else -#ifdef _WIN32 /* 32-bit NT */ -#define PTRINT_FMT "ld" -#define UPTRINT_FMT "lu" -#define xPTRINT_FMT "lx" -#define XPTRINT_FMT "lX" -#else /* 32 and 64-bit UNIX */ -#define PTRINT_FMT "ld" -#define UPTRINT_FMT "lu" -#define xPTRINT_FMT "lx" -#define XPTRINT_FMT "lX" -#endif -#endif - -/* printf formats for 8-byte integers */ -#ifndef INT8_FMT_DEFINED -#ifdef _WIN32 /* 32 and 64-bit NT */ -#define INT8_FMT "I64d" -#define UINT8_FMT "I64u" -#define xINT8_FMT "I64x" -#define XINT8_FMT "I64X" -#else /* 32 and 64-bit UNIX */ -#define INT8_FMT "lld" -#define UINT8_FMT "llu" -#define xINT8_FMT "llx" -#define XINT8_FMT "llX" -#endif -#define INT8_FMT_DEFINED 1 -#endif - -/* The following types are defined in the newer odbc include files - from Microsoft -*/ -#if defined (_WIN32) && !defined (_IA64_) -#ifndef SQLROWSETSIZE -#define SQLROWSETSIZE SQLUINTEGER -#define SQLLEN SQLINTEGER -#define SQLROWOFFSET SQLINTEGER -#define SQLROWCOUNT SQLUINTEGER -#define SQLULEN SQLUINTEGER -#define SQLSETPOSIROW SQLUSMALLINT -#endif -#endif - - -#endif diff --git a/ndb/test/odbc/tpcb/tpcb.cpp b/ndb/test/odbc/tpcb/tpcb.cpp deleted file mode 100644 index 60d746e7844..00000000000 --- a/ndb/test/odbc/tpcb/tpcb.cpp +++ /dev/null @@ -1,1415 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -static const volatile char cvsid[] = "$Id: tpcb.cpp,v 1.4 2003/09/26 09:04:34 johan Exp $"; -/* - * $Revision: 1.4 $ - * (c) Copyright 1996-2003, TimesTen, Inc. - * All rights reserved. - */ - -/* This source is best displayed with a tabstop of 4 */ - -#define NDB - -//#define MYSQL - -#ifdef WIN32 -#include <windows.h> -#include "ttRand.h" -#else -#if !defined NDB && !defined MYSQL -#include <sqlunix.h> -#endif -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#ifdef SB_P_OS_CHORUS -#include "ttRand.h" -#endif -#endif - -#include <math.h> -#include <time.h> -#include <sql.h> -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> - -#if !defined NDB && !defined MYSQL -#include "ttTime.h" -#include "utils.h" -#include "tt_version.h" -#include "timesten.h" -#endif - -#if defined NDB || defined MYSQL -#include <NdbOut.hpp> -#include <string.h> - -#include <sqlext.h> -#include <sql.h> -extern "C" { -#include "ttTime.h" -#include "timesten.h" - void ttGetWallClockTime(ttWallClockTime* timeP); - void ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP); - void ttGetThreadTimes(ttThreadTimes * endRes); - void ttCalcElapsedThreadTimes(ttThreadTimes* startRes, - ttThreadTimes * endRes, - double * kernel, - double * user); -} - -#define app_exit exit -#define status_msg0 ndbout_c -#define status_msg1 ndbout_c -#define status_msg2 ndbout_c -#define err_msg0 ndbout_c -#define err_msg1 ndbout_c -#define err_msg3 ndbout_c -#define out_msg0 ndbout_c -#define out_msg1 ndbout_c -#define out_msg3 ndbout_c -#define CONN_STR_LEN 255 -#define DBMS_TIMESTEN 1 -#define DBMS_MSSQL 2 -#define DBMS_UNKNOWN 3 -#define ABORT_DISCONNECT_EXIT 1 -#define NO_EXIT 0 -#define ERROR_EXIT 1 -#define DISCONNECT_EXIT 2 -#endif - -#define VERBOSE_NOMSGS 0 -/* this value is used for results (and err msgs) only */ -#define VERBOSE_RESULTS 1 -/* this value is the default for the cmdline demo */ -#define VERBOSE_DFLT 2 -#define VERBOSE_ALL 3 - -#ifdef MYSQL -#define DSNNAME "DSN=myodbc3" -#elif defined NDB -#define DSNNAME "DSN=ndb" -#else -#define DSNNAME "DSN=" -#endif - -/* number of branches, tellers, and accounts */ - -#define NumBranches 1 -#define TellersPerBranch 10 -#define AccountsPerBranch 10000 - -/* number of transactions to execute */ - -#define NumXacts 25000 - -/* starting seed value for the random number generator */ - -#define SeedVal 84773 - -/* for MS SQL, the drop, create and use database statements */ - -#define DatabaseDropStmt "drop database tpcbDB;" -#ifdef MYSQL -#define DatabaseCreateStmt "create database tpcbDB;" -#else -#define DatabaseCreateStmt "create database tpcbDB ON DEFAULT = %d;" -#endif -#define DatabaseUseStmt "use tpcbDB;" - -/* - * Specifications of table columns. - * Fillers of 80, 80, 84, and 24 bytes, respectively, are used - * to ensure that rows are the width required by the benchmark. - * - * Note: The TimesTen and MS SQL CREATE TABLE statements for the - * accounts, tellers and branches tables are different. - * - */ - -#define TuplesPerPage 256 - - -#ifdef MYSQL - -#define AccountCrTblStmt "create table accounts \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80));" - -#define TellerCrTblStmt "create table tellers \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80));" - -#define BranchCrTblStmt "create table branches \ -(number integer not null primary key, \ -balance float not null, \ -filler char(84));" - -#endif - - -#ifdef NDB -#define AccountCrTblStmt "create table accounts \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80)) nologging" - -#define TellerCrTblStmt "create table tellers \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80)) nologging" - -#define BranchCrTblStmt "create table branches \ -(number integer not null primary key, \ -balance float not null, \ -filler char(84)) nologging" -#endif - -#ifdef NDB - -#define HistoryCrTblStmt "create table History \ -(tellernum integer not null, \ -branchnum integer not null, \ -accountnum integer not null, \ -delta float not null, \ -createtime integer not null, \ -filler char(24), \ -primary key (tellernum, branchnum, accountnum, delta, createtime)) nologging" - -#else - -#ifdef MYSQL - -#define HistoryCrTblStmt "create table History \ -(tellernum integer not null, \ -branchnum integer not null, \ -accountnum integer not null, \ -delta float(53) not null, \ -createtime integer not null, \ -filler char(24))" -#endif - -#define HistoryCrTblStmt "create table History \ -(tellernum integer not null, \ -branchnum integer not null, \ -accountnum integer not null, \ -delta float(53) not null, \ -createtime integer not null, \ -filler char(24));" -#endif - -#define TTAccountCrTblStmt "create table accounts \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float(53) not null, \ -filler char(80)) unique hash on (number) pages = %" PTRINT_FMT ";" - -#define TTTellerCrTblStmt "create table tellers \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float(53) not null, \ -filler char(80)) unique hash on (number) pages = %" PTRINT_FMT ";" - -#define TTBranchCrTblStmt "create table branches \ -(number integer not null primary key, \ -balance float(53) not null, \ -filler char(84)) unique hash on (number) pages = %" PTRINT_FMT ";" - - -/* Insertion statements used to populate the tables */ - -#define NumInsStmts 3 -char* insStmt[NumInsStmts] = { - "insert into branches values (?, 0.0, NULL)", - "insert into tellers values (?, ?, 0.0, NULL)", - "insert into accounts values (?, ?, 0.0, NULL)" -}; - -/* Transaction statements used to update the tables */ - -#define NumXactStmts 5 - -#ifdef NDB -char* tpcbXactStmt[NumXactStmts] = { - "update accounts \ -set balance = balance + ? \ -where number = ?", - - "select balance \ -from accounts \ -where number = ?", - - "update tellers \ -set balance = balance + ? \ -where number = ?", - - "update branches \ -set balance = balance + ? \ -where number = ?", - - "insert into History(tellernum, branchnum, \ -accountnum, delta, createtime, filler) \ -values (?, ?, ?, ?, ?, NULL)" -}; - -#else -char* tpcbXactStmt[NumXactStmts] = { - "update accounts \ -set balance = balance + ? \ -where number = ?;", - - "select balance \ -from accounts \ -where number = ?;", - - "update tellers \ -set balance = balance + ? \ -where number = ?;", - - "update branches \ -set balance = balance + ? \ -where number = ?;", - - "insert into History \ -values (?, ?, ?, ?, ?, NULL);" -}; - - -#endif - -/* Global parameters and flags (typically set by parse_args()) */ - -int tabFlag = 0; /* Default is NOT tab output mode */ -char szConnStrIn[CONN_STR_LEN]; /* ODBC Connection String */ -int printXactTimes = 0; /* Transaction statistics - * gathering flag */ -char statFile[FILENAME_MAX]; /* Transaction statistics filename */ -int scaleFactor = 2; /* Default TPS scale factor */ -int numBranchTups; /* Number of branches */ -int numTellerTups; /* Number of tellers */ -int numAccountTups; /* Number of accounts */ -int numNonLocalAccountTups; /* Number of local accounts */ -int numXacts = NumXacts; /* Default number of transactions */ -int verbose = VERBOSE_DFLT; /* Verbose level */ -FILE *statusfp; /* File for status messages */ - - - -int DBMSType; /* DBMS type (DBMS_TIMESTEN, DBMS_MSSQL...) */ - - -SQLHENV henv; /* Environment handle */ - - - - - - - -void handle_errors( SQLHDBC hdbc, SQLHSTMT hstmt, int errcode, int action, char * msg, - char * file, int line) { - - if (errcode == SQL_SUCCESS) - return; - - if(errcode == SQL_ERROR) { - int ret; - long diagCount=0; - short length=0; - SQLCHAR state[10] = ""; - SQLCHAR message[200] = ""; - long native = 0; - if(hstmt != 0) { - ret = SQLGetDiagField(SQL_HANDLE_STMT, hstmt, 0, SQL_DIAG_NUMBER, &diagCount, SQL_IS_INTEGER, 0); - - for(long i = 0; i < diagCount; i++) { - ret = SQLGetDiagRec(SQL_HANDLE_STMT, hstmt, i, (SQLCHAR*)state, &native, (SQLCHAR*)message, 200, &length); - ndbout_c("GetDiagRec: Message : %s ", message); - } - } - } - - if(errcode != SQL_SUCCESS) { - ndbout_c("Message: %s", msg); - switch(errcode) { - case SQL_SUCCESS_WITH_INFO: - ndbout_c("SQL_SUCCESS_WITH_INFO"); - break; - case SQL_STILL_EXECUTING: - ndbout_c("SQL_STILL_EXECUTING"); - break; - case SQL_ERROR: - ndbout_c("SQL_ERROR"); - break; - case SQL_INVALID_HANDLE: - ndbout_c("SQL_INVALID_HANDLE"); - break; - default: - ndbout_c("Some other error"); - } - exit(1); - } - - -} - - - - - -/********************************************************************* - * FUNCTION: usage - * - * DESCRIPTION: This function prints a usage message describing - * the command line options of the program. - * - * PARAMETERS: char* prog full program path name - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -static void usage(char *prog) -{ - char *progname; - - /* Get the name of the program (sans path). */ - -#ifdef WIN32 - progname = strrchr(prog, '\\'); -#else - progname = strrchr(prog, '/'); -#endif - if (progname == 0) - progname = prog; - else - ++progname; - - /* Print the usage message */ - - fprintf(stderr, - "Usage:\t%s [-h] [-help] [-V] [-connStr <string>] [-v <level>]\n" - "\t\t[-xact <xacts>] [-scale <scale>] [-tabs] [-s <statfile>]\n\n" - " -h Prints this message and exits.\n" - " -help Same as -h.\n" - " -V Prints version number and exits.\n" - " -connStr <string> Specifies an ODBC connection string to replace the\n" - " default DSN for the program. The default is\n" - " \"DSN=TpcbData<version>;OverWrite=1\".\n" - " -v <level> Verbose level\n" - " 0 = errors only\n" - " 1 = results only\n" - " 2 = results and some status messages (default)\n" - " 3 = all messages\n" - " -xact <xacts> Specifies the number of transactions to be run\n" - " The default is 25000 transactions.\n" - " -scale <scale> Specifies a scale factor which determines the\n" - " number of branches (scale), tellers (scale x 10),\n" - " accounts (scale x 10000) and non-local accounts\n" - " ((scale-1) x 10000. The default scale factor is 2.\n" - " -tabs Specifies that the output be a tab-separated\n" - " format suitable for import into a spreadsheet.\n" - " Results only go to stdout; status and other\n" - " messages go to stderr.\n" - " -s <statfile> Prints individual transaction times to <statfile>.\n", - progname); -} - -/********************************************************************* - * - * FUNCTION: parse_args - * - * DESCRIPTION: This function parses the command line arguments - * passed to main(), setting the appropriate global - * variables and issuing a usage message for - * invalid arguments. - * - * PARAMETERS: int argc # of arguments from main() - * char *argv[] arguments from main() - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -parse_args(int argc, char *argv[]) -{ - int i = 1; - - *szConnStrIn = 0; - - while (i < argc) { - - if ( !strcmp(argv[i], "-h") || !strcmp(argv[i], "-help") ) { - usage(argv[0]); - app_exit(0); - } - /* - if (!strcmp(argv[i], "-V")) { - printf("%s\n", TTVERSION_STRING); - app_exit(0); - } - */ - if (strcmp(argv[i], "-s") == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - if (sscanf(argv[i+1], "%s", statFile) == 0) { - usage(argv[0]); - app_exit(1); - } - printXactTimes = 1; - i += 2; - } - else if (!strcmp(argv[i], "-connStr")) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - strcpy(szConnStrIn, argv[i+1]); - i += 2; - continue; - } - else if (strcmp("-v", argv[i]) == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - if (sscanf(argv[i+1], "%d", &verbose) == -1 || - verbose < 0 || verbose > 3) { - fprintf(stderr, "-v flag requires an integer parameter (0-3)\n"); - usage(argv[0]); - app_exit(1); - } - i += 2; - } - else if (strcmp("-xact",argv[i]) == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - - if (sscanf(argv[i+1], "%" PTRINT_FMT, &numXacts) == -1 || numXacts < 0) { - fprintf(stderr, "-xact flag requires a non-negative integer argument\n"); - usage(argv[0]); - app_exit(1); - } - - i += 2; - } - else if (strcmp("-scale",argv[i]) == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - if (sscanf(argv[i+1], "%d", &scaleFactor) == -1 || scaleFactor < 1) { - fprintf(stderr, "-scale flag requires an integer argument >= 1\n"); - usage(argv[0]); - app_exit(1); - } - /* Calculate tuple sizes */ - numBranchTups = NumBranches * scaleFactor; - numTellerTups = TellersPerBranch * scaleFactor; - numAccountTups = AccountsPerBranch * scaleFactor; - numNonLocalAccountTups = AccountsPerBranch * (scaleFactor-1); - i += 2; - } - else if (strcmp("-tabs",argv[i]) == 0) { - tabFlag = 1; - statusfp = stderr; - i += 1; - } - else { - usage(argv[0]); - app_exit(1); - } - } -} - -/********************************************************************* - * - * FUNCTION: doImmed - * - * DESCRIPTION: This function executes and frees the specified - * statement. It is used as a direct means to - * create the tables used by this benchmark, - * - * PARAMETERS: SQLHDBC hdbc SQL Connection handle - * SQLHSTMT hs SQL Statement handle - * char* cmd SQL Statement text - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -doImmed(SQLHDBC hdbc, SQLHSTMT hs, char* cmd) -{ - SQLRETURN rc; - - /* Execute the command */ - - rc = SQLExecDirect(hs, (SQLCHAR *) cmd, SQL_NTS); - handle_errors(hdbc, hs, rc, ABORT_DISCONNECT_EXIT, - "Error executing statement", __FILE__, __LINE__); - - /* Close associated cursor and drop pending results */ - - rc = SQLFreeStmt(hs, SQL_CLOSE); - handle_errors(hdbc, hs, rc, ABORT_DISCONNECT_EXIT, - "closing statement handle", - __FILE__, __LINE__); - -} - - -/********************************************************************* - * - * FUNCTION: main - * - * DESCRIPTION: This is the main function of the tpcb benchmark. - * It connects to an ODBC data source, creates and - * populates tables, updates the tables in a user- - * specified number of transactions and reports on - * on the transaction times. - * - * PARAMETERS: int argc # of command line arguments - * char *argv[] command line arguments - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -int -main(int argc, char *argv[]) -{ - - /* variables used for setting up the tables */ - - char cmdStr[1024]; - char errstr[4096]; - - /* variables used during transactions */ - - int accountNum; - int tellerNum; - int branchNum; - int timeStamp; - double delta; - unsigned int lrand; - unsigned short *srands, localLimit; - int lp64; - - /* variables used for timing and statistics */ - - int warmup; - double kernel, user, real; - ttThreadTimes startRes, endRes; - ttWallClockTime startT, endT; - ttWallClockTime** rtStart; - ttWallClockTime** rtEnd; - double** resTime; - double maxTime, totTime; - int i; - int j; - int numLocalXacts=0, numRemoteXacts=0; - - /* variables for ODBC */ - - SQLHDBC hdbc; - SQLHSTMT hstmt; - SQLHSTMT txstmt[NumXactStmts]; - SQLRETURN rc; - char DBMSName[32]; - char DBMSVersion[32]; - int databaseSize; - - int fThreadTime = 1; - -#ifdef WIN32 - OSVERSIONINFO sysInfo; - - sysInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx (&sysInfo); - - /* GetThreadTimes is not supported on 95/98. Hence, - we do not support Resource/User/System times */ - if (sysInfo.dwPlatformId != VER_PLATFORM_WIN32_NT) - fThreadTime = 0; -#endif -#if defined(TTCLIENTSERVER) && defined(__hpux) && !defined(__LP64__) - /* HP requires this for C main programs that call aC++ shared libs */ - _main(); -#endif /* hpux32 */ - - /* Set up default signal handlers */ - -#ifndef NDB - /* StopRequestClear(); - if (HandleSignals() != 0) { - err_msg0("Unable to set signal handlers\n"); - return 1; - } - */ -#endif - /* set IO mode for demo */ - /* set_io_mode(); */ - - /* initialize the file for status messages */ - statusfp = stdout; - - /* set variable for 8-byte longs */ - lp64 = (sizeof(lrand) == 8); - - /* set the default tuple sizes */ - - numBranchTups = NumBranches * scaleFactor; - numTellerTups = TellersPerBranch * scaleFactor; - numAccountTups = AccountsPerBranch * scaleFactor; - numNonLocalAccountTups = AccountsPerBranch * (scaleFactor-1); - - /* parse the command arguments */ - parse_args(argc, argv); - - /* allocate the transaction-based variables */ - - rtStart = (ttWallClockTime**) malloc(numXacts * sizeof(ttWallClockTime*)); - if (!rtStart) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - for (i = 0; i < numXacts; i++) { - rtStart[i] = (ttWallClockTime*) malloc(sizeof(ttWallClockTime)); - if (!rtStart[i]) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - } - - rtEnd = (ttWallClockTime**) malloc(numXacts * sizeof(ttWallClockTime*)); - if (!rtEnd) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - for (i = 0; i < numXacts; i++) { - rtEnd[i] = (ttWallClockTime*) malloc(sizeof(ttWallClockTime)); - if (!rtEnd[i]) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - } - - resTime = (double**) malloc(numXacts * sizeof(double*)); - if (!resTime) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - for (i = 0; i < numXacts; i++) { - resTime[i] = (double*) malloc(sizeof(double)); - if (!resTime[i]) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - } - - /* ODBC initialization */ - - rc = SQLAllocEnv(&henv); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - /* error occurred -- don't bother calling handle_errors, since handle - * is not valid so SQLError won't work */ - err_msg3("ERROR in %s, line %d: %s\n", - __FILE__, __LINE__, "allocating an environment handle"); - app_exit(1); - } - SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER); - - /* call this in case of warning */ - handle_errors(NULL, NULL, rc, NO_EXIT, - "allocating execution environment", - __FILE__, __LINE__); - - rc = SQLAllocConnect(henv, &hdbc); - handle_errors(NULL, NULL, rc, ERROR_EXIT, - "allocating connection handle", - __FILE__, __LINE__); - - /* Connect to data store */ - - status_msg0("Connecting to the data source...\n"); - - /* Set up the connection options if not specified on the command line - * (default to TimesTen settings). - */ - - if ( !*szConnStrIn ) { - /* Running the benchmark with a scale factor creates (scale) branches, - * (scale x 10) tellers, (scale x 10000) accounts and ((scale-1) x 10000) - * non-local accounts. The size of the table rows are branches (141) - * tellers (141) and accounts (141). Therefore the data size requirements - * of this benchmark is: - * size ~= 141 * ((scale * 20011) - 10000) (bytes) - * - * Multiply data size by 20% to account for additional DB overhead (e.g. - * indexes), and round up the nearest 10Mb for safety. - */ - - int est_size = (int) (3.6 * scaleFactor + 10.0); - est_size = est_size - (est_size % 10); - - sprintf(szConnStrIn,"OverWrite=1;PermSize=%d;%s", - est_size, DSNNAME); - status_msg0("Connecting to the data source... %s \n", szConnStrIn); - } - - rc = SQLDriverConnect(hdbc, NULL, (SQLCHAR *) szConnStrIn, SQL_NTS, - NULL, 0, NULL, - SQL_DRIVER_NOPROMPT); - - status_msg0("Connected to the data source...\n"); - sprintf(errstr, "connecting to driver (connect string %s)\n", - szConnStrIn); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - errstr, __FILE__, __LINE__); - - /* Turn auto-commit off */ - - rc = SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF); - handle_errors(hdbc, NULL, rc, DISCONNECT_EXIT, - "switching off the AUTO_COMMIT option", - __FILE__, __LINE__); - - /* Allocate a statement handle */ - - rc = SQLAllocStmt(hdbc, &hstmt); - handle_errors(hdbc, NULL, rc, DISCONNECT_EXIT, - "allocating a statement handle", - __FILE__, __LINE__); - - /* (Implicit) Transaction begin */ - - /* Determine the DBMS Type*/ - - DBMSName[0] = '\0'; - rc = SQLGetInfo(hdbc, SQL_DBMS_NAME, (PTR) &DBMSName, - sizeof(DBMSName), NULL); - rc = SQLGetInfo(hdbc, SQL_DRIVER_VER, (PTR) &DBMSVersion, - sizeof(DBMSVersion), NULL); - - if (strcmp(DBMSName, "TimesTen") == 0) - DBMSType = DBMS_TIMESTEN; - else if (strcmp(DBMSName, "Microsoft SQL Server") == 0) - DBMSType = DBMS_MSSQL; - else DBMSType = DBMS_UNKNOWN; - - /* if not TimesTen: delete (if it exists), create & use the new database */ - - if (DBMSType != DBMS_TIMESTEN) { - status_msg0("Deleting the database...\n"); - rc = SQLExecDirect(hstmt, (SQLCHAR *) DatabaseDropStmt, SQL_NTS); - - /* estimate database size, size = data space + log space - * data space = (#tuples)/(tuples per page) * 2K bytes/page - * tuples per page = useable page size / row size (no index) = 2016/(96+2) - * log space = #transactions * average log size for the program transaction mix - * database size is in MB - */ - - databaseSize = (int) ceil((((numBranchTups + numTellerTups + numAccountTups)/ - (2016/98)) * 2048 + (numXacts * 600)) / 1000000.0); - - status_msg1("Creating the database (%dMB)...\n", databaseSize); -#ifndef NDB - sprintf(cmdStr, DatabaseCreateStmt, databaseSize); - doImmed(hdbc, hstmt, cmdStr); - strcpy(cmdStr, DatabaseUseStmt); - doImmed(hdbc, hstmt, cmdStr); -#endif - } - - status_msg2("Connected to '%s' version '%s'...\n", DBMSName, DBMSVersion); - - /* create branches table */ - status_msg0("Creating tasddbles...\n"); -#ifndef NDB - if (DBMSType == DBMS_TIMESTEN) - sprintf(cmdStr, TTBranchCrTblStmt, numBranchTups/TuplesPerPage + 1); - else -#endif - sprintf(cmdStr, BranchCrTblStmt); - doImmed(hdbc, hstmt, cmdStr); - - /* create tellers table */ -#ifndef NDB - if (DBMSType == DBMS_TIMESTEN) - sprintf(cmdStr, TTTellerCrTblStmt, numTellerTups/TuplesPerPage + 1); - - else -#endif - sprintf(cmdStr, TellerCrTblStmt); - doImmed(hdbc, hstmt, cmdStr); - - /* create accounts table */ -#ifndef NDB - if (DBMSType == DBMS_TIMESTEN) - sprintf(cmdStr, TTAccountCrTblStmt, numAccountTups/TuplesPerPage + 1); - else -#endif - sprintf(cmdStr, AccountCrTblStmt); - doImmed(hdbc, hstmt, cmdStr); - - /* create History table */ - - doImmed(hdbc, hstmt, HistoryCrTblStmt); - - /* lock the database during population */ -#ifndef NDB - if ( DBMSType == DBMS_TIMESTEN ) { - rc = SQLExecDirect(hstmt, (SQLCHAR *)"call ttlocklevel('DS')", SQL_NTS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "specifying dbs lock usage", - __FILE__, __LINE__); - /* make sure dbs lock take effect in next transaction */ - rc = SQLTransact(henv,hdbc,SQL_COMMIT); - if ( rc != SQL_SUCCESS) { - handle_errors(hdbc, SQL_NULL_HSTMT, rc, ERROR_EXIT, - "committing transaction", - __FILE__, __LINE__); - } - } -#endif - /* populate branches table */ - - - rc = SQLPrepare(hstmt, (SQLCHAR *) insStmt[0], SQL_NTS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "preparing statement", - __FILE__, __LINE__); - - rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 10, 0, &branchNum, sizeof branchNum, NULL); - - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - - status_msg1("Populating branches table (%" PTRINT_FMT " rows)...\n", - numBranchTups); - - - for (i=0; i<numBranchTups; i++) { - branchNum = i; - rc = SQLExecute(hstmt); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "Error executing statement", - __FILE__, __LINE__); - } - - /* Reset all bind-parameters for the statement handle. */ - rc = SQLFreeStmt(hstmt, SQL_RESET_PARAMS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "resetting parms on statement handle", - __FILE__, __LINE__); - - /* populate tellers table */ - - status_msg1("Populating tellers table (%" PTRINT_FMT " rows)...\n", - numTellerTups); - - - rc = SQLPrepare(hstmt, (SQLCHAR *) insStmt[1], SQL_NTS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "preparing statement", - __FILE__, __LINE__); - - rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, - 10, 0, &tellerNum, sizeof tellerNum, NULL); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, - 10, 0, &branchNum, sizeof branchNum, NULL); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - for (i=0; i<numTellerTups; i++) { - tellerNum = i; - branchNum = i/TellersPerBranch; - rc = SQLExecute(hstmt); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "Error executing statement", - __FILE__, __LINE__); - } - - /* Reset all bind-parameters for the statement handle. */ - - rc = SQLFreeStmt(hstmt, SQL_RESET_PARAMS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "resetting parms on statement handle", - __FILE__, __LINE__); - - /* populate accounts table */ - - status_msg1("Populating accounts table (%" PTRINT_FMT " rows)...\n", - numAccountTups); - - rc = SQLPrepare(hstmt, (SQLCHAR *) insStmt[2], SQL_NTS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "preparing statement", - __FILE__, __LINE__); - - rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, - 10, 0, &accountNum, sizeof accountNum, NULL); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, - 10, 0, &branchNum, sizeof branchNum, NULL); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - for (i=0; i<numAccountTups; i++) { - accountNum = i; - branchNum = i/AccountsPerBranch; - rc = SQLExecute(hstmt); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "Error executing statement", - __FILE__, __LINE__); - } - status_msg0("Commit...\n"); - rc = SQLTransact(henv, hdbc, SQL_COMMIT); - status_msg0("Commit done...\n"); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "committing transaction", - __FILE__, __LINE__); - - /* compile SQL statements of transaction */ - - status_msg0("Compiling statements of transaction...\n"); - for (i=0; i<NumXactStmts; i++) { -#ifndef NDB - rc = SQLAllocStmt(hdbc, &txstmt[i]); - handle_errors(hdbc, NULL, rc, ABORT_DISCONNECT_EXIT, - "allocating a statement handle", - __FILE__, __LINE__); -#else - rc = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &txstmt[i]); - handle_errors(hdbc, NULL, rc, ABORT_DISCONNECT_EXIT, - "allocating a statement handle", - __FILE__, __LINE__); - -#endif - - rc = SQLPrepare(txstmt[i], (SQLCHAR *) tpcbXactStmt[i], SQL_NTS); - handle_errors(hdbc, txstmt[i], rc, ABORT_DISCONNECT_EXIT, - "preparing statement", - __FILE__, __LINE__); - } - - /* unuse dbs lock */ -#ifndef NDB - if ( DBMSType == DBMS_TIMESTEN ) { - rc = SQLExecDirect(hstmt, (SQLCHAR *)"call ttlocklevel('Row')", SQL_NTS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "specifying row lock usage", - __FILE__, __LINE__); - } -#endif - - /* commit transaction */ - - rc = SQLTransact(henv, hdbc, SQL_COMMIT); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "committing transaction", - __FILE__, __LINE__); - - - /* Initialize random seed and timers */ - - srand48(SeedVal); - localLimit = (unsigned short)((1<<16) * 0.85); - - /* Initialize parameter lists for each of the transactions */ - - rc = SQLBindParameter(txstmt[0], 1, SQL_PARAM_INPUT, SQL_C_DOUBLE, - SQL_DOUBLE, 15, 0, &delta, sizeof delta, NULL); - handle_errors(hdbc, txstmt[0], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[0], 2, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &accountNum, sizeof accountNum, - NULL); - handle_errors(hdbc, txstmt[0], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[1], 1, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &accountNum, sizeof accountNum, - NULL); - handle_errors(hdbc, txstmt[1], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[2], 1, SQL_PARAM_INPUT, SQL_C_DOUBLE, - SQL_DOUBLE, 15, 0, &delta, sizeof delta, NULL); - handle_errors(hdbc, txstmt[2], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[2], 2, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &tellerNum, sizeof tellerNum, - NULL); - handle_errors(hdbc, txstmt[2], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[3], 1, SQL_PARAM_INPUT, SQL_C_DOUBLE, - SQL_DOUBLE, 15, 0, &delta, sizeof delta, NULL); - handle_errors(hdbc, txstmt[3], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[3], 2, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &branchNum, sizeof branchNum, - NULL); - handle_errors(hdbc, txstmt[3], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[4], 1, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &tellerNum, sizeof tellerNum, - NULL); - handle_errors(hdbc, txstmt[4], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[4], 2, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &branchNum, sizeof branchNum, - NULL); - handle_errors(hdbc, txstmt[4], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[4], 3, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &accountNum, sizeof accountNum, - NULL); - handle_errors(hdbc, txstmt[4], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[4], 4, SQL_PARAM_INPUT, SQL_C_DOUBLE, - SQL_DOUBLE, 15, 0, &delta, sizeof delta, NULL); - handle_errors(hdbc, txstmt[4], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - rc = SQLBindParameter(txstmt[4], 5, SQL_PARAM_INPUT, SQL_C_SLONG, - SQL_INTEGER, 10, 0, &timeStamp, sizeof timeStamp, - NULL); - handle_errors(hdbc, txstmt[4], rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - /* Execute transaction loop. - * Do it twice, once briefly as a warm-up. */ - - - - for (warmup = 1; warmup >= 0; warmup--) { - - int max_i = (warmup ? numXacts/10 : numXacts); - - /* Execute tpcb transaction max_i times.*/ - - if (warmup) { - status_msg1("\nWarming up with %d tpcb transactions...\n", max_i); - } - else { - status_msg1("Executing and timing %d tpcb transactions...\n", max_i); - } - - ttGetWallClockTime(&startT); - ttGetThreadTimes(&startRes); - - for (i = 0; i < max_i; i++) { - - lrand = lrand48(); - srands = (unsigned short *)(&lrand); - if (lp64) srands += 2; /* skip high half -- all zero */ - - /* randomly choose a teller */ - - tellerNum = srands[0] % numTellerTups; - - /* compute branch */ - - branchNum = (tellerNum / TellersPerBranch); - - /* randomly choose an account */ - - if (srands[1] < localLimit || numBranchTups == 1) { - - /* choose account local to selected branch */ - - accountNum = branchNum * AccountsPerBranch + - (lrand48() % AccountsPerBranch); - - ++numLocalXacts; - - } - else { - /* choose account not local to selected branch */ - - /* first select account in range [0,numNonLocalAccountTups) */ - - accountNum = lrand48() % numNonLocalAccountTups; - - /* if branch number of selected account is at least as big - * as local branch number, then increment account number - * by AccountsPerBranch to skip over local accounts - */ - - if ((accountNum/AccountsPerBranch) >= branchNum) - accountNum += AccountsPerBranch; - - ++numRemoteXacts; - } - - /* select delta amount, -999,999 to +999,999 */ - - delta = ((lrand48() % 1999999) - 999999); - - - /* begin timing the "residence time" */ - - ttGetWallClockTime(rtStart[i]); - - for ( j = 0; j < NumXactStmts - 2; j++) { - rc = SQLExecute(txstmt[j]); - handle_errors(hdbc, txstmt[j], rc, ABORT_DISCONNECT_EXIT, - "Error executing statement1", - __FILE__, __LINE__); - - /* Close the handle after the SELECT statement - * (txstmt[1]) for non TimesTen DBMS' */ - - if ((DBMSType != DBMS_TIMESTEN) && (j == 1)) { - SQLFreeStmt(txstmt[1], SQL_CLOSE); - } - - - } - - /* note that time must be taken within the */ - timeStamp = time(NULL); - - rc = SQLExecute(txstmt[NumXactStmts - 1]); - handle_errors(hdbc, txstmt[NumXactStmts - 1], rc, - ABORT_DISCONNECT_EXIT, "Error executing statement2", - __FILE__, __LINE__); - - rc = SQLTransact(henv, hdbc, SQL_COMMIT); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "Error committing transaction", - __FILE__, __LINE__); - - ttGetWallClockTime(rtEnd[i]); - - } /* end fortransaction loop */ - - - - - ttGetThreadTimes(&endRes); - ttGetWallClockTime(&endT); - ttCalcElapsedThreadTimes(&startRes, &endRes, &kernel, &user); - ttCalcElapsedWallClockTime(&startT, &endT, &real); - - if (warmup) { - if (!tabFlag) { - if (verbose) { - if (fThreadTime) { - out_msg0(" time user system\n"); - - out_msg3("Warmup time (sec): %12.3f %12.3f %12.3f\n\n", - real/1000.0, user, kernel); - } else { - out_msg1("Warmup time (sec): %12.3f\n\n", real/1000.0); - } - } - } else { - if (verbose) { - if (fThreadTime) { - out_msg0("\ttime\tuser\tsystem\n"); - - out_msg3("Warmup time (sec):\t%12.3f\t%12.3f\t%12.3f\n", - real/1000.0, user, kernel); - } else { - out_msg1("Warmup time (sec):\t%12.3f\n", real/1000.0); - } - } - } - } - } - - status_msg0("\nExecution completed...\n"); - - /* Compute and report timing statistics */ - - maxTime = 0.0; - totTime = 0.0; - - for (i = 0; i < numXacts; i++) { - ttCalcElapsedWallClockTime(rtStart[i], rtEnd[i], resTime[i]); - totTime += *(resTime[i]); - - if (*(resTime[i]) > maxTime) maxTime = *(resTime[i]); - } - - if (!tabFlag) { - if (verbose) { - if (fThreadTime) { - out_msg0(" time user system\n"); - out_msg3("Total time (sec): %12.3f %12.3f %12.3f\n", - real/1000.0, user, kernel); - } else { - out_msg1("Total time (sec): %12.3f\n", real/1000.0); - } - } - - if (verbose) - out_msg1("\nAverage transaction time (msec):%12.3f\n", - totTime/numXacts); - if (verbose) - out_msg1("Maximum transaction time (msec):%12.3f\n", maxTime); - if (verbose) - out_msg1("\nLocal transactions: %7" PTRINT_FMT "\n", numLocalXacts); - if (verbose) - out_msg1("Remote transactions: %7" PTRINT_FMT "\n", numRemoteXacts); - - } else { - if (verbose) { - if (fThreadTime) { - out_msg0("\ttime\tuser\tsystem\n"); - out_msg3("Total time (sec):\t%12.3f\t%12.3f\t%12.3f\n", - real/1000.0, user, kernel); - } else { - out_msg1("Total time (sec):\t%12.3f\n", real/1000.0); - } - } - - if (verbose) - out_msg1("\nAverage transaction time (msec):\t%12.3f\n", - totTime/numXacts); - if (verbose) - out_msg1("Maximum transaction time (msec):\t%12.3f\n", maxTime); - if (verbose) - out_msg1("Local transactions:\t%7" PTRINT_FMT "\n", numLocalXacts); - - if (verbose) - out_msg1("Remote transactions:\t%7" PTRINT_FMT "\n", numRemoteXacts); - - - - } - - /* If the statfile option is selected, print each transaction's time */ - - if (printXactTimes) { - FILE * fp; - if ( (fp = fopen (statFile, "w")) == NULL ) { - err_msg1("Unable to open stat file %s for writing\n\n", statFile); - } else { - for (int i = 0; i < numXacts; i++) - fprintf(fp,"%6d: %12.3f\n", i, *(resTime[i])); - fclose(fp); - } - } - - /* Disconnect and return */ - - rc = SQLFreeStmt(hstmt, SQL_DROP); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "dropping the statement handle", - __FILE__, __LINE__); - - for (int i=0; i<NumXactStmts; i++) { - rc = SQLFreeStmt(txstmt[i], SQL_DROP); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "dropping the statement handle", - __FILE__, __LINE__); - } - - if (verbose >= VERBOSE_DFLT) - status_msg0("Disconnecting from the data source...\n"); - - rc = SQLDisconnect(hdbc); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "disconnecting", - __FILE__, __LINE__); - - rc = SQLFreeConnect(hdbc); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "freeing connection handle", - __FILE__, __LINE__); - - rc = SQLFreeEnv(henv); - handle_errors(NULL, NULL, rc, ERROR_EXIT, - "freeing environment handle", - __FILE__, __LINE__); - - app_exit(0); - return 0; -} - - - - - -/* Emacs variable settings */ -/* Local Variables: */ -/* tab-width:8 */ -/* indent-tabs-mode:nil */ -/* c-basic-offset:2 */ -/* End: */ - - - diff --git a/ndb/test/odbc/tpcb/ttTime.c b/ndb/test/odbc/tpcb/ttTime.c deleted file mode 100644 index 8f10b0c6b91..00000000000 --- a/ndb/test/odbc/tpcb/ttTime.c +++ /dev/null @@ -1,366 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -static const volatile char cvsid[] = "$Id: ttTime.c,v 1.1 2003/09/23 12:43:46 johan Exp $"; -/* - * $Revision: 1.1 $ - * (c) Copyright 1996-2003, TimesTen, Inc. - * All rights reserved. - * - */ - - -/* Contains functions for performing elapsed-time calculations - in a portable manner */ - -#include "ttTime.h" - -#ifdef WIN32 - -#include <stdio.h> -#include <mapiutil.h> - -/*------------*/ -/* NT VERSION */ -/*------------*/ - -/********************************************************************* - * - * FUNCTION: ttGetThreadTimes - * - * DESCRIPTION: This function sets the supplied parameter's - * user and kernel time for the current thread. - * - * PARAMETERS: ttThreadTimes* timesP thread time structure - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttGetThreadTimes(ttThreadTimes* timesP) -{ - BOOL rc; - HANDLE curThread; - FILETIME creationTime; - FILETIME exitTime; - FILETIME kTime; - FILETIME uTime; - - memset (&kTime, 0, sizeof (FILETIME)); - memset (&uTime, 0, sizeof (FILETIME)); - - curThread = GetCurrentThread(); - rc = GetThreadTimes(curThread, - &creationTime, - &exitTime, - &kTime, - &uTime); - - timesP->kernelTime = kTime; - timesP->userTime = uTime; - -} - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedThreadTimes - * - * DESCRIPTION: This function calculates the user and kernel - * time deltas. - * - * PARAMETERS: ttThreadTimes* beforeP beginning timestamp (IN) - * ttThreadTimes* afterP ending timestamp (IN) - * double* kernelDeltaP kernel time delta (OUT) - * double* userDeltaP user time delta (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, - ttThreadTimes* afterP, - double* kernelDeltaP, - double* userDeltaP) -{ - static const double secPerHi = (double) 4.294967296; /* 2**32 * 10**-9 */ - FILETIME *before, *after; - - before = &beforeP->kernelTime; - after = &afterP->kernelTime; - *kernelDeltaP = (double) ((after->dwHighDateTime - before->dwHighDateTime) * secPerHi - + (after->dwLowDateTime - before->dwLowDateTime) * 100e-9); - before = &beforeP->userTime; - after = &afterP->userTime; - *userDeltaP = (double) ((after->dwHighDateTime - before->dwHighDateTime) * secPerHi - + (after->dwLowDateTime - before->dwLowDateTime) * 100e-9); -} - -/********************************************************************* - * - * FUNCTION: ttGetWallClockTime - * - * DESCRIPTION: This function gets the current wall-clock time. - * - * PARAMETERS: ttWallClockTime* timeP tms time structure (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttGetWallClockTime(ttWallClockTime* timeP) -{ - LARGE_INTEGER frequency; - if ( QueryPerformanceFrequency(&frequency) ) { - QueryPerformanceCounter(&(timeP->time64)); - } - else { - _ftime(&(timeP->notSoLargeTime)); - } -} - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedWallClockTime - * - * DESCRIPTION: This function calculates the elapsed wall-clock - * time in msec. - * - * PARAMETERS: ttWallClockTime* beforeP starting timestamp - * ttWallClockTime* afterP ending timestamp - * double* nmillisecondsP elapsed time (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP) -{ - LARGE_INTEGER frequency; - - if ( QueryPerformanceFrequency(&frequency) ) { - *nmillisecondsP = 1000 * ((double) (afterP->time64.QuadPart - - beforeP->time64.QuadPart)) - / frequency.QuadPart; - - } - else { - double start; - double end; - - start = (double) beforeP->notSoLargeTime.time * 1000. + - (double) beforeP->notSoLargeTime.millitm; - end = (double) afterP->notSoLargeTime.time * 1000. + - (double) afterP->notSoLargeTime.millitm; - - *nmillisecondsP = (double) (end - start); - } -} - -#elif defined (RTSYS_VXWORKS) - -/*-----------------*/ -/* VxWorks VERSION */ -/*-----------------*/ - -/* - * The TimeBase registers have a period of 60ns, i.e. - * 0.00000006 or (6e-8) seconds. - */ -#define TIMER_MSEC_PER_CYC (6e-5) - -void -ttGetWallClockTime(ttWallClockTime* timeP) -{ - vxTimeBaseGet(&timeP->sep.upper32, &timeP->sep.lower32); -} - - -void -ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP) -{ - *nmillisecondsP = (double)(afterP->val - beforeP->val) * TIMER_MSEC_PER_CYC; -} - - -#else - -/*--------------*/ -/* UNIX VERSION */ -/*--------------*/ - -#include <unistd.h> - -/********************************************************************* - * - * FUNCTION: ttGetThreadTimes - * - * DESCRIPTION: This function sets the supplied parameter's - * tms structure. - * - * PARAMETERS: ttThreadTimes* timesP tms time structure - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -#ifdef SB_P_OS_CHORUS -void ttGetThreadTimes(ttThreadTimes* timesP) -{ - KnCap actorCap; - - if (acap (agetId(), &actorCap) == -1) { - timesP->ins.tmSec = 0; - timesP->ins.tmNSec = 0; - timesP->ext.tmSec = 0; - timesP->ext.tmNSec = 0; - } - else { - (void) threadTimes (&actorCap, K_ALLACTORTHREADS, - ×P->ins, ×P->ext); - } -} -#else -void ttGetThreadTimes(ttThreadTimes* timesP) -{ - (void) times(timesP); -} -#endif - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedThreadTimes - * - * DESCRIPTION: This function calculates the user and kernel - * time deltas. - * - * PARAMETERS: ttThreadTimes* beforeP beginning timestamp (IN) - * ttThreadTimes* afterP ending timestamp (IN) - * double* kernelDeltaP kernel time delta (OUT) - * double* userDeltaP user time delta (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -#ifdef SB_P_OS_CHORUS -void -ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, - ttThreadTimes* afterP, - double* kernelDeltaP, - double* userDeltaP) -{ - double kernelBefore; - double kernelAfter; - double userBefore; - double userAfter; - - kernelBefore = (beforeP->ext.tmSec) + (beforeP->ext.tmNSec / 1e9); - kernelAfter = (afterP->ext.tmSec) + (afterP->ext.tmNSec / 1e9); - *kernelDeltaP = kernelAfter - kernelBefore; - - userBefore = (beforeP->ins.tmSec) + (beforeP->ins.tmNSec / 1e9); - userAfter = (afterP->ins.tmSec) + (afterP->ins.tmNSec / 1e9); - *userDeltaP = userAfter - userBefore; - -} -#else -void -ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, - ttThreadTimes* afterP, - double* kernelDeltaP, - double* userDeltaP) -{ - double ticks = (double)sysconf(_SC_CLK_TCK); - - *kernelDeltaP = (afterP->tms_stime - beforeP->tms_stime) / ticks; - *userDeltaP = (afterP->tms_utime - beforeP->tms_utime) / ticks; -} -#endif - -/********************************************************************* - * - * FUNCTION: ttGetWallClockTime - * - * DESCRIPTION: This function gets the current wall-clock time. - * - * PARAMETERS: ttWallClockTime* timeP tms time structure (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttGetWallClockTime(ttWallClockTime* timeP) -{ - gettimeofday(timeP, NULL); -} - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedWallClockTime - * - * DESCRIPTION: This function calculates the elapsed wall-clock - * time is msec. - * - * PARAMETERS: ttWallClockTime* beforeP starting timestamp - * ttWallClockTime* afterP ending timestamp - * double* nmillisecondsP elapsed time (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisP) -{ - *nmillisP = (afterP->tv_sec - beforeP->tv_sec)*1000.0 + - (afterP->tv_usec - beforeP->tv_usec)/1000.0; -} - -#endif - -/* Emacs variable settings */ -/* Local Variables: */ -/* tab-width:8 */ -/* indent-tabs-mode:nil */ -/* c-basic-offset:2 */ -/* End: */ diff --git a/ndb/test/odbc/tpcb/ttTime.h b/ndb/test/odbc/tpcb/ttTime.h deleted file mode 100644 index f78b71667fe..00000000000 --- a/ndb/test/odbc/tpcb/ttTime.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright (C) 2003 MySQL 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 */ - -/* - * $Revision: 1.1 $ - * (c) Copyright 1996-2003, TimesTen, Inc. - * All rights reserved. - * - */ - -#ifndef __TT_TIME -#define __TT_TIME - - -#ifdef WIN32 - -#include <windows.h> -#include <sys/types.h> -#include <sys/timeb.h> - -typedef struct { - FILETIME kernelTime; - FILETIME userTime; -} ttThreadTimes; - - -typedef union { - LARGE_INTEGER time64; - struct _timeb notSoLargeTime; -} ttWallClockTime; - -#elif defined(RTSYS_VXWORKS) - -#define srand48(x) sb_srand48((x)) -#define drand48() sb_drand48() - -#ifdef SB_P_OS_VXPPC -/* For little-endian switch the lower, upper fields */ -typedef union { - struct { - unsigned int upper32; - unsigned int lower32; - } sep; - long long val; -} ttWallClockTime; - -/* - * This is a VxWorks private function to read the PPC's 64 bit Time Base - * Register. This is the assembler dump of this function. - 001126e4 7cad42e6 mftb r5, TBU - 001126e8 7ccc42e6 mftb r6, TBL - 001126ec 7ced42e6 mftb r7, TBU - 001126f0 7c053800 cmp crf0, 0, r5, r7 - 001126f4 4082fff0 bc 0x4, 0x2, vxTimeBaseGet - 001126f8 90a30000 stw r5, 0x0(r3) - 001126fc 90c40000 stw r6, 0x0(r4) - 00112700 4e800020 blr - * This is a fine grained timer with a period of 60ns. - */ -void vxTimeBaseGet(unsigned int* pUpper32, unsigned int* pLower32); -#endif /* SB_P_OS_VXPPC */ - -#elif defined(SB_P_OS_CHORUS) -#include <sys/types.h> -#include <sys/times.h> -#include <sys/time.h> - -#include <vtimer/chVtimer.h> - -struct chrTimes { - KnTimeVal ins; - KnTimeVal ext; -}; -typedef struct chrTimes ttThreadTimes; - -typedef struct timeval ttWallClockTime; - -#else -/* UNIX version */ - -#include <sys/times.h> -#include <sys/time.h> - -typedef struct tms ttThreadTimes; - -typedef struct timeval ttWallClockTime; - -#endif /* NT, VxWorks, Chorus, Unix */ - - -#ifndef RTSYS_VXWORKS -void ttGetThreadTimes(ttThreadTimes* timesP); -void ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, ttThreadTimes* afterP, - double* kernelDeltaP, double* userDeltaP); -#endif /* ! VXWORKS */ -void ttGetWallClockTime(ttWallClockTime* timeP); -void ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP); - - - - - -#endif /* __TT_TIME */ - -/* Emacs variable settings */ -/* Local Variables: */ -/* tab-width:8 */ -/* indent-tabs-mode:nil */ -/* c-basic-offset:2 */ -/* End: */ diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index 3bf2edde47a..6b3ba0bff09 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -10,9 +10,9 @@ test_DATA=daily-basic-tests.txt daily-devel-tests.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 -atrt_SOURCES = main.cpp -INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient -LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \ +atrt_SOURCES = main.cpp run-test.hpp +INCLUDES_LOC = -I$(top_srcdir)/ndb/test/include +LDADD_LOC = $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ @@ -21,5 +21,9 @@ LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \ wrappersdir=$(prefix)/bin wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run +EXTRA_DIST = $(test_DATA) $(test_SCRIPTS) $(wrappers_SCRIPTS) README.ATRT + # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/test/run-test/Makefile_old b/ndb/test/run-test/Makefile_old deleted file mode 100644 index 6b4689b2dbb..00000000000 --- a/ndb/test/run-test/Makefile_old +++ /dev/null @@ -1,22 +0,0 @@ -include .defs.mk - -TYPE := util - -BIN_TARGET := atrt -BIN_TARGET_LIBS := mgmapi - -SOURCES = main.cpp -SCRIPTS = atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ - atrt-clear-result.sh make-config.sh - -OBJECTS_LOC = $(call fixpath,$(NDB_TOP)/src/mgmclient/CpcClient.o) - -CFLAGS_main.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmclient) -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) - -include $(NDB_TOP)/Epilogue.mk - -_bins:: - -rm -f $(SCRIPTS:%=$(NDB_TOP)/bin/%) - cp $(SCRIPTS) $(NDB_TOP)/bin - diff --git a/ndb/test/run-test/atrt-mysql-test-run b/ndb/test/run-test/atrt-mysql-test-run index dd7b709bd06..2ebc11b0070 100755 --- a/ndb/test/run-test/atrt-mysql-test-run +++ b/ndb/test/run-test/atrt-mysql-test-run @@ -5,8 +5,8 @@ p=`pwd` cd $MYSQL_BASE_DIR/mysql-test ./mysql-test-run --with-ndbcluster --ndb-connectstring=$NDB_CONNECTSTRING $* | tee $p/output.txt -f=`grep -c fail $p/output.txt` -o=`grep -c pass $p/output.txt` +f=`grep -c '\[ fail \]' $p/output.txt` +o=`grep -c '\[ pass \]' $p/output.txt` if [ $o -gt 0 -a $f -eq 0 ] then diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index 8d7e8a06c72..453fe1ad7ae 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -1,3 +1,11 @@ +max-time: 3600 +cmd: atrt-mysql-test-run +args: --force + +max-time: 600 +cmd: atrt-testBackup +args: -n BackupOne T1 T6 T3 I3 + # BASIC FUNCTIONALITY max-time: 500 cmd: testBasic @@ -222,6 +230,18 @@ max-time: 500 cmd: testScan args: -n ScanRead488 -l 10 T6 +max-time: 500 +cmd: testScan +args: -n ScanRead488O -l 10 T6 + +max-time: 1000 +cmd: testScan +args: -n ScanRead488_Mixed -l 10 T6 + +max-time: 500 +cmd: testScan +args: -n ScanRead488Timeout -l 10 T6 + max-time: 600 cmd: testScan args: -n ScanRead40 -l 100 T2 @@ -358,6 +378,10 @@ max-time: 500 cmd: testScan args: -n ScanRestart T1 +max-time: 500 +cmd: testScan +args: -l 100 -n Scan-bug8262 T7 + # OLD FLEX max-time: 500 cmd: flexBench @@ -474,493 +498,13 @@ args: -n UpdateWithoutValues T6 #cmd: testInterpreter #args: T1 # -max-time: 1500 -cmd: testOperations -args: -n ReadRead - -max-time: 1500 -cmd: testOperations -args: -n ReadReadEx - -max-time: 1500 -cmd: testOperations -args: -n ReadInsert - -max-time: 1500 -cmd: testOperations -args: -n ReadUpdate - -max-time: 1500 -cmd: testOperations -args: -n ReadDelete - -max-time: 1500 -cmd: testOperations -args: -n FReadRead - -max-time: 1500 -cmd: testOperations -args: -n FReadReadEx - -max-time: 1500 -cmd: testOperations -args: -n FReadInsert - -max-time: 1500 -cmd: testOperations -args: -n FReadUpdate - -max-time: 1500 -cmd: testOperations -args: -n FReadDelete - -max-time: 1500 -cmd: testOperations -args: -n ReadExRead - -max-time: 1500 -cmd: testOperations -args: -n ReadExReadEx - -max-time: 1500 -cmd: testOperations -args: -n ReadExInsert - -max-time: 1500 -cmd: testOperations -args: -n ReadExUpdate - -max-time: 1500 -cmd: testOperations -args: -n ReadExDelete - -max-time: 1500 -cmd: testOperations -args: -n InsertRead - -max-time: 1500 -cmd: testOperations -args: -n InsertReadEx - -max-time: 1500 -cmd: testOperations -args: -n InsertInsert - -max-time: 1500 -cmd: testOperations -args: -n InsertUpdate - -max-time: 1500 -cmd: testOperations -args: -n InsertDelete - -max-time: 1500 -cmd: testOperations -args: -n UpdateRead - -max-time: 1500 -cmd: testOperations -args: -n UpdateReadEx - -max-time: 1500 -cmd: testOperations -args: -n UpdateInsert - -max-time: 1500 -cmd: testOperations -args: -n UpdateUpdate - -max-time: 1500 -cmd: testOperations -args: -n UpdateDelete - -max-time: 1500 -cmd: testOperations -args: -n DeleteRead - -max-time: 1500 -cmd: testOperations -args: -n DeleteReadEx - -max-time: 1500 -cmd: testOperations -args: -n DeleteInsert - -max-time: 1500 -cmd: testOperations -args: -n DeleteUpdate - -max-time: 1500 -cmd: testOperations -args: -n DeleteDelete - -max-time: 1500 -cmd: testOperations -args: -n ReadSimpleRead - -max-time: 1500 -cmd: testOperations -args: -n ReadDirtyRead - -max-time: 1500 -cmd: testOperations -args: -n FReadSimpleRead - -max-time: 1500 -cmd: testOperations -args: -n FReadDirtyRead - -max-time: 1500 -cmd: testOperations -args: -n ReadExSimpleRead - -max-time: 1500 -cmd: testOperations -args: -n ReadExDirtyRead - -max-time: 1500 -cmd: testOperations -args: -n InsertSimpleRead - -max-time: 1500 -cmd: testOperations -args: -n InsertDirtyRead - -max-time: 1500 -cmd: testOperations -args: -n UpdateSimpleRead - -max-time: 1500 -cmd: testOperations -args: -n UpdateDirtyRead - -max-time: 1500 -cmd: testOperations -args: -n DeleteSimpleRead - -max-time: 1500 +max-time: 150000 cmd: testOperations -args: -n DeleteDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n ReadRead - -max-time: 1500 -cmd: testTransactions -args: -n ReadReadEx - -max-time: 1500 -cmd: testTransactions -args: -n ReadInsert - -max-time: 1500 -cmd: testTransactions -args: -n ReadUpdate - -max-time: 1500 -cmd: testTransactions -args: -n ReadDelete - -max-time: 1500 -cmd: testTransactions -args: -n ReadExRead - -max-time: 1500 -cmd: testTransactions -args: -n ReadExReadEx - -max-time: 1500 -cmd: testTransactions -args: -n ReadExInsert - -max-time: 1500 -cmd: testTransactions -args: -n ReadExUpdate - -max-time: 1500 -cmd: testTransactions -args: -n ReadExDelete - -max-time: 1500 -cmd: testTransactions -args: -n InsertRead - -max-time: 1500 -cmd: testTransactions -args: -n InsertReadEx - -max-time: 1500 -cmd: testTransactions -args: -n InsertInsert - -max-time: 1500 -cmd: testTransactions -args: -n InsertUpdate - -max-time: 1500 -cmd: testTransactions -args: -n InsertDelete - -max-time: 1500 -cmd: testTransactions -args: -n UpdateRead - -max-time: 1500 -cmd: testTransactions -args: -n UpdateReadEx - -max-time: 1500 -cmd: testTransactions -args: -n UpdateInsert - -max-time: 1500 -cmd: testTransactions -args: -n UpdateUpdate - -max-time: 1500 -cmd: testTransactions -args: -n UpdateDelete - -max-time: 1500 -cmd: testTransactions -args: -n DeleteRead - -max-time: 1500 -cmd: testTransactions -args: -n DeleteReadEx - -max-time: 1500 -cmd: testTransactions -args: -n DeleteInsert - -max-time: 1500 -cmd: testTransactions -args: -n DeleteUpdate - -max-time: 1500 -cmd: testTransactions -args: -n DeleteDelete - -max-time: 1500 -cmd: testTransactions -args: -n ReadSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n ReadDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n ReadExSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n ReadExDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n InsertSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n InsertDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n UpdateSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n UpdateDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n DeleteSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n DeleteDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n ReadScan - -max-time: 1500 -cmd: testTransactions -args: -n ReadScanHl - -max-time: 1500 -cmd: testTransactions -args: -n ReadScanEx - -max-time: 1500 -cmd: testTransactions -args: -n ScanRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanReadEx - -max-time: 1500 -cmd: testTransactions -args: -n ScanSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanInsert - -max-time: 1500 -cmd: testTransactions -args: -n ScanUpdate - -max-time: 1500 -cmd: testTransactions -args: -n ScanDelete - -max-time: 1500 -cmd: testTransactions -args: -n ScanScan - -max-time: 1500 -cmd: testTransactions -args: -n ScanScanHl - -max-time: 1500 -cmd: testTransactions -args: -n ScanScanEx - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlReadEx - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlInsert - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlUpdate - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlDelete - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlScan - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlScanHl - -max-time: 1500 -cmd: testTransactions -args: -n ScanHlScanEx - -max-time: 1500 -cmd: testTransactions -args: -n ScanExRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanExReadEx - -max-time: 1500 -cmd: testTransactions -args: -n ScanExSimpleRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanExDirtyRead - -max-time: 1500 -cmd: testTransactions -args: -n ScanExInsert - -max-time: 1500 -cmd: testTransactions -args: -n ScanExUpdate - -max-time: 1500 -cmd: testTransactions -args: -n ScanExDelete - -max-time: 1500 -cmd: testTransactions -args: -n ScanExScan - -max-time: 1500 -cmd: testTransactions -args: -n ScanExScanHl - -max-time: 1500 -cmd: testTransactions -args: -n ScanExScanEx - -max-time: 1500 -cmd: testTransactions -args: -n ReadExScan - -max-time: 1500 -cmd: testTransactions -args: -n ReadExScanHl - -max-time: 1500 -cmd: testTransactions -args: -n ReadExScanEx - -max-time: 1500 -cmd: testTransactions -args: -n InsertScan - -max-time: 1500 -cmd: testTransactions -args: -n InsertScanHl - -max-time: 1500 -cmd: testTransactions -args: -n InsertScanEx - -max-time: 1500 -cmd: testTransactions -args: -n UpdateScan - -max-time: 1500 -cmd: testTransactions -args: -n UpdateScanHl - -max-time: 1500 -cmd: testTransactions -args: -n UpdateScanEx - -max-time: 1500 -cmd: testTransactions -args: -n DeleteScan - -max-time: 1500 -cmd: testTransactions -args: -n DeleteScanHl +args: -max-time: 1500 +max-time: 150000 cmd: testTransactions -args: -n DeleteScanEx +args: max-time: 1500 cmd: testRestartGci diff --git a/ndb/test/run-test/daily-devel-tests.txt b/ndb/test/run-test/daily-devel-tests.txt index 5c0b2821d85..2cdd39ffa4c 100644 --- a/ndb/test/run-test/daily-devel-tests.txt +++ b/ndb/test/run-test/daily-devel-tests.txt @@ -1,7 +1,3 @@ -max-time: 2500 -cmd: atrt-mysql-test-run -args: --do-test=ndb --force - # # INDEX # @@ -22,10 +18,6 @@ args: -n CreateLoadDrop T1 T10 # # BACKUP # -max-time: 600 -cmd: atrt-testBackup -args: -n BackupOne T1 T6 T3 I3 - max-time: 1000 cmd: atrt-testBackup args: -n BackupBank T6 @@ -212,3 +204,32 @@ max-time: 2500 cmd: test_event args: -n BasicEventOperation T1 T6 +max-time: 300 +cmd: DbCreate +args: + +max-time: 180 +cmd: DbAsyncGenerator +args: -time 60 -p 1 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -time 60 -p 25 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -time 60 -p 100 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -time 60 -p 200 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -time 60 -p 1 -proc 25 +type: bench + diff --git a/ndb/test/run-test/example.conf b/ndb/test/run-test/example.conf new file mode 100644 index 00000000000..1e152da332d --- /dev/null +++ b/ndb/test/run-test/example.conf @@ -0,0 +1,10 @@ +target=pc-linux-i686 +base_dir=/ndb +src_clone_base=mysqldev@bk-internal.mysql.com:/home/bk/mysql +run_dir=/space/autotest +build_dir=/ndb +hosts="ndb01 ndb02 ndb03 ndb04 ndb05 ndb06 ndb07 ndb08 ndb09 ndb10 ndb11 ndb12" +result_host="ndb.mysql.com" +result_path="public_html" +configure='CC=gcc CXX=gcc CFLAGS="-Wall -pedantic -Wno-long-long" CXXFLAGS="-Wall -pedantic -Wno-long-long" ./configure --with-ndbcluster --with-ndb-test --with-ndbcc-flags="-g -DERROR_INSERT"' + diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index 22799a9a1b2..02c2cc862a3 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -219,7 +219,7 @@ main(int argc, const char ** argv){ fflush(g_report_file); } - if(g_mode_bench || (g_mode_regression && result)){ + if(test_case.m_report || g_mode_bench || (g_mode_regression && result)){ BaseString tmp; tmp.assfmt("result.%d", test_no); if(rename("result", tmp.c_str()) != 0){ @@ -228,7 +228,7 @@ main(int argc, const char ** argv){ goto end; } } - + if(g_mode_interactive && result){ g_logger.info ("Encountered failed test in interactive mode - terminating"); @@ -275,6 +275,7 @@ parse_args(int argc, const char** argv){ int tmp = Logger::LL_WARNING - g_verbosity; tmp = (tmp < Logger::LL_DEBUG ? Logger::LL_DEBUG : tmp); g_logger.disable(Logger::LL_ALL); + g_logger.enable(Logger::LL_ON); g_logger.enable((Logger::LoggerLevel)tmp, Logger::LL_ALERT); } @@ -459,7 +460,7 @@ setup_config(atrt_config& config){ proc.m_type = atrt_process::NDB_MGM; proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_mgmd"); proc.m_proc.m_path.assign(dir).append("/libexec/ndb_mgmd"); - proc.m_proc.m_args = "--nodaemon -c initconfig.txt"; + proc.m_proc.m_args = "--nodaemon -f config.ini"; proc.m_proc.m_cwd.appfmt("%d.ndb_mgmd", index); connect_string.appfmt("host=%s:%d;", proc.m_hostname.c_str(), proc.m_ndb_mgm_port); @@ -538,15 +539,19 @@ connect_ndb_mgm(atrt_process & proc){ } BaseString tmp = proc.m_hostname; tmp.appfmt(":%d", proc.m_ndb_mgm_port); - time_t start = time(0); - const time_t max_connect_time = 30; - do { - if(ndb_mgm_connect(handle, tmp.c_str()) != -1){ - proc.m_ndb_mgm_handle = handle; - return true; - } - sleep(1); - } while(time(0) < (start + max_connect_time)); + + if (ndb_mgm_set_connectstring(handle,tmp.c_str())) + { + g_logger.critical("Unable to create parse connectstring"); + return false; + } + + if(ndb_mgm_connect(handle, 30, 1, 0) != -1) + { + proc.m_ndb_mgm_handle = handle; + return true; + } + g_logger.critical("Unable to connect to ndb mgm %s", tmp.c_str()); return false; } @@ -903,6 +908,11 @@ read_test_case(FILE * file, atrt_testcase& tc, int& line){ tc.m_max_time = 60000; else tc.m_max_time = atoi(mt); + + if(p.get("type", &mt) && strcmp(mt, "bench") == 0) + tc.m_report= true; + else + tc.m_report= false; return true; } diff --git a/ndb/test/run-test/make-html-reports.sh b/ndb/test/run-test/make-html-reports.sh index 89f13a4b62a..67395ceba47 100755 --- a/ndb/test/run-test/make-html-reports.sh +++ b/ndb/test/run-test/make-html-reports.sh @@ -154,9 +154,12 @@ do ts=`time_spec $time` res_txt="" case $res in - 0) pass; res_txt="PASSED"; res_dir=" ";; + 0) pass; res_txt="PASSED";; *) fail; res_txt="FAILED";; esac + + if [ ! -d "$src_dir/result.$no" ]; then res_dir=" "; fi + total=`expr $total + $time` ( diff --git a/ndb/test/run-test/ndb-autotest.sh b/ndb/test/run-test/ndb-autotest.sh new file mode 100755 index 00000000000..397df97d52f --- /dev/null +++ b/ndb/test/run-test/ndb-autotest.sh @@ -0,0 +1,228 @@ +#!/bin/sh + +save_args=$* +VERSION="ndb-autotest.sh version 1.0" + +DATE=`date '+%Y-%m-%d'` +export DATE + +set -e +ulimit -Sc unlimited + +echo "`date` starting: $*" + +RSYNC_RSH=ssh +export RSYNC_RSH + +do_clone=yes +build=yes +deploy=yes + +clone=5.0-ndb +RUN="daily-basic daily-devel" +conf=autotest.conf + +while [ "$1" ] +do + case "$1" in + --no-clone) do_clone="";; + --no-build) build="";; + --no-deploy) deploy="";; + --clone=*) clone=`echo $1 | sed s/--clone=//`;; + --conf=*) conf=`echo $1 | sed s/--conf=//`;; + --version) echo $VERSION; exit;; + *) RUN=$*;; + esac + shift +done + +if [ -f $conf ] +then + . $conf +else + echo "Can't find config file: $conf" + exit +fi + +env + +LOCK=$HOME/.autotest-lock +src_clone=$src_clone_base-$clone + +if [ -f $LOCK ] +then + echo "Lock file exists: $LOCK" + exit 1 +fi + +echo "$DATE $RUN" > $LOCK +trap "rm -f $LOCK" ERR + +dst_place=${build_dir}/clone-mysql-$clone-$DATE + +if [ "$do_clone" ] +then + rm -rf $dst_place + bk clone $src_clone $dst_place +fi + +if [ "$build" ] +then + cd $dst_place + rm -rf $run_dir/* + aclocal; autoheader; autoconf; automake + (cd innobase; aclocal; autoheader; autoconf; automake) + (cd bdb/dist; sh s_all) + eval $configure --prefix=$run_dir + make + make install +fi + +### +# check script version +# +script=$run_dir/mysql-test/ndb/ndb-autotest.sh +if [ -x $script ] +then + $script --version > /tmp/version.$$ +else + echo $VERSION > /tmp/version.$$ +fi +match=`grep -c "$VERSION" /tmp/version.$$` +rm -f /tmp/version.$$ +if [ $match -eq 0 ] +then + echo "Incorrect script version...restarting" + cp $run_dir/mysql-test/ndb/ndb-autotest.sh /tmp/at.$$.sh + rm -rf $run_dir $dst_place + sh /tmp/at.$$.sh $save_args + exit +fi + +# Check that all interesting files are present +test_dir=$run_dir/mysql-test/ndb +atrt=$test_dir/atrt +html=$test_dir/make-html-reports.sh +PATH=$test_dir:$PATH +export PATH + +filter(){ + neg=$1 + shift + while [ $# -gt 0 ] + do + if [ `grep -c $1 $neg` -eq 0 ] ; then echo $1; fi + shift + done +} + +### +# check ndb_cpcc fail hosts +# +ndb_cpcc $hosts | awk '{ if($1=="Failed"){ print;}}' > /tmp/failed.$DATE +filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE +hosts=`cat /tmp/hosts.$DATE` + +if [ "$deploy" ] +then + (cd / && tar cfz /tmp/build.$DATE.tgz $run_dir ) + for i in $hosts + do + ok=0 + scp /tmp/build.$DATE.tgz $i:/tmp/build.$DATE.$$.tgz && \ + ssh $i "rm -rf /space/autotest/*" && \ + ssh $i "cd / && tar xfz /tmp/build.$DATE.$$.tgz" && \ + ssh $i "rm /tmp/build.$DATE.$$.tgz" && ok=1 + if [ $ok -eq 0 ] + then + echo "$i failed during scp/ssh, excluding" + echo $i >> /tmp/failed.$DATE + fi + done +fi +rm -f /tmp/build.$DATE.tgz + +### +# handle scp failed hosts +# +filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE +hosts=`cat /tmp/hosts.$DATE` +cat /tmp/failed.$DATE > /tmp/filter_hosts.$$ + +### +# functions for running atrt +# +choose(){ + SRC=$1 + TMP1=/tmp/choose.$$ + TMP2=/tmp/choose.$$.$$ + shift + + cp $SRC $TMP1 + i=1 + while [ $# -gt 0 ] + do + sed -e s,"CHOOSE_host$i",$1,g < $TMP1 > $TMP2 + mv $TMP2 $TMP1 + shift + i=`expr $i + 1` + done + cat $TMP1 + rm -f $TMP1 +} +start(){ + rm -rf report.txt result* log.txt + $atrt -v -v -r -R --log-file=log.txt --testcase-file=$test_dir/$2-tests.txt & + pid=$! + echo $pid > run.pid + wait $pid + rm run.pid + [ -f log.txt ] && mv log.txt $3 + [ -f report.txt ] && mv report.txt $3 + [ "`find . -name 'result*'`" ] && mv result* $3 + cd $3 + sh $html . $1 $DATE + cd .. + p2=`pwd` + cd .. + tar cfz /tmp/res.$$.tgz `basename $p2`/$DATE + scp /tmp/res.$$.tgz $result_host:$result_path + ssh $result_host "cd $result_path && tar xfz res.$$.tgz && rm -f res.$$.tgz" + rm -f /tmp/res.$$.tgz +} + +p=`pwd` +for dir in $RUN +do + echo "Fixing hosts for $dir" + + run_dir=$base_dir/run-$dir-mysql-$clone-$target + res_dir=$base_dir/result-$dir-mysql-$clone-$target/$DATE + + mkdir -p $res_dir + rm -rf $res_dir/* + + count=`grep -c "COMPUTER" $run_dir/1.ndb_mgmd/initconfig.template` + avail_hosts=`filter /tmp/filter_hosts.$$ $hosts` + avail=`echo $avail_hosts | wc -w` + if [ $count -gt $avail ] + then + echo "Not enough hosts" + echo "Needs: $count available: $avail ($avail_hosts)" + break; + fi + + run_hosts=`echo $avail_hosts| awk '{for(i=1;i<='$count';i++)print $i;}'` + choose $run_dir/d.template $run_hosts > $run_dir/d.txt + choose $run_dir/1.ndb_mgmd/initconfig.template $run_hosts > $run_dir/1.ndb_mgmd/config.ini + echo $run_hosts >> /tmp/filter_hosts.$$ + + cd $run_dir + start $dir-mysql-$clone-$target $dir $res_dir & +done +cd $p +rm /tmp/filter_hosts.$$ + +wait + +rm -f $LOCK diff --git a/ndb/test/run-test/run-test.hpp b/ndb/test/run-test/run-test.hpp index 8d00a7b6a55..ff7f916d4ef 100644 --- a/ndb/test/run-test/run-test.hpp +++ b/ndb/test/run-test/run-test.hpp @@ -68,6 +68,7 @@ struct atrt_config { }; struct atrt_testcase { + bool m_report; time_t m_max_time; BaseString m_command; BaseString m_args; diff --git a/ndb/src/mgmclient/CpcClient.cpp b/ndb/test/src/CpcClient.cpp index d407ba65312..1d1b4fcb977 100644 --- a/ndb/src/mgmclient/CpcClient.cpp +++ b/ndb/test/src/CpcClient.cpp @@ -15,9 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> -#include <editline/editline.h> - -#include <netdb.h> #include <NdbOut.hpp> #include <NdbTCP.h> @@ -33,7 +30,7 @@ 0, 0, \ 0, \ (desc), \ - (void *)(value) } + (value) } #define CPC_ARG(name, type, opt, desc) \ { (name), \ @@ -354,17 +351,12 @@ SimpleCpcClient::define_process(Process & p, Properties& reply){ int SimpleCpcClient::list_processes(Vector<Process> &procs, Properties& reply) { - enum Proclist { - Proclist_Start, - Proclist_End, - Proclist_Entry - }; + int start, end, entry; const ParserRow_t list_reply[] = { - CPC_CMD("start processes", Proclist_Start, ""), - - CPC_CMD("end processes", Proclist_End, ""), + CPC_CMD("start processes", &start, ""), + CPC_CMD("end processes", &end, ""), - CPC_CMD("process", Proclist_Entry, ""), + CPC_CMD("process", &entry, ""), CPC_ARG("id", Int, Mandatory, "Id of process."), CPC_ARG("name", String, Mandatory, "Name of process"), CPC_ARG("group", String, Mandatory, "Group of process"), @@ -393,26 +385,29 @@ SimpleCpcClient::list_processes(Vector<Process> &procs, Properties& reply) { bool done = false; while(!done) { const Properties *proc; - enum Proclist p; - cpc_recv(list_reply, &proc, (void **)&p); + void *p; + cpc_recv(list_reply, &proc, &p); - switch(p) { - case Proclist_Start: + if(p == &start) + { /* do nothing */ - break; - case Proclist_End: + } + else if(p == &end) + { done = true; - break; - case Proclist_Entry: + } + else if(p == &entry) + { if(proc != NULL){ Process p; convert(* proc, p); procs.push_back(p); } - break; - default: - /* ignore */ - break; + } + else + { + ndbout_c("internal error: %d", __LINE__); + return -1; } } return 0; diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp index e8e2d992345..8e6603ec6ff 100644 --- a/ndb/test/src/HugoOperations.cpp +++ b/ndb/test/src/HugoOperations.cpp @@ -32,6 +32,13 @@ int HugoOperations::startTransaction(Ndb* pNdb){ return NDBT_OK; } +void +HugoOperations::setTransactionId(Uint64 id){ + if (pTrans != NULL){ + pTrans->setTransactionId(id); + } +} + int HugoOperations::closeTransaction(Ndb* pNdb){ if (pTrans != NULL){ @@ -401,6 +408,10 @@ HugoOperations::HugoOperations(const NdbDictionary::Table& _tab): HugoOperations::~HugoOperations(){ deallocRows(); + if (pTrans != NULL){ + pTrans->close(); + pTrans = NULL; + } } diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 456bfffbb77..5d5b2fa99df 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -29,26 +29,173 @@ HugoTransactions::~HugoTransactions(){ deallocRows(); } - -int HugoTransactions::scanReadCommittedRecords(Ndb* pNdb, +int +HugoTransactions::scanReadRecords(Ndb* pNdb, int records, int abortPercent, - int parallelism){ - return scanReadRecords(pNdb, records, abortPercent, parallelism, true); + int parallelism, + NdbOperation::LockMode lm) +{ + + int retryAttempt = 0; + const int retryMax = 100; + int check, a; + NdbScanOperation *pOp; + + while (true){ + + if (retryAttempt >= retryMax){ + g_err << "ERROR: has retried this operation " << retryAttempt + << " times, failing!" << endl; + return NDBT_FAILED; + } + + pTrans = pNdb->startTransaction(); + if (pTrans == NULL) { + const NdbError err = pNdb->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + ERR(err); + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + return NDBT_FAILED; + } + + pOp = pTrans->getNdbScanOperation(tab.getName()); + if (pOp == NULL) { + ERR(pTrans->getNdbError()); + closeTransaction(pNdb); + return NDBT_FAILED; + } + + NdbResultSet * rs; + rs = pOp ->readTuples(lm); + + if( rs == 0 ) { + ERR(pTrans->getNdbError()); + closeTransaction(pNdb); + return NDBT_FAILED; + } + + check = pOp->interpret_exit_ok(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + closeTransaction(pNdb); + return NDBT_FAILED; + } + + for(a = 0; a<tab.getNoOfColumns(); a++){ + if((row.attributeStore(a) = + pOp->getValue(tab.getColumn(a)->getName())) == 0) { + ERR(pTrans->getNdbError()); + closeTransaction(pNdb); + return NDBT_FAILED; + } + } + + check = pTrans->execute(NoCommit); + if( check == -1 ) { + const NdbError err = pTrans->getNdbError(); + if (err.status == NdbError::TemporaryError){ + ERR(err); + closeTransaction(pNdb); + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + closeTransaction(pNdb); + return NDBT_FAILED; + } + + // Abort after 1-100 or 1-records rows + int ranVal = rand(); + int abortCount = ranVal % (records == 0 ? 100 : records); + bool abortTrans = false; + if (abort > 0){ + // Abort if abortCount is less then abortPercent + if (abortCount < abortPercent) + abortTrans = true; + } + + int eof; + int rows = 0; + while((eof = rs->nextResult(true)) == 0){ + rows++; + if (calc.verifyRowValues(&row) != 0){ + closeTransaction(pNdb); + return NDBT_FAILED; + } + + if (abortCount == rows && abortTrans == true){ + ndbout << "Scan is aborted" << endl; + g_info << "Scan is aborted" << endl; + rs->close(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + closeTransaction(pNdb); + return NDBT_FAILED; + } + + closeTransaction(pNdb); + return NDBT_OK; + } + } + if (eof == -1) { + const NdbError err = pTrans->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + ERR_INFO(err); + closeTransaction(pNdb); + NdbSleep_MilliSleep(50); + switch (err.code){ + case 488: + case 245: + case 490: + // Too many active scans, no limit on number of retry attempts + break; + default: + retryAttempt++; + } + continue; + } + ERR(err); + closeTransaction(pNdb); + return NDBT_FAILED; + } + + closeTransaction(pNdb); + + g_info << rows << " rows have been read" << endl; + if (records != 0 && rows != records){ + g_err << "Check expected number of records failed" << endl + << " expected=" << records <<", " << endl + << " read=" << rows << endl; + return NDBT_FAILED; + } + + return NDBT_OK; + } + return NDBT_FAILED; } int HugoTransactions::scanReadRecords(Ndb* pNdb, + const NdbDictionary::Index * pIdx, int records, int abortPercent, int parallelism, - bool committed){ + NdbOperation::LockMode lm, + bool sorted) +{ int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; - NdbScanOperation *pOp; + NdbIndexScanOperation *pOp; while (true){ @@ -72,27 +219,26 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, return NDBT_FAILED; } - pOp = pTrans->getNdbScanOperation(tab.getName()); + pOp = pTrans->getNdbIndexScanOperation(pIdx->getName(), tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } NdbResultSet * rs; - rs = pOp ->readTuples(committed ? NdbScanOperation::LM_CommittedRead : - NdbScanOperation::LM_Read); + rs = pOp ->readTuples(lm, 0, parallelism, sorted); if( rs == 0 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->interpret_exit_ok(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -100,7 +246,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -110,13 +256,13 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -135,7 +281,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, while((eof = rs->nextResult(true)) == 0){ rows++; if (calc.verifyRowValues(&row) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -145,11 +291,11 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, rs->close(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_OK; } } @@ -158,7 +304,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR_INFO(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); switch (err.code){ case 488: @@ -172,17 +318,17 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been read" << endl; if (records != 0 && rows != records){ g_err << "Check expected number of records failed" << endl - << " expected=" << records <<", " << endl - << " read=" << rows << endl; + << " expected=" << records <<", " << endl + << " read=" << rows << endl; return NDBT_FAILED; } @@ -196,9 +342,9 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, int HugoTransactions::scanUpdateRecords(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ + int records, + int abortPercent, + int parallelism){ if(m_defaultScanUpdateMethod == 1){ return scanUpdateRecords1(pNdb, records, abortPercent, parallelism); } else if(m_defaultScanUpdateMethod == 2){ @@ -221,7 +367,6 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; @@ -250,21 +395,21 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->openScanExclusive(parallelism); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->interpret_exit_ok(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -272,7 +417,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, for(a=0; a<tab.getNoOfColumns(); a++){ if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == NULL){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -282,13 +427,13 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -316,11 +461,11 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, check = pTrans->stopScan(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_OK; } int res = takeOverAndUpdateRecord(pNdb, pOp); @@ -329,7 +474,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, continue; } if (res != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return res; } @@ -353,18 +498,18 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } if(eof == -2){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been updated" << endl; return NDBT_OK; @@ -388,7 +533,6 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; @@ -417,21 +561,21 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->openScanExclusive(parallelism); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->interpret_exit_ok(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -439,7 +583,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, for(a=0; a<tab.getNoOfColumns(); a++){ if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == NULL){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -449,13 +593,13 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -471,7 +615,6 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, int eof; int rows = 0; - NdbConnection* pUpTrans; while((eof = pTrans->nextScanResult(true)) == 0){ pUpTrans = pNdb->startTransaction(); @@ -491,7 +634,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, rows++; if (addRowToUpdate(pNdb, pUpTrans, pOp) != 0){ pNdb->closeTransaction(pUpTrans); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } while((eof = pTrans->nextScanResult(false)) == 0); @@ -502,12 +645,12 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, check = pTrans->stopScan(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pNdb->closeTransaction(pUpTrans); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pNdb->closeTransaction(pUpTrans); return NDBT_OK; } @@ -517,7 +660,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, const NdbError err = pUpTrans->getNdbError(); ERR(err); pNdb->closeTransaction(pUpTrans); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } pNdb->closeTransaction(pUpTrans); @@ -527,17 +670,17 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been updated" << endl; return NDBT_OK; @@ -554,12 +697,11 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbScanOperation *pOp; while (true){ - restart: +restart: if (retryAttempt++ >= retryMax){ g_info << "ERROR: has retried this operation " << retryAttempt << " times, failing!" << endl; @@ -580,14 +722,14 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, pOp = pTrans->getNdbScanOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } NdbResultSet *rs = pOp->readTuplesExclusive(parallelism); if( rs == 0 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -595,7 +737,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, for(a=0; a<tab.getNoOfColumns(); a++){ if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == NULL){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -604,7 +746,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, if( check == -1 ) { const NdbError err = pTrans->getNdbError(); ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); continue; @@ -629,7 +771,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, NdbOperation* pUp = rs->updateTuple(); if(pUp == 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } const int updates = calc.getUpdatesValue(&row) + 1; @@ -638,7 +780,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == false){ if(setValueForAttr(pUp, a, r, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -647,7 +789,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, if (rows == abortCount && abortTrans == true){ g_info << "Scan is aborted" << endl; // This scan should be aborted - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_OK; } } while((check = rs->nextResult(false)) == 0); @@ -659,7 +801,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if( check == -1 ) { - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); ERR(err); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); @@ -671,7 +813,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if( check == -1 ) { - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); ERR(err); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); @@ -680,7 +822,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been updated" << endl; return NDBT_OK; @@ -698,7 +840,6 @@ HugoTransactions::loadTable(Ndb* pNdb, int check, a; int retryAttempt = 0; int retryMax = 5; - NdbConnection *pTrans; NdbOperation *pOp; bool first_batch = true; @@ -751,14 +892,14 @@ HugoTransactions::loadTable(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->insertTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -766,7 +907,7 @@ HugoTransactions::loadTable(Ndb* pNdb, for (a = 0; a<tab.getNoOfColumns(); a++){ if(setValueForAttr(pOp, a, c+b, 0 ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -784,7 +925,7 @@ HugoTransactions::loadTable(Ndb* pNdb, } if(check == -1 ) { const NdbError err = pTrans->getNdbError(); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pTrans= 0; switch(err.status){ case NdbError::Success: @@ -826,7 +967,7 @@ HugoTransactions::loadTable(Ndb* pNdb, } else{ if (closeTrans) { - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pTrans= 0; } } @@ -844,7 +985,6 @@ HugoTransactions::fillTable(Ndb* pNdb, int check, a, b; int retryAttempt = 0; int retryMax = 5; - NdbConnection *pTrans; NdbOperation *pOp; g_info << "|- Inserting records..." << endl; @@ -877,14 +1017,14 @@ HugoTransactions::fillTable(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->insertTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -892,7 +1032,7 @@ HugoTransactions::fillTable(Ndb* pNdb, for (a = 0; a<tab.getNoOfColumns(); a++){ if(setValueForAttr(pOp, a, c+b, 0 ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -902,7 +1042,7 @@ HugoTransactions::fillTable(Ndb* pNdb, check = pTrans->execute( Commit, CommitAsMuchAsPossible ); if(check == -1 ) { const NdbError err = pTrans->getNdbError(); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); switch(err.status){ case NdbError::Success: @@ -954,7 +1094,7 @@ HugoTransactions::fillTable(Ndb* pNdb, } } else{ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } // Step to next record @@ -1236,7 +1376,6 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; if (batchsize == 0) { @@ -1271,7 +1410,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1293,7 +1432,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1302,7 +1441,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1313,7 +1452,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1326,7 +1465,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; @@ -1339,13 +1478,13 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, default: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else{ for (int b=0; (b<batchsize) && (r+b<records); b++){ if (calc.verifyRowValues(rows[b]) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } reads++; @@ -1353,7 +1492,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, } } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } deallocRows(); @@ -1373,7 +1512,6 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a, b; - NdbConnection *pTrans; NdbOperation *pOp; allocRows(batch); @@ -1408,14 +1546,14 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1424,7 +1562,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1435,7 +1573,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1447,19 +1585,19 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } for(b = 0; b<batch && (b+r)<records; b++){ if (calc.verifyRowValues(rows[b]) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1469,14 +1607,14 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, pUpdOp = pTrans->getNdbOperation(tab.getName()); if (pUpdOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pUpdOp->updateTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1484,7 +1622,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pUpdOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1494,7 +1632,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == false){ if(setValueForAttr(pUpdOp, a, r+b, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1507,14 +1645,14 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); ndbout << "r = " << r << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } else{ @@ -1522,7 +1660,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r += batch; // Read next record } @@ -1541,7 +1679,6 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; while (r < records){ @@ -1568,14 +1705,14 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, NdbOperation* pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1584,7 +1721,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1596,7 +1733,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1608,13 +1745,13 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1624,14 +1761,14 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, pUpdOp = pTrans->getNdbOperation(tab.getName()); if (pUpdOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pUpdOp->interpretedUpdateTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1640,7 +1777,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pUpdOp, a, r) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1657,7 +1794,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, check = pUpdOp->incValue(attr->getName(), valToIncWith); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1669,7 +1806,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, (calc.isUpdateCol(a) == false)){ if(setValueForAttr(pUpdOp, a, r, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1683,14 +1820,14 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); ndbout << "r = " << r << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } else{ @@ -1698,7 +1835,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r++; // Read next record @@ -1720,7 +1857,6 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; g_info << "|- Deleting records..." << endl; @@ -1752,14 +1888,14 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->deleteTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1768,7 +1904,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1780,7 +1916,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, switch(err.status){ case NdbError::TemporaryError: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; @@ -1799,20 +1935,20 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, } } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; break; default: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else { deleted++; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r++; // Read next record @@ -1835,7 +1971,6 @@ HugoTransactions::lockRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a, b; - NdbConnection *pTrans; NdbOperation *pOp; // Calculate how many records to lock in each batch @@ -1875,14 +2010,14 @@ HugoTransactions::lockRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1891,7 +2026,7 @@ HugoTransactions::lockRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1902,7 +2037,7 @@ HugoTransactions::lockRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1918,18 +2053,18 @@ HugoTransactions::lockRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } for (int b=0; (b<lockBatch) && (r+b<records); b++){ if (calc.verifyRowValues(rows[b]) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1944,26 +2079,26 @@ HugoTransactions::lockRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } else{ for (int b=0; (b<lockBatch) && (r<records); b++){ if (calc.verifyRowValues(rows[b]) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } r++; // Read next record } } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } @@ -1982,7 +2117,6 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; NdbIndexScanOperation *sOp; NdbResultSet * rs; @@ -2030,7 +2164,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, pOp = pTrans->getNdbIndexOperation(idxName, tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTuple(); @@ -2038,7 +2172,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, pOp = sOp = pTrans->getNdbIndexScanOperation(idxName, tab.getName()); if (sOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2048,7 +2182,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2057,7 +2191,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2068,7 +2202,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2081,7 +2215,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; @@ -2094,13 +2228,13 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, default: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else{ for (int b=0; (b<batchsize) && (r+b<records); b++){ if (calc.verifyRowValues(rows[b]) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } reads++; @@ -2109,11 +2243,11 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if(ordered && rs->nextResult(true) == 0){ ndbout << "Error when comparing records " << " - index op next_result to many" << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } deallocRows(); g_info << reads << " records read" << endl; @@ -2133,7 +2267,6 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a, b; - NdbConnection *pTrans; NdbOperation *pOp; NdbScanOperation * sOp; NdbResultSet * rs; @@ -2174,21 +2307,21 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, pOp = pTrans->getNdbIndexOperation(idxName, tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else { pOp = sOp = pTrans->getNdbIndexScanOperation(idxName, tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2201,7 +2334,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2212,7 +2345,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2223,7 +2356,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if( check == -1 ) { const NdbError err = pTrans->getNdbError(); ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); @@ -2235,13 +2368,13 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if(ordered && check != 0){ g_err << "Row: " << r << " not found!!" << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } for(b = 0; b<batchsize && (b+r)<records; b++){ if (calc.verifyRowValues(rows[b]) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2257,13 +2390,13 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (pUpdOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2272,7 +2405,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pUpdOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2283,7 +2416,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == false){ if(setValueForAttr(pUpdOp, a, r+b, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2294,7 +2427,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if( check == -1 ) { const NdbError err = pTrans->getNdbError(); ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); @@ -2307,7 +2440,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, updated += batchsize; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r+= batchsize; // Read next record } diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index a513086dc33..289633b060a 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -9,7 +9,8 @@ libNDBT_a_SOURCES = \ HugoAsynchTransactions.cpp UtilTransactions.cpp \ NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \ NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp \ - NdbSchemaCon.cpp NdbSchemaOp.cpp + NdbSchemaCon.cpp NdbSchemaOp.cpp getarg.c \ + CpcClient.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/common/mgmcommon -I$(top_srcdir)/ndb/include/mgmcommon -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/src/mgmapi @@ -18,3 +19,17 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libNDBT.dsp + +libNDBT.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB diff --git a/ndb/test/src/Makefile_old b/ndb/test/src/Makefile_old deleted file mode 100644 index 2738ce1aba2..00000000000 --- a/ndb/test/src/Makefile_old +++ /dev/null @@ -1,33 +0,0 @@ -include .defs.mk - -TYPE := ndbapitest - -ARCHIVE_TARGET := NDBT - -SOURCES = NDBT_ReturnCodes.cpp \ - NDBT_Error.cpp NDBT_Tables.cpp NDBT_ResultRow.cpp \ - NDBT_Test.cpp HugoCalculator.cpp \ - HugoOperations.cpp HugoTransactions.cpp \ - HugoAsynchTransactions.cpp UtilTransactions.cpp \ - NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \ - NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp - -SOURCES.c = - -CFLAGS_NdbRestarter.cpp := -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) -CFLAGS_NdbConfig.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/src/mgmapi) -CFLAGS_NdbRestarts.cpp := -I$(call fixpath,$(NDB_TOP)/include/kernel) -CFLAGS_NdbBackup.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/src/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/include/kernel) -CFLAGS_NdbGrep.cpp += -I$(call fixpath,$(NDB_TOP)/include/kernel) -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) - -include $(NDB_TOP)/Epilogue.mk - - - - - - - diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 367223f8c98..600a5443f40 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -327,13 +327,17 @@ NDBT_Finalizer::NDBT_Finalizer(NDBT_TestCase* ptest, NDBT_TestCase::NDBT_TestCase(NDBT_TestSuite* psuite, const char* pname, const char* pcomment) : - name(pname) , - comment(pcomment), - suite(psuite){ + name(strdup(pname)) , + comment(strdup(pcomment)), + suite(psuite) +{ + _name.assign(pname); + _comment.assign(pcomment); + name= _name.c_str(); + comment= _comment.c_str(); assert(suite != NULL); } - NDBT_TestCaseImpl1::NDBT_TestCaseImpl1(NDBT_TestSuite* psuite, const char* pname, const char* pcomment) : @@ -475,7 +479,6 @@ void * runStep_C(void * s) { runStep(s); - NdbThread_Exit(0); return NULL; } @@ -519,6 +522,7 @@ void NDBT_TestCaseImpl1::waitSteps(){ NdbThread_WaitFor(threads[i], &status); NdbThread_Destroy(&threads[i]); } + threads.clear(); } @@ -839,9 +843,9 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab, continue; } pTab2 = pDict->getTable(pTab->getName()); - } else { + } else if(!pTab2) { pTab2 = pTab; - } + } ctx = new NDBT_Context(); ctx->setTab(pTab2); diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 1ce48d495a5..5e22468692e 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -46,7 +46,8 @@ NdbBackup::start(unsigned int & _backup_id){ ndb_mgm_reply reply; reply.return_code = 0; - if (ndb_mgm_start_backup(handle, + if (ndb_mgm_start_backup(handle, + 2, // wait until completed &_backup_id, &reply) == -1) { g_err << "Could not start backup " << endl; @@ -69,28 +70,19 @@ NdbBackup::getBackupDataDirForNode(int _node_id){ /** * Fetch configuration from management server */ - LocalConfig lc; - if (!lc.init(0,0)) { - abort(); - } - ConfigRetriever cr(lc, 0, NODE_TYPE_API); - ndb_mgm_configuration * p = 0; + ndb_mgm_configuration *p; + if (connect()) + return NULL; - BaseString tmp; tmp.assfmt("%s:%d", host.c_str(), port); - NdbMgmHandle handle = ndb_mgm_create_handle(); - if(handle == 0 || ndb_mgm_connect(handle, tmp.c_str()) != 0 || - (p = ndb_mgm_get_configuration(handle, 0)) == 0){ - - const char * s = 0; - if(p == 0 && handle != 0){ - s = ndb_mgm_get_latest_error_msg(handle); - if(s == 0) - s = "No error given!"; + if ((p = ndb_mgm_get_configuration(handle, 0)) == 0) + { + const char * s= ndb_mgm_get_latest_error_msg(handle); + if(s == 0) + s = "No error given!"; - ndbout << "Could not fetch configuration" << endl; - ndbout << s << endl; - return NULL; - } + ndbout << "Could not fetch configuration" << endl; + ndbout << s << endl; + return NULL; } /** @@ -155,13 +147,14 @@ NdbBackup::execRestore(bool _restore_data, ndbout << "scp res: " << res << endl; - BaseString::snprintf(buf, 255, "%sndb_restore -c \"host=%s\" -n %d -b %d %s %s .", + BaseString::snprintf(buf, 255, "%sndb_restore -c \"%s:%d\" -n %d -b %d %s %s .", #if 1 "", #else "valgrind --leak-check=yes -v " #endif - addr.c_str(), + ndb_mgm_get_connected_host(handle), + ndb_mgm_get_connected_port(handle), _node_id, _backup_id, _restore_data?"-r":"", diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 4d6d3ddc001..91c0963feae 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -18,7 +18,6 @@ #include <NdbOut.hpp> #include <NdbSleep.h> #include <NdbTick.h> -#include <LocalConfig.hpp> #include <mgmapi_debug.h> #include <NDBT_Output.hpp> #include <random.h> @@ -33,42 +32,11 @@ NdbRestarter::NdbRestarter(const char* _addr): connected(false), - port(-1), handle(NULL), m_config(0) { if (_addr == NULL){ - LocalConfig lcfg; - if(!lcfg.init()){ - lcfg.printError(); - lcfg.printUsage(); - g_err << "NdbRestarter - Error parsing local config file" << endl; - return; - } - - if (lcfg.ids.size() == 0){ - g_err << "NdbRestarter - No management servers configured in local config file" << endl; - return; - } - - for (int i = 0; i<lcfg.ids.size(); i++){ - MgmtSrvrId * m = &lcfg.ids[i]; - - switch(m->type){ - case MgmId_TCP: - char buf[255]; - snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); - addr.assign(buf); - host.assign(m->name.c_str()); - port = m->port; - return; - break; - case MgmId_File: - break; - default: - break; - } - } + addr.assign(""); } else { addr.assign(_addr); } @@ -391,13 +359,22 @@ NdbRestarter::isConnected(){ int NdbRestarter::connect(){ + disconnect(); handle = ndb_mgm_create_handle(); if (handle == NULL){ g_err << "handle == NULL" << endl; return -1; } g_info << "Connecting to mgmsrv at " << addr.c_str() << endl; - if (ndb_mgm_connect(handle, addr.c_str()) == -1) { + if (ndb_mgm_set_connectstring(handle,addr.c_str())) + { + MGMERR(handle); + g_err << "Connection to " << addr.c_str() << " failed" << endl; + return -1; + } + + if (ndb_mgm_connect(handle, 0, 0, 0) == -1) + { MGMERR(handle); g_err << "Connection to " << addr.c_str() << " failed" << endl; return -1; diff --git a/ndb/test/src/NdbRestarts.cpp b/ndb/test/src/NdbRestarts.cpp index b649a60d98b..607e48c4126 100644 --- a/ndb/test/src/NdbRestarts.cpp +++ b/ndb/test/src/NdbRestarts.cpp @@ -445,7 +445,7 @@ int twoNodeFailure(NdbRestarter& _restarter, << ") secs " << endl; NdbSleep_SecSleep(seconds); - randomId = (random() % _restarter.getNumDbNodes()); + randomId = (rand() % _restarter.getNumDbNodes()); nodeId = _restarter.getDbNodeId(randomId); g_info << _restart->m_name << ": node = "<< nodeId << endl; diff --git a/ndb/test/src/UtilTransactions.cpp b/ndb/test/src/UtilTransactions.cpp index c0e6effd244..869f7fc76cb 100644 --- a/ndb/test/src/UtilTransactions.cpp +++ b/ndb/test/src/UtilTransactions.cpp @@ -619,7 +619,7 @@ UtilTransactions::addRowToInsert(Ndb* pNdb, int UtilTransactions::scanReadRecords(Ndb* pNdb, int parallelism, - bool exclusive, + NdbOperation::LockMode lm, int records, int noAttribs, int *attrib_list, @@ -669,10 +669,7 @@ UtilTransactions::scanReadRecords(Ndb* pNdb, return NDBT_FAILED; } - NdbResultSet * rs = pOp->readTuples(exclusive ? - NdbScanOperation::LM_Exclusive : - NdbScanOperation::LM_Read, - 0, parallelism); + NdbResultSet * rs = pOp->readTuples(lm, 0, parallelism); if( rs == 0 ) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); @@ -761,7 +758,7 @@ int UtilTransactions::selectCount(Ndb* pNdb, int parallelism, int* count_rows, - ScanLock lock, + NdbOperation::LockMode lm, NdbConnection* pTrans){ int retryAttempt = 0; @@ -785,19 +782,7 @@ UtilTransactions::selectCount(Ndb* pNdb, return NDBT_FAILED; } - NdbResultSet * rs; - switch(lock){ - case SL_ReadHold: - rs = pOp->readTuples(NdbScanOperation::LM_Read); - break; - case SL_Exclusive: - rs = pOp->readTuples(NdbScanOperation::LM_Exclusive); - break; - case SL_Read: - default: - rs = pOp->readTuples(NdbScanOperation::LM_CommittedRead); - } - + NdbResultSet * rs = pOp->readTuples(lm); if( rs == 0) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); diff --git a/ndb/src/common/util/getarg.c b/ndb/test/src/getarg.c index 99b2840a5a6..5b67eb6343d 100644 --- a/ndb/src/common/util/getarg.c +++ b/ndb/test/src/getarg.c @@ -35,16 +35,35 @@ #include <ndb_global.h> #include "getarg.h" - -#define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag) +#include <basestring_vsnprintf.h> #ifndef HAVE_STRLCPY -extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); -#endif /* !HAVE_STRLCPY */ - +static size_t +strlcpy (char *dst, const char *src, size_t dst_sz) +{ + size_t n; + char *p; + for (p = dst, n = 0; + n + 1 < dst_sz && *src != '\0'; + ++p, ++src, ++n) + *p = *src; + *p = '\0'; + if (*src == '\0') + return n; + else + return n + strlen (src); +} +#endif #ifndef HAVE_STRLCAT -extern size_t strlcat (char *dst, const char *src, size_t dst_sz); -#endif /* !HAVE_STRLCAT */ +static size_t +strlcat (char *dst, const char *src, size_t dst_sz) +{ + size_t len = strlen(dst); + return len + strlcpy (dst + len, src, dst_sz - len); +} +#endif + +#define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag) #ifndef max #define max(a, b) (a) > (b) ? (a) : (b) @@ -275,7 +294,7 @@ arg_printusage (struct getargs *args, col += fprintf(stderr, " %s", buf); } if (args[i].short_name) { - snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); + basestring_snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); len += 2; len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf), 0, 0, &args[i]); diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am index 8d94c21b721..a6a013bb263 100644 --- a/ndb/test/tools/Makefile.am +++ b/ndb/test/tools/Makefile.am @@ -20,12 +20,12 @@ copy_tab_SOURCES = copy_tab.cpp create_index_SOURCES = create_index.cpp ndb_cpcc_SOURCES = cpcc.cpp -INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient - include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am -ndb_cpcc_LDADD = $(LDADD) $(top_builddir)/ndb/src/mgmclient/CpcClient.o +ndb_cpcc_LDADD = $(LDADD) # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/test/tools/Makefile_old b/ndb/test/tools/Makefile_old deleted file mode 100644 index b8e90ae207f..00000000000 --- a/ndb/test/tools/Makefile_old +++ /dev/null @@ -1,9 +0,0 @@ -include .defs.mk - -DIRS := hugoCalculator hugoFill hugoLoad hugoLockRecords \ - hugoPkDelete hugoPkRead hugoPkReadRecord hugoPkUpdate \ - hugoScanRead hugoScanUpdate restart waiter - -include $(NDB_TOP)/Epilogue.mk - -_bins_ndbapi : _libs_src diff --git a/ndb/test/tools/create_index.cpp b/ndb/test/tools/create_index.cpp index 75a657522f6..6e4c5377f4a 100644 --- a/ndb/test/tools/create_index.cpp +++ b/ndb/test/tools/create_index.cpp @@ -30,7 +30,7 @@ main(int argc, const char** argv){ const char* _dbname = "TEST_DB"; int _help = 0; - int _ordered, _pk; + int _ordered = 0, _pk = 1; struct getargs args[] = { { "database", 'd', arg_string, &_dbname, "dbname", diff --git a/ndb/test/tools/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead.cpp index cdfdcea4654..42180207a8a 100644 --- a/ndb/test/tools/hugoScanRead.cpp +++ b/ndb/test/tools/hugoScanRead.cpp @@ -35,13 +35,17 @@ int main(int argc, const char** argv){ int _parallelism = 1; const char* _tabname = NULL; int _help = 0; - + int lock = NdbOperation::LM_Read; + int sorted = 0; + struct getargs args[] = { { "aborts", 'a', arg_integer, &_abort, "percent of transactions that are aborted", "abort%" }, { "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" }, { "parallelism", 'p', arg_integer, &_parallelism, "parallelism(1-240)", "para" }, { "records", 'r', arg_integer, &_records, "Number of records", "recs" }, - { "usage", '?', arg_flag, &_help, "Print help", "" } + { "usage", '?', arg_flag, &_help, "Print help", "" }, + { "lock", 'm', arg_integer, &lock, "lock mode", "" }, + { "sorted", 's', arg_flag, &sorted, "sorted", "" } }; int num_args = sizeof(args) / sizeof(args[0]); int optind = 0; @@ -73,16 +77,48 @@ int main(int argc, const char** argv){ ndbout << " Table " << _tabname << " does not exist!" << endl; return NDBT_ProgramExit(NDBT_WRONGARGS); } + + const NdbDictionary::Index * pIdx = 0; + if(optind+1 < argc) + { + pIdx = MyNdb.getDictionary()->getIndex(argv[optind+1], _tabname); + if(!pIdx) + ndbout << " Index " << argv[optind+1] << " not found" << endl; + else + if(pIdx->getType() != NdbDictionary::Index::UniqueOrderedIndex && + pIdx->getType() != NdbDictionary::Index::OrderedIndex) + { + ndbout << " Index " << argv[optind+1] << " is not scannable" << endl; + pIdx = 0; + } + } HugoTransactions hugoTrans(*pTab); int i = 0; while (i<_loops || _loops==0) { ndbout << i << ": "; - if(hugoTrans.scanReadRecords(&MyNdb, - 0, - _abort, - _parallelism) != 0){ - return NDBT_ProgramExit(NDBT_FAILED); + if(!pIdx) + { + if(hugoTrans.scanReadRecords(&MyNdb, + 0, + _abort, + _parallelism, + (NdbOperation::LockMode)lock) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + } + else + { + if(hugoTrans.scanReadRecords(&MyNdb, pIdx, + 0, + _abort, + _parallelism, + (NdbOperation::LockMode)lock, + sorted) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } } i++; } diff --git a/ndb/test/tools/old_dirs/waiter/Makefile_old b/ndb/test/tools/old_dirs/waiter/Makefile_old deleted file mode 100644 index da2c9daff00..00000000000 --- a/ndb/test/tools/old_dirs/waiter/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := ndbapitest - -BIN_TARGET := waiter - -# Source files of non-templated classes (.C files) -SOURCES = waiter.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/test/tools/transproxy.cpp b/ndb/test/tools/transproxy.cpp index 88267801172..28a621fa584 100644 --- a/ndb/test/tools/transproxy.cpp +++ b/ndb/test/tools/transproxy.cpp @@ -291,7 +291,6 @@ extern "C" void* copyrun_C(void* copy) { ((Copy*) copy)->run(); - NdbThread_Exit(0); return 0; } @@ -322,7 +321,6 @@ extern "C" void* connrun_C(void* conn) { ((Conn*) conn)->run(); - NdbThread_Exit(0); return 0; } diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 64625f69ea2..c350fb0a141 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -1,5 +1,6 @@ ndbtools_PROGRAMS = \ + ndb_test_platform \ ndb_waiter \ ndb_drop_table \ ndb_delete_all \ @@ -7,22 +8,34 @@ ndbtools_PROGRAMS = \ ndb_drop_index \ ndb_show_tables \ ndb_select_all \ - ndb_select_count + ndb_select_count \ + ndb_restore -tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp ../test/src/NDBT_Table.cpp ../test/src/NDBT_Output.cpp +tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp \ + ../test/src/NDBT_Table.cpp \ + ../test/src/NDBT_Output.cpp +ndb_test_platform_SOURCES = ndb_test_platform.cpp ndb_waiter_SOURCES = waiter.cpp $(tools_common_sources) ndb_delete_all_SOURCES = delete_all.cpp $(tools_common_sources) ndb_desc_SOURCES = desc.cpp $(tools_common_sources) ndb_drop_index_SOURCES = drop_index.cpp $(tools_common_sources) ndb_drop_table_SOURCES = drop_tab.cpp $(tools_common_sources) ndb_show_tables_SOURCES = listTables.cpp $(tools_common_sources) -ndb_select_all_SOURCES = select_all.cpp ../test/src/NDBT_ResultRow.cpp $(tools_common_sources) +ndb_select_all_SOURCES = select_all.cpp \ + ../test/src/NDBT_ResultRow.cpp \ + $(tools_common_sources) ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources) +ndb_restore_SOURCES = restore/restore_main.cpp \ + restore/consumer.cpp \ + restore/consumer_restore.cpp \ + restore/consumer_printer.cpp \ + restore/Restore.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am +ndb_test_platform_LDFLAGS = @ndb_bin_am_ldflags@ ndb_waiter_LDFLAGS = @ndb_bin_am_ldflags@ ndb_drop_table_LDFLAGS = @ndb_bin_am_ldflags@ ndb_delete_all_LDFLAGS = @ndb_bin_am_ldflags@ @@ -31,6 +44,113 @@ ndb_drop_index_LDFLAGS = @ndb_bin_am_ldflags@ ndb_show_tables_LDFLAGS = @ndb_bin_am_ldflags@ ndb_select_all_LDFLAGS = @ndb_bin_am_ldflags@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: \ + ndb_waiter.dsp \ + ndb_drop_table.dsp \ + ndb_delete_all.dsp \ + ndb_desc.dsp \ + ndb_drop_index.dsp \ + ndb_show_tables.dsp \ + ndb_select_all.dsp \ + ndb_select_count.dsp + +ndb_waiter.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_waiter + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_waiter_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_drop_table.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_table + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_table_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_delete_all.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_delete_all + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_delete_all_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_desc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_desc + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_desc_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_drop_index.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_index + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_index_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_show_tables.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_show_tables + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_show_tables_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_select_all.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_select_all + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_all_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_select_count.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_select_count + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_count_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/tools/Makefile_old b/ndb/tools/Makefile_old deleted file mode 100644 index b9dc6883e18..00000000000 --- a/ndb/tools/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -BIN_DIRS = select_all select_count desc list_tables \ - drop_tab delete_all copy_tab \ - create_index drop_index verify_index cpcc - -ifneq ($(NDB_ODBC),N) -BIN_DIRS += ndbsql -endif - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index aa5798376ae..21e0c2ac089 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -15,41 +15,52 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> +#include <ndb_opts.h> #include <NdbOut.hpp> #include <NdbApi.hpp> #include <NdbSleep.h> #include <NDBT.hpp> -#include <getarg.h> - static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240); -int main(int argc, const char** argv){ - ndb_init(); +NDB_STD_OPTS_VARS; - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _help = 0; - - struct getargs args[] = { - { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"} - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* _dbname = "TEST_DB"; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_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() +{ char desc[] = "tabname\n"\ "This program will delete all records in the specified table using scan delete.\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help) { - arg_printusage(args, num_args, argv[0], desc); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_delete_all.trace"); +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); - } - _tabname = argv[optind]; + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); @@ -64,13 +75,12 @@ int main(int argc, const char** argv){ // Check if table exists in db int res = NDBT_OK; - for(int i = optind; i<argc; i++){ + for(int i = 0; i<argc; i++){ const NdbDictionary::Table * pTab = NDBT_Table::discoverTableFromDb(&MyNdb, argv[i]); if(pTab == NULL){ - ndbout << " Table " << _tabname << " does not exist!" << endl; + ndbout << " Table " << argv[i] << " does not exist!" << endl; return NDBT_ProgramExit(NDBT_WRONGARGS); } - ndbout << "Deleting all from " << argv[i] << "..."; if(clear_table(&MyNdb, pTab) == NDBT_FAILED){ res = NDBT_FAILED; diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index 9eed1485a6d..4287a771694 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -14,40 +14,53 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <getarg.h> +#include <ndb_global.h> +#include <ndb_opts.h> #include <NDBT.hpp> #include <NdbApi.hpp> +NDB_STD_OPTS_VARS; - - -int main(int argc, const char** argv){ - ndb_init(); - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _unqualified = 0; - int _help = 0; - - struct getargs args[] = { - { "unqualified", 'u', arg_flag, &_unqualified, "unqualified", - "Use unqualified table names"}, - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* _dbname = "TEST_DB"; +static int _unqualified = 0; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "unqualified", 'u', "Use unqualified table names", + (gptr*) &_unqualified, (gptr*) &_unqualified, 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() +{ char desc[] = "tabname\n"\ "This program list all properties of table(s) in NDB Cluster.\n"\ " ex: desc T1 T2 T4\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL ||_help) { - arg_printusage(args, num_args, argv[0], desc); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_desc.trace"); +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); - } - _tabname = argv[optind]; + + Ndb::setConnectString(opt_connect_str); Ndb* pMyNdb; pMyNdb = new Ndb(_dbname); @@ -60,7 +73,7 @@ int main(int argc, const char** argv){ ndbout << endl; NdbDictionary::Dictionary * dict = pMyNdb->getDictionary(); - for (int i = optind; i < argc; i++) { + for (int i = 0; i < argc; i++) { NDBT_Table* pTab = (NDBT_Table*)dict->getTable(argv[i]); if (pTab != 0){ ndbout << (* pTab) << endl; diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 70c29461c23..2fcba41bd11 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -15,38 +15,53 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> +#include <ndb_opts.h> #include <NdbOut.hpp> #include <NdbApi.hpp> #include <NDBT.hpp> -#include <getarg.h> +NDB_STD_OPTS_VARS; -int main(int argc, const char** argv){ - ndb_init(); - - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _help = 0; - - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* _dbname = "TEST_DB"; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_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() +{ char desc[] = "<indexname>+\n"\ "This program will drop index(es) in Ndb\n"; + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_drop_index.trace"); +} - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help){ - arg_printusage(args, num_args, argv[0], desc); +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if (argc < 1) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } - _tabname = argv[optind]; + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); if(MyNdb.init() != 0){ @@ -58,7 +73,7 @@ int main(int argc, const char** argv){ ndbout << "Waiting for ndb to become ready..." << endl; int res = 0; - for(int i = optind; i<argc; i++){ + for(int i = 0; i<argc; i++){ ndbout << "Dropping index " << argv[i] << "..."; int tmp; if((tmp = MyNdb.getDictionary()->dropIndex(argv[i], 0)) != 0){ diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 15c229cb0fb..091db5cc4b7 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -15,43 +15,53 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> +#include <ndb_opts.h> #include <NdbOut.hpp> #include <NdbApi.hpp> #include <NDBT.hpp> -#include <getarg.h> +NDB_STD_OPTS_VARS; -int main(int argc, const char** argv){ - ndb_init(); - - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - const char* _connectstr = NULL; - int _help = 0; - - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "connstr", 'c', arg_string, &_connectstr, "connect string", - "How to connect to NDB"}, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* _dbname = "TEST_DB"; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_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() +{ char desc[] = "tabname\n"\ "This program will drop one table in Ndb\n"; + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_drop_table.trace"); +} - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help){ - arg_printusage(args, num_args, argv[0], desc); +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if (argc < 1) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } - _tabname = argv[optind]; - - if (_connectstr) - Ndb::setConnectString(_connectstr); + + Ndb::setConnectString(opt_connect_str); Ndb MyNdb(_dbname); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); @@ -62,7 +72,7 @@ int main(int argc, const char** argv){ ndbout << "Waiting for ndb to become ready..." << endl; int res = 0; - for(int i = optind; i<argc; i++){ + for(int i = 0; i<argc; i++){ ndbout << "Dropping table " << argv[i] << "..."; int tmp; if((tmp = MyNdb.getDictionary()->dropTable(argv[i])) != 0){ diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index 4fc5bcd7f21..064ec299ef9 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -22,7 +22,7 @@ */ #include <ndb_global.h> -#include <getarg.h> +#include <ndb_opts.h> #include <NdbApi.hpp> #include <NDBT.hpp> @@ -161,63 +161,65 @@ list(const char * tabname, } } -#ifndef DBUG_OFF -const char *debug_option= 0; -#endif +NDB_STD_OPTS_VARS; -int main(int argc, const char** argv){ - ndb_init(); - int _loops = 1; - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _type = 0; - int _help = 0; - const char* _connect_str = NULL; - - struct getargs args[] = { - { "loops", 'l', arg_integer, &_loops, "loops", - "Number of times to run(default = 1)" }, - { "unqualified", 'u', arg_flag, &_unqualified, "unqualified", - "Use unqualified table names"}, - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "type", 't', arg_integer, &_type, "type", - "Type of objects to show, see NdbDictionary.hpp for numbers(default = 0)" }, - { "connect-string", 'c', arg_string, &_connect_str, - "Set connect string for connecting to ndb_mgmd. <constr>=\"host=<hostname:port>[;nodeid=<id>]\". Overides specifying entries in NDB_CONNECTSTRING and config file", - "<constr>" }, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options" }, -#endif - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* _dbname = "TEST_DB"; +static int _loops; +static int _type; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_show_tables"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "loops", 'l', "loops", + (gptr*) &_loops, (gptr*) &_loops, 0, + GET_INT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0 }, + { "type", 't', "type", + (gptr*) &_type, (gptr*) &_type, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "unqualified", 'u', "Use unqualified table names", + (gptr*) &_unqualified, (gptr*) &_unqualified, 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() +{ char desc[] = "tabname\n"\ "This program list all system objects in NDB Cluster.\n"\ "Type of objects to display can be limited with -t option\n"\ - " ex: list_tables -t 2 would show all UserTables\n"\ + " ex: ndb_show_tables -t 2 would show all UserTables\n"\ "To show all indexes for a table write table name as final argument\n"\ - " ex: list_tables T1\n"; - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, argv[0], desc); + " ex: ndb_show_tables T1\n"; + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_show_tables.trace"); +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char* _tabname; + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); - } - _tabname = argv[optind]; - -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif + _tabname = argv[0]; - ndb_cluster_connection = new Ndb_cluster_connection(_connect_str); + ndb_cluster_connection = new Ndb_cluster_connection(opt_connect_str); + if (ndb_cluster_connection->connect(12,5,1)) + fatal("unable to connect"); ndb = new Ndb(ndb_cluster_connection, _dbname); if (ndb->init() != 0) fatal("init"); - ndb_cluster_connection->connect(); if (ndb->waitUntilReady(30) < 0) fatal("waitUntilReady"); dic = ndb->getDictionary(); diff --git a/ndb/tools/ndb_test_platform.cpp b/ndb/tools/ndb_test_platform.cpp new file mode 100644 index 00000000000..72dd146dacd --- /dev/null +++ b/ndb/tools/ndb_test_platform.cpp @@ -0,0 +1,95 @@ +/* Copyright (C) 2003 MySQL 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 */ + + +#include <ndb_global.h> +#include <my_sys.h> +#include <BaseString.hpp> + +/* + * Test BaseString::snprintf + */ + +static +int test_snprintf(const char * fmt, int buf_sz, int result) +{ + int ret; + char buf[100]; + ret = BaseString::snprintf(buf, buf_sz, fmt); + + if(ret < 0) + { + printf("BaseString::snprint returns %d with size=%d and strlen(fmt)=%d\n", + ret, buf_sz, strlen(fmt)); + return -1; + } + + if(ret+1 == buf_sz) + { + printf("BaseString::snprint truncates returns %d with size=%d and strlen(fmt)=%d\n", + ret, buf_sz, strlen(fmt)); + return -1; + } + + if(ret != result) + { + printf("BaseString::snprint returns incorrect value: returned=%d != expected=%d\n", + ret, result); + return -1; + } + + for(ret = 0; ret+1 < buf_sz && ret < result; ret++) + { + if(buf[ret] != fmt[ret]) + { + printf("BaseString::snprint Incorrect value in output buffer: " + "size=%d returned=expected=%d at pos=%d result=%d != expected=%d\n", + buf_sz, result, ret, buf[ret], fmt[ret]); + return -1; + } + } + return 0; +} + +int +main(void) +{ + /* + * Test BaseString::snprintf + */ + + if(test_snprintf("test", 1, 4)) + return -1; + + if(test_snprintf("test", 0, 4)) + return -1; + + if(test_snprintf("test", 100, 4)) + return -1; + + /* + * Test UintPtr + */ + + if (sizeof(UintPtr) != sizeof(Uint32*)) + { + printf("sizeof(UintPtr)=%d != sizeof(Uint32*)=%d\n", + sizeof(UintPtr), sizeof(Uint32*)); + return -1; + } + + return 0; +} diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index fb3bde6bdef..fa616ee8fee 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Restore.hpp" -#include "BackupFormat.hpp" #include <NdbTCP.h> #include <OutputStream.hpp> #include <Bitmask.hpp> @@ -25,9 +24,6 @@ #include <SimpleProperties.hpp> #include <signaldata/DictTabInfo.hpp> -// from src/ndbapi -#include <NdbDictionaryImpl.hpp> - Uint16 Twiddle16(Uint16 in); // Byte shift 16-bit data Uint32 Twiddle32(Uint32 in); // Byte shift 32-bit data Uint64 Twiddle64(Uint64 in); // Byte shift 64-bit data @@ -196,14 +192,15 @@ RestoreMetaData::readGCPEntry() { return true; } -TableS::TableS(NdbTableImpl* tableImpl) +TableS::TableS(Uint32 version, NdbTableImpl* tableImpl) : m_dictTable(tableImpl) { m_dictTable = tableImpl; m_noOfNullable = m_nullBitmaskSize = 0; m_auto_val_id= ~(Uint32)0; m_max_auto_val= 0; - + backupVersion = version; + for (int i = 0; i < tableImpl->getNoOfColumns(); i++) createAttr(tableImpl->getColumn(i)); } @@ -230,11 +227,10 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len) debug << "parseTableInfo " << tableImpl->getName() << " done" << endl; - TableS * table = new TableS(tableImpl); + TableS * table = new TableS(m_fileHeader.NdbVersion, tableImpl); if(table == NULL) { return false; } - table->setBackupVersion(m_fileHeader.NdbVersion); debug << "Parsed table id " << table->getTableId() << endl; debug << "Parsed table #attr " << table->getNoOfAttributes() << endl; @@ -264,16 +260,16 @@ TupleS & TupleS::operator=(const TupleS& tuple) memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData)); return *this; -}; +} int TupleS::getNoOfAttributes() const { if (m_currentTable == 0) return 0; return m_currentTable->getNoOfAttributes(); -}; +} TableS * TupleS::getTable() const { return m_currentTable; -}; +} const AttributeDesc * TupleS::getDesc(int i) const { return m_currentTable->allAttributesDesc[i]; @@ -281,7 +277,7 @@ const AttributeDesc * TupleS::getDesc(int i) const { AttributeData * TupleS::getData(int i) const{ return &(allAttrData[i]); -}; +} bool TupleS::prepareRecord(TableS & tab){ @@ -703,12 +699,12 @@ void TableS::createAttr(NdbDictionary::Column *column) if (d->m_column->getAutoIncrement()) m_auto_val_id= d->attrId; - if(d->m_column->getPrimaryKey() /* && not variable */) + if(d->m_column->getPrimaryKey() && backupVersion <= MAKE_VERSION(4,1,7)) { m_fixedKeys.push_back(d); return; } - + if(!d->m_column->getNullable()) { m_fixedAttribs.push_back(d); diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index 0ec1ab852e9..d7f6e3b7799 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -19,7 +19,8 @@ #include <ndb_global.h> #include <NdbOut.hpp> -#include <BackupFormat.hpp> +#include "../src/kernel/blocks/backup/BackupFormat.hpp" +#include "../src/ndbapi/NdbDictionaryImpl.hpp" #include <NdbApi.hpp> #include <ndb_version.h> @@ -139,7 +140,7 @@ class TableS { public: class NdbDictionary::Table* m_dictTable; - TableS (class NdbTableImpl* dictTable); + TableS (Uint32 version, class NdbTableImpl* dictTable); ~TableS(); Uint32 getTableId() const { @@ -186,28 +187,33 @@ public: }; void update_max_auto_val(const char *data, int size) { - Uint64 val= 0; + union { + Uint8 u8; + Uint16 u16; + Uint32 u32; + } val; + Uint64 v; switch(size){ - case 8: - val= *(Uint8*)data; - break; - case 16: - val= *(Uint16*)data; - break; - case 24: - val= (0xffffff)&*(Uint32*)data; + case 64: + memcpy(&v,data,8); break; case 32: - val= *(Uint32*)data; + memcpy(&val.u32,data,4); + v= val.u32; break; - case 64: - val= *(Uint64*)data; + case 16: + memcpy(&val.u16,data,2); + v= val.u16; + break; + case 8: + memcpy(&val.u8,data,1); + v= val.u8; break; default: return; }; - if(val > m_max_auto_val) - m_max_auto_val= val; + if(v > m_max_auto_val) + m_max_auto_val= v; }; /** * Get attribute descriptor diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.cpp b/ndb/tools/restore/consumer.cpp index e94c31b2666..ecbdbbf8f4e 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer.cpp +++ b/ndb/tools/restore/consumer.cpp @@ -44,9 +44,12 @@ BackupConsumer::create_table_string(const TableS & table, case NdbDictionary::Column::Float: pos += sprintf(buf+pos, "%s", "float"); break; - case NdbDictionary::Column::Decimal: + case NdbDictionary::Column::Olddecimal: pos += sprintf(buf+pos, "%s", "decimal"); break; + case NdbDictionary::Column::Olddecimalunsigned: + pos += sprintf(buf+pos, "%s", "decimal unsigned"); + break; case NdbDictionary::Column::Char: pos += sprintf(buf+pos, "%s", "char"); break; @@ -71,7 +74,10 @@ BackupConsumer::create_table_string(const TableS & table, case NdbDictionary::Column::Datetime: pos += sprintf(buf+pos, "%s", "datetime"); break; - case NdbDictionary::Column::Timespec: + case NdbDictionary::Column::Date: + pos += sprintf(buf+pos, "%s", "date"); + break; + case NdbDictionary::Column::Time: pos += sprintf(buf+pos, "%s", "time"); break; case NdbDictionary::Column::Undefined: diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.hpp b/ndb/tools/restore/consumer.hpp index 692c814159f..692c814159f 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer.hpp +++ b/ndb/tools/restore/consumer.hpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp b/ndb/tools/restore/consumer_printer.cpp index 0aa5b521d29..0aa5b521d29 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp +++ b/ndb/tools/restore/consumer_printer.cpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp b/ndb/tools/restore/consumer_printer.hpp index 7cbc924e364..7cbc924e364 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp +++ b/ndb/tools/restore/consumer_printer.hpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp index a35d9d22c65..fbe96cb2a71 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp +++ b/ndb/tools/restore/consumer_restore.cpp @@ -16,7 +16,6 @@ #include "consumer_restore.hpp" #include <NdbSleep.h> -#include <NdbDictionaryImpl.hpp> extern FilteredNdbOut err; extern FilteredNdbOut info; @@ -53,19 +52,10 @@ BackupRestore::init() return false; } - m_tuples = new TupleS[m_parallelism]; - - if (m_tuples == 0) - { - err << "Failed to allocate tuples" << endl; - return false; - } - m_free_callback= m_callback; for (Uint32 i= 0; i < m_parallelism; i++) { m_callback[i].restore= this; m_callback[i].connection= 0; - m_callback[i].tup= &m_tuples[i]; if (i > 0) m_callback[i-1].next= &(m_callback[i]); } @@ -87,12 +77,6 @@ void BackupRestore::release() delete [] m_callback; m_callback= 0; } - - if (m_tuples) - { - delete [] m_tuples; - m_tuples= 0; - } } BackupRestore::~BackupRestore() @@ -119,14 +103,21 @@ BackupRestore::get_table(const NdbDictionary::Table* tab){ m_cache.m_old_table = tab; int cnt, id1, id2; - char buf[256]; - if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", buf, buf, &id1, &id2)) == 4){ - BaseString::snprintf(buf, sizeof(buf), "NDB$BLOB_%d_%d", m_new_tables[id1]->getTableId(), id2); - m_cache.m_new_table = m_ndb->getDictionary()->getTable(buf); + char db[256], schema[256]; + if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", + db, schema, &id1, &id2)) == 4){ + m_ndb->setDatabaseName(db); + m_ndb->setSchemaName(schema); + + BaseString::snprintf(db, sizeof(db), "NDB$BLOB_%d_%d", + m_new_tables[id1]->getTableId(), id2); + + m_cache.m_new_table = m_ndb->getDictionary()->getTable(db); + } else { m_cache.m_new_table = m_new_tables[tab->getTableId()]; } - + assert(m_cache.m_new_table); return m_cache.m_new_table; } @@ -267,22 +258,24 @@ void BackupRestore::tuple(const TupleS & tup) if (!m_restore) return; + while (m_free_callback == 0) + { + assert(m_transactions == m_parallelism); + // send-poll all transactions + // close transaction is done in callback + m_ndb->sendPollNdb(3000, 1); + } + restore_callback_t * cb = m_free_callback; - + if (cb == 0) assert(false); - + m_free_callback = cb->next; cb->retries = 0; - *(cb->tup) = tup; // must do copy! + cb->tup = tup; // must do copy! tuple_a(cb); - if (m_free_callback == 0) - { - // send-poll all transactions - // close transaction is done in callback - m_ndb->sendPollNdb(3000, 1); - } } void BackupRestore::tuple_a(restore_callback_t *cb) @@ -304,7 +297,7 @@ void BackupRestore::tuple_a(restore_callback_t *cb) exitHandler(); } // if - const TupleS &tup = *(cb->tup); + const TupleS &tup = cb->tup; const NdbDictionary::Table * table = get_table(tup.getTable()->m_dictTable); NdbOperation * op = cb->connection->getNdbOperation(table); @@ -373,7 +366,9 @@ void BackupRestore::tuple_a(restore_callback_t *cb) m_transactions++; return; } - err << "Unable to recover from errors. Exiting..." << endl; + err << "Retried transaction " << cb->retries << " times.\nLast error" + << m_ndb->getNdbError(cb->error_code) << endl + << "...Unable to recover from errors. Exiting..." << endl; exitHandler(); } @@ -417,16 +412,21 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) NdbError error= cb->connection->getNdbError(); m_ndb->closeTransaction(cb->connection); cb->connection= 0; + + Uint32 sleepTime = 100 + cb->retries * 300; + cb->retries++; + cb->error_code = error.code; + switch(error.status) { case NdbError::Success: - return false; - // ERROR! - break; - + return false; + // ERROR! + break; + case NdbError::TemporaryError: - NdbSleep_MilliSleep(10); + NdbSleep_MilliSleep(sleepTime); return true; // RETRY break; @@ -439,15 +439,6 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) default: case NdbError::PermanentError: - switch (error.code) - { - case 499: - case 250: - NdbSleep_MilliSleep(10); - return true; //temp errors? - default: - break; - } //ERROR err << error << endl; return false; @@ -469,13 +460,10 @@ BackupRestore::tuple_free() if (!m_restore) return; - if (m_transactions > 0) { - // Send all transactions to NDB - m_ndb->sendPreparedTransactions(0); - - // Poll all transactions - while (m_transactions > 0) - m_ndb->pollNdb(3000, m_transactions); + // Poll all transactions + while (m_transactions) + { + m_ndb->sendPollNdb(3000); } } diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp b/ndb/tools/restore/consumer_restore.hpp index 59e2734ea1f..df219cd4412 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp +++ b/ndb/tools/restore/consumer_restore.hpp @@ -21,9 +21,10 @@ struct restore_callback_t { class BackupRestore *restore; - class TupleS *tup; + class TupleS tup; class NdbConnection *connection; int retries; + int error_code; restore_callback_t *next; }; @@ -39,7 +40,6 @@ public: m_restore_meta = false; m_parallelism = parallelism; m_callback = 0; - m_tuples = 0; m_free_callback = 0; m_transactions = 0; m_cache.m_old_table = 0; @@ -68,9 +68,8 @@ public: Uint32 m_dataCount; Uint32 m_parallelism; - Uint32 m_transactions; + volatile Uint32 m_transactions; - TupleS *m_tuples; restore_callback_t *m_callback; restore_callback_t *m_free_callback; diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp b/ndb/tools/restore/consumer_restorem.cpp index 6a9ec07148a..6a9ec07148a 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp +++ b/ndb/tools/restore/consumer_restorem.cpp diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/tools/restore/restore_main.cpp index f7b1479cc93..84f9511fe2f 100644 --- a/ndb/src/kernel/blocks/backup/restore/main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -14,7 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <getarg.h> +#include <ndb_global.h> +#include <ndb_opts.h> #include <Vector.hpp> #include <ndb_limits.h> #include <NdbTCP.h> @@ -35,80 +36,107 @@ static Vector<class BackupConsumer *> g_consumers; static const char* ga_backupPath = "." DIR_SEPARATOR; -static const char* ga_connect_NDB = NULL; +NDB_STD_OPTS_VARS; /** * print and restore flags */ static bool ga_restore = false; static bool ga_print = false; +static int _print = 0; +static int _print_meta = 0; +static int _print_data = 0; +static int _print_log = 0; +static int _restore_data = 0; +static int _restore_meta = 0; + +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_restore"), + { "connect", 'c', "same as --connect-string", + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "nodeid", 'n', "Backup files from node with id", + (gptr*) &ga_nodeId, (gptr*) &ga_nodeId, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "backupid", 'b', "Backup id", + (gptr*) &ga_backupId, (gptr*) &ga_backupId, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "restore_data", 'r', + "Restore table data/logs into NDB Cluster using NDBAPI", + (gptr*) &_restore_data, (gptr*) &_restore_data, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "restore_meta", 'm', + "Restore meta data into NDB Cluster using NDBAPI", + (gptr*) &_restore_meta, (gptr*) &_restore_meta, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "parallelism", 'p', + "No of parallel transactions during restore of data." + "(parallelism can be 1 to 1024)", + (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0, + GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 }, + { "print", 256, "Print data and log to stdout", + (gptr*) &_print, (gptr*) &_print, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "print_data", 257, "Print data to stdout", + (gptr*) &_print_data, (gptr*) &_print_data, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "print_meta", 258, "Print meta data to stdout", + (gptr*) &_print_meta, (gptr*) &_print_meta, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "print_log", 259, "Print log to stdout", + (gptr*) &_print_log, (gptr*) &_print_log, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "dont_ignore_systab_0", 'f', + "Experimental. Do not ignore system table during restore.", + (gptr*) &ga_dont_ignore_systab_0, (gptr*) &ga_dont_ignore_systab_0, 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 short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS] [<path to backup files>]\n", my_progname); +} +static void usage() +{ + short_usage_sub(); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_restore.trace"); + switch (optid) { + case 'n': + if (ga_nodeId == 0) + { + printf("Error in --nodeid,-n setting, see --help\n"); + exit(1); + } + break; + case 'b': + if (ga_backupId == 0) + { + printf("Error in --backupid,-b setting, see --help\n"); + exit(1); + } + break; + } + return 0; +} bool -readArguments(const int argc, const char** argv) +readArguments(int *pargc, char*** pargv) { - - int _print = 0; - int _print_meta = 0; - int _print_data = 0; - int _print_log = 0; - int _restore_data = 0; - int _restore_meta = 0; - - - struct getargs args[] = - { - { "connect", 'c', arg_string, &ga_connect_NDB, - "NDB Cluster connection", "\"nodeid=<api id>;host=<hostname:port>\""}, - { "nodeid", 'n', arg_integer, &ga_nodeId, - "Backup files from node", "db node id"}, - { "backupid", 'b',arg_integer, &ga_backupId, "Backup id", "backup id"}, - { "print", '\0', arg_flag, &_print, - "Print data and log to stdout", "print data and log"}, - { "print_data", '\0', arg_flag, &_print_data, - "Print data to stdout", "print data"}, - { "print_meta", '\0', arg_flag, &_print_meta, - "Print meta data to stdout", "print meta data"}, - { "print_log", '\0', arg_flag, &_print_log, - "Print log to stdout", "print log"}, - { "restore_data", 'r', arg_flag, &_restore_data, - "Restore table data/logs into NDB Cluster using NDBAPI", - "Restore table data/log"}, - { "restore_meta", 'm', arg_flag, &_restore_meta, - "Restore meta data into NDB Cluster using NDBAPI", "Restore meta data"}, - { "parallelism", 'p', arg_integer, &ga_nParallelism, - "No of parallel transactions during restore of data." - "(parallelism can be 1 to 1024)", - "Parallelism"}, -#ifdef USE_MYSQL - { "use_mysql", '\0', arg_flag, &use_mysql, - "Restore meta data via mysql. Systab will be ignored. Data is restored " - "using NDBAPI.", "use mysql"}, - { "user", '\0', arg_string, &ga_user, "MySQL user", "Default: root"}, - { "password", '\0', arg_string, &ga_password, "MySQL user's password", - "Default: \"\" "}, - { "host", '\0', arg_string, &ga_host, "Hostname of MySQL server", - "Default: localhost"}, - { "socket", '\0', arg_string, &ga_socket, "Path to MySQL server socket file", - "Default: /tmp/mysql.sock"}, - { "port", '\0', arg_integer, &ga_port, "Port number of MySQL server", - "Default: 3306"}, -#endif - { "dont_ignore_systab_0", 'f', arg_flag, &ga_dont_ignore_systab_0, - "Experimental. Do not ignore system table during restore.", - "dont_ignore_systab_0"} - - }; - - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; - - if (getarg(args, num_args, argc, argv, &optind) || - ga_nodeId == 0 || - ga_backupId == 0 || - ga_nParallelism < 1 || - ga_nParallelism >1024) + const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 }; + load_defaults("my",load_default_groups,pargc,pargv); + if (handle_options(pargc, pargv, my_long_options, get_one_option)) { - arg_printusage(args, num_args, argv[0], "<path to backup files>\n"); - return false; + exit(1); } BackupPrinter* printer = new BackupPrinter(); @@ -122,10 +150,6 @@ readArguments(const int argc, const char** argv) return false; } - /** - * Got segmentation fault when using the printer's attributes directly - * in getargs... Do not have the time to found out why... this is faster... - */ if (_print) { ga_print = true; @@ -169,15 +193,14 @@ readArguments(const int argc, const char** argv) g_consumers.push_back(c); } // Set backup file path - if (argv[optind] != NULL) + if (*pargv[0] != NULL) { - ga_backupPath = argv[optind]; + ga_backupPath = *pargv[0]; } return true; } - void clearConsumers() { @@ -204,19 +227,16 @@ free_data_callback() } int -main(int argc, const char** argv) +main(int argc, char** argv) { - ndb_init(); - if (!readArguments(argc, argv)) + NDB_INIT(argv[0]); + + if (!readArguments(&argc, &argv)) { return -1; } - if (ga_connect_NDB != NULL) - { - // Use connection string - Ndb::setConnectString(ga_connect_NDB); - } + Ndb::setConnectString(opt_connect_str); /** * we must always load meta data, even if we will only print it to stdout @@ -227,11 +247,18 @@ main(int argc, const char** argv) ndbout << "Failed to read " << metaData.getFilename() << endl << endl; return -1; } + + const BackupFormat::FileHeader & tmp = metaData.getFileHeader(); + const Uint32 version = tmp.NdbVersion; + + ndbout << "Ndb version in backup files: " + << getVersionString(version, 0) << endl; + /** * check wheater we can restore the backup (right version). */ int res = metaData.loadContent(); - + if (res == 0) { ndbout_c("Restore: Failed to load content"); @@ -323,7 +350,8 @@ main(int argc, const char** argv) if (res < 0) { - err << "Restore: An error occured while restoring data. Exiting... res=" << res << endl; + err << "Restore: An error occured while restoring data. Exiting... " + << "res=" << res << endl; return -1; } @@ -349,7 +377,8 @@ main(int argc, const char** argv) } if (res < 0) { - err << "Restore: An restoring the data log. Exiting... res=" << res << endl; + err << "Restore: An restoring the data log. Exiting... res=" + << res << endl; return -1; } logIter.validateFooter(); //not implemented diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 9f8108d9f32..23fd2290349 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -16,6 +16,7 @@ #include <ndb_global.h> +#include <ndb_opts.h> #include <NdbOut.hpp> @@ -23,13 +24,8 @@ #include <NdbMain.h> #include <NDBT.hpp> #include <NdbSleep.h> -#include <getarg.h> #include <NdbScanFilter.hpp> -#ifndef DBUG_OFF -const char *debug_option= 0; -#endif - int scanReadRecords(Ndb*, const NdbDictionary::Table*, const NdbDictionary::Index*, @@ -40,39 +36,41 @@ int scanReadRecords(Ndb*, char delim, bool orderby); -int main(int argc, const char** argv){ - ndb_init(); - int _parallelism = 240; - const char* _delimiter = "\t"; - int _header = true; - int _useHexFormat = false; - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _help = 0; - int _lock = 0; - int _order = 0; - - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "parallelism", 'p', arg_integer, &_parallelism, "parallelism", - "parallelism" }, - { "header", 'h', arg_flag, &_header, "Print header", "header" }, - { "useHexFormat", 'x', arg_flag, &_useHexFormat, - "Output numbers in hexadecimal format", "useHexFormat" }, - { "delimiter", 'd', arg_string, &_delimiter, "Column delimiter", - "delimiter" }, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options" }, -#endif - { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "lock", 'l', arg_integer, &_lock, - "Read(0), Read-hold(1), Exclusive(2)", "lock"}, - { "order", 'o', arg_flag, &_order, "Sort resultset according to index", ""} - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +NDB_STD_OPTS_VARS; + +static const char* _dbname = "TEST_DB"; +static const char* _delimiter = "\t"; +static int _unqualified, _header, _parallelism, _useHexFormat, _lock, + _order; + +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "parallelism", 'p', "parallelism", + (gptr*) &_parallelism, (gptr*) &_parallelism, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)", + (gptr*) &_lock, (gptr*) &_lock, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "order", 'o', "Sort resultset according to index", + (gptr*) &_order, (gptr*) &_order, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "header", 'h', "Print header", + (gptr*) &_header, (gptr*) &_header, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, + { "useHexFormat", 'x', "Output numbers in hexadecimal format", + (gptr*) &_useHexFormat, (gptr*) &_useHexFormat, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "delimiter", 'D', "Column delimiter", + (gptr*) &_delimiter, (gptr*) &_delimiter, 0, + GET_STR, REQUIRED_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() +{ char desc[] = "tabname\n"\ "This program reads all records from one table in NDB Cluster\n"\ @@ -80,19 +78,32 @@ int main(int argc, const char** argv){ "(It only print error messages if it encounters a permanent error.)\n"\ "It can also be used to dump the content of a table to file \n"\ " ex: select_all --no-header --delimiter=';' T4 > T4.data\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help) { - arg_printusage(args, num_args, argv[0], desc); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_select_all.trace"); +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + const char* _tabname; + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if ((_tabname = argv[0]) == 0) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } - _tabname = argv[optind]; - -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); @@ -108,14 +119,19 @@ int main(int argc, const char** argv){ // Check if table exists in db const NdbDictionary::Table* pTab = NDBT_Table::discoverTableFromDb(&MyNdb, _tabname); const NdbDictionary::Index * pIdx = 0; - if(optind+1 < argc){ - pIdx = MyNdb.getDictionary()->getIndex(argv[optind+1], _tabname); + if(argc > 1){ + pIdx = MyNdb.getDictionary()->getIndex(argv[1], _tabname); } if(pTab == NULL){ ndbout << " Table " << _tabname << " does not exist!" << endl; return NDBT_ProgramExit(NDBT_WRONGARGS); } + + if(argc > 1 && pIdx == 0) + { + ndbout << " Index " << argv[1] << " does not exists" << endl; + } if(_order && pIdx == NULL){ ndbout << " Order flag given without an index" << endl; diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index 6650421e637..a9a3e71da67 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -16,6 +16,7 @@ #include <ndb_global.h> +#include <ndb_opts.h> #include <NdbOut.hpp> @@ -23,7 +24,6 @@ #include <NdbMain.h> #include <NDBT.hpp> #include <NdbSleep.h> -#include <getarg.h> #include <UtilTransactions.hpp> static int @@ -32,34 +32,55 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, int* count_rows, UtilTransactions::ScanLock lock); -int main(int argc, const char** argv){ - ndb_init(); - const char* _dbname = "TEST_DB"; - int _parallelism = 240; - int _help = 0; - int _lock = 0; - - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "parallelism", 's', arg_integer, &_parallelism, "parallelism", "parallelism" }, - { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "lock", 'l', arg_integer, &_lock, - "Read(0), Read-hold(1), Exclusive(2)", "lock"} - - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +NDB_STD_OPTS_VARS; + +static const char* _dbname = "TEST_DB"; +static int _parallelism = 240; +static int _lock = 0; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "parallelism", 'p', "parallelism", + (gptr*) &_parallelism, (gptr*) &_parallelism, 0, + GET_INT, REQUIRED_ARG, 240, 0, 0, 0, 0, 0 }, + { "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)", + (gptr*) &_lock, (gptr*) &_lock, 0, + GET_INT, REQUIRED_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() +{ char desc[] = "tabname1 ... tabnameN\n"\ "This program will count the number of records in tables\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help) { - arg_printusage(args, num_args, argv[0], desc); + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_select_count.trace"); +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if (argc < 1) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); @@ -72,7 +93,7 @@ int main(int argc, const char** argv){ while(MyNdb.waitUntilReady() != 0) ndbout << "Waiting for ndb to become ready..." << endl; - for(int i = optind; i<argc; i++){ + for(int i = 0; i<argc; i++){ // Check if table exists in db const NdbDictionary::Table * pTab = NDBT_Table::discoverTableFromDb(&MyNdb, argv[i]); if(pTab == NULL){ diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index c01a3f9192e..cc6a21428c8 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -16,88 +16,89 @@ #include <ndb_global.h> +#include <ndb_opts.h> + #include <mgmapi.h> #include <NdbMain.h> #include <NdbOut.hpp> #include <NdbSleep.h> -#include <getarg.h> #include <kernel/ndb_limits.h> -#include "../include/mgmcommon/LocalConfig.hpp" #include <NDBT.hpp> int -waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); +waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, + unsigned int _timeout); + +enum ndb_waiter_options { + OPT_WAIT_STATUS_NOT_STARTED = NDB_STD_OPTIONS_LAST +}; +NDB_STD_OPTS_VARS; + +static int _no_contact = 0; +static int _not_started = 0; +static int _timeout = 120; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "no-contact", 'n', "Wait for cluster no contact", + (gptr*) &_no_contact, (gptr*) &_no_contact, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started", + (gptr*) &_not_started, (gptr*) &_not_started, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "timeout", 't', "Timeout to wait", + (gptr*) &_timeout, (gptr*) &_timeout, 0, + GET_INT, REQUIRED_ARG, 120, 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() +{ + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} -int main(int argc, const char** argv){ - ndb_init(); +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_drop_table.trace"); +} +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); const char* _hostName = NULL; - int _no_contact = 0; - int _help = 0; - int _timeout = 120; - - struct getargs args[] = { - { "timeout", 0, arg_integer, &_timeout, "Timeout to wait", "#" }, - { "no-contact", 0, arg_flag, &_no_contact, "Wait for cluster no contact", "" }, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; - char desc[] = - "hostname:port\n"\ - "This program will connect to the mgmsrv of a NDB cluster.\n"\ - "It will then wait for all nodes to be started\n"; - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, argv[0], desc); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); - } char buf[255]; - _hostName = argv[optind]; - - if (_hostName == NULL){ - LocalConfig lcfg; - if(!lcfg.init()) - { - lcfg.printError(); - lcfg.printUsage(); - g_err << "Error parsing local config file" << endl; - return NDBT_ProgramExit(NDBT_FAILED); - } + _hostName = argv[0]; - for (unsigned i = 0; i<lcfg.ids.size();i++) - { - MgmtSrvrId * m = &lcfg.ids[i]; - - switch(m->type){ - case MgmId_TCP: - snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); - _hostName = buf; - break; - case MgmId_File: - break; - default: - break; - } - if (_hostName != NULL) - break; - } - if (_hostName == NULL) - { - g_err << "No management servers configured in local config file" << endl; - return NDBT_ProgramExit(NDBT_FAILED); - } + if (_hostName == 0) + _hostName= opt_connect_str; + + enum ndb_mgm_node_status wait_status; + if (_no_contact) + { + wait_status= NDB_MGM_NODE_STATUS_NO_CONTACT; + } + else if (_not_started) + { + wait_status= NDB_MGM_NODE_STATUS_NOT_STARTED; + } + else + { + wait_status= NDB_MGM_NODE_STATUS_STARTED; } - if (_no_contact) { - if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT, _timeout) != 0) - return NDBT_ProgramExit(NDBT_FAILED); - } else if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_STARTED, _timeout) != 0) + if (waitClusterStatus(_hostName, wait_status, _timeout) != 0) return NDBT_ProgramExit(NDBT_FAILED); - return NDBT_ProgramExit(NDBT_OK); } @@ -183,13 +184,19 @@ waitClusterStatus(const char* _addr, int _nodes[MAX_NDB_NODES]; int _num_nodes = 0; - handle = ndb_mgm_create_handle(); + handle = ndb_mgm_create_handle(); if (handle == NULL){ g_err << "handle == NULL" << endl; return -1; } g_info << "Connecting to mgmsrv at " << _addr << endl; - if (ndb_mgm_connect(handle, _addr) == -1) { + if (ndb_mgm_set_connectstring(handle, _addr)) + { + MGMERR(handle); + g_err << "Connectstring " << _addr << " invalid" << endl; + return -1; + } + if (ndb_mgm_connect(handle,0,0,1)) { MGMERR(handle); g_err << "Connection to " << _addr << " failed" << endl; return -1; diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index 25e843c87e3..2bd7150ec0d 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -171,15 +171,9 @@ do rm $file.org done -# create the libmysql.imp file in netware folder from libmysql/libmysql.def -# file -echo "generating llibmysql.imp file..." -awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp - # create the libmysql.imp file in netware folder from libmysql/libmysql.def file echo "generating llibmysql.imp file..." -awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp - +awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp # build linux tools echo "compiling linux tools..." diff --git a/netware/comp_err.def b/netware/comp_err.def index d694c07174a..f27b40c7b78 100644 --- a/netware/comp_err.def +++ b/netware/comp_err.def @@ -2,7 +2,7 @@ # MySQL Error File Compiler #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Error File Compiler" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/init_db.sql b/netware/init_db.sql index 15111c9043b..c5810b50e8e 100644 --- a/netware/init_db.sql +++ b/netware/init_db.sql @@ -3,14 +3,14 @@ CREATE DATABASE test; USE mysql; -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; +CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); @@ -18,21 +18,21 @@ INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('',''); -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; +CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; +CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; -CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics'; -CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; +CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help topics'; +CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help categories'; +CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help keywords'; +CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='keyword-topic relation'; -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names'; +CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone names'; -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones'; -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; +CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zones'; +CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transitions'; -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; +CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transition types'; +CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Leap seconds information for time zones'; diff --git a/netware/isamchk.def b/netware/isamchk.def index 69e8ac0405b..31cf3fc569a 100644 --- a/netware/isamchk.def +++ b/netware/isamchk.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL ISAM Table Check Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Check Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/isamlog.def b/netware/isamlog.def index bb8312066ef..52f9de0d928 100644 --- a/netware/isamlog.def +++ b/netware/isamlog.def @@ -2,7 +2,7 @@ # ISAM Log #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Log Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/libmysql.def b/netware/libmysql.def index 7804c4468a5..fea117dedd1 100644 --- a/netware/libmysql.def +++ b/netware/libmysql.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm EXPORT @libmysql.imp -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Client Library" VERSION 4, 0 AUTOUNLOAD diff --git a/netware/my_print_defaults.def b/netware/my_print_defaults.def index 49f167341ae..826981256b5 100644 --- a/netware/my_print_defaults.def +++ b/netware/my_print_defaults.def @@ -2,7 +2,7 @@ # My Print Defaults #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Print Defaults Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/myisam_ftdump.def b/netware/myisam_ftdump.def index 259d6617445..9639404b53b 100644 --- a/netware/myisam_ftdump.def +++ b/netware/myisam_ftdump.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Dump Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Dump Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/myisamchk.def b/netware/myisamchk.def index cdfe186058f..eaa01730872 100644 --- a/netware/myisamchk.def +++ b/netware/myisamchk.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Check Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Check Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/myisamlog.def b/netware/myisamlog.def index 5c4cbb23361..3580c870c10 100644 --- a/netware/myisamlog.def +++ b/netware/myisamlog.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Log Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Log Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/myisampack.def b/netware/myisampack.def index 9111538c2c0..a6946982236 100644 --- a/netware/myisampack.def +++ b/netware/myisampack.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Pack Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Pack Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql.def b/netware/mysql.def index 9b4424ed4fb..5ae8dc102a0 100644 --- a/netware/mysql.def +++ b/netware/mysql.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Monitor" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Monitor" VERSION 4, 0 MULTIPLE diff --git a/netware/mysql_fix_privilege_tables.pl b/netware/mysql_fix_privilege_tables.pl index c0a428eff0f..20af37be2d7 100644 --- a/netware/mysql_fix_privilege_tables.pl +++ b/netware/mysql_fix_privilege_tables.pl @@ -206,7 +206,7 @@ unique index (name) \ print "Filling online help tables with contents...\n"; # Generate the path for "fill_help_tables.sql" file which is in different folder. $fill_help_table=$0; -$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/support-files\\fill_help_tables.sql/; +$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/share\\fill_help_tables.sql/; #read all content from the sql file which contains recordsfor help tables. open(fileIN,$fill_help_table) or die("Cannot open $fill_help_table: $!"); diff --git a/netware/mysql_install.def b/netware/mysql_install.def index 87fc76919f9..3392afb7298 100644 --- a/netware/mysql_install.def +++ b/netware/mysql_install.def @@ -2,7 +2,7 @@ # My Print Defaults #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Install Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql_install_db.def b/netware/mysql_install_db.def index 4653638b5ad..1657b7c17af 100644 --- a/netware/mysql_install_db.def +++ b/netware/mysql_install_db.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Install" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Initial Database Installer" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index fd5725a6414..d8cfb79c1cb 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -192,7 +192,7 @@ void install_db(char *datadir) char error[PATH_MAX]; // input file - snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); + snprintf(input, PATH_MAX, "%s/bin/test_db.sql", base_dir); snprintf(output, PATH_MAX, "%s/install.out", datadir); snprintf(error, PATH_MAX, "%s/install.err", datadir); @@ -1160,7 +1160,8 @@ void setup(char *file) setenv("MASTER_MYPORT", "9306", 1); setenv("SLAVE_MYPORT", "9307", 1); setenv("MYSQL_TCP_PORT", "3306", 1); - + snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port); + setenv("MYSQL_CLIENT_TEST",file_path,1); } /****************************************************************************** diff --git a/netware/mysql_test_run.def b/netware/mysql_test_run.def index b34f62a1f91..d4d4baee168 100644 --- a/netware/mysql_test_run.def +++ b/netware/mysql_test_run.def @@ -4,7 +4,7 @@ MODULE libc.nlm STACKSIZE 65536 SCREENNAME "MySQL Test Run" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Test Run" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql_waitpid.def b/netware/mysql_waitpid.def index 4d56d29c42f..da0884ccba3 100644 --- a/netware/mysql_waitpid.def +++ b/netware/mysql_waitpid.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm #SCREENNAME "MySQL Tool - Wait for a Program to Terminate" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Tool - Wait for a Program to Terminate" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/mysqladmin.def b/netware/mysqladmin.def index 0ace36992b1..46f90d531fa 100644 --- a/netware/mysqladmin.def +++ b/netware/mysqladmin.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Admin" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Admin Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlbinlog.def b/netware/mysqlbinlog.def index 89677b4a353..25a470e7353 100644 --- a/netware/mysqlbinlog.def +++ b/netware/mysqlbinlog.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Binary Log Dump Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Binary Log Dump Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlcheck.def b/netware/mysqlcheck.def index 8820e9aae8e..7067b1d1729 100644 --- a/netware/mysqlcheck.def +++ b/netware/mysqlcheck.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Check Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Check Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqld.def b/netware/mysqld.def index 6856aefe56c..42c2d176a1b 100644 --- a/netware/mysqld.def +++ b/netware/mysqld.def @@ -2,7 +2,7 @@ # MySQL Server #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Database Server" VERSION 4, 0 MULTIPLE diff --git a/netware/mysqld_safe.def b/netware/mysqld_safe.def index 9080ef783c9..2a9ef04b47d 100644 --- a/netware/mysqld_safe.def +++ b/netware/mysqld_safe.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Database Server" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Database Server Monitor" VERSION 4, 0 MULTIPLE diff --git a/netware/mysqldump.def b/netware/mysqldump.def index 901c9b262dc..ddacf7bc0d5 100644 --- a/netware/mysqldump.def +++ b/netware/mysqldump.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Dump Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Dump Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlimport.def b/netware/mysqlimport.def index d6f7fcb6bbd..5253da42567 100644 --- a/netware/mysqlimport.def +++ b/netware/mysqlimport.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Import" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Import Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlshow.def b/netware/mysqlshow.def index 2b41386f643..0b61b81dcf9 100644 --- a/netware/mysqlshow.def +++ b/netware/mysqlshow.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Show" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Show Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqltest.def b/netware/mysqltest.def index d98f6436a4a..e134acede07 100644 --- a/netware/mysqltest.def +++ b/netware/mysqltest.def @@ -2,7 +2,7 @@ # MySQL Admin #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Test Case Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/pack_isam.def b/netware/pack_isam.def index f0f5a7e328a..b93cfdffbeb 100644 --- a/netware/pack_isam.def +++ b/netware/pack_isam.def @@ -2,7 +2,7 @@ # Pack ISAM #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Pack Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/perror.def b/netware/perror.def index f1d23715f55..18c95d8b236 100644 --- a/netware/perror.def +++ b/netware/perror.def @@ -2,7 +2,7 @@ # PERROR #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Error Code Description Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/replace.def b/netware/replace.def index b55690152b9..19348ee4245 100644 --- a/netware/replace.def +++ b/netware/replace.def @@ -2,7 +2,7 @@ # Replace #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Text Replacement Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/resolve_stack_dump.def b/netware/resolve_stack_dump.def index 21fd177fbc7..01042699d61 100644 --- a/netware/resolve_stack_dump.def +++ b/netware/resolve_stack_dump.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm #SCREENNAME "MySQL Stack Dump Resolve Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Stack Dump Resolve Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/resolveip.def b/netware/resolveip.def index 10b99304e22..244f52bb969 100644 --- a/netware/resolveip.def +++ b/netware/resolveip.def @@ -2,7 +2,7 @@ # Resolve IP #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL IP/Hostname Resolve Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/pstack/pstack.c b/pstack/pstack.c index 75869686e35..4cdd80d68b5 100644 --- a/pstack/pstack.c +++ b/pstack/pstack.c @@ -1663,7 +1663,7 @@ pr_tag_type (p, name, id, kind) { struct pr_handle *info = (struct pr_handle *) p; const char *t, *tag; - char idbuf[20]; + char idbuf[30]; switch (kind) { diff --git a/regex/Makefile.am b/regex/Makefile.am index 2e23efcbf2a..ee7fc5463b7 100644 --- a/regex/Makefile.am +++ b/regex/Makefile.am @@ -17,12 +17,11 @@ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include noinst_LIBRARIES = libregex.a -LDADD = libregex.a ../strings/libmystrings.a +LDADD= libregex.a $(top_builddir)/strings/libmystrings.a noinst_HEADERS = cclass.h cname.h regex2.h utils.h engine.c regex.h libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c noinst_PROGRAMS = re re_SOURCES = split.c debug.c main.c -re_DEPENDENCIES= $(LIBRARIES) re_LDFLAGS= @NOINST_LDFLAGS@ EXTRA_DIST = tests CHANGES COPYRIGHT WHATSNEW regexp.c \ debug.ih engine.ih main.ih regcomp.ih regerror.ih \ diff --git a/regex/regcomp.c b/regex/regcomp.c index 5f0351c32aa..998b39379aa 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -860,11 +860,28 @@ othercase(charset,ch) CHARSET_INFO *charset; int ch; { + /* + In MySQL some multi-byte character sets + have 'ctype' array but don't have 'to_lower' + and 'to_upper' arrays. In this case we handle + only basic latin letters a..z and A..Z. + + If 'to_lower' and 'to_upper' arrays are empty in a character set, + then my_isalpha(cs, ch) should never return TRUE for characters + other than basic latin letters. Otherwise it should be + considered as a mistake in character set definition. + */ assert(my_isalpha(charset,ch)); if (my_isupper(charset,ch)) - return(my_tolower(charset,ch)); + { + return(charset->to_lower ? my_tolower(charset,ch) : + ch - 'A' + 'a'); + } else if (my_islower(charset,ch)) - return(my_toupper(charset,ch)); + { + return(charset->to_upper ? my_toupper(charset,ch) : + ch - 'a' + 'A'); + } else /* peculiar, but could happen */ return(ch); } diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4158b5a34dc..d5337df35b1 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -121,6 +121,7 @@ SUFFIXES = .sh -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ + -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ @@ -139,6 +140,9 @@ SUFFIXES = .sh -e 's!@''IS_LINUX''@!@IS_LINUX@!' \ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ + -e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \ + -e 's!@''NON_THREADED_LIBS''@!@NON_THREADED_LIBS@!' \ + -e 's!@''ZLIB_DEPS''@!@ZLIB_DEPS@!' \ -e "s!@MAKE@!$(MAKE)!" \ $< > $@-t @CHMOD@ +x $@-t diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index cb5437f7178..fc0c684c2dc 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -197,9 +197,13 @@ sub prepare_name $a =~ s/(\@node(.*?)\n)/ /g; $a =~ s/(\@tab)/\t/g; $a =~ s/\@item/ /g; + $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@dots\{\}/.../g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; @@ -244,9 +248,13 @@ sub prepare_description $a =~ s/(\@item)/ /g; $a =~ s/(\@tindex\s(.*?)\n)//g; $a =~ s/(\@c\s(.*?)\n)//g; + $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@dots\{\}/.../g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; @@ -273,6 +281,8 @@ sub prepare_example $a =~ s/(^\@c for_help_topic(.*?)\n)//g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@dots\{\}/.../g; $a =~ s/\\/\\\\/g; $a =~ s/(\@{)/{/g; $a =~ s/(\@})/}/g; @@ -444,10 +454,12 @@ sub print_verbose_errors print STDERR "number of help keywords - ",$count_keywords,"\n"; my $count_without_help= scalar(@without_help); + my $percent_without_help= $count_lex ? + int (($count_without_help/$count_lex)*100) : + "100"; print_bad_names(\@without_help,"lexems without help (". $count_without_help." ~ ". - (int (($count_without_help/$count_lex)*100)). - "%)"); + $percent_without_help."%)"); print_bad_names(\@description_with_at, " topics below have symbol \'@\' in their descriptions.\n". "it's probably the litter from 'texi' tags (script needs fixing)"); @@ -457,10 +469,12 @@ sub print_verbose_errors print_bad_names(\@without_description,"topics without description"); my $count_without_example= scalar(@without_example); + my $percent_without_example= $count_topics ? + int (($count_without_example/$count_topics)*100) : + "100"; print_bad_names(\@without_example,"topics without example (". $count_without_example." ~ ". - (int (($count_without_example/$count_topics)*100)). - "%)"); + $percent_without_example."%)"); } print_verbose_errors if ($verbose_option ne 0); @@ -479,6 +493,24 @@ sub print_insert_header } } +print <<EOF; +-- Copyright (C) 2000-2005 MySQL 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 + +EOF print "delete from help_topic;\n"; print "delete from help_category;\n"; print "delete from help_keyword;\n"; diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 281ef9bd469..70eff2db79b 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -107,8 +107,11 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS -"; + client/mysqlbinlog$BS \ + tests/mysql_client_test$BS \ + libmysqld/examples/mysql_client_test_embedded$BS \ + libmysqld/examples/mysqltest_embedded$BS \ + "; # Platform-specific bin dir files: if [ $BASE_SYSTEM = "netware" ] ; then @@ -127,6 +130,9 @@ else client/.libs/mysqltest client/.libs/mysqlcheck \ client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ + tests/.libs/mysql_client_test \ + libmysqld/examples/.libs/mysql_client_test_embedded \ + libmysqld/examples/.libs/mysqltest_embedded \ "; fi @@ -187,7 +193,7 @@ fi if [ $BASE_SYSTEM != "netware" ] ; then if [ -d tests ] ; then - $CP tests/client_test tests/*.res tests/*.tst tests/*.pl $BASE/tests + $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests fi if [ -d man ] ; then $CP man/*.1 $BASE/man/man1 @@ -214,7 +220,7 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r +$CP mysql-test/r/*result mysql-test/r/*result.es mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* @@ -236,8 +242,12 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - cp ./netware/static_init_db.sql ./netware/init_db.sql - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql +echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql + echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 > $BASE/bin/test_db.sql +# cp ./netware/static_init_db.sql ./netware/init_db.sql +# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # @@ -272,7 +282,7 @@ if [ x$NDBCLUSTER = x1 ]; then $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/lib/. + $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 rm -rf $BASE/ndb-stage fi diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index e58d44f336b..16a033b8de4 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -6,7 +6,6 @@ version=@VERSION@ export version -SOURCE=`pwd` CP="cp -p" DEBUG=0 @@ -24,6 +23,7 @@ if [ ! -f scripts/make_win_src_distribution ]; then echo "ERROR : You must run this script from the MySQL top-level directory" exit 1 fi +SOURCE=`pwd` # # Check for source compilation/configuration @@ -119,7 +119,7 @@ unix_to_dos() for arg do print_debug "Replacing LF -> CRLF from '$arg'" - cat $arg | awk '{sub(/$/,"\r");print}' > $arg.tmp + awk '{sub(/$/,"\r");print}' < $arg > $arg.tmp rm -f $arg mv $arg.tmp $arg done @@ -138,14 +138,6 @@ if [ -d $BASE ] ; then fi $CP -r $SOURCE/VC++Files $BASE -( -find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print -)|( - while read v - do - unix_to_dos $v - done -) # # Process version tags in InstallShield files @@ -196,8 +188,11 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ - README INSTALL* LICENSE + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ + README INSTALL* LICENSE *.inc *.test *.result \ + *.pem Moscow_leap des_key_file *.dat *.000001 \ + *.require *.opt + do if [ -f $i ] then @@ -252,10 +247,15 @@ do done # +# Create project files for ndb +# +make -C $SOURCE/ndb windoze + +# # Input directories to be copied recursively # -for i in bdb innobase +for i in bdb innobase mysql-test ndb do copy_dir_dirs $i done @@ -281,7 +281,6 @@ for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ Docs/manual_toc.html Docs/manual.html \ Docs/manual.txt Docs/mysqld_error.txt \ Docs/INSTALL-BINARY Docs/internals.texi - do print_debug "Copying file '$i'" if [ -f $i ] @@ -322,7 +321,18 @@ done ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp -unix_to_dos $BASE/README +# +# Search the tree for plain text files and adapt the line end marker +# +find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ +| while read v + do + unix_to_dos $v + done +# File extension '.txt' matches too many other files, error messages etc. +unix_to_dos $BASE/Docs/*.txt + mv $BASE/README $BASE/README.txt # diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 86cbe944416..a5c8af5ecb2 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -82,13 +82,14 @@ version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' -client_libs='@CLIENT_LIBS@' # Create options -libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" +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 @LIBS@ @openssl_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" @@ -100,7 +101,9 @@ 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]*' do - cflags=`echo "$cflags"|sed -e "s/-$remove *//g"` + # The first option we might strip will always have a space before it because + # we set -I$pkgincludedir as the first option + cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` done cflags=`echo "$cflags"|sed -e 's/ *\$//'` diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index f524b322388..993efcb0fda 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -54,18 +54,18 @@ then c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," - c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d ) engine=MyISAM" @@ -85,18 +85,18 @@ then c_h="$c_h CREATE TABLE host (" c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," - c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h ) engine=MyISAM" c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" @@ -113,28 +113,28 @@ then c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL," - c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u File_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," + c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," c_u="$c_u x509_subject BLOB NOT NULL," @@ -163,9 +163,7 @@ then INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi @@ -180,7 +178,7 @@ then c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," c_f="$c_f dl char(128) DEFAULT '' NOT NULL," - c_f="$c_f type enum ('function','aggregate') NOT NULL," + c_f="$c_f type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL," c_f="$c_f PRIMARY KEY (name)" c_f="$c_f ) engine=MyISAM" c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin" @@ -200,8 +198,8 @@ then c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Timestamp timestamp(14)," - c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," - c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL," + c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t KEY Grantor (Grantor)" c_t="$c_t ) engine=MyISAM" @@ -222,7 +220,7 @@ then c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Timestamp timestamp(14)," - c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" c_c="$c_c ) engine=MyISAM" c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin" @@ -330,7 +328,7 @@ then c_tz="$c_tz CREATE TABLE time_zone (" c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," - c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + c_tz="$c_tz Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8" c_tz="$c_tz comment='Time zones';" diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index c9e8e0c4dfd..56807a81d7c 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -14,6 +14,7 @@ port="" socket="" database="mysql" bindir="" +print_defaults_bindir="." file=mysql_fix_privilege_tables.sql @@ -57,7 +58,9 @@ parse_arguments() { --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;; - --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;; + --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` + print_defaults_bindir=$bindir + ;; *) if test -n "$pick_args" then @@ -73,7 +76,8 @@ parse_arguments() { # Get first arguments from the my.cfg file, groups [mysqld] and # [mysql_install_db], and then merge with the command line arguments -for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra +print_defaults=my_print_defaults +for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra do if test -x $dir/my_print_defaults then @@ -115,7 +119,7 @@ then password=$old_style_password fi -cmd="$bindir/mysql -f --user=$user --host=$host" +cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" if test ! -z "$password" ; then cmd="$cmd --password=$password" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index a60d987f8b5..8f398689bd9 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,29 +9,23 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' -ALTER TABLE user type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE db type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user change Password Password char(41) binary not null; -ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, - type enum ('function','aggregate') NOT NULL, + type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + -- Detect whether or not we had the Grant_priv column SET @hadGrantPriv:=0; SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; -ALTER TABLE user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -ALTER TABLE db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; --- Fix privileges for old tables UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; @@ -43,7 +37,7 @@ UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Cr -- Adding columns needed by GRANT .. REQUIRE (openssl)" ALTER TABLE user -ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, +ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, ADD ssl_cipher BLOB NOT NULL, ADD x509_issuer BLOB NOT NULL, ADD x509_subject BLOB NOT NULL; @@ -60,10 +54,14 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), - Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, - Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name) ) CHARACTER SET utf8 COLLATE utf8_bin; +-- Fix collation of set fields +ALTER TABLE tables_priv + modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, @@ -72,22 +70,25 @@ CREATE TABLE IF NOT EXISTS columns_priv ( Table_name char(60) DEFAULT '' NOT NULL, Column_name char(59) DEFAULT '' NOT NULL, Timestamp timestamp(14), - Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) CHARACTER SET utf8 COLLATE utf8_bin; +-- Fix collation of set fields +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -- -- Name change of Type -> Column_priv from MySQL 3.22.12 -- -ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL; +ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -- -- Add the new 'type' column to the func table. -- -ALTER TABLE func add type enum ('function','aggregate') NOT NULL; +ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; -- -- Change the user,db and host tables to MySQL 4.0 format @@ -98,13 +99,13 @@ SET @hadShowDbPriv:=0; SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; ALTER TABLE user -ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv, -ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, -ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, -ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, -ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; +ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv, +ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv, +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, +ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; -- Convert privileges so that users have similar privileges as before @@ -125,11 +126,11 @@ ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; -- ALTER TABLE db -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE host -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; alter table db change Db Db char(64) binary DEFAULT '' NOT NULL; alter table host change Db Db char(64) binary DEFAULT '' NOT NULL; @@ -145,6 +146,95 @@ alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; +-- Convert all tables to UTF-8 with binary collation +-- and reset all char columns to correct width +ALTER TABLE user + MODIFY Host char(60) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Password char(41) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE db + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE host + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE func + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func + MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE tables_priv + MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + # # Create some possible missing tables # @@ -192,9 +282,12 @@ PRIMARY KEY Name (Name) CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, -Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, +Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) CHARACTER SET utf8 comment='Time zones'; +-- Make enum field case-insensitive +ALTER TABLE time_zone + MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b4f59790e73..0b82e02761e 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -98,9 +98,9 @@ else if test -x "$basedir/libexec/mysqld" then execdir="$basedir/libexec" - elif test -x "@libexecdir@/mysqld" + elif test -x "$basedir/sbin/mysqld" then - execdir="@libexecdir@" + execdir="$basedir/sbin" else execdir="$basedir/bin" fi @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M" +--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 9fd1f63f67a..654b43a8a99 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -2,7 +2,7 @@ # **************************** package MySQLaccess; #use strict; -use POSIX qw(tmpnam); +use File::Temp qw(tempfile tmpnam); use Fcntl; BEGIN { @@ -32,7 +32,6 @@ BEGIN { $ACCESS_U_BCK = 'user_backup'; $ACCESS_D_BCK = 'db_backup'; $DIFF = '/usr/bin/diff'; - $TMP_PATH = '/tmp'; #path to writable tmp-directory $MYSQLDUMP = '@bindir@/mysqldump'; #path to mysqldump executable @@ -431,7 +430,7 @@ use IPC::Open3; # no caching on STDOUT $|=1; - $MYSQL_CNF = POSIX::tmpnam(); + $MYSQL_CNF = tmpnam(); %MYSQL_CNF = (client => { }, mysql => { }, mysqldump => { }, @@ -576,8 +575,6 @@ if (!defined($Param{'host'})) { $Param{'host'}='localhost'; } push(@MySQLaccess::Grant::Error,'not_found_mysql') if !(-x $MYSQL); push(@MySQLaccess::Grant::Error,'not_found_diff') if !(-x $DIFF); push(@MySQLaccess::Grant::Error,'not_found_mysqldump') if !(-x $MYSQLDUMP); -push(@MySQLaccess::Grant::Error,'not_found_tmp') if !(-d $TMP_PATH); -push(@MySQLaccess::Grant::Error,'write_err_tmp') if !(-w $TMP_PATH); if (@MySQLaccess::Grant::Error) { MySQLaccess::Report::Print_Error_Messages() ; exit 0; @@ -1776,17 +1773,15 @@ sub Diff_Privileges { @before = sort(@before); @after = sort(@after); - $before = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.before.$$"; - $after = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.after.$$"; - #$after = "/tmp/t0"; - open(BEFORE,"> $before") || - push(@MySQLaccess::Report::Errors,"Can't open temporary file $before for writing"); - open(AFTER,"> $after") || - push(@MySQLaccess::Report::Errors,"Can't open temporary file $after for writing"); - print BEFORE join("\n",@before); - print AFTER join("\n",@after); - close(BEFORE); - close(AFTER); + ($hb, $before) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + ($ha, $after) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + + print $hb join("\n",@before); + print $ha join("\n",@after); + close $hb; + close $ha; # ---------------------------------- # compute difference @@ -1799,8 +1794,8 @@ sub Diff_Privileges { # ---------------------------------- # cleanup temp. files - unlink(BEFORE); - unlink(AFTER); + unlink($before); + unlink($after); return \@diffs; } @@ -2315,14 +2310,6 @@ BEGIN { => "The diff program <$MySQLaccess::DIFF> could not be found.\n" ."+ Check your path, or\n" ."+ edit the source of this script to point \$DIFF to the diff program.\n" - ,'not_found_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> could not be found.\n" - ."+ create this directory (writeable!), or\n" - ."+ edit the source of this script to point \$TMP_PATH to the right directory.\n" - ,'write_err_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> is not writable.\n" - ."+ make this directory writeable!, or\n" - ."+ edit the source of this script to point \$TMP_PATH to another directory.\n" ,'Unrecognized_option' => "Sorry,\n" ."You are using an old version of the mysql-program,\n" diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index b9e7ce21f79..f6b0169d230 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -86,7 +86,7 @@ parse_arguments() { MY_PWD=`pwd` # Check if we are starting this relative (for the binary release) -if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ +if test -f ./share/mysql/english/errmsg.sys -a \ -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are @@ -97,7 +97,7 @@ then defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" fi # Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ +elif test -f ./share/mysql/english/errmsg.sys -a \ -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are @@ -141,12 +141,12 @@ fi args= SET_USER=2 -parse_arguments `$print_defaults --loose-verbose $defaults mysqld server` +parse_arguments `$print_defaults $defaults --loose-verbose mysqld server` if test $SET_USER -eq 2 then SET_USER=0 fi -parse_arguments `$print_defaults --loose-verbose $defaults mysqld_safe safe_mysqld` +parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} @@ -315,20 +315,20 @@ do break fi - if test @IS_LINUX@ -a $KILL_MYSQLD -eq 1 + if @IS_LINUX@ && test $KILL_MYSQLD -eq 1 then # Test if one process was hanging. # This is only a fix for Linux (running as base 3 mysqld processes) # but should work for the rest of the servers. # The only thing is ps x => redhat 5 gives warnings when using ps -x. # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` + numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` + PROC=`ps xaww | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` for T in $PROC do diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index 8ec62442b11..a40ef8fbc7d 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -1039,7 +1039,7 @@ try_and_report("Automatic row id", "automatic_rowid", ["MATCH UNIQUE","match_unique", "1 match unique (select a from crash_me)",1,0], ["MATCH","match","1 match (select a from crash_me)",1,0], - ["MATCHES","matches","b matcjhes 'a*'",1,0], + ["MATCHES","matches","b matches 'a*'",1,0], ["NOT BETWEEN","not_between","7 not between 4 and 6",1,0], ["NOT EXISTS","not_exists", "not exists (select * from crash_me where a = 2)",1,0], diff --git a/sql-common/client.c b/sql-common/client.c index b847c467b85..3de2483ef75 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -321,8 +321,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, { net->last_errno=CR_NAMEDPIPEOPEN_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } /* wait for for an other instance */ @@ -330,8 +331,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, { net->last_errno=CR_NAMEDPIPEWAIT_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } } @@ -339,8 +341,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, { net->last_errno=CR_NAMEDPIPEOPEN_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } dwMode = PIPE_READMODE_BYTE | PIPE_WAIT; @@ -349,8 +352,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, CloseHandle( hPipe ); net->last_errno=CR_NAMEDPIPESETSTATE_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno),host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } *arg_host=host ; *arg_unix_socket=unix_socket; /* connect arg */ @@ -396,6 +400,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) HANDLE event_server_read = NULL; HANDLE event_client_wrote = NULL; HANDLE event_client_read = NULL; + HANDLE event_conn_closed = NULL; HANDLE handle_file_map = NULL; ulong connect_number; char connect_number_char[22], *p; @@ -508,6 +513,13 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) error_allow = CR_SHARED_MEMORY_EVENT_ERROR; goto err2; } + + strmov(suffix_pos, "CONNECTION_CLOSED"); + if ((event_conn_closed = OpenEvent(EVENT_ALL_ACCESS,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_EVENT_ERROR; + goto err2; + } /* Set event that server should send data */ @@ -517,9 +529,9 @@ err2: if (error_allow == 0) { net->vio= vio_new_win32shared_memory(net,handle_file_map,handle_map, - event_server_wrote, + event_server_wrote, event_server_read,event_client_wrote, - event_client_read); + event_client_read,event_conn_closed); } else { @@ -532,6 +544,8 @@ err2: CloseHandle(event_client_read); if (event_client_wrote) CloseHandle(event_client_wrote); + if (event_conn_closed) + CloseHandle(event_conn_closed); if (handle_map) UnmapViewOfFile(handle_map); if (handle_file_map) @@ -553,9 +567,11 @@ err: net->last_errno=error_allow; strmov(net->sqlstate, unknown_sqlstate); if (error_allow == CR_SHARED_MEMORY_EVENT_ERROR) - sprintf(net->last_error,ER(net->last_errno),suffix_pos,error_code); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),suffix_pos,error_code); else - sprintf(net->last_error,ER(net->last_errno),error_code); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),error_code); return(INVALID_HANDLE_VALUE); } return(handle_map); @@ -784,7 +800,8 @@ static int check_license(MYSQL *mysql) if (net->last_errno == ER_UNKNOWN_SYSTEM_VARIABLE) { net->last_errno= CR_WRONG_LICENSE; - sprintf(net->last_error, ER(net->last_errno), required_license); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), required_license); } return 1; } @@ -801,7 +818,8 @@ static int check_license(MYSQL *mysql) strncmp(row[0], required_license, sizeof(required_license)))) { net->last_errno= CR_WRONG_LICENSE; - sprintf(net->last_error, ER(net->last_errno), required_license); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), required_license); } mysql_free_result(res); return net->last_errno; @@ -872,7 +890,7 @@ static const char *default_options[]= "connect-timeout", "local-infile", "disable-local-infile", "replication-probe", "enable-reads-from-master", "repl-parse-query", "ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name", - "multi-results", "multi-queries", "secure-auth", + "multi-results", "multi-statements", "multi-queries", "secure-auth", NullS }; @@ -1078,9 +1096,10 @@ void mysql_read_default_options(struct st_mysql_options *options, options->client_flag|= CLIENT_MULTI_RESULTS; break; case 31: + case 32: options->client_flag|= CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS; break; - case 32: /* secure-auth */ + case 33: /* secure-auth */ options->secure_auth= TRUE; break; default: @@ -1403,6 +1422,7 @@ mysql_init(MYSQL *mysql) bzero((char*) (mysql),sizeof(*(mysql))); mysql->options.connect_timeout= CONNECT_TIMEOUT; mysql->last_used_con= mysql->next_slave= mysql->master = mysql; + mysql->charset=default_charset_info; strmov(mysql->net.sqlstate, not_error_sqlstate); /* By default, we are a replication pivot. The caller must reset it @@ -1617,7 +1637,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, sock=0; unix_socket = 0; host=mysql->options.shared_memory_base_name; - sprintf(host_info=buff, ER(CR_SHARED_MEMORY_CONNECTION), host); + my_snprintf(host_info=buff, sizeof(buff)-1, + ER(CR_SHARED_MEMORY_CONNECTION), host); } } #endif /* HAVE_SMEM */ @@ -1637,7 +1658,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, { net->last_errno=CR_SOCKET_CREATE_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),socket_errno); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),socket_errno); goto error; } net->vio = vio_new(sock, VIO_TYPE_SOCKET, TRUE); @@ -1651,7 +1673,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, socket_errno)); net->last_errno=CR_CONNECTION_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),unix_socket,socket_errno); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),unix_socket,socket_errno); goto error; } mysql->options.protocol=MYSQL_PROTOCOL_SOCKET; @@ -1681,7 +1704,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, else { net->vio=vio_new_win32pipe(hPipe); - sprintf(host_info=buff, ER(CR_NAMEDPIPE_CONNECTION), unix_socket); + my_snprintf(host_info=buff, sizeof(buff)-1, + ER(CR_NAMEDPIPE_CONNECTION), unix_socket); } } #endif @@ -1694,7 +1718,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, port=mysql_port; if (!host) host=LOCAL_HOST; - sprintf(host_info=buff,ER(CR_TCP_CONNECTION),host); + my_snprintf(host_info=buff,sizeof(buff)-1,ER(CR_TCP_CONNECTION),host); DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host,port)); #ifdef MYSQL_SERVER thr_alarm_init(&alarmed); @@ -1709,7 +1733,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, { net->last_errno=CR_IPSOCK_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),socket_errno); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),socket_errno); goto error; } net->vio = vio_new(sock,VIO_TYPE_TCPIP,FALSE); @@ -1736,7 +1761,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, my_gethostbyname_r_free(); net->last_errno=CR_UNKNOWN_HOST; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(CR_UNKNOWN_HOST), host, tmp_errno); goto error; } memcpy(&sock_addr.sin_addr, hp->h_addr, @@ -1751,7 +1777,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, host)); net->last_errno= CR_CONN_HOST_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, socket_errno); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(CR_CONN_HOST_ERROR), host, socket_errno); goto error; } } @@ -1804,8 +1831,9 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, { strmov(net->sqlstate, unknown_sqlstate); net->last_errno= CR_VERSION_ERROR; - sprintf(net->last_error, ER(CR_VERSION_ERROR), mysql->protocol_version, - PROTOCOL_VERSION); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(CR_VERSION_ERROR), mysql->protocol_version, + PROTOCOL_VERSION); goto error; } end=strend((char*) net->read_pos+1); diff --git a/sql-common/my_time.c b/sql-common/my_time.c index be349285b88..8dd4801b562 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -339,11 +339,11 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, } l_time->neg= 0; - if (year_length == 2 && i >= format_position[1] && i >=format_position[2] && - (l_time->month || l_time->day)) + if (year_length == 2 && not_zero_date) l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900); - if (number_of_fields < 3 || l_time->month > 12 || + if (number_of_fields < 3 || + l_time->year > 9999 || l_time->month > 12 || l_time->day > 31 || l_time->hour > 23 || l_time->minute > 59 || l_time->second > 59 || (!(flags & TIME_FUZZY_DATE) && (l_time->month == 0 || l_time->day == 0))) @@ -664,6 +664,10 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) I couldn't come up with a better way to get a repeatable result :( We can't use mktime() as it's buggy on many platforms and not thread safe. + + Note: this code assumes that our time_t estimation is not too far away + from real value (we assume that localtime_r(tmp) will return something + within 24 hrs from t) which is probably true for all current time zones. */ tmp=(time_t) (((calc_daynr((uint) t->year,(uint) t->month,(uint) t->day) - (long) days_at_timestart)*86400L + (long) t->hour*3600L + @@ -676,7 +680,8 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) for (loop=0; loop < 2 && (t->hour != (uint) l_time->tm_hour || - t->minute != (uint) l_time->tm_min); + t->minute != (uint) l_time->tm_min || + t->second != (uint) l_time->tm_sec); loop++) { /* One check should be enough ? */ /* Get difference in days */ @@ -686,15 +691,22 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) else if (days > 1) days= -1; diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) + - (long) (60*((int) t->minute - (int) l_time->tm_min))); + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); current_timezone+= diff+3600; /* Compensate for -3600 above */ tmp+= (time_t) diff; localtime_r(&tmp,&tm_tmp); l_time=&tm_tmp; } /* - Fix that if we are in the not existing daylight saving time hour - we move the start of the next real hour + Fix that if we are in the non existing daylight saving time hour + we move the start of the next real hour. + + This code doesn't handle such exotical thing as time-gaps whose length + is more than one hour or non-integer (latter can theoretically happen + if one of seconds will be removed due leap correction, or because of + general time correction like it happened for Africa/Monrovia time zone + in year 1972). */ if (loop == 2 && t->hour != (uint) l_time->tm_hour) { @@ -704,7 +716,8 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) else if (days > 1) days= -1; diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+ - (long) (60*((int) t->minute - (int) l_time->tm_min))); + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); if (diff == 3600) tmp+=3600 - t->minute*60 - t->second; /* Move to next hour */ else if (diff == -3600) @@ -720,10 +733,10 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) /* Set MYSQL_TIME structure to 0000-00-00 00:00:00.000000 */ -void set_zero_time(MYSQL_TIME *tm) +void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type) { bzero((void*) tm, sizeof(*tm)); - tm->time_type= MYSQL_TIMESTAMP_NONE; + tm->time_type= time_type; } @@ -743,9 +756,6 @@ void set_zero_time(MYSQL_TIME *tm) int my_time_to_str(const MYSQL_TIME *l_time, char *to) { uint extra_hours= 0; - /* Get extra hours, if we are getting data from the server */ - if (l_time->year == 0 && l_time->month == 0) - extra_hours= l_time->day*24; return my_sprintf(to, (to, "%s%02d:%02d:%02d", (l_time->neg ? "-" : ""), extra_hours+ l_time->hour, diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 6fbfb3f9f9d..bc4af0c7dc7 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -42,18 +42,20 @@ handle bulk inserts as well (that is if someone was trying to read at the same time since we would want to flush). - A "meta" file is kept. All this file does is contain information on - the number of rows. + A "meta" file is kept alongside the data file. This file serves two purpose. + The first purpose is to track the number of rows in the table. The second + purpose is to determine if the table was closed properly or not. When the + meta file is first opened it is marked as dirty. It is opened when the table + itself is opened for writing. When the table is closed the new count for rows + is written to the meta file and the file is marked as clean. If the meta file + is opened and it is marked as dirty, it is assumed that a crash occured. At + this point an error occurs and the user is told to rebuild the file. + A rebuild scans the rows and rewrites the meta file. If corruption is found + in the data file then the meta file is not repaired. - No attempts at durability are made. You can corrupt your data. A repair - method was added to repair the meta file that stores row information, - but if your data file gets corrupted I haven't solved that. I could - create a repair that would solve this, but do you want to take a - chance of loosing your data? + At some point a recovery method for such a drastic case needs to be divised. - Locks are row level, and you will get a consistant read. Transactions - will be added later (they are not that hard to add at this - stage). + Locks are row level, and you will get a consistant read. For performance as far as table scans go it is quite fast. I don't have good numbers but locally it has out performed both Innodb and MyISAM. For @@ -88,7 +90,6 @@ compression but may speed up ordered searches). Checkpoint the meta file to allow for faster rebuilds. Dirty open (right now the meta file is repaired if a crash occured). - Transactions. Option to allow for dirty reads, this would lower the sync calls, which would make inserts a lot faster, but would mean highly arbitrary reads. @@ -113,10 +114,11 @@ data - The data is stored in a "row +blobs" format. */ +/* If the archive storage engine has been inited */ +static bool archive_inited= 0; /* Variables for archive share methods */ pthread_mutex_t archive_mutex; static HASH archive_open_tables; -static int archive_init= 0; /* The file extension */ #define ARZ ".ARZ" // The data file @@ -142,6 +144,51 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length, return (byte*) share->table_name; } + +/* + Initialize the archive handler. + + SYNOPSIS + archive_db_init() + void + + RETURN + FALSE OK + TRUE Error +*/ + +bool archive_db_init() +{ + archive_inited= 1; + VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST)); + return (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0, + (hash_get_key) archive_get_key, 0, 0)); +} + + +/* + Release the archive handler. + + SYNOPSIS + archive_db_end() + void + + RETURN + FALSE OK +*/ + +bool archive_db_end() +{ + if (archive_inited) + { + hash_free(&archive_open_tables); + VOID(pthread_mutex_destroy(&archive_mutex)); + } + archive_inited= 0; + return FALSE; +} + + /* This method reads the header of a datafile and returns whether or not it was successful. */ @@ -269,23 +316,6 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) uint length; char *tmp_name; - if (!archive_init) - { - /* Hijack a mutex for init'ing the storage engine */ - pthread_mutex_lock(&LOCK_mysql_create_db); - if (!archive_init) - { - VOID(pthread_mutex_init(&archive_mutex,MY_MUTEX_INIT_FAST)); - if (hash_init(&archive_open_tables,system_charset_info,32,0,0, - (hash_get_key) archive_get_key,0,0)) - { - pthread_mutex_unlock(&LOCK_mysql_create_db); - return NULL; - } - archive_init++; - } - pthread_mutex_unlock(&LOCK_mysql_create_db); - } pthread_mutex_lock(&archive_mutex); length=(uint) strlen(table_name); @@ -333,6 +363,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) opposite. */ (void)write_meta_file(share->meta_file, share->rows_recorded, TRUE); + /* It is expensive to open and close the data files and since you can't have a gzip file that can be both read and written we keep a writer open @@ -341,10 +372,8 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) if ((share->archive_write= gzopen(share->data_file_name, "ab")) == NULL) goto error2; if (my_hash_insert(&archive_open_tables, (byte*) share)) - goto error2; - thr_lock_init(&share->lock); - if (pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST)) goto error3; + thr_lock_init(&share->lock); } share->use_count++; pthread_mutex_unlock(&archive_mutex); @@ -352,14 +381,13 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) return share; error3: - VOID(pthread_mutex_destroy(&share->mutex)); - thr_lock_delete(&share->lock); /* We close, but ignore errors since we already have errors */ (void)gzclose(share->archive_write); error2: my_close(share->meta_file,MYF(0)); error: pthread_mutex_unlock(&archive_mutex); + VOID(pthread_mutex_destroy(&share->mutex)); my_free((gptr) share, MYF(0)); return NULL; @@ -382,6 +410,8 @@ int ha_archive::free_share(ARCHIVE_SHARE *share) (void)write_meta_file(share->meta_file, share->rows_recorded, FALSE); if (gzclose(share->archive_write) == Z_ERRNO) rc= 1; + if (my_close(share->meta_file, MYF(0))) + rc= 1; my_free((gptr) share, MYF(0)); } pthread_mutex_unlock(&archive_mutex); @@ -493,23 +523,30 @@ int ha_archive::create(const char *name, TABLE *table_arg, if ((archive= gzdopen(create_file, "ab")) == NULL) { error= errno; - delete_table(name); - goto error; + goto error2; } if (write_data_header(archive)) { - gzclose(archive); - goto error2; + error= errno; + goto error3; } if (gzclose(archive)) + { + error= errno; goto error2; + } + + my_close(create_file, MYF(0)); DBUG_RETURN(0); +error3: + /* We already have an error, so ignore results of gzclose. */ + (void)gzclose(archive); error2: - error= errno; - delete_table(name); + my_close(create_file, MYF(0)); + delete_table(name); error: /* Return error number, if we got one */ DBUG_RETURN(error ? error : -1); @@ -528,6 +565,7 @@ error: int ha_archive::write_row(byte * buf) { z_off_t written; + Field_blob **field; DBUG_ENTER("ha_archive::write_row"); statistic_increment(ha_write_count,&LOCK_status); @@ -543,7 +581,7 @@ int ha_archive::write_row(byte * buf) We should probably mark the table as damagaged if the record is written but the blob fails. */ - for (Field_blob **field=table->blob_field ; *field ; field++) + for (field= table->blob_field ; *field ; field++) { char *ptr; uint32 size= (*field)->get_length(); @@ -735,7 +773,7 @@ int ha_archive::rebuild_meta_file(char *table_name, File meta_file) if ((rebuild_file= gzopen(data_file_name, "rb")) == NULL) DBUG_RETURN(errno ? errno : -1); - if (rc= read_data_header(rebuild_file)) + if ((rc= read_data_header(rebuild_file))) goto error; /* @@ -799,7 +837,7 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt) DBUG_RETURN(-1); } - while (read= gzread(reader, block, IO_SIZE)) + while ((read= gzread(reader, block, IO_SIZE))) gzwrite(writer, block, read); gzclose(reader); diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h index b619de5f6c1..855d756368d 100644 --- a/sql/examples/ha_archive.h +++ b/sql/examples/ha_archive.h @@ -125,3 +125,7 @@ public: THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); }; + +bool archive_db_init(void); +bool archive_db_end(void); + diff --git a/sql/field.cc b/sql/field.cc index 3e625f3a582..2baf1bf84fd 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -245,6 +245,7 @@ static Field::field_cast_enum field_cast_date[]= Field::FIELD_CAST_BLOB, Field::FIELD_CAST_STOP}; static Field::field_cast_enum field_cast_newdate[]= {Field::FIELD_CAST_NEWDATE, + Field::FIELD_CAST_DATE, Field::FIELD_CAST_DATETIME, Field::FIELD_CAST_STRING, Field::FIELD_CAST_VARSTRING, Field::FIELD_CAST_BLOB, Field::FIELD_CAST_STOP}; @@ -531,7 +532,8 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) /* Convert character set if the old one is multi byte */ if (cs->mbmaxlen > 1) { - tmp.copy(from, len, cs, &my_charset_bin); + uint dummy_errors; + tmp.copy(from, len, cs, &my_charset_bin, &dummy_errors); from= tmp.ptr(); len= tmp.length(); } @@ -966,7 +968,9 @@ int Field_decimal::store(longlong nr) double Field_decimal::val_real(void) { int not_used; - return my_strntod(&my_charset_bin, ptr, field_length, NULL, ¬_used); + char *end_not_used; + return my_strntod(&my_charset_bin, ptr, field_length, &end_not_used, + ¬_used); } longlong Field_decimal::val_int(void) @@ -1774,6 +1778,24 @@ void Field_medium::sql_type(String &res) const ** long int ****************************************************************************/ +/* + A helper function to check whether the next character + in the string "s" is MINUS SIGN. +*/ +#ifdef HAVE_CHARSET_ucs2 +static bool test_if_minus(CHARSET_INFO *cs, + const char *s, const char *e) +{ + my_wc_t wc; + return cs->cset->mb_wc(cs, &wc, (uchar*) s, (uchar*) e) > 0 && wc == '-'; +} +#else +/* + If not UCS2 support is compiled then it is easier +*/ +#define test_if_minus(cs, s, e) (*s == '-') +#endif + int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) { @@ -1788,7 +1810,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) if (unsigned_flag) { - if (!len || *from == '-') + if (!len || test_if_minus(cs, from, from + len)) { tmp=0; // Set negative to 0 my_errno=ERANGE; @@ -1859,9 +1881,9 @@ int Field_long::store(double nr) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (nr > (double) (ulong) ~0L) + else if (nr > (double) UINT_MAX32) { - res=(int32) (uint32) ~0L; + res= UINT_MAX32; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } @@ -2084,7 +2106,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs) my_errno=0; if (unsigned_flag) { - if (!len || *from == '-') + if (!len || test_if_minus(cs, from, from + len)) { tmp=0; // Set negative to 0 my_errno= ERANGE; @@ -2144,7 +2166,7 @@ int Field_longlong::store(double nr) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (nr >= (double) LONGLONG_MAX) + else if (nr >= (double) (ulonglong) LONGLONG_MAX) { res=(longlong) LONGLONG_MAX; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); @@ -2394,23 +2416,7 @@ int Field_float::store(double nr) int Field_float::store(longlong nr) { - int error= 0; - float j= (float) nr; - if (unsigned_flag && j < 0) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - j=0; - error= 1; - } -#ifdef WORDS_BIGENDIAN - if (table->db_low_byte_first) - { - float4store(ptr,j); - } - else -#endif - memcpy_fixed(ptr,(byte*) &j,sizeof(j)); - return error; + return store((double)nr); } @@ -2689,23 +2695,7 @@ int Field_double::store(double nr) int Field_double::store(longlong nr) { - double j= (double) nr; - int error= 0; - if (unsigned_flag && j < 0) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - j=0; - } -#ifdef WORDS_BIGENDIAN - if (table->db_low_byte_first) - { - float8store(ptr,j); - } - else -#endif - doublestore(ptr,j); - return error; + return store((double)nr); } @@ -3542,9 +3532,17 @@ void Field_time::sql_type(String &res) const int Field_year::store(const char *from, uint len,CHARSET_INFO *cs) { - int not_used; // We can ignore result from str2int + int err; char *end; - long nr= my_strntol(cs, from, len, 10, &end, ¬_used); + long nr= my_strntol(cs, from, len, 10, &end, &err); + + if (err) + { + if (table->in_use->count_cuted_fields) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); + *ptr= 0; + return 0; + } if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155) { @@ -4085,6 +4083,10 @@ int Field_datetime::store(longlong nr) void Field_datetime::store_time(TIME *ltime,timestamp_type type) { longlong tmp; + /* + We don't perform range checking here since values stored in TIME + structure always fit into DATETIME range. + */ if (type == MYSQL_TIMESTAMP_DATE || type == MYSQL_TIMESTAMP_DATETIME) tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*LL(1000000)+ (ltime->hour*10000L+ltime->minute*100+ltime->second)); @@ -4275,9 +4277,12 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used)) { - tmpstr.copy(from, length, cs, field_charset); + uint conv_errors; + tmpstr.copy(from, length, cs, field_charset, &conv_errors); from= tmpstr.ptr(); length= tmpstr.length(); + if (conv_errors) + error= 1; } /* @@ -4300,11 +4305,11 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) from+= field_charset->cset->scan(field_charset, from, end, MY_SEQ_SPACES); if (from != end) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); - error=1; - } + error= 1; } + if (error) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); + return error; } @@ -4325,13 +4330,20 @@ int Field_str::store(double nr) char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; uint length; bool use_scientific_notation= TRUE; - use_scientific_notation= TRUE; - if (field_length < 32 && fabs(nr) < log_10[field_length]-1) + /* + Check fabs(nr) against longest value that can be stored in field, + which depends on whether the value is < 1 or not, and negative or not + */ + double anr= fabs(nr); + int neg= (nr < 0.0) ? 1 : 0; + if (field_length > 4 && field_length < 32 && + (anr < 1.0 ? anr > 1/(log_10[max(0,field_length-neg-2)]) /* -2 for "0." */ + : anr < log_10[field_length-neg]-1)) use_scientific_notation= FALSE; length= (uint) my_sprintf(buff, (buff, "%-.*g", (use_scientific_notation ? - max(0, (int)field_length-5) : + max(0, (int)field_length-neg-5) : field_length), nr)); /* @@ -4360,8 +4372,9 @@ int Field_string::store(longlong nr) double Field_string::val_real(void) { int not_used; + char *end_not_used; CHARSET_INFO *cs=charset(); - return my_strntod(cs,ptr,field_length,(char**)0,¬_used); + return my_strntod(cs, ptr, field_length, &end_not_used, ¬_used); } @@ -4386,6 +4399,8 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)), int Field_string::cmp(const char *a_ptr, const char *b_ptr) { + uint a_len, b_len; + if (field_charset->strxfrm_multiply > 1) { /* @@ -4397,22 +4412,31 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr) (const uchar*) b_ptr, field_length); } - return my_strnncoll(field_charset,(const uchar*) a_ptr, field_length, - (const uchar*) b_ptr, field_length); + if (field_charset->mbmaxlen != 1) + { + uint char_len= field_length/field_charset->mbmaxlen; + a_len= my_charpos(field_charset, a_ptr, a_ptr + field_length, char_len); + b_len= my_charpos(field_charset, b_ptr, b_ptr + field_length, char_len); + } + else + a_len= b_len= field_length; + return my_strnncoll(field_charset,(const uchar*) a_ptr, a_len, + (const uchar*) b_ptr, b_len); } + void Field_string::sort_string(char *to,uint length) { uint tmp=my_strnxfrm(field_charset, (unsigned char *) to, length, (unsigned char *) ptr, field_length); - if (tmp < length) - field_charset->cset->fill(field_charset, to + tmp, length - tmp, ' '); + DBUG_ASSERT(tmp == length); } void Field_string::sql_type(String &res) const { + THD *thd= table->in_use; CHARSET_INFO *cs=res.charset(); ulong length= cs->cset->snprintf(cs,(char*) res.ptr(), res.alloced_length(), "%s(%d)", @@ -4423,6 +4447,9 @@ void Field_string::sql_type(String &res) const (has_charset() ? "char" : "binary")), (int) field_length / charset()->mbmaxlen); res.length(length); + if ((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) && + has_charset() && (charset()->state & MY_CS_BINSORT)) + res.append(" binary"); } char *Field_string::pack(char *to, const char *from, uint max_length) @@ -4528,16 +4555,20 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used)) { - tmpstr.copy(from, length, cs, field_charset); + uint conv_errors; + tmpstr.copy(from, length, cs, field_charset, &conv_errors); from= tmpstr.ptr(); length= tmpstr.length(); + if (conv_errors) + error= 1; } if (length > field_length) { length=field_length; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } + if (error) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); memcpy(ptr+HA_KEY_BLOB_LENGTH,from,length); int2store(ptr, length); return error; @@ -4559,7 +4590,9 @@ double Field_varstring::val_real(void) int not_used; uint length=uint2korr(ptr)+HA_KEY_BLOB_LENGTH; CHARSET_INFO *cs=charset(); - return my_strntod(cs, ptr+HA_KEY_BLOB_LENGTH, length, (char**)0, ¬_used); + char *end_not_used; + return my_strntod(cs, ptr+HA_KEY_BLOB_LENGTH, length, &end_not_used, + ¬_used); } @@ -4601,9 +4634,7 @@ void Field_varstring::sort_string(char *to,uint length) (uchar*) to, length, (uchar*) ptr+HA_KEY_BLOB_LENGTH, tot_length); - if (tot_length < length) - field_charset->cset->fill(field_charset, to+tot_length,length-tot_length, - binary() ? (char) 0 : ' '); + DBUG_ASSERT(tot_length == length); } @@ -4865,6 +4896,7 @@ void Field_blob::put_length(char *pos, uint32 length) int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) { + int error= 0; if (!length) { bzero(ptr,Field_blob::pack_length()); @@ -4881,9 +4913,12 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) if ((was_conversion= String::needs_conversion(length, cs, field_charset, ¬_used))) { - tmpstr.copy(from, length, cs, field_charset); + uint conv_errors; + tmpstr.copy(from, length, cs, field_charset, &conv_errors); from= tmpstr.ptr(); length= tmpstr.length(); + if (conv_errors) + error= 1; } copy_length= max_data_length(); @@ -4897,8 +4932,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) min(length, copy_length), copy_length); if (copy_length < length) - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); - + error= 1; Field_blob::store_length(copy_length); if (was_conversion || table->copy_blobs || copy_length <= MAX_FIELD_WIDTH) { // Must make a copy @@ -4910,6 +4944,8 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) } bmove(ptr+packlength,(char*) &from,sizeof(char*)); } + if (error) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); return 0; } @@ -4934,12 +4970,13 @@ double Field_blob::val_real(void) { int not_used; char *blob; + char *end_not_used; memcpy_fixed(&blob,ptr+packlength,sizeof(char*)); if (!blob) return 0.0; uint32 length=get_length(ptr); CHARSET_INFO *cs=charset(); - return my_strntod(cs,blob,length,(char**)0, ¬_used); + return my_strntod(cs,blob,length, &end_not_used, ¬_used); } @@ -5116,10 +5153,7 @@ void Field_blob::sort_string(char *to,uint length) blob_length=my_strnxfrm(field_charset, (uchar*) to, length, (uchar*) blob, blob_length); - if (blob_length < length) - field_charset->cset->fill(field_charset, to+blob_length, - length-blob_length, - binary() ? (char) 0 : ' '); + DBUG_ASSERT(blob_length == length); } } @@ -5490,14 +5524,14 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used)) { - tmpstr.copy(from, length, cs, field_charset); + uint dummy_errors; + tmpstr.copy(from, length, cs, field_charset, &dummy_errors); from= tmpstr.ptr(); length= tmpstr.length(); } /* Remove end space */ - while (length > 0 && my_isspace(system_charset_info,from[length-1])) - length--; + length= field_charset->cset->lengthsp(field_charset, from, length); uint tmp=find_type2(typelib, from, length, field_charset); if (!tmp) { @@ -5599,7 +5633,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)), val_ptr->set("", 0, field_charset); else val_ptr->set((const char*) typelib->type_names[tmp-1], - (uint) strlen(typelib->type_names[tmp-1]), + typelib->type_lengths[tmp-1], field_charset); return val_ptr; } @@ -5636,12 +5670,14 @@ void Field_enum::sql_type(String &res) const res.append("enum("); bool flag=0; - for (const char **pos= typelib->type_names; *pos; pos++) + uint *len= typelib->type_lengths; + for (const char **pos= typelib->type_names; *pos; pos++, len++) { + uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - enum_item.copy(*pos, strlen(*pos), charset(), res.charset()); + enum_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors); append_unescaped(&res, enum_item.ptr(), enum_item.length()); flag= 1; } @@ -5672,7 +5708,8 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used_offset)) { - tmpstr.copy(from, length, cs, field_charset); + uint dummy_errors; + tmpstr.copy(from, length, cs, field_charset, &dummy_errors); from= tmpstr.ptr(); length= tmpstr.length(); } @@ -5719,14 +5756,15 @@ String *Field_set::val_str(String *val_buffer, uint bitnr=0; val_buffer->length(0); + val_buffer->set_charset(field_charset); while (tmp && bitnr < (uint) typelib->count) { if (tmp & 1) { if (val_buffer->length()) - val_buffer->append(field_separator); + val_buffer->append(&field_separator, 1, &my_charset_latin1); String str(typelib->type_names[bitnr], - (uint) strlen(typelib->type_names[bitnr]), + typelib->type_lengths[bitnr], field_charset); val_buffer->append(str); } @@ -5746,12 +5784,14 @@ void Field_set::sql_type(String &res) const res.append("set("); bool flag=0; - for (const char **pos= typelib->type_names; *pos; pos++) + uint *len= typelib->type_lengths; + for (const char **pos= typelib->type_names; *pos; pos++, len++) { + uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - set_item.copy(*pos, strlen(*pos), charset(), res.charset()); + set_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors); append_unescaped(&res, set_item.ptr(), set_item.length()); flag= 1; } @@ -5806,25 +5846,24 @@ bool Field_num::eq_def(Field *field) void create_field::create_length_to_internal_length(void) { - switch (sql_type) - { - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_VAR_STRING: - case MYSQL_TYPE_STRING: - length*= charset->mbmaxlen; - pack_length= calc_pack_length(sql_type == FIELD_TYPE_VAR_STRING ? - FIELD_TYPE_STRING : sql_type, length); - break; - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_SET: - length*= charset->mbmaxlen; - break; - default: - /* do nothing */ - break; + switch (sql_type) { + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + length*= charset->mbmaxlen; + pack_length= calc_pack_length(sql_type == FIELD_TYPE_VAR_STRING ? + FIELD_TYPE_STRING : sql_type, length); + break; + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + length*= charset->mbmaxlen; + break; + default: + /* do nothing */ + break; } } @@ -5909,8 +5948,15 @@ Field *make_field(char *ptr, uint32 field_length, if (f_is_alpha(pack_flag)) { if (!f_is_packed(pack_flag)) - return new Field_string(ptr,field_length,null_pos,null_bit, - unireg_check, field_name, table, field_charset); + { + if (field_type == FIELD_TYPE_STRING || + field_type == FIELD_TYPE_DECIMAL || // 3.23 or 4.0 string + field_type == FIELD_TYPE_VAR_STRING) + return new Field_string(ptr,field_length,null_pos,null_bit, + unireg_check, field_name, table, + field_charset); + return 0; // Error + } uint pack_length=calc_pack_length((enum_field_types) f_packtype(pack_flag), @@ -6011,6 +6057,40 @@ Field *make_field(char *ptr, uint32 field_length, } +/* + Check if field_type is appropriate field type + to create field for tmp table using + item->tmp_table_field() method + + SYNOPSIS + field_types_to_be_kept() + field_type - field type + + NOTE + it is used in function get_holder_example_field() + from item.cc + + RETURN + 1 - can use item->tmp_table_field() method + 0 - can not use item->tmp_table_field() method + +*/ + +bool field_types_to_be_kept(enum_field_types field_type) +{ + switch (field_type) + { + case FIELD_TYPE_DATE: + case FIELD_TYPE_NEWDATE: + case FIELD_TYPE_TIME: + case FIELD_TYPE_DATETIME: + return 1; + default: + return 0; + } +} + + /* Create a field suitable for create of table */ create_field::create_field(Field *old_field,Field *orig_field) @@ -6042,6 +6122,8 @@ create_field::create_field(Field *old_field,Field *orig_field) } length=(length+charset->mbmaxlen-1)/charset->mbmaxlen; // QQ: Probably not needed break; + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: case FIELD_TYPE_STRING: case FIELD_TYPE_VAR_STRING: length=(length+charset->mbmaxlen-1)/charset->mbmaxlen; diff --git a/sql/field.h b/sql/field.h index 8887da1dc0f..b5d88504939 100644 --- a/sql/field.h +++ b/sql/field.h @@ -277,6 +277,7 @@ public: virtual bool get_date(TIME *ltime,uint fuzzydate); virtual bool get_time(TIME *ltime); virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; } + virtual CHARSET_INFO *sort_charset(void) const { return charset(); } virtual bool has_charset(void) const { return FALSE; } virtual void set_charset(CHARSET_INFO *charset) { } bool set_warning(const unsigned int level, const unsigned int code, @@ -1152,6 +1153,8 @@ public: bool optimize_range(uint idx, uint part) { return 0; } bool eq_def(Field *field); bool has_charset(void) const { return TRUE; } + /* enum and set are sorted as integers */ + CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; } field_cast_enum field_cast_type() { return FIELD_CAST_ENUM; } }; @@ -1198,6 +1201,7 @@ public: uint decimals,flags,pack_length; Field::utype unireg_check; TYPELIB *interval; // Which interval to use + List<String> interval_list; CHARSET_INFO *charset; Field::geometry_type geom_type; Field *field; // For alter table @@ -1264,6 +1268,7 @@ int set_field_to_null(Field *field); int set_field_to_null_with_conversions(Field *field, bool no_conversions); bool test_if_int(const char *str, int length, const char *int_end, CHARSET_INFO *cs); +bool field_types_to_be_kept(enum_field_types field_type); /* The following are for the interface with the .frm file @@ -1274,10 +1279,10 @@ bool test_if_int(const char *str, int length, const char *int_end, #define FIELDFLAG_NUMBER 2 #define FIELDFLAG_ZEROFILL 4 #define FIELDFLAG_PACK 120 // Bits used for packing -#define FIELDFLAG_INTERVAL 256 -#define FIELDFLAG_BITFIELD 512 // mangled with dec! -#define FIELDFLAG_BLOB 1024 // mangled with dec! -#define FIELDFLAG_GEOM 2048 +#define FIELDFLAG_INTERVAL 256 // mangled with decimals! +#define FIELDFLAG_BITFIELD 512 // mangled with decimals! +#define FIELDFLAG_BLOB 1024 // mangled with decimals! +#define FIELDFLAG_GEOM 2048 // mangled with decimals! #define FIELDFLAG_LEFT_FULLSCREEN 8192 #define FIELDFLAG_RIGHT_FULLSCREEN 16384 @@ -1302,10 +1307,10 @@ bool test_if_int(const char *str, int length, const char *int_end, #define f_decimals(x) ((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC)) #define f_is_alpha(x) (!f_is_num(x)) #define f_is_binary(x) ((x) & FIELDFLAG_BINARY) // 4.0- compatibility -#define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL) -#define f_is_bitfield(x) ((x) & FIELDFLAG_BITFIELD) +#define f_is_enum(x) (((x) & (FIELDFLAG_INTERVAL | FIELDFLAG_NUMBER)) == FIELDFLAG_INTERVAL) +#define f_is_bitfield(x) (((x) & (FIELDFLAG_BITFIELD | FIELDFLAG_NUMBER)) == FIELDFLAG_BITFIELD) #define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB) -#define f_is_geom(x) ((x) & FIELDFLAG_GEOM) +#define f_is_geom(x) (((x) & (FIELDFLAG_GEOM | FIELDFLAG_NUMBER)) == FIELDFLAG_GEOM) #define f_is_equ(x) ((x) & (1+2+FIELDFLAG_PACK+31*256)) #define f_settype(x) (((int) x) << FIELDFLAG_PACK_SHIFT) #define f_maybe_null(x) (x & FIELDFLAG_MAYBE_NULL) diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 890687fc925..8b362bbf807 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -473,7 +473,7 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*) { if (to->flags & BLOB_FLAG) { - if (!(from->flags & BLOB_FLAG)) + if (!(from->flags & BLOB_FLAG) || from->charset() != to->charset()) return do_conv_blob; if (from_length != to_length || to->table->db_low_byte_first != from->table->db_low_byte_first) @@ -559,6 +559,7 @@ void field_conv(Field *to,Field *from) if (to->real_type() == from->real_type()) { if (to->pack_length() == from->pack_length() && + !(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) && to->real_type() != FIELD_TYPE_ENUM && to->real_type() != FIELD_TYPE_SET && from->charset() == to->charset() && diff --git a/sql/filesort.cc b/sql/filesort.cc index bd0de022fd4..76ce9ac4ce2 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -622,10 +622,7 @@ static void make_sortkey(register SORTPARAM *param, } uint tmp_length=my_strnxfrm(cs,to,sort_field->length, (unsigned char *) from, length); - if (tmp_length < sort_field->length) - cs->cset->fill(cs, (char*) to+tmp_length, - sort_field->length-tmp_length, - fill_char); + DBUG_ASSERT(tmp_length == sort_field->length); } else { @@ -806,11 +803,16 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer, if (flush_io_cache(to_file)) break; /* purecov: inspected */ temp=from_file; from_file=to_file; to_file=temp; + setup_io_cache(from_file); + setup_io_cache(to_file); *maxbuffer= (uint) (lastbuff-buffpek)-1; } close_cached_file(to_file); // This holds old result if (to_file == t_file) + { *t_file=t_file2; // Copy result file + setup_io_cache(t_file); + } DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */ } /* merge_many_buff */ @@ -1125,7 +1127,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) else { sortorder->length=sortorder->field->pack_length(); - if (use_strnxfrm((cs=sortorder->field->charset()))) + if (use_strnxfrm((cs=sortorder->field->sort_charset()))) { sortorder->need_strxnfrm= 1; *multi_byte_charset= 1; diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 09b3e340d1f..e33cd3fca1b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -165,11 +165,13 @@ bool berkeley_init(void) { db_env->close(db_env,0); /* purecov: inspected */ db_env=0; /* purecov: inspected */ + goto err; } (void) hash_init(&bdb_open_tables,system_charset_info,32,0,0, (hash_get_key) bdb_get_key,0,0); pthread_mutex_init(&bdb_mutex,MY_MUTEX_INIT_FAST); +err: DBUG_RETURN(db_env == 0); } @@ -234,13 +236,13 @@ int berkeley_show_logs(Protocol *protocol) { char **all_logs, **free_logs, **a, **f; int error=1; - MEM_ROOT show_logs_root; - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); + MEM_ROOT **root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC); + MEM_ROOT show_logs_root, *old_mem_root= *root_ptr; DBUG_ENTER("berkeley_show_logs"); init_sql_alloc(&show_logs_root, BDB_LOG_ALLOC_BLOCK_SIZE, BDB_LOG_ALLOC_BLOCK_SIZE); - my_pthread_setspecific_ptr(THR_MALLOC,&show_logs_root); + *root_ptr= &show_logs_root; if ((error= db_env->log_archive(db_env, &all_logs, DB_ARCH_ABS | DB_ARCH_LOG)) || @@ -277,15 +279,17 @@ int berkeley_show_logs(Protocol *protocol) } err: free_root(&show_logs_root,MYF(0)); - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + *root_ptr= old_mem_root; DBUG_RETURN(error); } + static void berkeley_print_error(const char *db_errpfx, char *buffer) { sql_print_error("%s: %s",db_errpfx,buffer); /* purecov: tested */ } + static void berkeley_noticecall(DB_ENV *db_env, db_notices notice) { switch (notice) diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 19b15c6fbcc..3c2249ce281 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -30,6 +30,18 @@ const char **ha_heap::bas_ext() const { static const char *ext[1]= { NullS }; return ext; } +/* + Hash index statistics is updated (copied from HP_KEYDEF::hash_buckets to + rec_per_key) after 1/HEAP_STATS_UPDATE_THRESHOLD fraction of table records + have been inserted/updated/deleted. delete_all_rows() and table flush cause + immediate update. + + NOTE + hash index statistics must be updated when number of table records changes + from 0 to non-zero value and vice versa. Otherwise records_in_range may + erroneously return 0 and 'range' may miss records. +*/ +#define HEAP_STATS_UPDATE_THRESHOLD 10 int ha_heap::open(const char *name, int mode, uint test_if_locked) { @@ -48,6 +60,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) { /* Initialize variables for the opened table */ set_keys_for_scanning(); + update_key_stats(); } return (file ? 0 : 1); } @@ -84,28 +97,60 @@ void ha_heap::set_keys_for_scanning(void) } } +void ha_heap::update_key_stats() +{ + for (uint i= 0; i < table->keys; i++) + { + KEY *key=table->key_info+i; + if (!key->rec_per_key) + continue; + if (key->algorithm != HA_KEY_ALG_BTREE) + { + ha_rows hash_buckets= file->s->keydef[i].hash_buckets; + key->rec_per_key[key->key_parts-1]= + hash_buckets ? file->s->records/hash_buckets : 0; + } + } + records_changed= 0; +} + int ha_heap::write_row(byte * buf) { + int res; statistic_increment(ha_write_count,&LOCK_status); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); if (table->next_number_field && buf == table->record[0]) update_auto_increment(); - return heap_write(file,buf); + res= heap_write(file,buf); + if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > + file->s->records) + update_key_stats(); + return res; } int ha_heap::update_row(const byte * old_data, byte * new_data) { + int res; statistic_increment(ha_update_count,&LOCK_status); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); - return heap_update(file,old_data,new_data); + res= heap_update(file,old_data,new_data); + if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > + file->s->records) + update_key_stats(); + return res; } int ha_heap::delete_row(const byte * buf) { + int res; statistic_increment(ha_delete_count,&LOCK_status); - return heap_delete(file,buf); + res= heap_delete(file,buf); + if (!res && table->tmp_table == NO_TMP_TABLE && + ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + update_key_stats(); + return res; } int ha_heap::index_read(byte * buf, const byte * key, uint key_len, @@ -227,6 +272,8 @@ int ha_heap::extra(enum ha_extra_function operation) int ha_heap::delete_all_rows() { heap_clear(file); + if (table->tmp_table == NO_TMP_TABLE) + update_key_stats(); return 0; } @@ -384,7 +431,8 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key, min_key->flag != HA_READ_KEY_EXACT || max_key->flag != HA_READ_AFTER_KEY) return HA_POS_ERROR; // Can only use exact keys - return 10; // Good guess + else + return key->rec_per_key[key->key_parts-1]; } @@ -413,12 +461,24 @@ int ha_heap::create(const char *name, TABLE *table_arg, KEY_PART_INFO *key_part= pos->key_part; KEY_PART_INFO *key_part_end= key_part + pos->key_parts; - mem_per_row+= (pos->key_length + (sizeof(char*) * 2)); - keydef[key].keysegs= (uint) pos->key_parts; keydef[key].flag= (pos->flags & (HA_NOSAME | HA_NULL_ARE_EQUAL)); keydef[key].seg= seg; - keydef[key].algorithm= ((pos->algorithm == HA_KEY_ALG_UNDEF) ? + + switch (pos->algorithm) { + case HA_KEY_ALG_UNDEF: + case HA_KEY_ALG_HASH: + keydef[key].algorithm= HA_KEY_ALG_HASH; + mem_per_row+= sizeof(char*) * 2; // = sizeof(HASH_INFO) + break; + case HA_KEY_ALG_BTREE: + keydef[key].algorithm= HA_KEY_ALG_BTREE; + mem_per_row+=sizeof(TREE_ELEMENT)+pos->key_length+sizeof(char*); + break; + default: + DBUG_ASSERT(0); // cannot happen + } + keydef[key].algorithm= ((pos->algorithm == HA_KEY_ALG_UNDEF) ? HA_KEY_ALG_HASH : pos->algorithm); for (; key_part != key_part_end; key_part++, seg++) @@ -454,17 +514,17 @@ int ha_heap::create(const char *name, TABLE *table_arg, } } mem_per_row+= MY_ALIGN(table_arg->reclength + 1, sizeof(char*)); - max_rows = (ha_rows) (current_thd->variables.max_heap_table_size / - mem_per_row); HP_CREATE_INFO hp_create_info; hp_create_info.auto_key= auto_key; hp_create_info.auto_key_type= auto_key_type; hp_create_info.auto_increment= (create_info->auto_increment_value ? create_info->auto_increment_value - 1 : 0); + hp_create_info.max_table_size=current_thd->variables.max_heap_table_size; + max_rows = (ha_rows) (hp_create_info.max_table_size / mem_per_row); error= heap_create(fn_format(buff,name,"","",4+2), table_arg->keys,keydef, table_arg->reclength, (ulong) ((table_arg->max_rows < max_rows && - table_arg->max_rows) ? + table_arg->max_rows) ? table_arg->max_rows : max_rows), (ulong) table_arg->min_rows, &hp_create_info); my_free((gptr) keydef, MYF(0)); diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 9ca6b9b76b6..f36e9f31c55 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -27,9 +27,10 @@ class ha_heap: public handler { HP_INFO *file; key_map btree_keys; - - public: - ha_heap(TABLE *table): handler(table), file(0) {} + /* number of records changed since last statistics update */ + uint records_changed; +public: + ha_heap(TABLE *table): handler(table), file(0), records_changed(0) {} ~ha_heap() {} const char *table_type() const { return "HEAP"; } const char *index_type(uint inx) @@ -91,5 +92,6 @@ class ha_heap: public handler THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); - +private: + void update_key_stats(); }; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 8d9ecb95fc0..4f32bb08e9a 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -278,15 +278,15 @@ convert_error_code_to_mysql( } else if (error == (int) DB_LOCK_WAIT_TIMEOUT) { - /* Since we rolled back the whole transaction, we must - tell it also to MySQL so that MySQL knows to empty the - cached binlog for this transaction */ + /* Since we rolled back the whole transaction, we must + tell it also to MySQL so that MySQL knows to empty the + cached binlog for this transaction */ - if (thd) { - ha_rollback(thd); - } + if (thd) { + ha_rollback(thd); + } - return(HA_ERR_LOCK_WAIT_TIMEOUT); + return(HA_ERR_LOCK_WAIT_TIMEOUT); } else if (error == (int) DB_NO_REFERENCED_ROW) { @@ -331,6 +331,9 @@ convert_error_code_to_mysql( } else if (error == (int) DB_NO_SAVEPOINT) { return(HA_ERR_NO_SAVEPOINT); + } else if (error == (int) DB_LOCK_TABLE_FULL) { + + return(HA_ERR_LOCK_TABLE_FULL); } else { return(-1); // Unknown error } @@ -469,7 +472,7 @@ innobase_mysql_tmpfile(void) { char filename[FN_REFLEN]; int fd2 = -1; - File fd = create_temp_file(filename, NullS, "ib", + File fd = create_temp_file(filename, mysql_tmpdir, "ib", #ifdef __WIN__ O_BINARY | O_TRUNC | O_SEQUENTIAL | O_TEMPORARY | O_SHORT_LIVED | @@ -1505,17 +1508,14 @@ innobase_close_connection( *****************************************************************************/ /******************************************************************** -This function is not relevant since we store the tables and indexes -into our own tablespace, not as files, whose extension this function would -give. */ +Gives the file extension of an InnoDB single-table tablespace. */ const char** ha_innobase::bas_ext() const /*========================*/ - /* out: file extension strings, currently not - used */ + /* out: file extension string */ { - static const char* ext[] = {".InnoDB", NullS}; + static const char* ext[] = {".ibd", NullS}; return(ext); } @@ -2248,6 +2248,8 @@ build_template( templ->mysql_col_len = (ulint) field->pack_length(); templ->type = get_innobase_type_from_mysql_type(field); + templ->charset = dtype_get_charset_coll_noninline( + index->table->cols[i].type.prtype); templ->is_unsigned = (ulint) (field->flags & UNSIGNED_FLAG); if (templ->type == DATA_BLOB) { @@ -2314,6 +2316,72 @@ ha_innobase::write_row( if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); + if (user_thd->lex->sql_command == SQLCOM_ALTER_TABLE + && num_write_row >= 10000) { + /* ALTER TABLE is COMMITted at every 10000 copied rows. + The IX table lock for the original table has to be re-issued. + As this method will be called on a temporary table where the + contents of the original table is being copied to, it is + a bit tricky to determine the source table. The cursor + position in the source table need not be adjusted after the + intermediate COMMIT, since writes by other transactions are + being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */ + + dict_table_t* src_table; + ibool mode; + + num_write_row = 0; + + /* Commit the transaction. This will release the table + locks, so they have to be acquired again. */ + + /* Altering an InnoDB table */ + /* Get the source table. */ + src_table = lock_get_src_table( + prebuilt->trx, prebuilt->table, &mode); + if (!src_table) { + no_commit: + /* Unknown situation: do not commit */ + /* + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB error: ALTER TABLE is holding lock" + " on %lu tables!\n", + prebuilt->trx->mysql_n_tables_locked); + */ + ; + } else if (src_table == prebuilt->table) { + /* Source table is not in InnoDB format: + no need to re-acquire locks on it. */ + + /* Altering to InnoDB format */ + innobase_commit(user_thd, prebuilt->trx); + /* Note that this transaction is still active. */ + user_thd->transaction.all.innodb_active_trans = 1; + /* We will need an IX lock on the destination table. */ + prebuilt->sql_stat_start = TRUE; + } else { + /* Ensure that there are no other table locks than + LOCK_IX and LOCK_AUTO_INC on the destination table. */ + if (!lock_is_table_exclusive(prebuilt->table, + prebuilt->trx)) { + goto no_commit; + } + + /* Commit the transaction. This will release the table + locks, so they have to be acquired again. */ + innobase_commit(user_thd, prebuilt->trx); + /* Note that this transaction is still active. */ + user_thd->transaction.all.innodb_active_trans = 1; + /* Re-acquire the table lock on the source table. */ + row_lock_table_for_mysql(prebuilt, src_table, mode); + /* We will need an IX lock on the destination table. */ + prebuilt->sql_stat_start = TRUE; + } + } + + num_write_row++; + if (last_query_id != user_thd->query_id) { prebuilt->sql_stat_start = TRUE; last_query_id = user_thd->query_id; @@ -2362,8 +2430,9 @@ ha_innobase::write_row( same SQL statement! */ if (auto_inc == 0 && user_thd->next_insert_id != 0) { - auto_inc = user_thd->next_insert_id; - auto_inc_counter_for_this_stat = auto_inc; + + auto_inc_counter_for_this_stat + = user_thd->next_insert_id; } if (auto_inc == 0 && auto_inc_counter_for_this_stat) { @@ -2371,14 +2440,14 @@ ha_innobase::write_row( this SQL statement with SET INSERT_ID. We must assign sequential values from the counter. */ - auto_inc_counter_for_this_stat++; - incremented_auto_inc_for_stat = TRUE; - auto_inc = auto_inc_counter_for_this_stat; /* We give MySQL a new value to place in the auto-inc column */ user_thd->next_insert_id = auto_inc; + + auto_inc_counter_for_this_stat++; + incremented_auto_inc_for_stat = TRUE; } if (auto_inc != 0) { @@ -2464,7 +2533,7 @@ ha_innobase::write_row( NOTE that a REPLACE command and LOAD DATA INFILE REPLACE handles a duplicate key error itself, and we must not decrement the autoinc counter - if we are performing a those statements. + if we are performing those statements. NOTE 2: if there was an error, for example a deadlock, which caused InnoDB to roll back the whole transaction already in the call of row_insert_for_mysql(), we may no @@ -3887,11 +3956,9 @@ ha_innobase::discard_or_import_tablespace( err = row_import_tablespace_for_mysql(dict_table->name, trx); } - if (err == DB_SUCCESS) { - DBUG_RETURN(0); - } + err = convert_error_code_to_mysql(err, NULL); - DBUG_RETURN(-1); + DBUG_RETURN(err); } /********************************************************************* @@ -4605,12 +4672,12 @@ ha_innobase::update_table_comment( dict_print_info_on_foreign_keys(FALSE, file, prebuilt->trx, prebuilt->table); flen = ftell(file); - if(length + flen + 3 > 64000) { + if (flen < 0) { + flen = 0; + } else if (length + flen + 3 > 64000) { flen = 64000 - 3 - length; } - ut_ad(flen > 0); - /* allocate buffer for the full string, and read the contents of the temporary file */ @@ -4674,12 +4741,12 @@ ha_innobase::get_foreign_key_create_info(void) prebuilt->trx->op_info = (char*)""; flen = ftell(file); - if(flen > 64000 - 1) { + if (flen < 0) { + flen = 0; + } else if(flen > 64000 - 1) { flen = 64000 - 1; } - ut_ad(flen >= 0); - /* allocate buffer for the string, and read the contents of the temporary file */ @@ -4922,19 +4989,6 @@ ha_innobase::external_lock( update_thd(thd); - if (prebuilt->table->ibd_file_missing && !current_thd->tablespace_op) { - ut_print_timestamp(stderr); - fprintf(stderr, " InnoDB error:\n" -"MySQL is trying to use a table handle but the .ibd file for\n" -"table %s does not exist.\n" -"Have you deleted the .ibd file from the database directory under\n" -"the MySQL datadir, or have you used DISCARD TABLESPACE?\n" -"Look from section 15.1 of http://www.innodb.com/ibman.html\n" -"how you can resolve the problem.\n", - prebuilt->table->name); - DBUG_RETURN(HA_ERR_CRASHED); - } - trx = prebuilt->trx; prebuilt->sql_stat_start = TRUE; @@ -4982,11 +5036,21 @@ ha_innobase::external_lock( prebuilt->select_lock_type = LOCK_S; } + /* Starting from 4.1.9, no InnoDB table lock is taken in LOCK + TABLES if AUTOCOMMIT=1. It does not make much sense to acquire + an InnoDB table lock if it is released immediately at the end + of LOCK TABLES, and InnoDB's table locks in that case cause + VERY easily deadlocks. */ + if (prebuilt->select_lock_type != LOCK_NONE) { + if (thd->in_lock_tables && - thd->variables.innodb_table_locks) { + thd->variables.innodb_table_locks && + (thd->options & OPTION_NOT_AUTOCOMMIT)) { + ulint error; - error = row_lock_table_for_mysql(prebuilt); + error = row_lock_table_for_mysql(prebuilt, + NULL, LOCK_TABLE_EXP); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql( @@ -5078,12 +5142,12 @@ innodb_show_status( srv_printf_innodb_monitor(srv_monitor_file); flen = ftell(srv_monitor_file); os_file_set_eof(srv_monitor_file); - if(flen > 64000 - 1) { + if (flen < 0) { + flen = 0; + } else if (flen > 64000 - 1) { flen = 64000 - 1; } - ut_ad(flen > 0); - /* allocate buffer for the string, and read the contents of the temporary file */ @@ -5203,7 +5267,9 @@ ha_innobase::store_lock( if ((lock_type == TL_READ && thd->in_lock_tables) || (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || - lock_type == TL_READ_NO_INSERT) { + lock_type == TL_READ_NO_INSERT || + thd->lex->sql_command != SQLCOM_SELECT) { + /* The OR cases above are in this order: 1) MySQL is doing LOCK TABLES ... READ LOCAL, or 2) (we do not know when TL_READ_HIGH_PRIORITY is used), or @@ -5211,10 +5277,32 @@ ha_innobase::store_lock( 4) we are doing a complex SQL statement like INSERT INTO ... SELECT ... and the logical logging (MySQL binlog) requires the use of a locking read, or - MySQL is doing LOCK TABLES ... READ. */ + MySQL is doing LOCK TABLES ... READ. + 5) we let InnoDB do locking reads for all SQL statements that + are not simple SELECTs; note that select_lock_type in this + case may get strengthened in ::external_lock() to LOCK_X. */ + + if (srv_locks_unsafe_for_binlog && + prebuilt->trx->isolation_level != TRX_ISO_SERIALIZABLE && + (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) && + thd->lex->sql_command != SQLCOM_SELECT && + thd->lex->sql_command != SQLCOM_UPDATE_MULTI && + thd->lex->sql_command != SQLCOM_DELETE_MULTI ) { + + /* In case we have innobase_locks_unsafe_for_binlog + option set and isolation level of the transaction + is not set to serializable and MySQL is doing + INSERT INTO...SELECT without FOR UPDATE or IN + SHARE MODE we use consistent read for select. + Similarly, in case of DELETE...SELECT and + UPDATE...SELECT when these are not multi table.*/ - prebuilt->select_lock_type = LOCK_S; - prebuilt->stored_select_lock_type = LOCK_S; + prebuilt->select_lock_type = LOCK_NONE; + prebuilt->stored_select_lock_type = LOCK_NONE; + } else { + prebuilt->select_lock_type = LOCK_S; + prebuilt->stored_select_lock_type = LOCK_S; + } } else if (lock_type != TL_IGNORE) { diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 7f7b000a100..e76a966c6b9 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -64,6 +64,7 @@ class ha_innobase: public handler uint last_match_mode;/* match mode of the latest search: ROW_SEL_EXACT, ROW_SEL_EXACT_PREFIX, or undefined */ + uint num_write_row; /* number of write_row() calls */ longlong auto_inc_counter_for_this_stat; ulong max_supported_row_length(const byte *buf); @@ -85,7 +86,8 @@ class ha_innobase: public handler HA_PRIMARY_KEY_IN_READ_INDEX | HA_TABLE_SCAN_ON_INDEX), last_dup_key((uint) -1), - start_of_scan(0) + start_of_scan(0), + num_write_row(0) { } ~ha_innobase() {} @@ -198,6 +200,7 @@ extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before is equivalent to a 'crash' */ extern "C" { extern ulong srv_max_buf_pool_modified_pct; +extern ulong srv_max_purge_lag; extern ulong srv_auto_extend_increment; extern ulong srv_max_purge_lag; } diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index 6fde84d6f6f..1e6cf2f4ada 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -81,7 +81,6 @@ class ha_myisam: public handler int index_first(byte * buf); int index_last(byte * buf); int index_next_same(byte *buf, const byte *key, uint keylen); - int index_end() { ft_handler=NULL; return 0; } int ft_init() { if (!ft_handler) @@ -89,8 +88,12 @@ class ha_myisam: public handler ft_handler->please->reinit_search(ft_handler); return 0; } - FT_INFO *ft_init_ext(uint flags, uint inx,const byte *key, uint keylen) - { return ft_init_search(flags,file,inx,(byte*) key,keylen, table->record[0]); } + FT_INFO *ft_init_ext(uint flags, uint inx,String *key) + { + return ft_init_search(flags,file,inx, + (byte *)key->ptr(), key->length(), key->charset(), + table->record[0]); + } int ft_read(byte *buf); int rnd_init(bool scan); int rnd_next(byte *buf); diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index bf4c2a36ffd..bf47b4625e0 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -35,6 +35,17 @@ const char **ha_myisammrg::bas_ext() const { static const char *ext[]= { ".MRG", NullS }; return ext; } +const char *ha_myisammrg::index_type(uint key_number) +{ + return ((table->key_info[key_number].flags & HA_FULLTEXT) ? + "FULLTEXT" : + (table->key_info[key_number].flags & HA_SPATIAL) ? + "SPATIAL" : + (table->key_info[key_number].algorithm == HA_KEY_ALG_RTREE) ? + "RTREE" : + "BTREE"); +} + int ha_myisammrg::open(const char *name, int mode, uint test_if_locked) { diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h index 264c580220c..6058c32c805 100644 --- a/sql/ha_myisammrg.h +++ b/sql/ha_myisammrg.h @@ -32,6 +32,7 @@ class ha_myisammrg: public handler ~ha_myisammrg() {} const char *table_type() const { return "MRG_MyISAM"; } const char **bas_ext() const; + const char *index_type(uint key_number); ulong table_flags() const { return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME | diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 044cb85b913..3e2fc5b2855 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -32,6 +32,10 @@ #include <ndbapi/NdbApi.hpp> #include <ndbapi/NdbScanFilter.hpp> +// options from from mysqld.cc +extern my_bool opt_ndb_optimized_node_selection; +extern const char *opt_ndbcluster_connectstring; + // Default value for parallelism static const int parallelism= 240; @@ -39,12 +43,6 @@ static const int parallelism= 240; // createable against NDB from this handler static const int max_transactions= 256; -// Default value for prefetch of autoincrement values -static const ha_rows autoincrement_prefetch= 32; - -// connectstring to cluster if given by mysqld -const char *ndbcluster_connectstring= 0; - static const char *ha_ndb_ext=".ndb"; #define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 @@ -103,51 +101,52 @@ struct err_code_mapping { int ndb_err; int my_err; + int show_warning; }; static const err_code_mapping err_map[]= { - { 626, HA_ERR_KEY_NOT_FOUND }, - { 630, HA_ERR_FOUND_DUPP_KEY }, - { 893, HA_ERR_FOUND_DUPP_UNIQUE }, - { 721, HA_ERR_TABLE_EXIST }, - { 4244, HA_ERR_TABLE_EXIST }, - - { 709, HA_ERR_NO_SUCH_TABLE }, - { 284, HA_ERR_NO_SUCH_TABLE }, - - { 266, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 274, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 296, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 297, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 237, HA_ERR_LOCK_WAIT_TIMEOUT }, - - { 623, HA_ERR_RECORD_FILE_FULL }, - { 624, HA_ERR_RECORD_FILE_FULL }, - { 625, HA_ERR_RECORD_FILE_FULL }, - { 826, HA_ERR_RECORD_FILE_FULL }, - { 827, HA_ERR_RECORD_FILE_FULL }, - { 832, HA_ERR_RECORD_FILE_FULL }, - - { 0, 1 }, - - { -1, -1 } + { 626, HA_ERR_KEY_NOT_FOUND, 0 }, + { 630, HA_ERR_FOUND_DUPP_KEY, 0 }, + { 893, HA_ERR_FOUND_DUPP_KEY, 0 }, + { 721, HA_ERR_TABLE_EXIST, 1 }, + { 4244, HA_ERR_TABLE_EXIST, 1 }, + + { 709, HA_ERR_NO_SUCH_TABLE, 1 }, + { 284, HA_ERR_NO_SUCH_TABLE, 1 }, + + { 266, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 274, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 296, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 297, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 237, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + + { 623, HA_ERR_RECORD_FILE_FULL, 1 }, + { 624, HA_ERR_RECORD_FILE_FULL, 1 }, + { 625, HA_ERR_RECORD_FILE_FULL, 1 }, + { 826, HA_ERR_RECORD_FILE_FULL, 1 }, + { 827, HA_ERR_RECORD_FILE_FULL, 1 }, + { 832, HA_ERR_RECORD_FILE_FULL, 1 }, + + { 0, 1, 0 }, + + { -1, -1, 1 } }; static int ndb_to_mysql_error(const NdbError *err) { uint i; - for (i=0 ; err_map[i].ndb_err != err->code ; i++) + for (i=0; err_map[i].ndb_err != err->code && err_map[i].my_err != -1; i++); + if (err_map[i].show_warning) { - if (err_map[i].my_err == -1){ - // Push the NDB error message as warning - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_GET_ERRMSG, ER(ER_GET_ERRMSG), - err->code, err->message, "NDB"); - return err->code; - } + // Push the NDB error message as warning + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_GET_ERRMSG, ER(ER_GET_ERRMSG), + err->code, err->message, "NDB"); } + if (err_map[i].my_err == -1) + return err->code; return err_map[i].my_err; } @@ -161,7 +160,7 @@ int execute_no_commit(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(NoCommit,AbortOnError,1); + return trans->execute(NoCommit,AbortOnError,h->m_force_send); } inline @@ -172,7 +171,18 @@ int execute_commit(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(Commit,AbortOnError,1); + return trans->execute(Commit,AbortOnError,h->m_force_send); +} + +inline +int execute_commit(THD *thd, NdbConnection *trans) +{ + int m_batch_execute= 0; +#ifdef NOT_USED + if (m_batch_execute) + return 0; +#endif + return trans->execute(Commit,AbortOnError,thd->variables.ndb_force_send); } inline @@ -183,7 +193,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(NoCommit,IgnoreError,1); + return trans->execute(NoCommit, AO_IgnoreError,h->m_force_send); } /* @@ -202,6 +212,13 @@ Thd_ndb::~Thd_ndb() { if (ndb) delete ndb; + ndb= 0; +} + +inline +Ndb *ha_ndbcluster::get_ndb() +{ + return ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; } /* @@ -226,6 +243,8 @@ void ha_ndbcluster::set_rec_per_key() void ha_ndbcluster::records_update() { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::records_update"); struct Ndb_table_local_info *info= (struct Ndb_table_local_info *)m_table_info; DBUG_PRINT("info", ("id=%d, no_uncommitted_rows_count=%d", @@ -233,8 +252,9 @@ void ha_ndbcluster::records_update() info->no_uncommitted_rows_count)); // if (info->records == ~(ha_rows)0) { + Ndb *ndb= get_ndb(); Uint64 rows; - if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){ + if(ndb_get_table_statistics(ndb, m_tabname, &rows, 0) == 0){ info->records= rows; } } @@ -249,6 +269,8 @@ void ha_ndbcluster::records_update() void ha_ndbcluster::no_uncommitted_rows_execute_failure() { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_execute_failure"); THD *thd= current_thd; ((Thd_ndb*)(thd->transaction.thd_ndb))->error= 1; @@ -257,6 +279,8 @@ void ha_ndbcluster::no_uncommitted_rows_execute_failure() void ha_ndbcluster::no_uncommitted_rows_init(THD *thd) { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_init"); struct Ndb_table_local_info *info= (struct Ndb_table_local_info *)m_table_info; Thd_ndb *thd_ndb= (Thd_ndb *)thd->transaction.thd_ndb; @@ -274,6 +298,8 @@ void ha_ndbcluster::no_uncommitted_rows_init(THD *thd) void ha_ndbcluster::no_uncommitted_rows_update(int c) { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_update"); struct Ndb_table_local_info *info= (struct Ndb_table_local_info *)m_table_info; @@ -286,6 +312,8 @@ void ha_ndbcluster::no_uncommitted_rows_update(int c) void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd) { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_reset"); ((Thd_ndb*)(thd->transaction.thd_ndb))->count++; ((Thd_ndb*)(thd->transaction.thd_ndb))->error= 0; @@ -311,7 +339,8 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans) switch (err.classification) { case NdbError::SchemaError: { - NDBDICT *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); DBUG_PRINT("info", ("invalidateTable %s", m_tabname)); dict->invalidateTable(m_tabname); table->version=0L; /* Free when thread is ready */ @@ -324,7 +353,7 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans) DBUG_PRINT("info", ("transformed ndbcluster error %d to mysql error %d", err.code, res)); if (res == HA_ERR_FOUND_DUPP_KEY) - dupkey= table->primary_key; + m_dupkey= table->primary_key; DBUG_RETURN(res); } @@ -341,7 +370,7 @@ bool ha_ndbcluster::get_error_message(int error, DBUG_ENTER("ha_ndbcluster::get_error_message"); DBUG_PRINT("enter", ("error: %d", error)); - Ndb *ndb= ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; + Ndb *ndb= get_ndb(); if (!ndb) DBUG_RETURN(FALSE); @@ -551,10 +580,10 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob) blob_size+= 8 - blob_size % 8; if (loop == 1) { - char *buf= blobs_buffer + offset; + char *buf= m_blobs_buffer + offset; uint32 len= 0xffffffff; // Max uint32 DBUG_PRINT("value", ("read blob ptr=%x len=%u", - (uint)buf, (uint)blob_len)); + (UintPtr)buf, (uint)blob_len)); if (ndb_blob->readData(buf, len) != 0) DBUG_RETURN(-1); DBUG_ASSERT(len == blob_len); @@ -563,15 +592,15 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob) offset+= blob_size; } } - if (loop == 0 && offset > blobs_buffer_size) + if (loop == 0 && offset > m_blobs_buffer_size) { - my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); - blobs_buffer_size= 0; + my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); + m_blobs_buffer_size= 0; DBUG_PRINT("value", ("allocate blobs buffer size %u", offset)); - blobs_buffer= my_malloc(offset, MYF(MY_WME)); - if (blobs_buffer == NULL) + m_blobs_buffer= my_malloc(offset, MYF(MY_WME)); + if (m_blobs_buffer == NULL) DBUG_RETURN(-1); - blobs_buffer_size= offset; + m_blobs_buffer_size= offset; } } DBUG_RETURN(0); @@ -670,7 +699,8 @@ bool ha_ndbcluster::uses_blob_value(bool all_fields) int ha_ndbcluster::get_metadata(const char *path) { - NDBDICT *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; int error; bool invalidating_ndb_table= FALSE; @@ -735,6 +765,42 @@ int ha_ndbcluster::get_metadata(const char *path) DBUG_RETURN(build_index_list(table, ILBP_OPEN)); } +static int fix_unique_index_attr_order(NDB_INDEX_DATA &data, + const NDBINDEX *index, + KEY *key_info) +{ + DBUG_ENTER("fix_unique_index_attr_order"); + unsigned sz= index->getNoOfIndexColumns(); + + if (data.unique_index_attrid_map) + my_free((char*)data.unique_index_attrid_map, MYF(0)); + data.unique_index_attrid_map= (unsigned char*)my_malloc(sz,MYF(MY_WME)); + + KEY_PART_INFO* key_part= key_info->key_part; + KEY_PART_INFO* end= key_part+key_info->key_parts; + DBUG_ASSERT(key_info->key_parts == sz); + for (unsigned i= 0; key_part != end; key_part++, i++) + { + const char *field_name= key_part->field->field_name; + unsigned name_sz= strlen(field_name); + if (name_sz >= NDB_MAX_ATTR_NAME_SIZE) + name_sz= NDB_MAX_ATTR_NAME_SIZE-1; +#ifndef DBUG_OFF + data.unique_index_attrid_map[i]= 255; +#endif + for (unsigned j= 0; j < sz; j++) + { + const NdbDictionary::Column *c= index->getColumn(j); + if (strncmp(field_name, c->getName(), name_sz) == 0) + { + data.unique_index_attrid_map[i]= j; + break; + } + } + DBUG_ASSERT(data.unique_index_attrid_map[i] != 255); + } + DBUG_RETURN(0); +} int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) { @@ -745,7 +811,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) static const char* unique_suffix= "$unique"; KEY* key_info= tab->key_info; const char **key_name= tab->keynames.type_names; - NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NdbDictionary::Dictionary *dict= ndb->getDictionary(); DBUG_ENTER("build_index_list"); // Save information about all known indexes @@ -777,7 +844,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) error= create_unique_index(unique_index_name, key_info); break; case UNIQUE_INDEX: - error= create_unique_index(unique_index_name, key_info); + if (!(error= check_index_fields_not_null(i))) + error= create_unique_index(unique_index_name, key_info); break; case ORDERED_INDEX: error= create_ordered_index(index_name, key_info); @@ -807,7 +875,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) const NDBINDEX *index= dict->getIndex(unique_index_name, m_tabname); if (!index) DBUG_RETURN(1); m_index[i].unique_index= (void *) index; - } + error= fix_unique_index_attr_order(m_index[i], index, key_info); + } } DBUG_RETURN(error); @@ -829,6 +898,26 @@ NDB_INDEX_TYPE ha_ndbcluster::get_index_type_from_table(uint inx) const ORDERED_INDEX); } +int ha_ndbcluster::check_index_fields_not_null(uint inx) +{ + KEY* key_info= table->key_info + inx; + KEY_PART_INFO* key_part= key_info->key_part; + KEY_PART_INFO* end= key_part+key_info->key_parts; + DBUG_ENTER("check_index_fields_not_null"); + + for (; key_part != end; key_part++) + { + Field* field= key_part->field; + if (field->maybe_null()) + { + my_printf_error(ER_NULL_COLUMN_IN_INDEX,ER(ER_NULL_COLUMN_IN_INDEX), + MYF(0),field->field_name); + DBUG_RETURN(ER_NULL_COLUMN_IN_INDEX); + } + } + + DBUG_RETURN(0); +} void ha_ndbcluster::release_metadata() { @@ -845,6 +934,11 @@ void ha_ndbcluster::release_metadata() { m_index[i].unique_index= NULL; m_index[i].index= NULL; + if (m_index[i].unique_index_attrid_map) + { + my_free((char *)m_index[i].unique_index_attrid_map, MYF(0)); + m_index[i].unique_index_attrid_map= NULL; + } } DBUG_VOID_RETURN; @@ -854,7 +948,7 @@ int ha_ndbcluster::get_ndb_lock_type(enum thr_lock_type type) { if (type >= TL_WRITE_ALLOW_WRITE) return NdbOperation::LM_Exclusive; - else if (uses_blob_value(retrieve_all_fields)) + else if (uses_blob_value(m_retrieve_all_fields)) return NdbOperation::LM_Read; else return NdbOperation::LM_CommittedRead; @@ -1018,7 +1112,8 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf) { Field *field= table->field[i]; if ((thd->query_id == field->query_id) || - retrieve_all_fields) + m_retrieve_all_fields || + (field->flags & PRI_KEY_FLAG) && m_retrieve_primary_key) { if (get_ndb_value(op, field, i, buf)) ERR_RETURN(trans->getNdbError()); @@ -1055,7 +1150,7 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data) THD *thd= current_thd; DBUG_ENTER("complemented_pk_read"); - if (retrieve_all_fields) + if (m_retrieve_all_fields) // We have allready retrieved all fields, nothing to complement DBUG_RETURN(0); @@ -1093,6 +1188,34 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data) DBUG_RETURN(0); } +/* + Peek to check if a particular row already exists +*/ + +int ha_ndbcluster::peek_row() +{ + NdbConnection *trans= m_active_trans; + NdbOperation *op; + THD *thd= current_thd; + 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()); + + int res; + if ((res= set_primary_key(op))) + ERR_RETURN(trans->getNdbError()); + + if (execute_no_commit_ie(this,trans) != 0) + { + table->status= STATUS_NOT_FOUND; + DBUG_RETURN(ndb_err(trans)); + } + DBUG_RETURN(0); +} /* Read one record from NDB using unique secondary index @@ -1128,9 +1251,11 @@ int ha_ndbcluster::unique_index_read(const byte *key, for (i= 0; key_part != end; key_part++, i++) { - if (set_ndb_key(op, key_part->field, i, key_ptr)) + if (set_ndb_key(op, key_part->field, + m_index[active_index].unique_index_attrid_map[i], + key_part->null_bit ? key_ptr + 1 : key_ptr)) ERR_RETURN(trans->getNdbError()); - key_ptr+= key_part->length; + key_ptr+= key_part->store_length; } // Get non-index attribute(s) @@ -1138,7 +1263,7 @@ int ha_ndbcluster::unique_index_read(const byte *key, { Field *field= table->field[i]; if ((thd->query_id == field->query_id) || - (field->flags & PRI_KEY_FLAG)) + (field->flags & PRI_KEY_FLAG)) // && m_retrieve_primary_key ?? { if (get_ndb_value(op, field, i, buf)) ERR_RETURN(op->getNdbError()); @@ -1192,14 +1317,14 @@ inline int ha_ndbcluster::next_result(byte *buf) /* We can only handle one tuple with blobs at a time. */ - if (ops_pending && blobs_pending) + if (m_ops_pending && m_blobs_pending) { if (execute_no_commit(this,trans) != 0) DBUG_RETURN(ndb_err(trans)); - ops_pending= 0; - blobs_pending= FALSE; + m_ops_pending= 0; + m_blobs_pending= FALSE; } - check= cursor->nextResult(contact_ndb); + check= cursor->nextResult(contact_ndb, m_force_send); if (check == 0) { // One more record found @@ -1219,10 +1344,11 @@ inline int ha_ndbcluster::next_result(byte *buf) all pending update or delete operations should be sent to NDB */ - DBUG_PRINT("info", ("ops_pending: %d", ops_pending)); - if (ops_pending) + DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); + if (m_ops_pending) { - if (current_thd->transaction.on) + // if (current_thd->transaction.on) + if (m_transaction_on) { if (execute_no_commit(this,trans) != 0) DBUG_RETURN(ndb_err(trans)); @@ -1234,7 +1360,7 @@ inline int ha_ndbcluster::next_result(byte *buf) int res= trans->restart(); DBUG_ASSERT(res == 0); } - ops_pending= 0; + m_ops_pending= 0; } contact_ndb= (check == 2); @@ -1290,7 +1416,6 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op, Field *field= key_part->field; uint part_len= key_part->length; uint part_store_len= key_part->store_length; - bool part_nullable= (bool) key_part->null_bit; // Info about each key part struct part_st { bool part_last; @@ -1312,9 +1437,9 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op, p.part_last= (tot_len + part_store_len >= key_tot_len[j]); p.key= keys[j]; p.part_ptr= &p.key->key[tot_len]; - p.part_null= (field->maybe_null() && *p.part_ptr); + p.part_null= key_part->null_bit && *p.part_ptr; p.bound_ptr= (const char *) - p.part_null ? 0 : part_nullable ? p.part_ptr + 1 : p.part_ptr; + p.part_null ? 0 : key_part->null_bit ? p.part_ptr + 1 : p.part_ptr; if (j == 0) { @@ -1393,8 +1518,10 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op, // Set bound if not cancelled via type -1 if (p.bound_type != -1) - if (op->setBound(field->field_name, p.bound_type, p.bound_ptr)) + { + if (op->setBound(i, p.bound_type, p.bound_ptr)) ERR_RETURN(op->getNdbError()); + } } } @@ -1418,7 +1545,7 @@ int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op) Field *field= table->field[i]; if ((thd->query_id == field->query_id) || (field->flags & PRI_KEY_FLAG) || - retrieve_all_fields) + m_retrieve_all_fields) { if (get_ndb_value(op, field, i, buf)) ERR_RETURN(op->getNdbError()); @@ -1487,7 +1614,7 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key, DBUG_ASSERT(op->getSorted() == sorted); DBUG_ASSERT(op->getLockMode() == (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type)); - if(op->reset_bounds()) + if(op->reset_bounds(m_force_send)) DBUG_RETURN(ndb_err(m_active_trans)); } @@ -1562,7 +1689,7 @@ int ha_ndbcluster::filtered_scan(const byte *key, uint key_len, Field* field= key_part->field; uint ndb_fieldnr= key_part->fieldnr-1; DBUG_PRINT("key_part", ("fieldnr: %d", ndb_fieldnr)); - // const NDBCOL *col= tab->getColumn(ndb_fieldnr); + //const NDBCOL *col= ((const NDBTAB *) m_table)->getColumn(ndb_fieldnr); uint32 field_len= field->pack_length(); DBUG_DUMP("key", (char*)key, field_len); @@ -1631,9 +1758,17 @@ int ha_ndbcluster::write_row(byte *record) int res; DBUG_ENTER("write_row"); - if(m_ignore_dup_key_not_supported) + if(m_ignore_dup_key && table->primary_key != MAX_KEY) { - DBUG_RETURN(HA_ERR_WRONG_COMMAND); + int peek_res= peek_row(); + + if (!peek_res) + { + m_dupkey= table->primary_key; + DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY); + } + if (peek_res != HA_ERR_KEY_NOT_FOUND) + DBUG_RETURN(peek_res); } statistic_increment(ha_write_count,&LOCK_status); @@ -1651,7 +1786,8 @@ int ha_ndbcluster::write_row(byte *record) if (table->primary_key == MAX_KEY) { // Table has hidden primary key - Uint64 auto_value= m_ndb->getAutoIncrementValue((const NDBTAB *) m_table); + Ndb *ndb= get_ndb(); + Uint64 auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table); if (set_hidden_key(op, table->fields, (const byte*)&auto_value)) ERR_RETURN(op->getNdbError()); } @@ -1661,9 +1797,9 @@ int ha_ndbcluster::write_row(byte *record) if (has_auto_increment) { - skip_auto_increment= FALSE; + m_skip_auto_increment= FALSE; update_auto_increment(); - skip_auto_increment= !auto_increment_column_changed; + m_skip_auto_increment= !auto_increment_column_changed; } if ((res= set_primary_key(op))) @@ -1678,7 +1814,7 @@ int ha_ndbcluster::write_row(byte *record) if (!(field->flags & PRI_KEY_FLAG) && set_ndb_value(op, field, i, &set_blob_value)) { - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; ERR_RETURN(op->getNdbError()); } } @@ -1690,25 +1826,26 @@ int ha_ndbcluster::write_row(byte *record) to NoCommit the transaction between each row. Find out how this is detected! */ - rows_inserted++; + m_rows_inserted++; no_uncommitted_rows_update(1); - bulk_insert_not_flushed= TRUE; - if ((rows_to_insert == 1) || - ((rows_inserted % bulk_insert_rows) == 0) || + m_bulk_insert_not_flushed= TRUE; + if ((m_rows_to_insert == 1) || + ((m_rows_inserted % m_bulk_insert_rows) == 0) || set_blob_value) { THD *thd= current_thd; // Send rows to NDB DBUG_PRINT("info", ("Sending inserts to NDB, "\ "rows_inserted:%d, bulk_insert_rows: %d", - (int)rows_inserted, (int)bulk_insert_rows)); + (int)m_rows_inserted, (int)m_bulk_insert_rows)); - bulk_insert_not_flushed= FALSE; - if (thd->transaction.on) + m_bulk_insert_not_flushed= FALSE; + // if (thd->transaction.on) + if (m_transaction_on) { if (execute_no_commit(this,trans) != 0) { - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } @@ -1717,7 +1854,7 @@ int ha_ndbcluster::write_row(byte *record) { if (execute_commit(this,trans) != 0) { - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } @@ -1725,17 +1862,18 @@ int ha_ndbcluster::write_row(byte *record) DBUG_ASSERT(res == 0); } } - if ((has_auto_increment) && (skip_auto_increment)) + if ((has_auto_increment) && (m_skip_auto_increment)) { + Ndb *ndb= get_ndb(); Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1; DBUG_PRINT("info", ("Trying to set next auto increment value to %lu", (ulong) next_val)); - if (m_ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) + if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) DBUG_PRINT("info", ("Setting next auto increment value to %u", next_val)); } - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; DBUG_RETURN(0); } @@ -1815,7 +1953,9 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) } // Delete old row DBUG_PRINT("info", ("insert succeded")); + m_primary_key_update= TRUE; delete_res= delete_row(old_data); + m_primary_key_update= FALSE; if (delete_res) { DBUG_PRINT("info", ("delete failed")); @@ -1838,9 +1978,9 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) DBUG_PRINT("info", ("Calling updateTuple on cursor")); if (!(op= cursor->updateTuple())) ERR_RETURN(trans->getNdbError()); - ops_pending++; + m_ops_pending++; if (uses_blob_value(FALSE)) - blobs_pending= TRUE; + m_blobs_pending= TRUE; } else { @@ -1875,7 +2015,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) for (i= 0; i < table->fields; i++) { Field *field= table->field[i]; - if ((thd->query_id == field->query_id) && + if (((thd->query_id == field->query_id) || m_retrieve_all_fields) && (!(field->flags & PRI_KEY_FLAG)) && set_ndb_value(op, field, i)) ERR_RETURN(op->getNdbError()); @@ -1916,7 +2056,7 @@ int ha_ndbcluster::delete_row(const byte *record) DBUG_PRINT("info", ("Calling deleteTuple on cursor")); if (cursor->deleteTuple() != 0) ERR_RETURN(trans->getNdbError()); - ops_pending++; + m_ops_pending++; no_uncommitted_rows_update(-1); @@ -1946,8 +2086,10 @@ int ha_ndbcluster::delete_row(const byte *record) else { int res; - if ((res= set_primary_key(op))) - return res; + if ((res= (m_primary_key_update ? + set_primary_key_from_old_data(op, record) + : set_primary_key(op)))) + return res; } } @@ -2134,24 +2276,26 @@ void ha_ndbcluster::print_results() fprintf(DBUG_FILE, "Double\t%f", value); break; } - case NdbDictionary::Column::Decimal: { + case NdbDictionary::Column::Olddecimal: { char *value= field->ptr; - - fprintf(DBUG_FILE, "Decimal\t'%-*s'", field->pack_length(), value); + fprintf(DBUG_FILE, "Olddecimal\t'%-*s'", field->pack_length(), value); + break; + } + case NdbDictionary::Column::Olddecimalunsigned: { + char *value= field->ptr; + fprintf(DBUG_FILE, "Olddecimalunsigned\t'%-*s'", field->pack_length(), value); break; } case NdbDictionary::Column::Char:{ - char buf[field->pack_length()+1]; - char *value= (char *) field->ptr; - snprintf(buf, field->pack_length(), "%s", value); - fprintf(DBUG_FILE, "Char\t'%s'", buf); + const char *value= (char *) field->ptr; + fprintf(DBUG_FILE, "Char\t'%.*s'", field->pack_length(), value); break; } case NdbDictionary::Column::Varchar: case NdbDictionary::Column::Binary: case NdbDictionary::Column::Varbinary: { - char *value= (char *) field->ptr; - fprintf(DBUG_FILE, "'%s'", value); + const char *value= (char *) field->ptr; + fprintf(DBUG_FILE, "Var\t'%.*s'", field->pack_length(), value); break; } case NdbDictionary::Column::Datetime: { @@ -2159,9 +2303,14 @@ void ha_ndbcluster::print_results() fprintf(DBUG_FILE, "Datetime\t%llu", value); break; } - case NdbDictionary::Column::Timespec: { + case NdbDictionary::Column::Date: { + Uint64 value= (Uint64) *field->ptr; + fprintf(DBUG_FILE, "Date\t%llu", value); + break; + } + case NdbDictionary::Column::Time: { Uint64 value= (Uint64) *field->ptr; - fprintf(DBUG_FILE, "Timespec\t%llu", value); + fprintf(DBUG_FILE, "Time\t%llu", value); break; } case NdbDictionary::Column::Blob: { @@ -2202,6 +2351,28 @@ int ha_ndbcluster::index_end() DBUG_RETURN(close_scan()); } +/** + * Check if key contains null + */ +static +int +check_null_in_key(const KEY* key_info, const byte *key, uint key_len) +{ + KEY_PART_INFO *curr_part, *end_part; + const byte* end_ptr = key + key_len; + curr_part= key_info->key_part; + end_part= curr_part + key_info->key_parts; + + + for (; curr_part != end_part && key < end_ptr; curr_part++) + { + if(curr_part->null_bit && *key) + return 1; + + key += curr_part->store_length; + } + return 0; +} int ha_ndbcluster::index_read(byte *buf, const byte *key, uint key_len, @@ -2219,6 +2390,8 @@ int ha_ndbcluster::index_read(byte *buf, case PRIMARY_KEY_INDEX: if (find_flag == HA_READ_KEY_EXACT && key_info->key_length == key_len) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); DBUG_RETURN(pk_read(key, key_len, buf)); } else if (type == PRIMARY_KEY_INDEX) @@ -2228,8 +2401,11 @@ int ha_ndbcluster::index_read(byte *buf, break; case UNIQUE_ORDERED_INDEX: case UNIQUE_INDEX: - if (find_flag == HA_READ_KEY_EXACT && key_info->key_length == key_len) + if (find_flag == HA_READ_KEY_EXACT && key_info->key_length == key_len && + !check_null_in_key(key_info, key, key_len)) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); DBUG_RETURN(unique_index_read(key, key_len, buf)); } else if (type == UNIQUE_INDEX) @@ -2303,14 +2479,14 @@ int ha_ndbcluster::index_last(byte *buf) int res; if((res= ordered_index_scan(0, 0, TRUE, buf)) == 0){ NdbResultSet *cursor= m_active_cursor; - while((res= cursor->nextResult(TRUE)) == 0); + while((res= cursor->nextResult(TRUE, m_force_send)) == 0); if(res == 1){ unpack_record(buf); table->status= 0; DBUG_RETURN(0); } } - DBUG_RETURN(1); + DBUG_RETURN(res); } @@ -2333,6 +2509,8 @@ int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key, start_key->length == key_info->key_length && start_key->flag == HA_READ_KEY_EXACT) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); error= pk_read(start_key->key, start_key->length, buf); DBUG_RETURN(error == HA_ERR_KEY_NOT_FOUND ? HA_ERR_END_OF_FILE : error); } @@ -2340,10 +2518,12 @@ int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key, case UNIQUE_ORDERED_INDEX: case UNIQUE_INDEX: key_info= table->key_info + active_index; - if (start_key && - start_key->length == key_info->key_length && - start_key->flag == HA_READ_KEY_EXACT) + if (start_key && start_key->length == key_info->key_length && + start_key->flag == HA_READ_KEY_EXACT && + !check_null_in_key(key_info, start_key->key, start_key->length)) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); error= unique_index_read(start_key->key, start_key->length, buf); DBUG_RETURN(error == HA_ERR_KEY_NOT_FOUND ? HA_ERR_END_OF_FILE : error); } @@ -2389,7 +2569,7 @@ int ha_ndbcluster::rnd_init(bool scan) { if (!scan) DBUG_RETURN(1); - int res= cursor->restart(); + int res= cursor->restart(m_force_send); DBUG_ASSERT(res == 0); } index_init(table->primary_key); @@ -2406,21 +2586,21 @@ int ha_ndbcluster::close_scan() DBUG_RETURN(1); - if (ops_pending) + if (m_ops_pending) { /* Take over any pending transactions to the deleteing/updating transaction before closing the scan */ - DBUG_PRINT("info", ("ops_pending: %d", ops_pending)); + DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); if (execute_no_commit(this,trans) != 0) { no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } - ops_pending= 0; + m_ops_pending= 0; } - cursor->close(); + cursor->close(m_force_send); m_active_cursor= NULL; DBUG_RETURN(0); } @@ -2532,14 +2712,20 @@ void ha_ndbcluster::info(uint flag) DBUG_PRINT("info", ("HA_STATUS_VARIABLE")); if (m_table_info) { - records_update(); + if (m_ha_not_exact_count) + records= 100; + else + records_update(); } else { - Uint64 rows; - if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){ - records= rows; - } + if ((my_errno= check_ndb_connection())) + DBUG_VOID_RETURN; + Ndb *ndb= get_ndb(); + Uint64 rows= 100; + if (current_thd->variables.ndb_use_exact_count) + ndb_get_table_statistics(ndb, m_tabname, &rows, 0); + records= rows; } } if (flag & HA_STATUS_CONST) @@ -2550,7 +2736,7 @@ void ha_ndbcluster::info(uint flag) if (flag & HA_STATUS_ERRKEY) { DBUG_PRINT("info", ("HA_STATUS_ERRKEY")); - errkey= dupkey; + errkey= m_dupkey; } if (flag & HA_STATUS_AUTO) DBUG_PRINT("info", ("HA_STATUS_AUTO")); @@ -2645,20 +2831,21 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) m_use_write= TRUE; } else { - m_ignore_dup_key_not_supported= TRUE; + DBUG_PRINT("info", ("Ignoring duplicate key")); + m_ignore_dup_key= TRUE; } break; case HA_EXTRA_NO_IGNORE_DUP_KEY: DBUG_PRINT("info", ("HA_EXTRA_NO_IGNORE_DUP_KEY")); DBUG_PRINT("info", ("Turning OFF use of write instead of insert")); m_use_write= FALSE; - m_ignore_dup_key_not_supported= FALSE; + m_ignore_dup_key= FALSE; break; case HA_EXTRA_RETRIEVE_ALL_COLS: /* Retrieve all columns, not just those where field->query_id is the same as the current query id */ DBUG_PRINT("info", ("HA_EXTRA_RETRIEVE_ALL_COLS")); - retrieve_all_fields= TRUE; + m_retrieve_all_fields= TRUE; break; case HA_EXTRA_PREPARE_FOR_DELETE: DBUG_PRINT("info", ("HA_EXTRA_PREPARE_FOR_DELETE")); @@ -2671,6 +2858,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) break; case HA_EXTRA_RETRIEVE_PRIMARY_KEY: DBUG_PRINT("info", ("HA_EXTRA_RETRIEVE_PRIMARY_KEY")); + m_retrieve_primary_key= TRUE; break; case HA_EXTRA_CHANGE_KEY_TO_UNIQUE: DBUG_PRINT("info", ("HA_EXTRA_CHANGE_KEY_TO_UNIQUE")); @@ -2702,8 +2890,8 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows) DBUG_ENTER("start_bulk_insert"); DBUG_PRINT("enter", ("rows: %d", (int)rows)); - rows_inserted= 0; - rows_to_insert= rows; + m_rows_inserted= 0; + m_rows_to_insert= rows; /* Calculate how many rows that should be inserted @@ -2717,7 +2905,7 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows) batch= bytesperbatch/bytes; batch= batch == 0 ? 1 : batch; DBUG_PRINT("info", ("batch: %d, bytes: %d", batch, bytes)); - bulk_insert_rows= batch; + m_bulk_insert_rows= batch; DBUG_VOID_RETURN; } @@ -2731,22 +2919,22 @@ int ha_ndbcluster::end_bulk_insert() DBUG_ENTER("end_bulk_insert"); // Check if last inserts need to be flushed - if (bulk_insert_not_flushed) + if (m_bulk_insert_not_flushed) { NdbConnection *trans= m_active_trans; // Send rows to NDB DBUG_PRINT("info", ("Sending inserts to NDB, "\ "rows_inserted:%d, bulk_insert_rows: %d", - rows_inserted, bulk_insert_rows)); - bulk_insert_not_flushed= FALSE; + m_rows_inserted, m_bulk_insert_rows)); + m_bulk_insert_not_flushed= FALSE; if (execute_no_commit(this,trans) != 0) { no_uncommitted_rows_execute_failure(); my_errno= error= ndb_err(trans); } } - rows_inserted= 0; - rows_to_insert= 1; + m_rows_inserted= 0; + m_rows_to_insert= 1; DBUG_RETURN(error); } @@ -2768,7 +2956,7 @@ int ha_ndbcluster::reset() const char **ha_ndbcluster::bas_ext() const -{ static const char *ext[]= { ".ndb", NullS }; return ext; } +{ static const char *ext[]= { ha_ndb_ext, NullS }; return ext; } /* @@ -2863,6 +3051,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_RETURN(1); Thd_ndb *thd_ndb= (Thd_ndb*)thd->transaction.thd_ndb; + Ndb *ndb= thd_ndb->ndb; DBUG_PRINT("enter", ("transaction.thd_ndb->lock_count: %d", thd_ndb->lock_count)); @@ -2880,9 +3069,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_ASSERT(!thd->transaction.stmt.ndb_tid); DBUG_PRINT("trans",("Starting transaction stmt")); - trans= m_ndb->startTransaction(); + trans= ndb->startTransaction(); if (trans == NULL) - ERR_RETURN(m_ndb->getNdbError()); + ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } @@ -2894,9 +3083,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) // A "master" transaction ha not been started yet DBUG_PRINT("trans",("starting transaction, all")); - trans= m_ndb->startTransaction(); + trans= ndb->startTransaction(); if (trans == NULL) - ERR_RETURN(m_ndb->getNdbError()); + ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); /* @@ -2927,15 +3116,26 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) pointer to point to the NDB transaction. */ + // store thread specific data first to set the right context + m_force_send= thd->variables.ndb_force_send; + m_ha_not_exact_count= !thd->variables.ndb_use_exact_count; + m_autoincrement_prefetch= thd->variables.ndb_autoincrement_prefetch_sz; + if (!thd->transaction.on) + m_transaction_on= FALSE; + else + m_transaction_on= thd->variables.ndb_use_transactions; + // m_use_local_query_cache= thd->variables.ndb_use_local_query_cache; + m_active_trans= thd->transaction.all.ndb_tid ? (NdbConnection*)thd->transaction.all.ndb_tid: (NdbConnection*)thd->transaction.stmt.ndb_tid; DBUG_ASSERT(m_active_trans); // Start of transaction - retrieve_all_fields= FALSE; - ops_pending= 0; + m_retrieve_all_fields= FALSE; + m_retrieve_primary_key= FALSE; + m_ops_pending= 0; { - NDBDICT *dict= m_ndb->getDictionary(); + NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; void *tab_info; if (!(tab= dict->getTable(m_tabname, &tab_info))) @@ -2962,7 +3162,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) We must in this case close the transaction to release resources */ DBUG_PRINT("trans",("ending non-updating transaction")); - m_ndb->closeTransaction(m_active_trans); + ndb->closeTransaction(m_active_trans); thd->transaction.stmt.ndb_tid= 0; } } @@ -2981,13 +3181,13 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_PRINT("warning", ("m_active_cursor != NULL")); m_active_cursor= NULL; - if (blobs_pending) + if (m_blobs_pending) DBUG_PRINT("warning", ("blobs_pending != 0")); - blobs_pending= 0; + m_blobs_pending= 0; - if (ops_pending) + if (m_ops_pending) DBUG_PRINT("warning", ("ops_pending != 0L")); - ops_pending= 0; + m_ops_pending= 0; } DBUG_RETURN(error); } @@ -3008,24 +3208,26 @@ int ha_ndbcluster::start_stmt(THD *thd) NdbConnection *trans= (NdbConnection*)thd->transaction.stmt.ndb_tid; if (!trans){ + Ndb *ndb= ((Thd_ndb*)thd->transaction.thd_ndb)->ndb; DBUG_PRINT("trans",("Starting transaction stmt")); NdbConnection *tablock_trans= (NdbConnection*)thd->transaction.all.ndb_tid; - DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans)); + DBUG_PRINT("info", ("tablock_trans: %x", (UintPtr)tablock_trans)); DBUG_ASSERT(tablock_trans); -// trans= m_ndb->hupp(tablock_trans); - trans= m_ndb->startTransaction(); +// trans= ndb->hupp(tablock_trans); + trans= ndb->startTransaction(); if (trans == NULL) - ERR_RETURN(m_ndb->getNdbError()); + ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } m_active_trans= trans; // Start of statement - retrieve_all_fields= FALSE; - ops_pending= 0; + m_retrieve_all_fields= FALSE; + m_retrieve_primary_key= FALSE; + m_ops_pending= 0; DBUG_RETURN(error); } @@ -3047,7 +3249,7 @@ int ndbcluster_commit(THD *thd, void *ndb_transaction) "stmt" : "all")); DBUG_ASSERT(ndb && trans); - if (execute_commit(0,trans) != 0) + if (execute_commit(thd,trans) != 0) { const NdbError err= trans->getNdbError(); const NdbOperation *error_op= trans->getNdbErrorOperation(); @@ -3102,17 +3304,18 @@ static int create_ndb_column(NDBCOL &col, HA_CREATE_INFO *info) { // Set name - col.setName(field->field_name); + { + char truncated_field_name[NDB_MAX_ATTR_NAME_SIZE]; + strnmov(truncated_field_name,field->field_name,sizeof(truncated_field_name)); + truncated_field_name[sizeof(truncated_field_name)-1]= '\0'; + col.setName(truncated_field_name); + } // Get char set CHARSET_INFO *cs= field->charset(); // Set type and sizes const enum enum_field_types mysql_type= field->real_type(); switch (mysql_type) { // Numeric types - case MYSQL_TYPE_DECIMAL: - col.setType(NDBCOL::Char); - col.setLength(field->pack_length()); - break; case MYSQL_TYPE_TINY: if (field->flags & UNSIGNED_FLAG) col.setType(NDBCOL::Tinyunsigned); @@ -3156,22 +3359,51 @@ static int create_ndb_column(NDBCOL &col, col.setType(NDBCOL::Double); col.setLength(1); break; - // Date types - case MYSQL_TYPE_TIMESTAMP: - col.setType(NDBCOL::Unsigned); - col.setLength(1); + case MYSQL_TYPE_DECIMAL: + { + Field_decimal *f= (Field_decimal*)field; + uint precision= f->pack_length(); + uint scale= f->decimals(); + if (field->flags & UNSIGNED_FLAG) + { + col.setType(NDBCOL::Olddecimalunsigned); + precision-= (scale > 0); + } + else + { + col.setType(NDBCOL::Olddecimal); + precision-= 1 + (scale > 0); + } + col.setPrecision(precision); + col.setScale(scale); + col.setLength(1); + } break; + // Date types case MYSQL_TYPE_DATETIME: col.setType(NDBCOL::Datetime); col.setLength(1); break; - case MYSQL_TYPE_DATE: - case MYSQL_TYPE_NEWDATE: - case MYSQL_TYPE_TIME: - case MYSQL_TYPE_YEAR: + case MYSQL_TYPE_DATE: // ? col.setType(NDBCOL::Char); col.setLength(field->pack_length()); break; + case MYSQL_TYPE_NEWDATE: + col.setType(NDBCOL::Date); + col.setLength(1); + break; + case MYSQL_TYPE_TIME: + col.setType(NDBCOL::Time); + col.setLength(1); + break; + case MYSQL_TYPE_YEAR: + col.setType(NDBCOL::Year); + col.setLength(1); + break; + case MYSQL_TYPE_TIMESTAMP: + col.setType(NDBCOL::Timestamp); + col.setLength(1); + break; // Char types case MYSQL_TYPE_STRING: if (field->flags & BINARY_FLAG) @@ -3291,13 +3523,59 @@ static int create_ndb_column(NDBCOL &col, Create a table in NDB Cluster */ +static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) +{ + if (form->max_rows == 0) /* default setting, don't set fragmentation */ + return; + /** + * get the number of fragments right + */ + uint no_fragments; + { +#if MYSQL_VERSION_ID >= 50000 + uint acc_row_size= 25 + /*safety margin*/ 2; +#else + uint acc_row_size= pk_length*4; + /* add acc overhead */ + if (pk_length <= 8) /* main page will set the limit */ + acc_row_size+= 25 + /*safety margin*/ 2; + else /* overflow page will set the limit */ + acc_row_size+= 4 + /*safety margin*/ 4; +#endif + ulonglong acc_fragment_size= 512*1024*1024; + ulonglong max_rows= form->max_rows; +#if MYSQL_VERSION_ID >= 50100 + no_fragments= (max_rows*acc_row_size)/acc_fragment_size+1; +#else + no_fragments= ((max_rows*acc_row_size)/acc_fragment_size+1 + +1/*correct rounding*/)/2; +#endif + } + { + uint no_nodes= g_ndb_cluster_connection->no_db_nodes(); + NDBTAB::FragmentType ftype; + if (no_fragments > 2*no_nodes) + { + ftype= NDBTAB::FragAllLarge; + if (no_fragments > 4*no_nodes) + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, + "Ndb might have problems storing the max amount of rows specified"); + } + else if (no_fragments > no_nodes) + ftype= NDBTAB::FragAllMedium; + else + ftype= NDBTAB::FragAllSmall; + tab.setFragmentType(ftype); + } +} + int ha_ndbcluster::create(const char *name, TABLE *form, HA_CREATE_INFO *info) { NDBTAB tab; NDBCOL col; - uint pack_length, length, i; + uint pack_length, length, i, pk_length= 0; const void *data, *pack_data; const char **key_names= form->keynames.type_names; char name2[FN_HEADLEN]; @@ -3344,6 +3622,8 @@ int ha_ndbcluster::create(const char *name, if ((my_errno= create_ndb_column(col, field, info))) DBUG_RETURN(my_errno); tab.addColumn(col); + if(col.getPrimaryKey()) + pk_length += (field->pack_length() + 3) / 4; } // No primary key, create shadow key as 64 bit, auto increment @@ -3357,13 +3637,49 @@ int ha_ndbcluster::create(const char *name, col.setPrimaryKey(TRUE); col.setAutoIncrement(TRUE); tab.addColumn(col); + pk_length += 2; } + // Make sure that blob tables don't have to big part size + for (i= 0; i < form->fields; i++) + { + /** + * The extra +7 concists + * 2 - words from pk in blob table + * 5 - from extra words added by tup/dict?? + */ + switch (form->field[i]->real_type()) { + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + { + NdbDictionary::Column * col = tab.getColumn(i); + int size = pk_length + (col->getPartSize()+3)/4 + 7; + if(size > NDB_MAX_TUPLE_SIZE_IN_WORDS && + (pk_length+7) < NDB_MAX_TUPLE_SIZE_IN_WORDS) + { + size = NDB_MAX_TUPLE_SIZE_IN_WORDS - pk_length - 7; + col->setPartSize(4*size); + } + /** + * If size > NDB_MAX and pk_length+7 >= NDB_MAX + * then the table can't be created anyway, so skip + * changing part size, and have error later + */ + } + default: + break; + } + } + + ndb_set_fragmentation(tab, form, pk_length); + if ((my_errno= check_ndb_connection())) DBUG_RETURN(my_errno); // Create the table in NDB - NDBDICT *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); if (dict->createTable(tab) != 0) { const NdbError err= dict->getNdbError(); @@ -3408,7 +3724,8 @@ int ha_ndbcluster::create_index(const char *name, KEY *key_info, bool unique) { - NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NdbDictionary::Dictionary *dict= ndb->getDictionary(); KEY_PART_INFO *key_part= key_info->key_part; KEY_PART_INFO *end= key_part + key_info->key_parts; @@ -3430,7 +3747,12 @@ int ha_ndbcluster::create_index(const char *name, { Field *field= key_part->field; DBUG_PRINT("info", ("attr: %s", field->field_name)); - ndb_index.addColumnName(field->field_name); + { + char truncated_field_name[NDB_MAX_ATTR_NAME_SIZE]; + strnmov(truncated_field_name,field->field_name,sizeof(truncated_field_name)); + truncated_field_name[sizeof(truncated_field_name)-1]= '\0'; + ndb_index.addColumnName(truncated_field_name); + } } if (dict->createIndex(ndb_index)) @@ -3448,24 +3770,35 @@ int ha_ndbcluster::create_index(const char *name, int ha_ndbcluster::rename_table(const char *from, const char *to) { + NDBDICT *dict; char new_tabname[FN_HEADLEN]; + const NDBTAB *orig_tab; + int result; DBUG_ENTER("ha_ndbcluster::rename_table"); + DBUG_PRINT("info", ("Renaming %s to %s", from, to)); set_dbname(from); set_tabname(from); set_tabname(to, new_tabname); if (check_ndb_connection()) DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION); + + Ndb *ndb= get_ndb(); + dict= ndb->getDictionary(); + if (!(orig_tab= dict->getTable(m_tabname))) + ERR_RETURN(dict->getNdbError()); - - int result= alter_table_name(m_tabname, new_tabname); - if (result == 0) + m_table= (void *)orig_tab; + // Change current database to that of target table + set_dbname(to); + ndb->setDatabaseName(m_dbname); + if (!(result= alter_table_name(new_tabname))) { - set_tabname(to); - handler::rename_table(from, to); + // Rename .ndb file + result= handler::rename_table(from, to); } - + DBUG_RETURN(result); } @@ -3474,19 +3807,17 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) Rename a table in NDB Cluster using alter table */ -int ha_ndbcluster::alter_table_name(const char *from, const char *to) +int ha_ndbcluster::alter_table_name(const char *to) { - NDBDICT *dict= m_ndb->getDictionary(); - const NDBTAB *orig_tab; + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); + const NDBTAB *orig_tab= (const NDBTAB *) m_table; + int ret; DBUG_ENTER("alter_table_name_table"); - DBUG_PRINT("enter", ("Renaming %s to %s", from, to)); - if (!(orig_tab= dict->getTable(from))) - ERR_RETURN(dict->getNdbError()); - - NdbDictionary::Table copy_tab= dict->getTableForAlteration(from); - copy_tab.setName(to); - if (dict->alterTable(copy_tab) != 0) + NdbDictionary::Table new_tab= *orig_tab; + new_tab.setName(to); + if (dict->alterTable(new_tab) != 0) ERR_RETURN(dict->getNdbError()); m_table= NULL; @@ -3509,7 +3840,7 @@ int ha_ndbcluster::delete_table(const char *name) if (check_ndb_connection()) DBUG_RETURN(HA_ERR_NO_CONNECTION); - + // Remove .ndb file handler::delete_table(name); DBUG_RETURN(drop_table()); } @@ -3521,8 +3852,9 @@ int ha_ndbcluster::delete_table(const char *name) int ha_ndbcluster::drop_table() { - NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); - + Ndb *ndb= get_ndb(); + NdbDictionary::Dictionary *dict= ndb->getDictionary(); + DBUG_ENTER("drop_table"); DBUG_PRINT("enter", ("Deleting %s", m_tabname)); @@ -3555,16 +3887,17 @@ longlong ha_ndbcluster::get_auto_increment() { DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); + Ndb *ndb= get_ndb(); int cache_size= - (rows_to_insert - rows_inserted < autoincrement_prefetch) ? - rows_to_insert - rows_inserted - : (rows_to_insert > autoincrement_prefetch) ? - rows_to_insert - : autoincrement_prefetch; + (m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ? + m_rows_to_insert - m_rows_inserted + : (m_rows_to_insert > m_autoincrement_prefetch) ? + m_rows_to_insert + : m_autoincrement_prefetch; Uint64 auto_value= - (skip_auto_increment) ? - m_ndb->readAutoIncrementValue((const NDBTAB *) m_table) - : m_ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); + (m_skip_auto_increment) ? + ndb->readAutoIncrementValue((const NDBTAB *) m_table) + : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); DBUG_RETURN((longlong)auto_value); } @@ -3577,7 +3910,6 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): handler(table_arg), m_active_trans(NULL), m_active_cursor(NULL), - m_ndb(NULL), m_table(NULL), m_table_info(NULL), m_table_flags(HA_REC_NOT_IN_SEQ | @@ -3586,18 +3918,25 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): HA_NO_PREFIX_CHAR_KEYS), m_share(0), m_use_write(FALSE), - m_ignore_dup_key_not_supported(FALSE), - retrieve_all_fields(FALSE), - rows_to_insert(1), - rows_inserted(0), - bulk_insert_rows(1024), - bulk_insert_not_flushed(FALSE), - ops_pending(0), - skip_auto_increment(TRUE), - blobs_pending(0), - blobs_buffer(0), - blobs_buffer_size(0), - dupkey((uint) -1) + m_ignore_dup_key(FALSE), + m_primary_key_update(FALSE), + m_retrieve_all_fields(FALSE), + m_retrieve_primary_key(FALSE), + m_rows_to_insert(1), + m_rows_inserted(0), + m_bulk_insert_rows(1024), + m_bulk_insert_not_flushed(FALSE), + m_ops_pending(0), + m_skip_auto_increment(TRUE), + m_blobs_pending(0), + m_blobs_buffer(0), + m_blobs_buffer_size(0), + m_dupkey((uint) -1), + m_ha_not_exact_count(FALSE), + m_force_send(TRUE), + m_autoincrement_prefetch(32), + m_transaction_on(TRUE), + m_use_local_query_cache(FALSE) { int i; @@ -3611,9 +3950,10 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): for (i= 0; i < MAX_KEY; i++) { - m_index[i].type= UNDEFINED_INDEX; - m_index[i].unique_index= NULL; - m_index[i].index= NULL; + m_index[i].type= UNDEFINED_INDEX; + m_index[i].unique_index= NULL; + m_index[i].index= NULL; + m_index[i].unique_index_attrid_map= NULL; } DBUG_VOID_RETURN; @@ -3631,8 +3971,8 @@ ha_ndbcluster::~ha_ndbcluster() if (m_share) free_share(m_share); release_metadata(); - my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); - blobs_buffer= 0; + my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); + m_blobs_buffer= 0; // Check for open cursor/transaction if (m_active_cursor) { @@ -3700,7 +4040,6 @@ int ha_ndbcluster::close(void) DBUG_ENTER("close"); free_share(m_share); m_share= 0; release_metadata(); - m_ndb= NULL; DBUG_RETURN(0); } @@ -3758,14 +4097,16 @@ Ndb* check_ndb_in_thd(THD* thd) } + int ha_ndbcluster::check_ndb_connection() { THD* thd= current_thd; + Ndb *ndb; DBUG_ENTER("check_ndb_connection"); - if (!(m_ndb= check_ndb_in_thd(thd))) + if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(HA_ERR_NO_CONNECTION); - m_ndb->setDatabaseName(m_dbname); + ndb->setDatabaseName(m_dbname); DBUG_RETURN(0); } @@ -4039,40 +4380,52 @@ bool ndbcluster_init() int res; DBUG_ENTER("ndbcluster_init"); // Set connectstring if specified - if (ndbcluster_connectstring != 0) - DBUG_PRINT("connectstring", ("%s", ndbcluster_connectstring)); + if (opt_ndbcluster_connectstring != 0) + DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring)); if ((g_ndb_cluster_connection= - new Ndb_cluster_connection(ndbcluster_connectstring)) == 0) + new Ndb_cluster_connection(opt_ndbcluster_connectstring)) == 0) { - DBUG_PRINT("error",("Ndb_cluster_connection(%s)",ndbcluster_connectstring)); - DBUG_RETURN(TRUE); + DBUG_PRINT("error",("Ndb_cluster_connection(%s)", + opt_ndbcluster_connectstring)); + goto ndbcluster_init_error; } + g_ndb_cluster_connection->set_optimized_node_selection + (opt_ndb_optimized_node_selection); + // Create a Ndb object to open the connection to NDB g_ndb= new Ndb(g_ndb_cluster_connection, "sys"); g_ndb->getDictionary()->set_local_table_data_size(sizeof(Ndb_table_local_info)); if (g_ndb->init() != 0) { ERR_PRINT (g_ndb->getNdbError()); - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; } - if ((res= g_ndb_cluster_connection->connect(1)) == 0) + if ((res= g_ndb_cluster_connection->connect(0,0,0)) == 0) { - g_ndb->waitUntilReady(10); + DBUG_PRINT("info",("NDBCLUSTER storage engine at %s on port %d", + g_ndb_cluster_connection->get_connected_host(), + g_ndb_cluster_connection->get_connected_port())); + g_ndb_cluster_connection->wait_until_ready(10,3); } else if(res == 1) { if (g_ndb_cluster_connection->start_connect_thread()) { DBUG_PRINT("error", ("g_ndb_cluster_connection->start_connect_thread()")); - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; + } + { + char buf[1024]; + DBUG_PRINT("info",("NDBCLUSTER storage engine not started, will connect using %s", + g_ndb_cluster_connection->get_connectstring(buf,sizeof(buf)))); } } else { DBUG_ASSERT(res == -1); DBUG_PRINT("error", ("permanent error")); - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; } (void) hash_init(&ndbcluster_open_tables,system_charset_info,32,0,0, @@ -4082,9 +4435,12 @@ bool ndbcluster_init() ndbcluster_inited= 1; #ifdef USE_DISCOVER_ON_STARTUP if (ndb_discover_tables() != 0) - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; #endif DBUG_RETURN(FALSE); + ndbcluster_init_error: + ndbcluster_end(); + DBUG_RETURN(TRUE); } @@ -4247,6 +4603,65 @@ ha_ndbcluster::records_in_range(uint inx, key_range *min_key, DBUG_RETURN(10); /* Good guess when you don't know anything */ } +ulong ha_ndbcluster::table_flags(void) const +{ + if (m_ha_not_exact_count) + return m_table_flags | HA_NOT_EXACT_COUNT; + else + return m_table_flags; +} +const char * ha_ndbcluster::table_type() const +{ + return("ndbcluster"); +} +uint ha_ndbcluster::max_supported_record_length() const +{ + return NDB_MAX_TUPLE_SIZE; +} +uint ha_ndbcluster::max_supported_keys() const +{ + return MAX_KEY; +} +uint ha_ndbcluster::max_supported_key_parts() const +{ + return NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; +} +uint ha_ndbcluster::max_supported_key_length() const +{ + return NDB_MAX_KEY_SIZE; +} +bool ha_ndbcluster::low_byte_first() const +{ +#ifdef WORDS_BIGENDIAN + return FALSE; +#else + return TRUE; +#endif +} +bool ha_ndbcluster::has_transactions() +{ + return m_transaction_on; +} +const char* ha_ndbcluster::index_type(uint key_number) +{ + switch (get_index_type(key_number)) { + case ORDERED_INDEX: + case UNIQUE_ORDERED_INDEX: + case PRIMARY_KEY_ORDERED_INDEX: + return "BTREE"; + case UNIQUE_INDEX: + case PRIMARY_KEY_INDEX: + default: + return "HASH"; + } +} +uint8 ha_ndbcluster::table_cache_type() +{ + if (m_use_local_query_cache) + return HA_CACHE_TBL_TRANSACT; + else + return HA_CACHE_TBL_NOCACHE; +} /* Handling the shared NDB_SHARE structure that is needed to @@ -4413,13 +4828,12 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, { DBUG_ENTER("ndb_get_table_statistics"); DBUG_PRINT("enter", ("table: %s", table)); - + NdbConnection* pTrans= ndb->startTransaction(); do { - NdbConnection* pTrans= ndb->startTransaction(); if (pTrans == NULL) break; - + NdbScanOperation* pOp= pTrans->getNdbScanOperation(table); if (pOp == NULL) break; @@ -4436,13 +4850,13 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, pOp->getValue(NdbDictionary::Column::ROW_COUNT, (char*)&rows); pOp->getValue(NdbDictionary::Column::COMMIT_COUNT, (char*)&commits); - check= pTrans->execute(NoCommit); + check= pTrans->execute(NoCommit, AbortOnError, TRUE); if (check == -1) break; Uint64 sum_rows= 0; Uint64 sum_commits= 0; - while((check= rs->nextResult(TRUE)) == 0) + while((check= rs->nextResult(TRUE, TRUE)) == 0) { sum_rows+= rows; sum_commits+= commits; @@ -4451,6 +4865,8 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, if (check == -1) break; + rs->close(TRUE); + ndb->closeTransaction(pTrans); if(row_count) * row_count= sum_rows; @@ -4460,6 +4876,7 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, DBUG_RETURN(0); } while(0); + ndb->closeTransaction(pTrans); DBUG_PRINT("exit", ("failed")); DBUG_RETURN(-1); } diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 8224d1c4167..07b305bad3e 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -26,7 +26,6 @@ #endif #include <ndbapi_limits.h> -#include <ndb_types.h> class Ndb; // Forward declaration class NdbOperation; // Forward declaration @@ -53,6 +52,7 @@ typedef struct ndb_index_data { NDB_INDEX_TYPE type; void *index; void *unique_index; + unsigned char *unique_index_attrid_map; } NDB_INDEX_DATA; typedef struct st_ndbcluster_share { @@ -119,15 +119,14 @@ class ha_ndbcluster: public handler int reset(); int external_lock(THD *thd, int lock_type); int start_stmt(THD *thd); - const char * table_type() const { return("ndbcluster");} + const char * table_type() const; const char ** bas_ext() const; - ulong table_flags(void) const { return m_table_flags; } + ulong table_flags(void) const; ulong index_flags(uint idx, uint part, bool all_parts) const; - uint max_supported_record_length() const { return NDB_MAX_TUPLE_SIZE; }; - uint max_supported_keys() const { return MAX_KEY; } - uint max_supported_key_parts() const - { return NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; }; - uint max_supported_key_length() const { return NDB_MAX_KEY_SIZE;}; + uint max_supported_record_length() const; + uint max_supported_keys() const; + uint max_supported_key_parts() const; + uint max_supported_key_length() const; int rename_table(const char *from, const char *to); int delete_table(const char *name); @@ -136,28 +135,9 @@ class ha_ndbcluster: public handler THR_LOCK_DATA **to, enum thr_lock_type lock_type); - bool low_byte_first() const - { -#ifdef WORDS_BIGENDIAN - return FALSE; -#else - return TRUE; -#endif - } - bool has_transactions() { return TRUE; } - - const char* index_type(uint key_number) { - switch (get_index_type(key_number)) { - case ORDERED_INDEX: - case UNIQUE_ORDERED_INDEX: - case PRIMARY_KEY_ORDERED_INDEX: - return "BTREE"; - case UNIQUE_INDEX: - case PRIMARY_KEY_INDEX: - default: - return "HASH"; - } - } + bool low_byte_first() const; + bool has_transactions(); + const char* index_type(uint key_number); double scan_time(); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); @@ -166,10 +146,10 @@ class ha_ndbcluster: public handler static Thd_ndb* seize_thd_ndb(); static void release_thd_ndb(Thd_ndb* thd_ndb); - uint8 table_cache_type() { return HA_CACHE_TBL_NOCACHE; } + uint8 table_cache_type(); private: - int alter_table_name(const char *from, const char *to); + int alter_table_name(const char *to); int drop_table(); int create_index(const char *name, KEY *key_info, bool unique); int create_ordered_index(const char *name, KEY *key_info); @@ -181,9 +161,11 @@ class ha_ndbcluster: public handler void release_metadata(); NDB_INDEX_TYPE get_index_type(uint idx_no) const; NDB_INDEX_TYPE get_index_type_from_table(uint index_no) const; - + int check_index_fields_not_null(uint index_no); + int pk_read(const byte *key, uint key_len, byte *buf); int complemented_pk_read(const byte *old_data, byte *new_data); + int peek_row(); int unique_index_read(const byte *key, uint key_len, byte *buf); int ordered_index_scan(const key_range *start_key, @@ -229,7 +211,6 @@ class ha_ndbcluster: public handler NdbConnection *m_active_trans; NdbResultSet *m_active_cursor; - Ndb *m_ndb; void *m_table; void *m_table_info; char m_dbname[FN_HEADLEN]; @@ -243,20 +224,29 @@ class ha_ndbcluster: public handler typedef union { NdbRecAttr *rec; NdbBlob *blob; void *ptr; } NdbValue; NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE]; bool m_use_write; - bool m_ignore_dup_key_not_supported; - bool retrieve_all_fields; - ha_rows rows_to_insert; - ha_rows rows_inserted; - ha_rows bulk_insert_rows; - bool bulk_insert_not_flushed; - ha_rows ops_pending; - bool skip_auto_increment; - bool blobs_pending; + bool m_ignore_dup_key; + bool m_primary_key_update; + bool m_retrieve_all_fields; + bool m_retrieve_primary_key; + ha_rows m_rows_to_insert; + ha_rows m_rows_inserted; + ha_rows m_bulk_insert_rows; + bool m_bulk_insert_not_flushed; + ha_rows m_ops_pending; + bool m_skip_auto_increment; + bool m_blobs_pending; // memory for blobs in one tuple - char *blobs_buffer; - uint32 blobs_buffer_size; - uint dupkey; - + char *m_blobs_buffer; + uint32 m_blobs_buffer_size; + uint m_dupkey; + // set from thread variables at external lock + bool m_ha_not_exact_count; + bool m_force_send; + ha_rows m_autoincrement_prefetch; + bool m_transaction_on; + bool m_use_local_query_cache; + + Ndb *get_ndb(); void set_rec_per_key(); void records_update(); void no_uncommitted_rows_execute_failure(); @@ -265,6 +255,8 @@ class ha_ndbcluster: public handler void no_uncommitted_rows_reset(THD *); friend int execute_no_commit(ha_ndbcluster*, NdbConnection*); + friend int execute_commit(ha_ndbcluster*, NdbConnection*); + friend int execute_no_commit_ie(ha_ndbcluster*, NdbConnection*); }; bool ndbcluster_init(void); diff --git a/sql/handler.cc b/sql/handler.cc index f7a1a6ef0bf..70ba236a5d5 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -109,6 +109,9 @@ const char *tx_isolation_names[] = TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"", tx_isolation_names, NULL}; +static TYPELIB known_extensions= {0,"known_exts", NULL, NULL}; +uint known_extensions_id= 0; + enum db_type ha_resolve_by_name(const char *name, uint namelen) { THD *thd=current_thd; @@ -275,6 +278,16 @@ int ha_init() opt_using_transactions=1; } #endif +#ifdef HAVE_ARCHIVE_DB + if (have_archive_db == SHOW_OPTION_YES) + { + if (archive_db_init()) + { + have_archive_db= SHOW_OPTION_DISABLED; + error= 1; + } + } +#endif return error; } @@ -306,6 +319,10 @@ int ha_panic(enum ha_panic_function flag) if (have_ndbcluster == SHOW_OPTION_YES) error|=ndbcluster_end(); #endif +#ifdef HAVE_ARCHIVE_DB + if (have_archive_db == SHOW_OPTION_YES) + error|= archive_db_end(); +#endif return error; } /* ha_panic */ @@ -581,6 +598,12 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) if (opt_using_transactions) { bool operation_done=0; + /* + As rollback can be 30 times slower than insert in InnoDB, and user may + not know there's rollback (if it's because of a dupl row), better warn. + */ + const char *save_proc_info= thd->proc_info; + thd->proc_info= "Rolling back"; #ifdef HAVE_NDBCLUSTER_DB if (trans->ndb_tid) { @@ -652,6 +675,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) thd->variables.tx_isolation=thd->session_tx_isolation; if (operation_done) statistic_increment(ha_rollback_count,&LOCK_status); + thd->proc_info= save_proc_info; } #endif /* USING_TRANSACTIONS */ DBUG_RETURN(error); @@ -713,7 +737,7 @@ int ha_rollback_to_savepoint(THD *thd, char *savepoint_name) if (unlikely((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && my_b_tell(&thd->transaction.trans_log))) { - Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE); + Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE, FALSE); if (mysql_bin_log.write(&qinfo)) error= 1; } @@ -751,7 +775,7 @@ int ha_savepoint(THD *thd, char *savepoint_name) innobase_savepoint(thd,savepoint_name, my_b_tell(&thd->transaction.trans_log)); #endif - Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE); + Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE, FALSE); if (mysql_bin_log.write(&qinfo)) error= 1; } @@ -764,6 +788,25 @@ int ha_savepoint(THD *thd, char *savepoint_name) DBUG_RETURN(error); } + +int ha_start_consistent_snapshot(THD *thd) +{ +#ifdef HAVE_INNOBASE_DB + if ((have_innodb == SHOW_OPTION_YES) && + !innobase_start_trx_and_assign_read_view(thd)) + return 0; +#endif + /* + Same idea as when one wants to CREATE TABLE in one engine which does not + exist: + */ + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, + "This MySQL server does not support any " + "consistent-read capable storage engine"); + return 0; +} + + bool ha_flush_logs() { bool result=0; @@ -924,8 +967,10 @@ int handler::read_first_row(byte * buf, uint primary_key) /* If there is very few deleted rows in the table, find the first row by scanning the table. + TODO remove the test for HA_READ_ORDER */ - if (deleted < 10 || primary_key >= MAX_KEY) + if (deleted < 10 || primary_key >= MAX_KEY || + !(index_flags(primary_key, 0, 0) & HA_READ_ORDER)) { (void) ha_rnd_init(1); while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ; @@ -1052,6 +1097,9 @@ void handler::print_error(int error, myf errflag) textno=ER_DUP_KEY; break; } + case HA_ERR_NULL_IN_SPATIAL: + textno= ER_UNKNOWN_ERROR; + DBUG_VOID_RETURN; case HA_ERR_FOUND_DUPP_UNIQUE: textno=ER_DUP_UNIQUE; break; @@ -1165,7 +1213,8 @@ uint handler::get_dup_key(int error) { DBUG_ENTER("handler::get_dup_key"); table->file->errkey = (uint) -1; - if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE) + if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE || + error == HA_ERR_NULL_IN_SPATIAL) info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK); DBUG_RETURN(table->file->errkey); } @@ -1633,3 +1682,64 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key, return error; } + +/* + Returns a list of all known extensions. + + SYNOPSIS + ha_known_exts() + + NOTES + No mutexes, worst case race is a minor surplus memory allocation + We have to recreate the extension map if mysqld is restarted (for example + within libmysqld) + + RETURN VALUE + pointer pointer to TYPELIB structure +*/ + +TYPELIB *ha_known_exts(void) +{ + if (!known_extensions.type_names || mysys_usage_id != known_extensions_id) + { + show_table_type_st *types; + List<char> found_exts; + List_iterator_fast<char> it(found_exts); + const char **ext, *old_ext; + + known_extensions_id= mysys_usage_id; + found_exts.push_back((char*) ".db"); + for (types= sys_table_types; types->type; types++) + { + if (*types->value == SHOW_OPTION_YES) + { + handler *file= get_new_handler(0,(enum db_type) types->db_type); + for (ext= file->bas_ext(); *ext; ext++) + { + while ((old_ext= it++)) + { + if (!strcmp(old_ext, *ext)) + break; + } + if (!old_ext) + found_exts.push_back((char *) *ext); + + it.rewind(); + } + delete file; + } + } + ext= (const char **) my_once_alloc(sizeof(char *)* + (found_exts.elements+1), + MYF(MY_WME | MY_FAE)); + + DBUG_ASSERT(ext); + known_extensions.count= found_exts.elements; + known_extensions.type_names= ext; + + while ((old_ext= it++)) + *ext++= old_ext; + *ext= 0; + } + return &known_extensions; +} diff --git a/sql/handler.h b/sql/handler.h index a7ce4e708fd..0426312f404 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -138,6 +138,8 @@ #define HA_CACHE_TBL_ASKTRANSACT 2 #define HA_CACHE_TBL_TRANSACT 4 +/* Options of START TRANSACTION statement (and later of SET TRANSACTION stmt) */ +#define MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT 1 enum db_type { @@ -370,8 +372,8 @@ public: virtual int read_range_next(); int compare_key(key_range *range); virtual int ft_init() { return HA_ERR_WRONG_COMMAND; } - virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key, - uint keylen) + void ft_end() { ft_handler=NULL; } + virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key) { return NULL; } virtual int ft_read(byte *buf) { return HA_ERR_WRONG_COMMAND; } virtual int rnd_next(byte *buf)=0; @@ -567,5 +569,5 @@ int ha_discover(THD* thd, const char* dbname, const char* name, int ha_find_files(THD *thd,const char *db,const char *path, const char *wild, bool dir,List<char>* files); int ha_table_exists(THD* thd, const char* db, const char* name); - - +TYPELIB *ha_known_exts(void); +int ha_start_consistent_snapshot(THD *thd); diff --git a/sql/item.cc b/sql/item.cc index b4c416e7741..76cbaa99029 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -45,7 +45,7 @@ Item::Item(): { marker= 0; maybe_null=null_value=with_sum_func=unsigned_flag=0; - collation.set(default_charset(), DERIVATION_COERCIBLE); + collation.set(&my_charset_bin, DERIVATION_COERCIBLE); name= 0; decimals= 0; max_length= 0; @@ -69,7 +69,7 @@ Item::Item(): } /* - Constructor used by Item_field, Item_ref & agregate (sum) functions. + Constructor used by Item_field, Item_*_ref & agregate (sum) functions. Used for duplicating lists in processing queries with temporary tables */ @@ -114,7 +114,7 @@ Item_ident::Item_ident(const char *db_name_par,const char *table_name_par, name = (char*) field_name_par; } -// Constructor used by Item_field & Item_ref (see Item comment) +// Constructor used by Item_field & Item_*_ref (see Item comment) Item_ident::Item_ident(THD *thd, Item_ident *item) :Item(thd, item), orig_db_name(item->orig_db_name), @@ -205,6 +205,41 @@ bool Item::eq(const Item *item, bool binary_cmp) const } +Item *Item::safe_charset_converter(CHARSET_INFO *tocs) +{ + /* + Don't allow automatic conversion to non-Unicode charsets, + as it potentially loses data. + */ + if (!(tocs->state & MY_CS_UNICODE)) + return NULL; // safe conversion is not possible + return new Item_func_conv_charset(this, tocs); +} + + +Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs) +{ + Item_string *conv; + uint conv_errors; + String tmp, cstr, *ostr= val_str(&tmp); + cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors); + if (conv_errors || !(conv= new Item_string(cstr.ptr(), cstr.length(), + cstr.charset(), + collation.derivation))) + { + /* + Safe conversion is not possible (or EOM). + We could not convert a string into the requested character set + without data loss. The target charset does not cover all the + characters from the string. Operation cannot be done correctly. + */ + return NULL; + } + conv->str_value.copy(); + return conv; +} + + bool Item_string::eq(const Item *item, bool binary_cmp) const { if (type() == item->type()) @@ -259,7 +294,95 @@ CHARSET_INFO *Item::default_charset() return current_thd->variables.collation_connection; } -bool DTCollation::aggregate(DTCollation &dt, bool superset_conversion) + +/* + Move SUM items out from item tree and replace with reference + + SYNOPSIS + split_sum_func2() + thd Thread handler + ref_pointer_array Pointer to array of reference fields + fields All fields in select + ref Pointer to item + + NOTES + This is from split_sum_func2() for items that should be split + + All found SUM items are added FIRST in the fields list and + we replace the item with a reference. + + thd->fatal_error() may be called if we are out of memory +*/ + + +void Item::split_sum_func2(THD *thd, Item **ref_pointer_array, + List<Item> &fields, Item **ref) +{ + if (type() != SUM_FUNC_ITEM && with_sum_func) + { + /* Will split complicated items and ignore simple ones */ + split_sum_func(thd, ref_pointer_array, fields); + } + else if ((type() == SUM_FUNC_ITEM || + (used_tables() & ~PARAM_TABLE_BIT)) && + type() != REF_ITEM) + { + /* + Replace item with a reference so that we can easily calculate + it (in case of sum functions) or copy it (in case of fields) + + The test above is to ensure we don't do a reference for things + that are constants (PARAM_TABLE_BIT is in effect a constant) + or already referenced (for example an item in HAVING) + */ + uint el= fields.elements; + Item *new_item; + ref_pointer_array[el]= this; + if (!(new_item= new Item_ref(ref_pointer_array + el, 0, name))) + return; // fatal_error is set + fields.push_front(this); + ref_pointer_array[el]= this; + thd->change_item_tree(ref, new_item); + } +} + + +/* + Aggregate two collations together taking + into account their coercibility (aka derivation): + + 0 == DERIVATION_EXPLICIT - an explicitely written COLLATE clause + 1 == DERIVATION_NONE - a mix of two different collations + 2 == DERIVATION_IMPLICIT - a column + 3 == DERIVATION_COERCIBLE - a string constant + + The most important rules are: + + 1. If collations are the same: + chose this collation, and the strongest derivation. + + 2. If collations are different: + - Character sets may differ, but only if conversion without + data loss is possible. The caller provides flags whether + character set conversion attempts should be done. If no + flags are substituted, then the character sets must be the same. + Currently processed flags are: + MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset + MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value + - two EXPLICIT collations produce an error, e.g. this is wrong: + CONCAT(expr1 collate latin1_swedish_ci, expr2 collate latin1_german_ci) + - the side with smaller derivation value wins, + i.e. a column is stronger than a string constant, + an explicit COLLATE clause is stronger than a column. + - if derivations are the same, we have DERIVATION_NONE, + we'll wait for an explicit COLLATE clause which possibly can + come from another argument later: for example, this is valid, + but we don't know yet when collecting the first two arguments: + CONCAT(latin1_swedish_ci_column, + latin1_german1_ci_column, + expr COLLATE latin1_german2_ci) +*/ +bool DTCollation::aggregate(DTCollation &dt, uint flags) { nagg++; if (!my_charset_same(collation, dt.collation)) @@ -290,28 +413,37 @@ bool DTCollation::aggregate(DTCollation &dt, bool superset_conversion) else ; // Do nothing } - else if (superset_conversion) + else if ((flags & MY_COLL_ALLOW_SUPERSET_CONV) && + derivation < dt.derivation && + collation->state & MY_CS_UNICODE) { - if (derivation < dt.derivation && - collation->state & MY_CS_UNICODE) - ; // Do nothing - else if (dt.derivation < derivation && - dt.collation->state & MY_CS_UNICODE) - { - set(dt); - strong= nagg; - } - else - { - // Cannot convert to superset - set(0, DERIVATION_NONE); - return 1; - } + // Do nothing + } + else if ((flags & MY_COLL_ALLOW_SUPERSET_CONV) && + dt.derivation < derivation && + dt.collation->state & MY_CS_UNICODE) + { + set(dt); + strong= nagg; + } + else if ((flags & MY_COLL_ALLOW_COERCIBLE_CONV) && + derivation < dt.derivation && + dt.derivation >= DERIVATION_COERCIBLE) + { + // Do nothing; + } + else if ((flags & MY_COLL_ALLOW_COERCIBLE_CONV) && + dt.derivation < derivation && + derivation >= DERIVATION_COERCIBLE) + { + set(dt); + strong= nagg; } else { + // Cannot apply conversion set(0, DERIVATION_NONE); - return 1; + return 1; } } else if (derivation < dt.derivation) @@ -678,6 +810,12 @@ String *Item_null::val_str(String *str) } +Item *Item_null::safe_charset_converter(CHARSET_INFO *tocs) +{ + collation.set(tocs); + return this; +} + /*********************** Item_param related ******************************/ /* @@ -751,6 +889,21 @@ void Item_param::set_double(double d) } +/* + Set parameter value from TIME value. + + SYNOPSIS + set_time() + tm - datetime value to set (time_type is ignored) + type - type of datetime value + max_length_arg - max length of datetime value as string + + NOTE + If we value to be stored is not normalized, zero value will be stored + instead and proper warning will be produced. This function relies on + the fact that even wrong value sent over binary protocol fits into + MAX_DATE_STRING_REP_LENGTH buffer. +*/ void Item_param::set_time(TIME *tm, timestamp_type type, uint32 max_length_arg) { DBUG_ENTER("Item_param::set_time"); @@ -758,6 +911,17 @@ void Item_param::set_time(TIME *tm, timestamp_type type, uint32 max_length_arg) value.time= *tm; value.time.time_type= type; + if (value.time.year > 9999 || value.time.month > 12 || + value.time.day > 31 || + type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23 || + value.time.minute > 59 || value.time.second > 59) + { + char buff[MAX_DATE_STRING_REP_LENGTH]; + uint length= my_TIME_to_str(&value.time, buff); + make_truncated_value_warning(current_thd, buff, length, type); + set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR); + } + state= TIME_VALUE; maybe_null= 0; max_length= max_length_arg; @@ -773,7 +937,9 @@ bool Item_param::set_str(const char *str, ulong length) Assign string with no conversion: data is converted only after it's been written to the binary log. */ - if (str_value.copy(str, length, &my_charset_bin, &my_charset_bin)) + uint dummy_errors; + if (str_value.copy(str, length, &my_charset_bin, &my_charset_bin, + &dummy_errors)) DBUG_RETURN(TRUE); state= STRING_VALUE; maybe_null= 0; @@ -974,8 +1140,9 @@ double Item_param::val() case LONG_DATA_VALUE: { int dummy_err; + char *end_not_used; return my_strntod(str_value.charset(), (char*) str_value.ptr(), - str_value.length(), (char**) 0, &dummy_err); + str_value.length(), &end_not_used, &dummy_err); } case TIME_VALUE: /* @@ -1130,6 +1297,10 @@ bool Item_param::convert_str_value(THD *thd) value.cs_info.character_set_client, value.cs_info.final_character_set_of_str_value); } + else + str_value.set_charset(value.cs_info.final_character_set_of_str_value); + /* Here str_value is guaranteed to be in final_character_set_of_str_value */ + max_length= str_value.length(); decimals= 0; /* @@ -1254,6 +1425,7 @@ static void mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current, bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { + enum_parsing_place place= NO_MATTER; DBUG_ASSERT(fixed == 0); if (!field) // If field is not checked { @@ -1301,8 +1473,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } Item_subselect *prev_subselect_item= prev_unit->item; - enum_parsing_place place= - prev_subselect_item->parsing_place; + place= prev_subselect_item->parsing_place; /* check table fields only if subquery used somewhere out of HAVING or outer SELECT do not use groupping (i.e. tables are @@ -1326,7 +1497,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ¬_used)) != (Item **) not_found_item) { - if (*refer && (*refer)->fixed) // Avoid crash in case of error + if (refer && (*refer)->fixed) // Avoid crash in case of error { prev_subselect_item->used_tables_cache|= (*refer)->used_tables(); prev_subselect_item->const_item_cache&= (*refer)->const_item(); @@ -1364,18 +1535,32 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } else if (refer != (Item **)not_found_item) { - if (!(*refer)->fixed) + if (!last->ref_pointer_array[counter]) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name, "forward reference in item list"); return -1; } - - Item_ref *rf= new Item_ref(last->ref_pointer_array + counter, - (char *)table_name, (char *)field_name); + DBUG_ASSERT((*refer)->fixed); + /* + Here, a subset of actions performed by Item_ref::set_properties + is not enough. So we pass ptr to NULL into Item_[direct]_ref + constructor, so no initialization is performed, and call + fix_fields() below. + */ + Item *save= last->ref_pointer_array[counter]; + last->ref_pointer_array[counter]= NULL; + Item_ref *rf= (place == IN_HAVING ? + new Item_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name) : + new Item_direct_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name)); if (!rf) return 1; thd->change_item_tree(ref, rf); + last->ref_pointer_array[counter]= save; /* rf is Item_ref => never substitute other items (in this case) during fix_fields() => we can use rf after fix_fields() @@ -1921,11 +2106,11 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) { DBUG_ASSERT(fixed == 0); uint counter; + enum_parsing_place place= NO_MATTER; bool not_used; if (!ref) { TABLE_LIST *where= 0, *table_list; - bool upward_lookup= 0; SELECT_LEX_UNIT *prev_unit= thd->lex->current_select->master_unit(); SELECT_LEX *sl= prev_unit->outer_select(); /* @@ -1946,7 +2131,6 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) { Field *tmp= (Field*) not_found_field; SELECT_LEX *last= 0; - upward_lookup= 1; /* We can't find table field in select list of current select, consequently we have to find it in outer subselect(s). @@ -1966,7 +2150,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) ¬_used)) != (Item **)not_found_item) { - if (*ref && (*ref)->fixed) // Avoid crash in case of error + if (ref && (*ref)->fixed) // Avoid crash in case of error { prev_subselect_item->used_tables_cache|= (*ref)->used_tables(); prev_subselect_item->const_item_cache&= (*ref)->const_item(); @@ -1979,8 +2163,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) // it is primary INSERT st_select_lex => skip first table resolving table_list= table_list->next; } - enum_parsing_place place= - prev_subselect_item->parsing_place; + place= prev_subselect_item->parsing_place; /* check table fields only if subquery used somewhere out of HAVING or SELECT list or outer SELECT do not use groupping (i.e. tables @@ -2011,20 +2194,10 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) return -1; if (ref == (Item **)not_found_item && tmp == not_found_field) { - if (upward_lookup) - { - // We can't say exactly what absend (table or field) - my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0), - full_name(), thd->where); - } - else - { - // Call to report error - find_item_in_list(this, - *(thd->lex->current_select->get_item_list()), - &counter, REPORT_ALL_ERRORS, ¬_used); - } - ref= 0; // Safety + // We can't say exactly what absend (table or field) + my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0), + full_name(), thd->where); + ref= 0; // Safety return 1; } if (tmp != not_found_field) @@ -2042,14 +2215,28 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) mark_as_dependent(thd, last, thd->lex->current_select, fld); return 0; } - if (!(*ref)->fixed) + if (!last->ref_pointer_array[counter]) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name, "forward reference in item list"); return -1; } + DBUG_ASSERT((*ref)->fixed); mark_as_dependent(thd, last, thd->lex->current_select, this); + if (place == IN_HAVING) + { + Item_ref *rf; + if (!(rf= new Item_direct_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name))) + return 1; + ref= 0; // Safety + if (rf->fix_fields(thd, tables, ref) || rf->check_cols(1)) + return 1; + thd->change_item_tree(reference, rf); + return 0; + } ref= last->ref_pointer_array + counter; } else if (!ref) @@ -2085,19 +2272,24 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) "forward reference in item list")); return 1; } + + set_properties(); + + if (ref && (*ref)->check_cols(1)) + return 1; + return 0; +} + +void Item_ref::set_properties() +{ max_length= (*ref)->max_length; maybe_null= (*ref)->maybe_null; decimals= (*ref)->decimals; collation.set((*ref)->collation); with_sum_func= (*ref)->with_sum_func; fixed= 1; - - if (ref && (*ref)->check_cols(1)) - return 1; - return 0; } - void Item_ref::print(String *str) { if (ref && *ref) @@ -2143,7 +2335,7 @@ bool Item_default_value::fix_fields(THD *thd, fixed= 1; return 0; } - if (arg->fix_fields(thd, table_list, &arg)) + if (!arg->fixed && arg->fix_fields(thd, table_list, &arg)) return 1; if (arg->type() == REF_ITEM) @@ -2190,7 +2382,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) { DBUG_ASSERT(fixed == 0); - if (arg->fix_fields(thd, table_list, &arg)) + if (!arg->fixed && arg->fix_fields(thd, table_list, &arg)) return 1; if (arg->type() == REF_ITEM) @@ -2394,10 +2586,12 @@ double Item_cache_str::val() DBUG_ASSERT(fixed == 1); int err; if (value) + { + char *end_not_used; return my_strntod(value->charset(), (char*) value->ptr(), - value->length(), (char**) 0, &err); - else - return (double)0; + value->length(), &end_not_used, &err); + } + return (double)0; } @@ -2500,7 +2694,53 @@ void Item_cache_row::bring_value() } -Item_type_holder::Item_type_holder(THD *thd, Item *item) +/* + Returns field for temporary table dependind on item type + + SYNOPSIS + get_holder_example_field() + thd - thread handler + item - pointer to item + table - empty table object + + NOTE + It is possible to return field for Item_func + items only if field type of this item is + date or time or datetime type. + also see function field_types_to_be_kept() from + field.cc + + RETURN + # - field + 0 - no field +*/ + +Field *get_holder_example_field(THD *thd, Item *item, TABLE *table) +{ + DBUG_ASSERT(table); + + Item_func *tmp_item= 0; + if (item->type() == Item::FIELD_ITEM) + return (((Item_field*) item)->field); + if (item->type() == Item::FUNC_ITEM) + tmp_item= (Item_func *) item; + else if (item->type() == Item::SUM_FUNC_ITEM) + { + Item_sum *item_sum= (Item_sum *) item; + if (item_sum->keep_field_type()) + { + if (item_sum->args[0]->type() == Item::FIELD_ITEM) + return (((Item_field*) item_sum->args[0])->field); + if (item_sum->args[0]->type() == Item::FUNC_ITEM) + tmp_item= (Item_func *) item_sum->args[0]; + } + } + return (tmp_item && field_types_to_be_kept(tmp_item->field_type()) ? + tmp_item->tmp_table_field(table) : 0); +} + + +Item_type_holder::Item_type_holder(THD *thd, Item *item, TABLE *table) :Item(thd, item), item_type(item->result_type()), orig_type(item_type) { @@ -2510,10 +2750,7 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item) It is safe assign pointer on field, because it will be used just after all JOIN::prepare calls and before any SELECT execution */ - if (item->type() == Item::FIELD_ITEM) - field_example= ((Item_field*) item)->field; - else - field_example= 0; + field_example= get_holder_example_field(thd, item, table); max_length= real_length(item); maybe_null= item->maybe_null; collation.set(item->collation); @@ -2553,25 +2790,23 @@ inline bool is_attr_compatible(Item *from, Item *to) (to->maybe_null || !from->maybe_null) && (to->result_type() != STRING_RESULT || from->result_type() != STRING_RESULT || - my_charset_same(from->collation.collation, - to->collation.collation))); + (from->collation.collation == to->collation.collation))); } -bool Item_type_holder::join_types(THD *thd, Item *item) +bool Item_type_holder::join_types(THD *thd, Item *item, TABLE *table) { uint32 new_length= real_length(item); bool use_new_field= 0, use_expression_type= 0; Item_result new_result_type= type_convertor[item_type][item->result_type()]; - bool item_is_a_field= item->type() == Item::FIELD_ITEM; - + Field *field= get_holder_example_field(thd, item, table); + bool item_is_a_field= (field != NULL); /* Check if both items point to fields: in this case we can adjust column types of result table in the union smartly. */ if (field_example && item_is_a_field) { - Field *field= ((Item_field *)item)->field; /* Can 'field_example' field store data of the column? */ if ((use_new_field= (!field->field_cast_compatible(field_example->field_cast_type()) || @@ -2612,7 +2847,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) It is safe to assign a pointer to field here, because it will be used before any table is closed. */ - field_example= ((Item_field*) item)->field; + field_example= field; } old_cs= collation.collation->name; diff --git a/sql/item.h b/sql/item.h index e22cef7ba7f..97e2b0c0945 100644 --- a/sql/item.h +++ b/sql/item.h @@ -31,12 +31,32 @@ void item_init(void); /* Init item functions */ enum Derivation { + DERIVATION_IGNORABLE= 4, DERIVATION_COERCIBLE= 3, DERIVATION_IMPLICIT= 2, DERIVATION_NONE= 1, DERIVATION_EXPLICIT= 0 }; +/* + Flags for collation aggregation modes: + MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset + MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value + (i.e. constant). + MY_COLL_ALLOW_CONV - allow any kind of conversion + (combintion of the above two) + MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE + (e.g. when aggregating for comparison) + MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV + and MY_COLL_DISALLOW_NONE +*/ + +#define MY_COLL_ALLOW_SUPERSET_CONV 1 +#define MY_COLL_ALLOW_COERCIBLE_CONV 2 +#define MY_COLL_ALLOW_CONV 3 +#define MY_COLL_DISALLOW_NONE 4 +#define MY_COLL_CMP_CONV 7 + class DTCollation { public: CHARSET_INFO *collation; @@ -72,13 +92,14 @@ public: { collation= collation_arg; } void set(Derivation derivation_arg) { derivation= derivation_arg; } - bool aggregate(DTCollation &dt, bool superset_conversion= FALSE); - bool set(DTCollation &dt1, DTCollation &dt2, bool superset_conversion= FALSE) - { set(dt1); return aggregate(dt2, superset_conversion); } + bool aggregate(DTCollation &dt, uint flags= 0); + bool set(DTCollation &dt1, DTCollation &dt2, uint flags= 0) + { set(dt1); return aggregate(dt2, flags); } const char *derivation_name() const { switch(derivation) { + case DERIVATION_IGNORABLE: return "IGNORABLE"; case DERIVATION_COERCIBLE: return "COERCIBLE"; case DERIVATION_IMPLICIT: return "IMPLICIT"; case DERIVATION_EXPLICIT: return "EXPLICIT"; @@ -98,7 +119,7 @@ public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) {} - static void operator delete(void *ptr,size_t size, MEM_ROOT *mem_root) {} + static void operator delete(void *ptr, MEM_ROOT *mem_root) {} enum Type {FIELD_ITEM, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM, INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM, @@ -241,10 +262,21 @@ public: virtual void update_used_tables() {} virtual void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields) {} + /* Called for items that really have to be split */ + void split_sum_func2(THD *thd, Item **ref_pointer_array, List<Item> &fields, + Item **ref); virtual bool get_date(TIME *ltime,uint fuzzydate); virtual bool get_time(TIME *ltime); virtual bool get_date_result(TIME *ltime,uint fuzzydate) { return get_date(ltime,fuzzydate); } + /* + This function is used only in Item_func_isnull/Item_func_isnotnull + (implementations of IS NULL/IS NOT NULL clauses). Item_func_is{not}null + calls this method instead of one of val/result*() methods, which + normally will set null_value. This allows to determine nullness of + a complex expression without fully evaluating it. + Any new item which can be NULL must implement this call. + */ virtual bool is_null() { return 0; } /* it is "top level" item of WHERE clause and we do not need correct NULL @@ -292,6 +324,7 @@ public: Field *tmp_table_field_from_field_type(TABLE *table); virtual Item *neg_transformer(THD *thd) { return NULL; } + virtual Item *safe_charset_converter(CHARSET_INFO *tocs); void delete_self() { cleanup(); @@ -420,6 +453,7 @@ public: max_length= 0; name= name_par ? name_par : (char*) "NULL"; fixed= 1; + collation.set(&my_charset_bin, DERIVATION_IGNORABLE); } enum Type type() const { return NULL_ITEM; } bool eq(const Item *item, bool binary_cmp) const; @@ -437,6 +471,7 @@ public: Item *new_item() { return new Item_null(name); } bool is_null() { return 1; } void print(String *str) { str->append("NULL", 4); } + Item *safe_charset_converter(CHARSET_INFO *tocs); }; @@ -549,6 +584,8 @@ public: void print(String *str) { str->append('?'); } /* parameter never equal to other parameter of other item */ bool eq(const Item *item, bool binary_cmp) const { return 0; } + bool is_null() + { DBUG_ASSERT(state != NO_VALUE); return state == NULL_VALUE; } }; class Item_int :public Item_num @@ -682,8 +719,9 @@ public: { DBUG_ASSERT(fixed == 1); int err; + char *end_not_used; return my_strntod(str_value.charset(), (char*) str_value.ptr(), - str_value.length(), (char**) 0, &err); + str_value.length(), &end_not_used, &err); } longlong val_int() { @@ -705,8 +743,9 @@ public: Item *new_item() { return new Item_string(name, str_value.ptr(), - str_value.length(), &my_charset_bin); + str_value.length(), collation.collation); } + Item *safe_charset_converter(CHARSET_INFO *tocs); String *const_string() { return &str_value; } inline void append(char *str, uint length) { str_value.append(str, length); } void print(String *str); @@ -730,7 +769,7 @@ class Item_empty_string :public Item_string public: Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : Item_string("",0, cs ? cs : &my_charset_bin) - { name=(char*) header; max_length=length;} + { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } void make_field(Send_field *field); }; @@ -792,14 +831,36 @@ public: class Item_ref :public Item_ident { +protected: + void set_properties(); public: Field *result_field; /* Save result here */ Item **ref; Item_ref(const char *db_par, const char *table_name_par, const char *field_name_par) :Item_ident(db_par, table_name_par, field_name_par), ref(0) {} + /* + This constructor is used in two scenarios: + A) *item = NULL + No initialization is performed, fix_fields() call will be necessary. + + B) *item points to an Item this Item_ref will refer to. This is + used for GROUP BY. fix_fields() will not be called in this case, + so we call set_properties to make this item "fixed". set_properties + performs a subset of action Item_ref::fix_fields does, and this subset + is enough for Item_ref's used in GROUP BY. + + TODO we probably fix a superset of problems like in BUG#6658. Check this + with Bar, and if we have a more broader set of problems like this. + */ Item_ref(Item **item, const char *table_name_par, const char *field_name_par) - :Item_ident(NullS, table_name_par, field_name_par), ref(item) {} + :Item_ident(NullS, table_name_par, field_name_par), ref(item) + { + DBUG_ASSERT(item); + if (*item) + set_properties(); + } + /* Constructor need to process subselect with temporary tables (see Item) */ Item_ref(THD *thd, Item_ref *item) :Item_ident(thd, item), ref(item->ref) {} enum Type type() const { return REF_ITEM; } @@ -807,29 +868,34 @@ public: { return ref && (*ref)->eq(item, binary_cmp); } double val() { + DBUG_ASSERT(fixed); double tmp=(*ref)->val_result(); null_value=(*ref)->null_value; return tmp; } longlong val_int() { + DBUG_ASSERT(fixed); longlong tmp=(*ref)->val_int_result(); null_value=(*ref)->null_value; return tmp; } String *val_str(String* tmp) { + DBUG_ASSERT(fixed); tmp=(*ref)->str_result(tmp); null_value=(*ref)->null_value; return tmp; } bool is_null() { + DBUG_ASSERT(fixed); (void) (*ref)->val_int_result(); return (*ref)->null_value; } bool get_date(TIME *ltime,uint fuzzydate) { + DBUG_ASSERT(fixed); return (null_value=(*ref)->get_date_result(ltime,fuzzydate)); } bool send(Protocol *prot, String *tmp){ return (*ref)->send(prot, tmp); } @@ -854,7 +920,52 @@ public: void print(String *str); }; + +/* + The same as Item_ref, but get value from val_* family of method to get + value of item on which it referred instead of result* family. +*/ +class Item_direct_ref :public Item_ref +{ +public: + Item_direct_ref(Item **item, const char *table_name_par, + const char *field_name_par) + :Item_ref(item, table_name_par, field_name_par) {} + /* Constructor need to process subselect with temporary tables (see Item) */ + Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} + + double val() + { + double tmp=(*ref)->val(); + null_value=(*ref)->null_value; + return tmp; + } + longlong val_int() + { + longlong tmp=(*ref)->val_int(); + null_value=(*ref)->null_value; + return tmp; + } + String *val_str(String* tmp) + { + tmp=(*ref)->val_str(tmp); + null_value=(*ref)->null_value; + return tmp; + } + bool is_null() + { + (void) (*ref)->val_int(); + return (*ref)->null_value; + } + bool get_date(TIME *ltime,uint fuzzydate) + { + return (null_value=(*ref)->get_date(ltime,fuzzydate)); + } +}; + + class Item_in_subselect; + class Item_ref_null_helper: public Item_ref { protected: @@ -876,9 +987,9 @@ class Item_null_helper :public Item_ref_null_helper public: Item_null_helper(Item_in_subselect* master, Item *item, const char *table_name_par, const char *field_name_par) - :Item_ref_null_helper(master, &store, table_name_par, field_name_par), + :Item_ref_null_helper(master, &item, table_name_par, field_name_par), store(item) - {} + { ref= &store; } void print(String *str); }; @@ -934,9 +1045,10 @@ public: double val() { int err; + char *end_not_used; return (null_value ? 0.0 : my_strntod(str_value.charset(), (char*) str_value.ptr(), - str_value.length(),NULL,&err)); + str_value.length(), &end_not_used, &err)); } longlong val_int() { @@ -1092,7 +1204,7 @@ class Item_cache_int: public Item_cache { longlong value; public: - Item_cache_int(): Item_cache() {} + Item_cache_int(): Item_cache(), value(0) {} void store(Item *item); double val() { DBUG_ASSERT(fixed == 1); return (double) value; } @@ -1110,7 +1222,7 @@ class Item_cache_real: public Item_cache { double value; public: - Item_cache_real(): Item_cache() {} + Item_cache_real(): Item_cache(), value(0) {} void store(Item *item); double val() { DBUG_ASSERT(fixed == 1); return value; } @@ -1132,7 +1244,7 @@ class Item_cache_str: public Item_cache char buffer[80]; String *value, value_buff; public: - Item_cache_str(): Item_cache() { } + Item_cache_str(): Item_cache(), value(0) { } void store(Item *item); double val(); @@ -1214,14 +1326,14 @@ protected: Item_result orig_type; Field *field_example; public: - Item_type_holder(THD*, Item*); + Item_type_holder(THD*, Item*, TABLE *); Item_result result_type () const { return item_type; } enum Type type() const { return TYPE_HOLDER; } double val(); longlong val_int(); String *val_str(String*); - bool join_types(THD *thd, Item *); + bool join_types(THD *thd, Item *, TABLE *); Field *example() { return field_example; } static uint32 real_length(Item *item); void cleanup() diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c9396aaa67c..690da1be18c 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -106,7 +106,7 @@ longlong Item_func_not::val_int() DBUG_ASSERT(fixed == 1); double value=args[0]->val(); null_value=args[0]->null_value; - return !null_value && value == 0 ? 1 : 0; + return ((!null_value && value == 0) ? 1 : 0); } /* @@ -117,13 +117,23 @@ longlong Item_func_not_all::val_int() { DBUG_ASSERT(fixed == 1); double value= args[0]->val(); - if (abort_on_null) - { - null_value= 0; - return (args[0]->null_value || value == 0) ? 1 : 0; - } + + /* + return TRUE if there was records in underlaying select in max/min + optimisation (ALL subquery) + */ + if (empty_underlying_subquery()) + return 1; + null_value= args[0]->null_value; - return (!null_value && value == 0) ? 1 : 0; + return ((!null_value && value == 0) ? 1 : 0); +} + + +bool Item_func_not_all::empty_underlying_subquery() +{ + return ((test_sum_item && !test_sum_item->any_value()) || + (test_sub_item && !test_sub_item->any_value())); } void Item_func_not_all::print(String *str) @@ -134,6 +144,30 @@ void Item_func_not_all::print(String *str) args[0]->print(str); } + +/* + Special NOP (No OPeration) for ALL subquery it is like Item_func_not_all + (return TRUE if underlaying sudquery do not return rows) but if subquery + returns some rows it return same value as argument (TRUE/FALSE). +*/ + +longlong Item_func_nop_all::val_int() +{ + DBUG_ASSERT(fixed == 1); + double value= args[0]->val(); + + /* + return FALSE if there was records in underlaying select in max/min + optimisation (SAME/ANY subquery) + */ + if (empty_underlying_subquery()) + return 0; + + null_value= args[0]->null_value; + return (null_value || value == 0) ? 0 : 1; +} + + /* Convert a constant expression or string to an integer. This is done when comparing DATE's of different formats and @@ -173,64 +207,11 @@ void Item_bool_func2::fix_length_and_dec() if (!args[0] || !args[1]) return; - /* - We allow to convert to Unicode character sets in some cases. - The conditions when conversion is possible are: - - arguments A and B have different charsets - - A wins according to coercibility rules - - character set of A is superset for character set of B - - If all of the above is true, then it's possible to convert - B into the character set of A, and then compare according - to the collation of A. - */ - - if (args[0] && args[1]) - { - uint strong= 0; - uint weak= 0; - uint32 dummy_offset; - DTCollation coll; - - if (args[0]->result_type() == STRING_RESULT && - args[1]->result_type() == STRING_RESULT && - String::needs_conversion(0, args[0]->collation.collation, - args[1]->collation.collation, - &dummy_offset) && - !coll.set(args[0]->collation, args[1]->collation, TRUE)) - { - Item* conv= 0; - Item_arena *arena= thd->current_arena, backup; - strong= coll.strong; - weak= strong ? 0 : 1; - /* - In case we're in statement prepare, create conversion item - in its memory: it will be reused on each execute. - */ - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - if (args[weak]->type() == STRING_ITEM) - { - String tmp, cstr; - String *ostr= args[weak]->val_str(&tmp); - cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), - args[strong]->collation.collation); - conv= new Item_string(cstr.ptr(),cstr.length(),cstr.charset(), - args[weak]->collation.derivation); - ((Item_string*)conv)->str_value.copy(); - } - else - { - conv= new Item_func_conv_charset(args[weak], - args[strong]->collation.collation); - conv->collation.set(args[weak]->collation.derivation); - conv->fix_fields(thd, 0, &conv); - } - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); - args[weak]= conv ? conv : args[weak]; - } - } + DTCollation coll; + if (args[0]->result_type() == STRING_RESULT && + args[1]->result_type() == STRING_RESULT && + agg_arg_charsets(coll, args, 2, MY_COLL_CMP_CONV)) + return; // Make a special case of compare with fields to get nicer DATE comparisons @@ -284,7 +265,7 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type) comparators= 0; return 1; } - if (!(comparators= (Arg_comparator *) sql_alloc(sizeof(Arg_comparator)*n))) + if (!(comparators= new Arg_comparator[n])) return 1; for (uint i=0; i < n; i++) { @@ -788,7 +769,7 @@ void Item_func_interval::fix_length_and_dec() maybe_null= 0; max_length= 2; used_tables_cache|= row->used_tables(); - not_null_tables_cache&= row->not_null_tables(); + not_null_tables_cache= row->not_null_tables(); with_sum_func= with_sum_func || row->with_sum_func; const_item_cache&= row->const_item(); } @@ -846,7 +827,7 @@ void Item_func_between::fix_length_and_dec() return; agg_cmp_type(&cmp_type, args, 3); if (cmp_type == STRING_RESULT && - agg_arg_collations_for_comparison(cmp_collation, args, 3)) + agg_arg_charsets(cmp_collation, args, 3, MY_COLL_CMP_CONV)) return; /* @@ -962,7 +943,7 @@ Item_func_ifnull::fix_length_and_dec() decimals=max(args[0]->decimals,args[1]->decimals); agg_result_type(&cached_result_type, args, 2); if (cached_result_type == STRING_RESULT) - agg_arg_collations(collation, args, arg_count); + agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV); else if (cached_result_type != REAL_RESULT) decimals= 0; @@ -1058,7 +1039,7 @@ Item_func_if::fix_length_and_dec() agg_result_type(&cached_result_type, args+1, 2); if (cached_result_type == STRING_RESULT) { - if (agg_arg_collations(collation, args+1, 2)) + if (agg_arg_charsets(collation, args+1, 2, MY_COLL_ALLOW_CONV)) return; } else @@ -1112,6 +1093,9 @@ Item_func_nullif::fix_length_and_dec() max_length=args[0]->max_length; decimals=args[0]->decimals; agg_result_type(&cached_result_type, args, 2); + if (cached_result_type == STRING_RESULT && + agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV)) + return; } } @@ -1329,7 +1313,7 @@ void Item_func_case::fix_length_and_dec() agg_result_type(&cached_result_type, agg, nagg); if ((cached_result_type == STRING_RESULT) && - agg_arg_collations(collation, agg, nagg)) + agg_arg_charsets(collation, agg, nagg, MY_COLL_ALLOW_CONV)) return; @@ -1345,7 +1329,7 @@ void Item_func_case::fix_length_and_dec() nagg++; agg_cmp_type(&cmp_type, agg, nagg); if ((cmp_type == STRING_RESULT) && - agg_arg_collations_for_comparison(cmp_collation, agg, nagg)) + agg_arg_charsets(cmp_collation, agg, nagg, MY_COLL_CMP_CONV)) return; } @@ -1452,7 +1436,7 @@ void Item_func_coalesce::fix_length_and_dec() set_if_bigger(decimals,args[i]->decimals); } if (cached_result_type == STRING_RESULT) - agg_arg_collations(collation, args, arg_count); + agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV); else if (cached_result_type != REAL_RESULT) decimals= 0; } @@ -1518,7 +1502,11 @@ void in_string::set(uint pos,Item *item) String *str=((String*) base)+pos; String *res=item->val_str(str); if (res && res != str) + { + if (res->uses_buffer_owned_by(str)) + res->copy(); *str= *res; + } if (!str->charset()) { CHARSET_INFO *cs; @@ -1540,6 +1528,12 @@ in_row::in_row(uint elements, Item * item) size= sizeof(cmp_item_row); compare= (qsort2_cmp) cmp_row; tmp.store_value(item); + /* + We need to reset these as otherwise we will call sort() with + uninitialized (even if not used) elements + */ + used_count= elements; + collation= 0; } in_row::~in_row() @@ -1764,63 +1758,13 @@ void Item_func_in::fix_length_and_dec() agg_cmp_type(&cmp_type, args, arg_count); + if (cmp_type == STRING_RESULT && + agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV)) + return; + for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++) const_itm&= arg[0]->const_item(); - - if (cmp_type == STRING_RESULT) - { - /* - We allow consts character set conversion for - - item IN (const1, const2, const3, ...) - - if item is in a superset for all arguments, - and if it is a stong side according to coercibility rules. - - TODO: add covnersion for non-constant IN values - via creating Item_func_conv_charset(). - */ - - if (agg_arg_collations_for_comparison(cmp_collation, - args, arg_count, TRUE)) - return; - if ((!my_charset_same(args[0]->collation.collation, - cmp_collation.collation) || !const_itm)) - { - if (agg_arg_collations_for_comparison(cmp_collation, - args, arg_count, FALSE)) - return; - } - else - { - /* - Conversion is possible: - All IN arguments are constants. - */ - Item_arena *arena= thd->current_arena, backup; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - for (arg= args+1, arg_end= args+arg_count; arg < arg_end; arg++) - { - if (!my_charset_same(cmp_collation.collation, - arg[0]->collation.collation)) - { - Item_string *conv; - String tmp, cstr, *ostr= arg[0]->val_str(&tmp); - cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), - cmp_collation.collation); - conv= new Item_string(cstr.ptr(),cstr.length(), cstr.charset(), - arg[0]->collation.derivation); - conv->str_value.copy(); - arg[0]= conv; - } - } - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); - } - } - /* Row item with NULLs inside can return NULL or FALSE => they can't be processed as static @@ -2025,30 +1969,33 @@ bool Item_cond::walk(Item_processor processor, byte *arg) return Item_func::walk(processor, arg); } + +/* + Move SUM items out from item tree and replace with reference + + SYNOPSIS + split_sum_func() + thd Thread handler + ref_pointer_array Pointer to array of reference fields + fields All fields in select + + NOTES + This function is run on all expression (SELECT list, WHERE, HAVING etc) + that have or refer (HAVING) to a SUM expression. + + The split is done to get an unique item for each SUM function + so that we can easily find and calculate them. + (Calculation done by update_sum_func() and copy_sum_funcs() in + sql_select.cc) +*/ + void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields) { List_iterator<Item> li(list); Item *item; - used_tables_cache=0; - const_item_cache=0; - while ((item=li++)) - { - if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) - item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) - { - Item **ref= li.ref(); - uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - fields.push_front(item); - ref_pointer_array[el]= item; - thd->change_item_tree(ref, new_item); - } - item->update_used_tables(); - used_tables_cache|=item->used_tables(); - const_item_cache&=item->const_item(); - } + while ((item= li++)) + item->split_sum_func2(thd, ref_pointer_array, fields, li.ref()); } @@ -2391,14 +2338,16 @@ bool Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { DBUG_ASSERT(fixed == 0); - if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1) || - args[1]->fix_fields(thd,tables, args + 1) || args[1]->check_cols(1)) + if ((!args[0]->fixed && + args[0]->fix_fields(thd, tables, args)) || args[0]->check_cols(1) || + (!args[1]->fixed && + args[1]->fix_fields(thd,tables, args + 1)) || args[1]->check_cols(1)) return 1; /* purecov: inspected */ with_sum_func=args[0]->with_sum_func || args[1]->with_sum_func; max_length= 1; decimals= 0; - if (agg_arg_collations(cmp_collation, args, 2)) + if (agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV)) return 1; used_tables_cache=args[0]->used_tables() | args[1]->used_tables(); @@ -2416,11 +2365,12 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) return 0; } int error; - if ((error=regcomp(&preg,res->c_ptr(), - (cmp_collation.collation->state & MY_CS_BINSORT) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE, - cmp_collation.collation))) + if ((error= regcomp(&preg,res->c_ptr(), + ((cmp_collation.collation->state & + (MY_CS_BINSORT | MY_CS_CSSORT)) ? + REG_EXTENDED | REG_NOSUB : + REG_EXTENDED | REG_NOSUB | REG_ICASE), + cmp_collation.collation))) { (void) regerror(error,&preg,buff,sizeof(buff)); my_printf_error(ER_REGEXP_ERROR,ER(ER_REGEXP_ERROR),MYF(0),buff); @@ -2468,10 +2418,11 @@ longlong Item_func_regex::val_int() regex_compiled=0; } if (regcomp(&preg,res2->c_ptr(), - (cmp_collation.collation->state & MY_CS_BINSORT) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE, - cmp_collation.collation)) + ((cmp_collation.collation->state & + (MY_CS_BINSORT | MY_CS_CSSORT)) ? + REG_EXTENDED | REG_NOSUB : + REG_EXTENDED | REG_NOSUB | REG_ICASE), + cmp_collation.collation)) { null_value=1; return 0; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 69528099aa1..061ed468b78 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -213,7 +213,7 @@ class Item_bool_rowready_func2 :public Item_bool_func2 public: Item_bool_rowready_func2(Item *a, Item *b) :Item_bool_func2(a, b) { - allowed_arg_cols= a->cols(); + allowed_arg_cols= 0; // Fetch this value from first argument } Item *neg_transformer(THD *thd); virtual Item *negated_item(); @@ -229,21 +229,43 @@ public: Item *neg_transformer(THD *thd); }; +class Item_maxmin_subselect; class Item_func_not_all :public Item_func_not { + /* allow to check presence od values in max/min optimisation */ + Item_sum_hybrid *test_sum_item; + Item_maxmin_subselect *test_sub_item; + bool abort_on_null; public: bool show; - Item_func_not_all(Item *a) :Item_func_not(a), abort_on_null(0), show(0) {} + Item_func_not_all(Item *a) + :Item_func_not(a), test_sum_item(0), test_sub_item(0), abort_on_null(0), + show(0) + {} virtual void top_level_item() { abort_on_null= 1; } bool top_level() { return abort_on_null; } longlong val_int(); enum Functype functype() const { return NOT_ALL_FUNC; } const char *func_name() const { return "<not>"; } void print(String *str); + void set_sum_test(Item_sum_hybrid *item) { test_sum_item= item; }; + void set_sub_test(Item_maxmin_subselect *item) { test_sub_item= item; }; + bool empty_underlying_subquery(); }; + +class Item_func_nop_all :public Item_func_not_all +{ +public: + + Item_func_nop_all(Item *a) :Item_func_not_all(a) {} + longlong val_int(); + const char *func_name() const { return "<nop>"; } +}; + + class Item_func_eq :public Item_bool_rowready_func2 { public: @@ -368,7 +390,10 @@ class Item_func_interval :public Item_int_func double *intervals; public: Item_func_interval(Item_row *a) - :Item_int_func(a),row(a),intervals(0) { allowed_arg_cols= a->cols(); } + :Item_int_func(a),row(a),intervals(0) + { + allowed_arg_cols= 0; // Fetch this value from first argument + } longlong val_int(); void fix_length_and_dec(); const char *func_name() const { return "interval"; } @@ -721,7 +746,7 @@ class Item_func_in :public Item_int_func Item_func_in(List<Item> &list) :Item_int_func(list), array(0), in_item(0), have_null(0) { - allowed_arg_cols= args[0]->cols(); + allowed_arg_cols= 0; // Fetch this value from first argument } longlong val_int(); void fix_length_and_dec(); diff --git a/sql/item_create.cc b/sql/item_create.cc index c98c7892c26..d959a6f393a 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -365,25 +365,26 @@ Item *create_func_sin(Item* a) Item *create_func_sha(Item* a) { - return new Item_func_sha(a); + return new Item_func_sha(a); } - + Item *create_func_space(Item *a) { CHARSET_INFO *cs= current_thd->variables.collation_connection; Item *sp; - + if (cs->mbminlen > 1) { + uint dummy_errors; sp= new Item_string("",0,cs); if (sp) - sp->str_value.copy(" ",1,&my_charset_latin1,cs); + sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); } else { sp= new Item_string(" ",1,cs); } - return new Item_func_repeat(sp, a); + return sp ? new Item_func_repeat(sp, a) : 0; } Item *create_func_soundex(Item* a) diff --git a/sql/item_create.h b/sql/item_create.h index 7577627ef04..faff6f45220 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -87,7 +87,7 @@ Item *create_func_soundex(Item* a); Item *create_func_space(Item *); Item *create_func_sqrt(Item* a); Item *create_func_strcmp(Item* a, Item *b); -Item *create_func_tan(Item* a);; +Item *create_func_tan(Item* a); Item *create_func_time_format(Item *a, Item *b); Item *create_func_time_to_sec(Item* a); Item *create_func_to_days(Item* a); diff --git a/sql/item_func.cc b/sql/item_func.cc index 17cf8642ce5..895740d2e5e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -76,7 +76,7 @@ static void my_coll_agg_error(Item** args, uint count, const char *fname) bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count, - bool allow_superset_conversion) + uint flags) { uint i; c.nagg= 0; @@ -84,29 +84,27 @@ bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count, c.set(av[0]->collation); for (i= 1; i < count; i++) { - if (c.aggregate(av[i]->collation, allow_superset_conversion)) + if (c.aggregate(av[i]->collation, flags)) { my_coll_agg_error(av, count, func_name()); return TRUE; } } + if ((flags & MY_COLL_DISALLOW_NONE) && + c.derivation == DERIVATION_NONE) + { + my_coll_agg_error(av, count, func_name()); + return TRUE; + } return FALSE; } bool Item_func::agg_arg_collations_for_comparison(DTCollation &c, Item **av, uint count, - bool allow_superset_conv) + uint flags) { - if (agg_arg_collations(c, av, count, allow_superset_conv)) - return TRUE; - - if (c.derivation == DERIVATION_NONE) - { - my_coll_agg_error(av, count, func_name()); - return TRUE; - } - return FALSE; + return (agg_arg_collations(c, av, count, flags | MY_COLL_DISALLOW_NONE)); } @@ -119,6 +117,88 @@ eval_const_cond(COND *cond) } + +/* + Collect arguments' character sets together. + We allow to apply automatic character set conversion in some cases. + The conditions when conversion is possible are: + - arguments A and B have different charsets + - A wins according to coercibility rules + (i.e. a column is stronger than a string constant, + an explicit COLLATE clause is stronger than a column) + - character set of A is either superset for character set of B, + or B is a string constant which can be converted into the + character set of A without data loss. + + If all of the above is true, then it's possible to convert + B into the character set of A, and then compare according + to the collation of A. + + For functions with more than two arguments: + + collect(A,B,C) ::= collect(collect(A,B),C) +*/ + +bool Item_func::agg_arg_charsets(DTCollation &coll, + Item **args, uint nargs, uint flags) +{ + Item **arg, **last, *safe_args[2]; + if (agg_arg_collations(coll, args, nargs, flags)) + return TRUE; + + /* + For better error reporting: save the first and the second argument. + We need this only if the the number of args is 3 or 2: + - for a longer argument list, "Illegal mix of collations" + doesn't display each argument's characteristics. + - if nargs is 1, then this error cannot happen. + */ + if (nargs >=2 && nargs <= 3) + { + safe_args[0]= args[0]; + safe_args[1]= args[1]; + } + + THD *thd= current_thd; + Item_arena *arena, backup; + bool res= FALSE; + /* + In case we're in statement prepare, create conversion item + in its memory: it will be reused on each execute. + */ + arena= thd->change_arena_if_needed(&backup); + + for (arg= args, last= args + nargs; arg < last; arg++) + { + Item* conv; + uint32 dummy_offset; + if (!String::needs_conversion(0, coll.collation, + (*arg)->collation.collation, + &dummy_offset)) + continue; + + if (!(conv= (*arg)->safe_charset_converter(coll.collation))) + { + if (nargs >=2 && nargs <= 3) + { + /* restore the original arguments for better error message */ + args[0]= safe_args[0]; + args[1]= safe_args[1]; + } + my_coll_agg_error(args, nargs, func_name()); + res= TRUE; + break; // we cannot return here, we need to restore "arena". + } + conv->fix_fields(thd, 0, &conv); + *arg= conv; + } + if (arena) + thd->restore_backup_item_arena(arena, &backup); + return res; +} + + + void Item_func::set_arguments(List<Item> &list) { allowed_arg_cols= 1; @@ -184,7 +264,7 @@ Item_func::Item_func(THD *thd, Item_func *item) Sets as a side effect the following class variables: maybe_null Set if any argument may return NULL with_sum_func Set if any of the arguments contains a sum function - used_table_cache Set to union of the arguments used table + used_tables_cache Set to union of the tables used by arguments str_value.charset If this is a string function, set this to the character set for the first argument. @@ -223,10 +303,24 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) We can't yet set item to *arg as fix_fields may change *arg We shouldn't call fix_fields() twice, so check 'fixed' field first */ - if ((!(*arg)->fixed && (*arg)->fix_fields(thd, tables, arg)) || - (*arg)->check_cols(allowed_arg_cols)) + if ((!(*arg)->fixed && (*arg)->fix_fields(thd, tables, arg))) return 1; /* purecov: inspected */ + item= *arg; + + if (allowed_arg_cols) + { + if (item->check_cols(allowed_arg_cols)) + return 1; + } + else + { + /* we have to fetch allowed_arg_cols from first argument */ + DBUG_ASSERT(arg == args); // it is first argument + allowed_arg_cols= item->cols(); + DBUG_ASSERT(allowed_arg_cols); // Can't be 0 any more + } + if (item->maybe_null) maybe_null=1; @@ -257,24 +351,15 @@ bool Item_func::walk (Item_processor processor, byte *argument) return (this->*processor)(argument); } + +/* See comments in Item_cmp_func::split_sum_func() */ + void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields) { Item **arg, **arg_end; for (arg= args, arg_end= args+arg_count; arg != arg_end ; arg++) - { - Item *item=* arg; - if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) - item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) - { - uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - fields.push_front(item); - ref_pointer_array[el]= item; - thd->change_item_tree(arg, new_item); - } - } + (*arg)->split_sum_func2(thd, ref_pointer_array, fields, arg); } @@ -694,9 +779,25 @@ longlong Item_func_neg::val_int() void Item_func_neg::fix_length_and_dec() { + enum Item_result arg_result= args[0]->result_type(); + enum Item::Type arg_type= args[0]->type(); decimals=args[0]->decimals; max_length=args[0]->max_length; hybrid_type= REAL_RESULT; + + /* + We need to account for added '-' in the following cases: + A) argument is a real or integer positive constant - in this case + argument's max_length is set to actual number of bytes occupied, and not + maximum number of bytes real or integer may require. Note that all + constants are non negative so we don't need to account for removed '-'. + B) argument returns a string. + */ + if (arg_result == STRING_RESULT || + (arg_type == REAL_ITEM && ((Item_real*)args[0])->value >= 0) || + (arg_type == INT_ITEM && ((Item_int*)args[0])->value > 0)) + max_length++; + if (args[0]->result_type() == INT_RESULT) { /* @@ -1010,7 +1111,8 @@ double Item_func_round::val() bool Item_func_rand::fix_fields(THD *thd, struct st_table_list *tables, Item **ref) { - Item_real_func::fix_fields(thd, tables, ref); + if (Item_real_func::fix_fields(thd, tables, ref)) + return TRUE; used_tables_cache|= RAND_TABLE_BIT; if (arg_count) { // Only use argument once in query @@ -1105,7 +1207,7 @@ void Item_func_min_max::fix_length_and_dec() cmp_type=item_cmp_type(cmp_type,args[i]->result_type()); } if (cmp_type == STRING_RESULT) - agg_arg_collations_for_comparison(collation, args, arg_count); + agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV); } @@ -1259,7 +1361,7 @@ longlong Item_func_coercibility::val_int() void Item_func_locate::fix_length_and_dec() { maybe_null=0; max_length=11; - agg_arg_collations_for_comparison(cmp_collation, args, 2); + agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV); } @@ -1358,7 +1460,7 @@ void Item_func_field::fix_length_and_dec() for (uint i=1; i < arg_count ; i++) cmp_type= item_cmp_type(cmp_type, args[i]->result_type()); if (cmp_type == STRING_RESULT) - agg_arg_collations_for_comparison(cmp_collation, args, arg_count); + agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV); } @@ -1521,18 +1623,21 @@ longlong Item_func_bit_count::val_int() udf_handler::~udf_handler() { - if (initialized) + if (!not_original) { - if (u_d->func_deinit != NULL) + if (initialized) { - void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*)) - u_d->func_deinit; - (*deinit)(&initid); + if (u_d->func_deinit != NULL) + { + void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*)) + u_d->func_deinit; + (*deinit)(&initid); + } + free_udf(u_d); } - free_udf(u_d); + if (buffers) // Because of bug in ecc + delete [] buffers; } - if (buffers) // Because of bug in ecc - delete [] buffers; } @@ -1579,7 +1684,8 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func, arg != arg_end ; arg++,i++) { - if ((*arg)->fix_fields(thd, tables, arg)) + if (!(*arg)->fixed && + (*arg)->fix_fields(thd, tables, arg)) DBUG_RETURN(1); // we can't assign 'item' before, because fix_fields() can change arg Item *item= *arg; @@ -1926,7 +2032,7 @@ void item_user_lock_release(User_level_lock *ull) tmp.copy(command, strlen(command), tmp.charset()); tmp.append(ull->key,ull->key_length); tmp.append("\")", 2); - Query_log_event qev(current_thd, tmp.ptr(), tmp.length(),1); + Query_log_event qev(current_thd, tmp.ptr(), tmp.length(),1, FALSE); qev.error_code=0; // this query is always safe to run on slave mysql_bin_log.write(&qev); } @@ -2182,14 +2288,10 @@ longlong Item_func_last_insert_id::val_int() longlong value=args[0]->val_int(); current_thd->insert_id(value); null_value=args[0]->null_value; - return value; } else - { - Item *it= get_system_var(current_thd, OPT_SESSION, "last_insert_id", 14, - "last_insert_id()"); - return it->val_int(); - } + current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); + return current_thd->insert_id(); } /* This function is just used to test speed of different functions */ @@ -2259,6 +2361,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name, entry->value=0; entry->length=0; entry->update_query_id=0; + entry->collation.set(NULL, DERIVATION_IMPLICIT); /* If we are here, we were called from a SET or a query which sets a variable. Imagine it is this: @@ -2300,7 +2403,24 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables, is different from query_id). */ entry->update_query_id= thd->query_id; - entry->collation.set(args[0]->collation); + /* + As it is wrong and confusing to associate any + character set with NULL, @a should be latin2 + after this query sequence: + + SET @a=_latin2'string'; + SET @a=NULL; + + I.e. the second query should not change the charset + to the current default value, but should keep the + original value assigned during the first query. + In order to do it, we don't copy charset + from the argument if the argument is NULL + and the variable has previously been initialized. + */ + if (!entry->collation.collation || !args[0]->null_value) + entry->collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT); + collation.set(entry->collation.collation, DERIVATION_IMPLICIT); cached_result_type= args[0]->result_type(); return 0; } @@ -2312,7 +2432,7 @@ Item_func_set_user_var::fix_length_and_dec() maybe_null=args[0]->maybe_null; max_length=args[0]->max_length; decimals=args[0]->decimals; - collation.set(args[0]->collation); + collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT); } @@ -2328,7 +2448,6 @@ bool Item_func_set_user_var::update_hash(void *ptr, uint length, my_free(entry->value,MYF(0)); entry->value=0; entry->length=0; - entry->collation.set(cs, dv); } else { @@ -2540,7 +2659,7 @@ Item_func_set_user_var::update() res= update_hash((void*) save_result.vstr->ptr(), save_result.vstr->length(), STRING_RESULT, save_result.vstr->charset(), - args[0]->collation.derivation); + DERIVATION_IMPLICIT); break; } case ROW_RESULT: @@ -2873,10 +2992,10 @@ void Item_func_match::init_search(bool no_order) if (key == NO_SUCH_KEY) { List<Item> fields; + fields.push_back(new Item_string(" ",1, cmp_collation.collation)); for (uint i=1; i < arg_count; i++) fields.push_back(args[i]); - concat=new Item_func_concat_ws(new Item_string(" ",1, - cmp_collation.collation), fields); + concat=new Item_func_concat_ws(fields); /* Above function used only to get value and do not need fix_fields for it: Item_string - basic constant @@ -2906,16 +3025,15 @@ void Item_func_match::init_search(bool no_order) if (ft_tmp->charset() != cmp_collation.collation) { + uint dummy_errors; search_value.copy(ft_tmp->ptr(), ft_tmp->length(), ft_tmp->charset(), - cmp_collation.collation); + cmp_collation.collation, &dummy_errors); ft_tmp= &search_value; } if (join_key && !no_order) flags|=FT_SORTED; - ft_handler=table->file->ft_init_ext(flags, key, - (byte*) ft_tmp->ptr(), - ft_tmp->length()); + ft_handler=table->file->ft_init_ext(flags, key, ft_tmp); if (join_key) table->file->ft_handler=ft_handler; @@ -2957,12 +3075,12 @@ bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) } /* Check that all columns come from the same table. - We've already checked that columns in MATCH are fields so + We've already checked that columns in MATCH are fields so PARAM_TABLE_BIT can only appear from AGAINST argument. */ if ((used_tables_cache & ~PARAM_TABLE_BIT) != item->used_tables()) key=NO_SUCH_KEY; - + if (key == NO_SUCH_KEY && !(flags & FT_BOOL)) { my_error(ER_WRONG_ARGUMENTS,MYF(0),"MATCH"); diff --git a/sql/item_func.h b/sql/item_func.h index 6e43d66a32d..2738c7419ca 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -32,6 +32,10 @@ class Item_func :public Item_result_field { protected: Item **args, *tmp_arg[2]; + /* + Allowed numbers of columns in result (usually 1, which means scalar value) + 0 means get this number from first argument + */ uint allowed_arg_cols; public: uint arg_count; @@ -141,11 +145,12 @@ public: Item *get_tmp_table_item(THD *thd); bool agg_arg_collations(DTCollation &c, Item **items, uint nitems, - bool allow_superset_conversion= FALSE); + uint flags= 0); bool agg_arg_collations_for_comparison(DTCollation &c, Item **items, uint nitems, - bool allow_superset_comversion= FALSE); - + uint flags= 0); + bool agg_arg_charsets(DTCollation &c, Item **items, uint nitems, + uint flags= 0); bool walk(Item_processor processor, byte *arg); }; @@ -823,8 +828,11 @@ public: double val() { int err; - String *res; res=val_str(&str_value); - return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(),0,&err) : 0.0; + String *res; + char *end_not_used; + res=val_str(&str_value); + return res ? my_strntod(res->charset(), (char*) res->ptr(), res->length(), + &end_not_used, &err) : 0.0; } longlong val_int() { diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 935925c1e83..2f00416bddf 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -24,7 +24,6 @@ #include "mysql_priv.h" #ifdef HAVE_SPATIAL -#include "sql_acl.h" #include <m_ctype.h> void Item_geometry_func::fix_length_and_dec() @@ -148,9 +147,9 @@ String *Item_func_geometry_type::val_str(String *str) swkb->length() - SRID_SIZE))))) return 0; /* String will not move */ - str->set(geom->get_class_info()->m_name.str, - geom->get_class_info()->m_name.length, - default_charset()); + str->copy(geom->get_class_info()->m_name.str, + geom->get_class_info()->m_name.length, + default_charset()); return str; } diff --git a/sql/item_row.cc b/sql/item_row.cc index 289efe45300..12d202a1699 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -84,25 +84,16 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) return 0; } + void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields) { Item **arg, **arg_end; for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) - { - if ((*arg)->with_sum_func && (*arg)->type() != SUM_FUNC_ITEM) - (*arg)->split_sum_func(thd, ref_pointer_array, fields); - else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM) - { - uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name); - fields.push_front(*arg); - ref_pointer_array[el]= *arg; - thd->change_item_tree(arg, new_item); - } - } + (*arg)->split_sum_func2(thd, ref_pointer_array, fields, arg); } + void Item_row::update_used_tables() { used_tables_cache= 0; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d78a3ac88a4..0023d7b1f20 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -25,7 +25,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include <m_ctype.h> #ifdef HAVE_OPENSSL #include <openssl/des.h> @@ -64,10 +63,11 @@ double Item_str_func::val() DBUG_ASSERT(fixed == 1); int err; char buff[64]; + char *end_not_used; String *res, tmp(buff,sizeof(buff), &my_charset_bin); res= val_str(&tmp); return res ? my_strntod(res->charset(), (char*) res->ptr(),res->length(), - NULL, &err) : 0.0; + &end_not_used, &err) : 0.0; } longlong Item_str_func::val_int() @@ -276,7 +276,8 @@ String *Item_func_concat::val_str(String *str) current_thd->variables.max_allowed_packet); goto null; } - if (res->alloced_length() >= res->length()+res2->length()) + if (!args[0]->const_item() && + res->alloced_length() >= res->length()+res2->length()) { // Use old buffer res->append(*res2); } @@ -346,7 +347,7 @@ void Item_func_concat::fix_length_and_dec() { max_length=0; - if (agg_arg_collations(collation, args, arg_count)) + if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV)) return; for (uint i=0 ; i < arg_count ; i++) @@ -532,7 +533,7 @@ String *Item_func_concat_ws::val_str(String *str) uint i; null_value=0; - if (!(sep_str= separator->val_str(&tmp_sep_str))) + if (!(sep_str= args[0]->val_str(&tmp_sep_str))) goto null; use_as_buff= &tmp_value; @@ -541,7 +542,7 @@ String *Item_func_concat_ws::val_str(String *str) // Skip until non-null argument is found. // If not, return the empty string - for (i=0; i < arg_count; i++) + for (i=1; i < arg_count; i++) if ((res= args[i]->val_str(str))) break; if (i == arg_count) @@ -635,67 +636,30 @@ null: return 0; } -void Item_func_concat_ws::split_sum_func(THD *thd, Item **ref_pointer_array, - List<Item> &fields) -{ - if (separator->with_sum_func && separator->type() != SUM_FUNC_ITEM) - separator->split_sum_func(thd, ref_pointer_array, fields); - else if (separator->used_tables() || separator->type() == SUM_FUNC_ITEM) - { - uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, separator->name); - fields.push_front(separator); - ref_pointer_array[el]= separator; - thd->change_item_tree(&separator, new_item); - } - Item_str_func::split_sum_func(thd, ref_pointer_array, fields); -} void Item_func_concat_ws::fix_length_and_dec() { - collation.set(separator->collation); - max_length=separator->max_length*(arg_count-1); - for (uint i=0 ; i < arg_count ; i++) - { - DTCollation tmp(collation.collation, collation.derivation); + max_length=0; + + if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV)) + return; + + /* + arg_count cannot be less than 2, + it is done on parser level in sql_yacc.yy + so, (arg_count - 2) is safe here. + */ + max_length= args[0]->max_length * (arg_count - 2); + for (uint i=1 ; i < arg_count ; i++) max_length+=args[i]->max_length; - if (collation.aggregate(args[i]->collation)) - { - collation.set(tmp); // Restore the previous value - my_coll_agg_error(collation, args[i]->collation, func_name()); - break; - } - } + if (max_length > MAX_BLOB_WIDTH) { max_length=MAX_BLOB_WIDTH; maybe_null=1; } - used_tables_cache|= separator->used_tables(); - not_null_tables_cache&= separator->not_null_tables(); - const_item_cache&= separator->const_item(); - with_sum_func= with_sum_func || separator->with_sum_func; -} - -void Item_func_concat_ws::update_used_tables() -{ - Item_func::update_used_tables(); - separator->update_used_tables(); - used_tables_cache|=separator->used_tables(); - const_item_cache&=separator->const_item(); } -void Item_func_concat_ws::print(String *str) -{ - str->append("concat_ws(", 10); - separator->print(str); - if (arg_count) - { - str->append(','); - print_args(str, 0); - } - str->append(')'); -} String *Item_func_reverse::val_str(String *str) { @@ -885,7 +849,7 @@ void Item_func_replace::fix_length_and_dec() maybe_null=1; } - if (agg_arg_collations_for_comparison(collation, args, 3)) + if (agg_arg_charsets(collation, args, 3, MY_COLL_CMP_CONV)) return; } @@ -930,11 +894,13 @@ null: void Item_func_insert::fix_length_and_dec() { - if (collation.set(args[0]->collation, args[3]->collation)) - { - my_coll_agg_error(args[0]->collation, args[3]->collation, func_name()); - return; - } + Item *cargs[2]; + cargs[0]= args[0]; + cargs[1]= args[3]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV)) + return; + args[0]= cargs[0]; + args[3]= cargs[1]; max_length=args[0]->max_length+args[3]->max_length; if (max_length > MAX_BLOB_WIDTH) { @@ -990,8 +956,9 @@ String *Item_func_left::val_str(String *str) if (res->length() <= (uint) length || res->length() <= (char_pos= res->charpos(length))) return res; - str_value.set(*res, 0, char_pos); - return &str_value; + + tmp_value.set(*res, 0, char_pos); + return &tmp_value; } @@ -1100,7 +1067,7 @@ void Item_func_substr_index::fix_length_and_dec() { max_length= args[0]->max_length; - if (agg_arg_collations_for_comparison(collation, args, 2)) + if (agg_arg_charsets(collation, args, 2, MY_COLL_CMP_CONV)) return; } @@ -1337,9 +1304,18 @@ String *Item_func_trim::val_str(String *str) return 0; /* purecov: inspected */ char buff[MAX_FIELD_WIDTH]; String tmp(buff,sizeof(buff),res->charset()); - String *remove_str= (arg_count==2) ? args[1]->val_str(&tmp) : &remove; uint remove_length; LINT_INIT(remove_length); + String *remove_str; /* The string to remove from res. */ + + if (arg_count == 2) + { + remove_str= args[1]->val_str(&tmp); + if ((null_value= args[1]->null_value)) + return 0; + } + else + remove_str= &remove; /* Default value. */ if (!remove_str || (remove_length=remove_str->length()) == 0 || remove_length > res->length()) @@ -1392,10 +1368,14 @@ void Item_func_trim::fix_length_and_dec() remove.set_ascii(" ",1); } else - if (collation.set(args[1]->collation, args[0]->collation) || - collation.derivation == DERIVATION_NONE) { - my_coll_agg_error(args[1]->collation, args[0]->collation, func_name()); + Item *cargs[2]; + cargs[0]= args[1]; + cargs[1]= args[0]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_CMP_CONV)) + return; + args[0]= cargs[1]; + args[1]= cargs[0]; } } @@ -1584,9 +1564,14 @@ void Item_func_soundex::fix_length_and_dec() else return 0 */ -static char get_scode(CHARSET_INFO *cs,char *ptr) +static char soundex_toupper(char ch) { - uchar ch=my_toupper(cs,*ptr); + return (ch >= 'a' && ch <= 'z') ? ch - 'a' + 'A' : ch; +} + +static char get_scode(char *ptr) +{ + uchar ch= soundex_toupper(*ptr); if (ch < 'A' || ch > 'Z') { // Thread extended alfa (country spec) @@ -1616,8 +1601,8 @@ String *Item_func_soundex::val_str(String *str) from++; /* purecov: inspected */ if (from == end) return &my_empty_string; // No alpha characters. - *to++ = my_toupper(cs,*from); // Copy first letter - last_ch = get_scode(cs,from); // code of the first letter + *to++ = soundex_toupper(*from); // Copy first letter + last_ch = get_scode(from); // code of the first letter // for the first 'double-letter check. // Loop on input letters until // end of input (null) or output @@ -1626,7 +1611,7 @@ String *Item_func_soundex::val_str(String *str) { if (!my_isalpha(cs,*from)) continue; - ch=get_scode(cs,from); + ch=get_scode(from); if ((ch != '0') && (ch != last_ch)) // if not skipped or double { *to++ = ch; // letter, copy to output @@ -1661,7 +1646,8 @@ String *Item_func_format::val_str(String *str) { DBUG_ASSERT(fixed == 1); double nr =args[0]->val(); - uint32 diff,length,str_length; + int diff; + uint32 length, str_length; uint dec; if ((null_value=args[0]->null_value)) return 0; /* purecov: inspected */ @@ -1686,9 +1672,12 @@ String *Item_func_format::val_str(String *str) pos[0]= pos[-(int) diff]; while (diff) { - pos[0]=pos[-(int) diff]; pos--; - pos[0]=pos[-(int) diff]; pos--; - pos[0]=pos[-(int) diff]; pos--; + *pos= *(pos - diff); + pos--; + *pos= *(pos - diff); + pos--; + *pos= *(pos - diff); + pos--; pos[0]=','; pos--; diff--; @@ -1716,7 +1705,7 @@ void Item_func_elt::fix_length_and_dec() max_length=0; decimals=0; - if (agg_arg_collations(collation, args+1, arg_count-1)) + if (agg_arg_charsets(collation, args+1, arg_count-1, MY_COLL_ALLOW_CONV)) return; for (uint i= 1 ; i < arg_count ; i++) @@ -1774,16 +1763,7 @@ String *Item_func_elt::val_str(String *str) void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields) { - if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) - item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) - { - uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - fields.push_front(item); - ref_pointer_array[el]= item; - thd->change_item_tree(&item, new_item); - } + item->split_sum_func2(thd, ref_pointer_array, fields, &item); Item_str_func::split_sum_func(thd, ref_pointer_array, fields); } @@ -1792,7 +1772,7 @@ void Item_func_make_set::fix_length_and_dec() { max_length=arg_count-1; - if (agg_arg_collations(collation, args, arg_count)) + if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV)) return; for (uint i=0 ; i < arg_count ; i++) @@ -1888,6 +1868,7 @@ String *Item_func_char::val_str(String *str) { int32 num=(int32) args[i]->val_int(); if (!args[i]->null_value) + { #ifdef USE_MB if (use_mb(collation.collation)) { @@ -1903,7 +1884,9 @@ b1: str->append((char)(num>>8)); } #endif str->append((char)num); + } } + str->set_charset(collation.collation); str->realloc(str->length()); // Add end 0 (for Purify) return str; } @@ -2000,12 +1983,13 @@ err: void Item_func_rpad::fix_length_and_dec() { - if (collation.set(args[0]->collation, args[2]->collation)) - { - my_coll_agg_error(args[0]->collation, args[2]->collation, func_name()); + Item *cargs[2]; + cargs[0]= args[0]; + cargs[1]= args[2]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV)) return; - } - + args[0]= cargs[0]; + args[2]= cargs[1]; if (args[1]->const_item()) { uint32 length= (uint32) args[1]->val_int() * collation.collation->mbmaxlen; @@ -2084,11 +2068,13 @@ String *Item_func_rpad::val_str(String *str) void Item_func_lpad::fix_length_and_dec() { - if (collation.set(args[0]->collation, args[2]->collation)) - { - my_coll_agg_error(args[0]->collation, args[2]->collation, func_name()); + Item *cargs[2]; + cargs[0]= args[0]; + cargs[1]= args[2]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV)) return; - } + args[0]= cargs[0]; + args[2]= cargs[1]; if (args[1]->const_item()) { @@ -2182,6 +2168,7 @@ String *Item_func_conv::val_str(String *str) return 0; } null_value=0; + unsigned_flag= !(from_base < 0); if (from_base < 0) dec= my_strntoll(res->charset(),res->ptr(),res->length(),-from_base,&endptr,&err); else @@ -2197,13 +2184,14 @@ String *Item_func_conv_charset::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *arg= args[0]->val_str(str); + uint dummy_errors; if (!arg) { null_value=1; return 0; } null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(), - conv_charset); + conv_charset, &dummy_errors); return null_value ? 0 : &str_value; } @@ -2286,11 +2274,12 @@ String *Item_func_charset::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *res = args[0]->val_str(str); + uint dummy_errors; if ((null_value=(args[0]->null_value || !res->charset()))) return 0; str->copy(res->charset()->csname,strlen(res->charset()->csname), - &my_charset_latin1, collation.collation); + &my_charset_latin1, collation.collation, &dummy_errors); return str; } @@ -2298,11 +2287,12 @@ String *Item_func_collation::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *res = args[0]->val_str(str); + uint dummy_errors; if ((null_value=(args[0]->null_value || !res->charset()))) return 0; str->copy(res->charset()->name,strlen(res->charset()->name), - &my_charset_latin1, collation.collation); + &my_charset_latin1, collation.collation, &dummy_errors); return str; } @@ -2345,17 +2335,6 @@ String *Item_func_hex::val_str(String *str) return &tmp_value; } -inline int hexchar_to_int(char c) -{ - if (c <= '9' && c >= '0') - return c-'0'; - c|=32; - if (c <= 'f' && c >= 'a') - return c-'a'+10; - return -1; -} - - /* Convert given hex string to a binary string */ String *Item_func_unhex::val_str(String *str) @@ -2508,6 +2487,9 @@ String* Item_func_export_set::val_str(String* str) case 3: sep_buf.set(",", 1, default_charset()); sep = &sep_buf; + break; + default: + DBUG_ASSERT(0); // cannot happen } null_value=0; @@ -2529,7 +2511,8 @@ void Item_func_export_set::fix_length_and_dec() uint sep_length=(arg_count > 3 ? args[3]->max_length : 1); max_length=length*64+sep_length*63; - if (agg_arg_collations(collation, args+1, min(4,arg_count)-1)) + if (agg_arg_charsets(collation, args+1, min(4,arg_count)-1), + MY_COLL_ALLOW_CONV) return; } @@ -2586,9 +2569,12 @@ String* Item_func_inet_ntoa::val_str(String* str) This function is very useful when you want to generate SQL statements - RETURN VALUES + NOTE + QUOTE(NULL) returns the string 'NULL' (4 letters, without quotes). + + RETURN VALUES str Quoted string - NULL Argument to QUOTE() was NULL or out of memory. + NULL Out of memory. */ #define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7)) @@ -2613,25 +2599,25 @@ String *Item_func_quote::val_str(String *str) String *arg= args[0]->val_str(str); uint arg_length, new_length; if (!arg) // Null argument - goto null; + { + str->copy("NULL", 4, collation.collation); // Return the string 'NULL' + null_value= 0; + return str; + } + arg_length= arg->length(); new_length= arg_length+2; /* for beginning and ending ' signs */ for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++) new_length+= get_esc_bit(escmask, (uchar) *from); - /* - We have to use realloc() instead of alloc() as we want to keep the - old result in str - */ - if (str->realloc(new_length)) + if (tmp_value.alloc(new_length)) goto null; /* - As 'arg' and 'str' may be the same string, we must replace characters - from the end to the beginning + We replace characters from the end to the beginning */ - to= (char*) str->ptr() + new_length - 1; + to= (char*) tmp_value.ptr() + new_length - 1; *to--= '\''; for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--) { @@ -2659,10 +2645,10 @@ String *Item_func_quote::val_str(String *str) } } *to= '\''; - str->length(new_length); - str->set_charset(collation.collation); + tmp_value.length(new_length); + tmp_value.set_charset(collation.collation); null_value= 0; - return str; + return &tmp_value; null: null_value= 1; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 77c1caec9fc..c1c0969672c 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -89,30 +89,12 @@ public: class Item_func_concat_ws :public Item_str_func { - Item *separator; String tmp_value; - public: - Item_func_concat_ws(Item *a,List<Item> &list) - :Item_str_func(list),separator(a) {} + Item_func_concat_ws(List<Item> &list) :Item_str_func(list) {} String *val_str(String *); void fix_length_and_dec(); - void update_used_tables(); - bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) - { - DBUG_ASSERT(fixed == 0); - return (separator->fix_fields(thd, tlist, &separator) || - separator->check_cols(1) || - Item_func::fix_fields(thd, tlist, ref)); - } - void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields); const char *func_name() const { return "concat_ws"; } - bool walk(Item_processor processor, byte *arg) - { - return separator->walk(processor, arg) || - Item_str_func::walk(processor, arg); - } - void print(String *str); }; class Item_func_reverse :public Item_str_func @@ -180,6 +162,7 @@ public: class Item_func_left :public Item_str_func { + String tmp_value; public: Item_func_left(Item *a,Item *b) :Item_str_func(a,b) {} String *val_str(String *); @@ -414,7 +397,8 @@ public: bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) { DBUG_ASSERT(fixed == 0); - return (item->fix_fields(thd, tlist, &item) || + return (!item->fixed && + item->fix_fields(thd, tlist, &item) || item->check_cols(1) || Item_func::fix_fields(thd, tlist, ref)); } @@ -604,6 +588,7 @@ public: class Item_func_quote :public Item_str_func { + String tmp_value; public: Item_func_quote(Item *a) :Item_str_func(a) {} const char *func_name() const { return "quote"; } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index a869e2d24fb..3a1e1918e55 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -155,6 +155,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) // did we changed top item of WHERE condition if (unit->outer_select()->where == (*ref)) unit->outer_select()->where= substitution; // correct WHERE for PS + else if (unit->outer_select()->having == (*ref)) + unit->outer_select()->having= substitution; // correct HAVING for PS (*ref)= substitution; substitution->name= name; @@ -164,12 +166,7 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) thd->where= "checking transformed subquery"; if (!(*ref)->fixed) ret= (*ref)->fix_fields(thd, tables, ref); - // We can't substitute aggregate functions like "SELECT (max(i))" - if (substype() == SINGLEROW_SUBS && (*ref)->with_sum_func) - { - my_error(ER_INVALID_GROUP_FUNC_USE, MYF(0)); - return 1; - } + thd->where= save_where; return ret; } // Is it one field subselect? @@ -180,6 +177,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) } fix_length_and_dec(); } + else + return 1; uint8 uncacheable= engine->uncacheable(); if (uncacheable) { @@ -195,15 +194,16 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) bool Item_subselect::exec() { int res; - MEM_ROOT *old_root= my_pthread_getspecific_ptr(MEM_ROOT*, THR_MALLOC); - if (&thd->mem_root != old_root) - { - my_pthread_setspecific_ptr(THR_MALLOC, &thd->mem_root); - res= engine->exec(); - my_pthread_setspecific_ptr(THR_MALLOC, old_root); - } - else - res= engine->exec(); + MEM_ROOT *old_root= thd->mem_root; + + /* + As this is execution, all objects should be allocated through the main + mem root + */ + thd->mem_root= &thd->main_mem_root; + res= engine->exec(); + thd->mem_root= old_root; + if (engine_changed) { engine_changed= 0; @@ -266,7 +266,6 @@ Item_singlerow_subselect::Item_singlerow_subselect(st_select_lex *select_lex) { DBUG_ENTER("Item_singlerow_subselect::Item_singlerow_subselect"); init(select_lex, new select_singlerow_subselect(this)); - max_columns= 1; maybe_null= 1; max_columns= UINT_MAX; DBUG_VOID_RETURN; @@ -275,7 +274,7 @@ Item_singlerow_subselect::Item_singlerow_subselect(st_select_lex *select_lex) Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max_arg) - :Item_singlerow_subselect() + :Item_singlerow_subselect(), was_values(TRUE) { DBUG_ENTER("Item_maxmin_subselect::Item_maxmin_subselect"); max= max_arg; @@ -294,12 +293,31 @@ Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, DBUG_VOID_RETURN; } +void Item_maxmin_subselect::cleanup() +{ + DBUG_ENTER("Item_maxmin_subselect::cleanup"); + Item_singlerow_subselect::cleanup(); + + /* + By default it is TRUE to avoid TRUE reporting by + Item_func_not_all/Item_func_nop_all if this item was never called. + + Engine exec() set it to FALSE by reset_value_registration() call. + select_max_min_finder_subselect::send_data() set it back to TRUE if some + value will be found. + */ + was_values= TRUE; + DBUG_VOID_RETURN; +} + + void Item_maxmin_subselect::print(String *str) { str->append(max?"<max>":"<min>", 5); Item_singlerow_subselect::print(str); } + void Item_singlerow_subselect::reset() { null_value= 1; @@ -307,6 +325,7 @@ void Item_singlerow_subselect::reset() value->null_value= 1; } + Item_subselect::trans_res Item_singlerow_subselect::select_transformer(JOIN *join) { @@ -317,11 +336,11 @@ Item_singlerow_subselect::select_transformer(JOIN *join) /* Juggle with current arena only if we're in prepared statement prepare */ Item_arena *arena= join->thd->current_arena; - Item_arena backup; if (!select_lex->master_unit()->first_select()->next_select() && !select_lex->table_list.elements && select_lex->item_list.elements == 1 && + !select_lex->item_list.head()->with_sum_func && /* We cant change name of Item_field or Item_ref, because it will prevent it's correct resolving, but we should save name of @@ -330,7 +349,13 @@ Item_singlerow_subselect::select_transformer(JOIN *join) TODO: solve above problem */ !(select_lex->item_list.head()->type() == FIELD_ITEM || - select_lex->item_list.head()->type() == REF_ITEM) + select_lex->item_list.head()->type() == REF_ITEM) && + /* + switch off this optimisation for prepare statement, + because we do not rollback this changes + TODO: make rollback for it, or special name resolving mode in 5.0. + */ + !arena->is_stmt_prepare() ) { @@ -352,9 +377,6 @@ Item_singlerow_subselect::select_transformer(JOIN *join) if (join->conds || join->having) { Item *cond; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - if (!join->having) cond= join->conds; else if (!join->conds) @@ -365,16 +387,12 @@ Item_singlerow_subselect::select_transformer(JOIN *join) if (!(substitution= new Item_func_if(cond, substitution, new Item_null()))) goto err; - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); - } + } return RES_REDUCE; } return RES_OK; err: - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); return RES_ERROR; } @@ -401,6 +419,13 @@ void Item_singlerow_subselect::fix_length_and_dec() engine->fix_length_and_dec(row); value= *row; } + /* + If there are not tables in subquery then ability to have NULL value + depends on SELECT list (if single row subquery have tables then it + always can be NULL if there are not records fetched). + */ + if (engine->no_tables()) + maybe_null= engine->may_be_null(); } uint Item_singlerow_subselect::cols() @@ -517,7 +542,7 @@ bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit) Item_in_subselect::Item_in_subselect(Item * left_exp, st_select_lex *select_lex): - Item_exists_subselect(), transformed(0), upper_not(0) + Item_exists_subselect(), transformed(0), upper_item(0) { DBUG_ENTER("Item_in_subselect::Item_in_subselect"); left_expr= left_exp; @@ -644,6 +669,7 @@ Item_subselect::trans_res Item_in_subselect::single_value_transformer(JOIN *join, Comp_creator *func) { + const char *save_where= thd->where; DBUG_ENTER("Item_in_subselect::single_value_transformer"); if (changed) @@ -652,11 +678,9 @@ Item_in_subselect::single_value_transformer(JOIN *join, } SELECT_LEX *select_lex= join->select_lex; - Item_arena *arena= join->thd->current_arena, backup; - + Item_arena *arena, backup; + arena= thd->change_arena_if_needed(&backup); thd->where= "scalar IN/ALL/ANY subquery"; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); /* Check that the right part of the subselect contains no more than one @@ -679,7 +703,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, NULL/IS NOT NULL functions). If so, we rewrite ALL/ANY with NOT EXISTS later in this method. */ - if ((abort_on_null || (upper_not && upper_not->top_level())) && + if ((abort_on_null || (upper_item && upper_item->top_level())) && !select_lex->master_unit()->uncacheable && !func->eqne_op()) { if (substitution) @@ -693,7 +717,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, !select_lex->with_sum_func && !(select_lex->next_select())) { - Item *item; + Item_sum_hybrid *item; if (func->l_op()) { /* @@ -710,6 +734,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, */ item= new Item_sum_min(*select_lex->ref_pointer_array); } + if (upper_item) + upper_item->set_sum_test(item); *select_lex->ref_pointer_array= item; { List_iterator<Item> it(select_lex->item_list); @@ -730,15 +756,19 @@ Item_in_subselect::single_value_transformer(JOIN *join, } else { + Item_maxmin_subselect *item; // remove LIMIT placed by ALL/ANY subquery select_lex->master_unit()->global_parameters->select_limit= HA_POS_ERROR; - subs= new Item_maxmin_subselect(this, select_lex, func->l_op()); + subs= item= new Item_maxmin_subselect(this, select_lex, func->l_op()); + if (upper_item) + upper_item->set_sub_test(item); } // left expression belong to outer select SELECT_LEX *current= thd->lex->current_select, *up; thd->lex->current_select= up= current->return_after_parsing(); - if (left_expr->fix_fields(thd, up->get_table_list(), &left_expr)) + if (!left_expr->fixed && + left_expr->fix_fields(thd, up->get_table_list(), &left_expr)) { thd->lex->current_select= current; goto err; @@ -769,9 +799,9 @@ Item_in_subselect::single_value_transformer(JOIN *join, As far as Item_ref_in_optimizer do not substitude itself on fix_fields we can use same item for all selects. */ - expr= new Item_ref((Item**)optimizer->get_cache(), - (char *)"<no matter>", - (char *)in_left_expr_name); + expr= new Item_direct_ref((Item**)optimizer->get_cache(), + (char *)"<no matter>", + (char *)in_left_expr_name); unit->uncacheable|= UNCACHEABLE_DEPENDENT; } @@ -862,7 +892,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, */ select_lex->having= join->having= - func->create(expr, + func->create(expr, new Item_null_helper(this, item, (char *)"<no matter>", (char *)"<result>")); @@ -889,7 +919,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SELECT_REDUCED, warn_buff); } - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(RES_REDUCE); } @@ -897,12 +927,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, } ok: - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); + thd->where= save_where; DBUG_RETURN(RES_OK); err: - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(RES_ERROR); } @@ -911,20 +942,19 @@ err: Item_subselect::trans_res Item_in_subselect::row_value_transformer(JOIN *join) { + const char *save_where= thd->where; DBUG_ENTER("Item_in_subselect::row_value_transformer"); if (changed) { DBUG_RETURN(RES_OK); } - Item_arena *arena= join->thd->current_arena, backup; + Item_arena *arena, backup; Item *item= 0; + SELECT_LEX *select_lex= join->select_lex; thd->where= "row IN/ALL/ANY subquery"; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - - SELECT_LEX *select_lex= join->select_lex; + arena= thd->change_arena_if_needed(&backup); if (select_lex->item_list.elements != left_expr->cols()) { @@ -960,14 +990,19 @@ Item_in_subselect::row_value_transformer(JOIN *join) List_iterator_fast<Item> li(select_lex->item_list); for (uint i= 0; i < n; i++) { + DBUG_ASSERT(left_expr->fixed && select_lex->ref_pointer_array[i]->fixed); + if (select_lex->ref_pointer_array[i]-> + check_cols(left_expr->el(i)->cols())) + goto err; Item *func= new Item_ref_null_helper(this, select_lex->ref_pointer_array+i, (char *) "<no matter>", (char *) "<list ref>"); func= - eq_creator.create(new Item_ref((*optimizer->get_cache())->addr(i), - (char *)"<no matter>", - (char *)in_left_expr_name), + eq_creator.create(new Item_direct_ref((*optimizer->get_cache())-> + addr(i), + (char *)"<no matter>", + (char *)in_left_expr_name), func); item= and_items(item, func); } @@ -1001,12 +1036,13 @@ Item_in_subselect::row_value_transformer(JOIN *join) if (join->conds->fix_fields(thd, join->tables_list, 0)) goto err; } - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); + thd->where= save_where; DBUG_RETURN(RES_OK); err: - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(RES_ERROR); } @@ -1039,8 +1075,8 @@ Item_subselect::trans_res Item_allany_subselect::select_transformer(JOIN *join) { transformed= 1; - if (upper_not) - upper_not->show= 1; + if (upper_item) + upper_item->show= 1; return single_value_transformer(join, func); } @@ -1086,6 +1122,7 @@ void subselect_single_select_engine::cleanup() DBUG_ENTER("subselect_single_select_engine::cleanup"); prepared= optimized= executed= 0; join= 0; + result->cleanup(); DBUG_VOID_RETURN; } @@ -1094,6 +1131,7 @@ void subselect_union_engine::cleanup() { DBUG_ENTER("subselect_union_engine::cleanup"); unit->reinit_exec_mechanism(); + result->cleanup(); DBUG_VOID_RETURN; } @@ -1101,6 +1139,10 @@ void subselect_union_engine::cleanup() void subselect_uniquesubquery_engine::cleanup() { DBUG_ENTER("subselect_uniquesubquery_engine::cleanup"); + /* + subselect_uniquesubquery_engine have not 'result' assigbed, so we do not + cleanup() it + */ DBUG_VOID_RETURN; } @@ -1245,6 +1287,7 @@ int subselect_single_select_engine::exec() } if (!executed) { + item->reset_value_registration(); join->exec(); executed= 1; join->thd->where= save_where; @@ -1383,13 +1426,15 @@ int subselect_indexsubquery_engine::exec() uint subselect_single_select_engine::cols() { - return select_lex->item_list.elements; + DBUG_ASSERT(select_lex->join); // should be called after fix_fields() + return select_lex->join->fields_list.elements; } uint subselect_union_engine::cols() { - return unit->first_select()->item_list.elements; + DBUG_ASSERT(unit->is_prepared()); // should be called after fix_fields() + return unit->types.elements; } @@ -1562,3 +1607,58 @@ int subselect_uniquesubquery_engine::change_item(Item_subselect *si, DBUG_ASSERT(0); return -1; } + + +/* + Report about presence of tables in subquery + + SINOPSYS + subselect_single_select_engine::no_tables() + + RETURN + TRUE there are not tables used in subquery + FALSE there are some tables in subquery +*/ +bool subselect_single_select_engine::no_tables() +{ + return(select_lex->table_list.elements == 0); +} + + +/* + Report about presence of tables in subquery + + SINOPSYS + subselect_union_engine::no_tables() + + RETURN + TRUE there are not tables used in subquery + FALSE there are some tables in subquery +*/ +bool subselect_union_engine::no_tables() +{ + for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select()) + { + if (sl->table_list.elements) + return FALSE; + } + return TRUE; +} + + +/* + Report about presence of tables in subquery + + SINOPSYS + subselect_uniquesubquery_engine::no_tables() + + RETURN + TRUE there are not tables used in subquery + FALSE there are some tables in subquery +*/ + +bool subselect_uniquesubquery_engine::no_tables() +{ + /* returning value is correct, but this method should never be called */ + return 0; +} diff --git a/sql/item_subselect.h b/sql/item_subselect.h index f570d89f28f..ab2d441ed7a 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -93,7 +93,7 @@ public: return null_value; } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref); - bool exec(); + virtual bool exec(); virtual void fix_length_and_dec(); table_map used_tables() const; bool const_item() const; @@ -109,6 +109,11 @@ public: engine_changed= 1; return eng == 0; } + /* + Used by max/min subquery to initialize value presence registration + mechanism. Engine call this method before rexecution query. + */ + virtual void reset_value_registration() {} friend class select_subselect; friend class Item_in_optimizer; @@ -150,13 +155,20 @@ public: }; /* used in static ALL/ANY optimisation */ +class select_max_min_finder_subselect; class Item_maxmin_subselect :public Item_singlerow_subselect { +protected: bool max; + bool was_values; // Set if we have found at least one row public: Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max); void print(String *str); + void cleanup(); + bool any_value() { return was_values; } + void register_value() { was_values= TRUE; } + void reset_value_registration() { was_values= FALSE; } }; /* exists subselect */ @@ -204,11 +216,11 @@ protected: bool abort_on_null; bool transformed; public: - Item_func_not_all *upper_not; // point on NOT before ALL subquery + Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery Item_in_subselect(Item * left_expr, st_select_lex *select_lex); Item_in_subselect() - :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_not(0) + :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_item(0) {} @@ -249,7 +261,7 @@ public: st_select_lex *select_lex, bool all); // only ALL subquery has upper not - subs_type substype() { return upper_not?ALL_SUBS:ANY_SUBS; } + subs_type substype() { return all?ALL_SUBS:ANY_SUBS; } trans_res select_transformer(JOIN *join); void print(String *str); }; @@ -291,6 +303,7 @@ public: static table_map calc_const_tables(TABLE_LIST *); virtual void print(String *str)= 0; virtual int change_item(Item_subselect *si, select_subselect *result)= 0; + virtual bool no_tables()= 0; }; @@ -315,6 +328,7 @@ public: table_map upper_select_const_tables(); void print (String *str); int change_item(Item_subselect *si, select_subselect *result); + bool no_tables(); }; @@ -335,6 +349,7 @@ public: table_map upper_select_const_tables(); void print (String *str); int change_item(Item_subselect *si, select_subselect *result); + bool no_tables(); }; @@ -364,6 +379,7 @@ public: table_map upper_select_const_tables() { return 0; } void print (String *str); int change_item(Item_subselect *si, select_subselect *result); + bool no_tables(); }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index e6c96dd6a9a..6bd2cc00b3e 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -218,16 +218,13 @@ Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) hybrid_type= item->result_type(); if (hybrid_type == INT_RESULT) { - cmp_charset= &my_charset_bin; max_length=20; } else if (hybrid_type == REAL_RESULT) { - cmp_charset= &my_charset_bin; max_length=float_length(decimals); }else { - cmp_charset= item->collation.collation; max_length=item->max_length; } decimals=item->decimals; @@ -254,7 +251,7 @@ Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) Item *Item_sum_sum::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_sum(thd, this); + return new (thd->mem_root) Item_sum_sum(thd, this); } @@ -282,7 +279,7 @@ double Item_sum_sum::val() Item *Item_sum_count::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_count(thd, this); + return new (thd->mem_root) Item_sum_count(thd, this); } @@ -327,7 +324,7 @@ void Item_sum_count::cleanup() Item *Item_sum_avg::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_avg(thd, this); + return new (thd->mem_root) Item_sum_avg(thd, this); } @@ -374,7 +371,7 @@ double Item_sum_std::val() Item *Item_sum_std::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_std(thd, this); + return new (thd->mem_root) Item_sum_std(thd, this); } @@ -384,7 +381,7 @@ Item *Item_sum_std::copy_or_same(THD* thd) Item *Item_sum_variance::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_variance(thd, this); + return new (thd->mem_root) Item_sum_variance(thd, this); } @@ -474,13 +471,14 @@ double Item_sum_hybrid::val() { DBUG_ASSERT(fixed == 1); int err; + char *end_not_used; if (null_value) return 0.0; switch (hybrid_type) { case STRING_RESULT: String *res; res=val_str(&str_value); return (res ? my_strntod(res->charset(), (char*) res->ptr(),res->length(), - (char**) 0, &err) : 0.0); + &end_not_used, &err) : 0.0); case INT_RESULT: if (unsigned_flag) return ulonglong2double(sum_int); @@ -540,13 +538,28 @@ void Item_sum_hybrid::cleanup() DBUG_ENTER("Item_sum_hybrid::cleanup"); Item_sum::cleanup(); used_table_cache= ~(table_map) 0; + + /* + by default it is TRUE to avoid TRUE reporting by + Item_func_not_all/Item_func_nop_all if this item was never called. + + no_rows_in_result() set it to FALSE if was not results found. + If some results found it will be left unchanged. + */ + was_values= TRUE; DBUG_VOID_RETURN; } +void Item_sum_hybrid::no_rows_in_result() +{ + Item_sum::no_rows_in_result(); + was_values= FALSE; +} + Item *Item_sum_min::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_min(thd, this); + return new (thd->mem_root) Item_sum_min(thd, this); } @@ -557,7 +570,7 @@ bool Item_sum_min::add() { String *result=args[0]->val_str(&tmp_value); if (!args[0]->null_value && - (null_value || sortcmp(&value,result,cmp_charset) > 0)) + (null_value || sortcmp(&value,result,collation.collation) > 0)) { value.copy(*result); null_value=0; @@ -599,7 +612,7 @@ bool Item_sum_min::add() Item *Item_sum_max::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_max(thd, this); + return new (thd->mem_root) Item_sum_max(thd, this); } @@ -610,7 +623,7 @@ bool Item_sum_max::add() { String *result=args[0]->val_str(&tmp_value); if (!args[0]->null_value && - (null_value || sortcmp(&value,result,cmp_charset) < 0)) + (null_value || sortcmp(&value,result,collation.collation) < 0)) { value.copy(*result); null_value=0; @@ -666,7 +679,7 @@ void Item_sum_bit::clear() Item *Item_sum_or::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_or(thd, this); + return new (thd->mem_root) Item_sum_or(thd, this); } @@ -680,7 +693,7 @@ bool Item_sum_or::add() Item *Item_sum_xor::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_xor(thd, this); + return new (thd->mem_root) Item_sum_xor(thd, this); } @@ -694,7 +707,7 @@ bool Item_sum_xor::add() Item *Item_sum_and::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_and(thd, this); + return new (thd->mem_root) Item_sum_and(thd, this); } @@ -921,7 +934,7 @@ Item_sum_hybrid::min_max_update_str_field() result_field->val_str(&tmp_value); if (result_field->is_null() || - (cmp_sign * sortcmp(res_str,&tmp_value,cmp_charset)) < 0) + (cmp_sign * sortcmp(res_str,&tmp_value,collation.collation)) < 0) result_field->store(res_str->ptr(),res_str->length(),res_str->charset()); result_field->set_notnull(); } @@ -1337,7 +1350,7 @@ int Item_sum_count_distinct::tree_to_myisam() Item *Item_sum_count_distinct::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_count_distinct(thd, this); + return new (thd->mem_root) Item_sum_count_distinct(thd, this); } @@ -1438,7 +1451,7 @@ bool Item_udf_sum::add() Item *Item_sum_udf_float::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_udf_float(thd, this); + return new (thd->mem_root) Item_sum_udf_float(thd, this); } double Item_sum_udf_float::val() @@ -1463,7 +1476,7 @@ String *Item_sum_udf_float::val_str(String *str) Item *Item_sum_udf_int::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_udf_int(thd, this); + return new (thd->mem_root) Item_sum_udf_int(thd, this); } @@ -1501,7 +1514,7 @@ void Item_sum_udf_str::fix_length_and_dec() Item *Item_sum_udf_str::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_udf_str(thd, this); + return new (thd->mem_root) Item_sum_udf_str(thd, this); } @@ -1815,7 +1828,7 @@ Item_func_group_concat::~Item_func_group_concat() Item *Item_func_group_concat::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_func_group_concat(thd, this); + return new (thd->mem_root) Item_func_group_concat(thd, this); } @@ -1906,7 +1919,9 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) for (i=0 ; i < arg_count ; i++) { - if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1)) + if ((!args[i]->fixed && + args[i]->fix_fields(thd, tables, args + i)) || + args[i]->check_cols(1)) return 1; if (i < arg_count_field) maybe_null|= args[i]->maybe_null; diff --git a/sql/item_sum.h b/sql/item_sum.h index 5aa0d37190b..dab136e4716 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -402,20 +402,21 @@ class Item_sum_hybrid :public Item_sum enum_field_types hybrid_field_type; int cmp_sign; table_map used_table_cache; - CHARSET_INFO *cmp_charset; + bool was_values; // Set if we have found at least one row (for max/min only) public: Item_sum_hybrid(Item *item_par,int sign) :Item_sum(item_par), sum(0.0), sum_int(0), hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG), - cmp_sign(sign), used_table_cache(~(table_map) 0), - cmp_charset(&my_charset_bin) - {} + cmp_sign(sign), used_table_cache(~(table_map) 0), was_values(TRUE) + { collation.set(&my_charset_bin); } Item_sum_hybrid(THD *thd, Item_sum_hybrid *item): Item_sum(thd, item), value(item->value), sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type), hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign), - used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {} + used_table_cache(item->used_table_cache), + was_values(TRUE) + { collation.set(item->collation); } bool fix_fields(THD *, TABLE_LIST *, Item **); table_map used_tables() const { return used_table_cache; } bool const_item() const { return !used_table_cache; } @@ -434,6 +435,8 @@ class Item_sum_hybrid :public Item_sum void min_max_update_real_field(); void min_max_update_int_field(); void cleanup(); + bool any_value() { return was_values; } + void no_rows_in_result(); }; @@ -532,7 +535,7 @@ public: :Item_sum( list ), udf(udf_arg) { quick_group=0;} Item_udf_sum(THD *thd, Item_udf_sum *item) - :Item_sum(thd, item), udf(item->udf) {} + :Item_sum(thd, item), udf(item->udf) { udf.not_original= TRUE; } const char *func_name() const { return udf.name(); } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { @@ -597,9 +600,11 @@ public: double val() { int err; - String *res; res=val_str(&str_value); + char *end_not_used; + String *res; + res=val_str(&str_value); return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(), - (char**) 0, &err) : 0.0; + &end_not_used, &err) : 0.0; } longlong val_int() { @@ -736,9 +741,10 @@ class Item_func_group_concat : public Item_sum String *res; char *end_ptr; int error; - res= val_str(&str_value); + if (!(res= val_str(&str_value))) + return (longlong) 0; end_ptr= (char*) res->ptr()+ res->length(); - return res ? my_strtoll10(res->ptr(), &end_ptr, &error) : (longlong) 0; + return my_strtoll10(res->ptr(), &end_ptr, &error); } String* val_str(String* str); Item *copy_or_same(THD* thd); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 3c8dbb013a9..2c500f16bf3 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -149,6 +149,9 @@ static DATE_TIME_FORMAT time_24hrs_format= {{0}, '\0', 0, conversion specifiers that can be used in such sub-patterns is limited. Also most of checks are skipped in this case. + If one adds new format specifiers to this function he should also + consider adding them to get_date_time_result_type() function. + RETURN 0 ok 1 error @@ -161,23 +164,24 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, { int weekday= 0, yearday= 0, daypart= 0; int week_number= -1; - CHARSET_INFO *cs= &my_charset_bin; int error= 0; + int strict_week_number_year= -1; + int frac_part; bool usa_time= 0; bool sunday_first_n_first_week_non_iso; bool strict_week_number; - int strict_week_number_year= -1; bool strict_week_number_year_type; - int frac_part; const char *val_begin= val; const char *val_end= val + length; const char *ptr= format->format.str; const char *end= ptr + format->format.length; + CHARSET_INFO *cs= &my_charset_bin; DBUG_ENTER("extract_date_time"); - LINT_INIT(sunday_first_n_first_week_non_iso); LINT_INIT(strict_week_number); - LINT_INIT(strict_week_number_year_type); + /* Remove valgrind varnings when using gcc 3.3 and -O1 */ + PURIFY_OR_LINT_INIT(strict_week_number_year_type); + PURIFY_OR_LINT_INIT(sunday_first_n_first_week_non_iso); if (!sub_pattern_end) bzero((char*) l_time, sizeof(*l_time)); @@ -1593,6 +1597,7 @@ void Item_func_from_unixtime::fix_length_and_dec() collation.set(&my_charset_bin); decimals=0; max_length=MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; thd->time_zone_used= 1; } @@ -1600,50 +1605,47 @@ void Item_func_from_unixtime::fix_length_and_dec() String *Item_func_from_unixtime::val_str(String *str) { TIME time_tmp; - my_time_t tmp; - + DBUG_ASSERT(fixed == 1); - tmp= (time_t) args[0]->val_int(); - if ((null_value=args[0]->null_value)) - goto null_date; - - thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, tmp); - + + if (get_date(&time_tmp, 0)) + return 0; + if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN)) - goto null_date; + { + null_value= 1; + return 0; + } + make_datetime((DATE_TIME_FORMAT *) 0, &time_tmp, str); return str; - -null_date: - null_value=1; - return 0; } longlong Item_func_from_unixtime::val_int() { TIME time_tmp; - my_time_t tmp; - + DBUG_ASSERT(fixed == 1); - tmp= (time_t) (ulong) args[0]->val_int(); - if ((null_value=args[0]->null_value)) + if (get_date(&time_tmp, 0)) return 0; - - current_thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, tmp); - + return (longlong) TIME_to_ulonglong_datetime(&time_tmp); } bool Item_func_from_unixtime::get_date(TIME *ltime, uint fuzzy_date __attribute__((unused))) { - my_time_t tmp=(my_time_t) args[0]->val_int(); - if ((null_value=args[0]->null_value)) + ulonglong tmp= (ulonglong)(args[0]->val_int()); + /* + "tmp > TIMESTAMP_MAX_VALUE" check also covers case of negative + from_unixtime() argument since tmp is unsigned. + */ + if ((null_value= (args[0]->null_value || tmp > TIMESTAMP_MAX_VALUE))) return 1; - - current_thd->variables.time_zone->gmt_sec_to_TIME(ltime, tmp); + + thd->variables.time_zone->gmt_sec_to_TIME(ltime, (my_time_t)tmp); return 0; } @@ -1654,6 +1656,7 @@ void Item_func_convert_tz::fix_length_and_dec() collation.set(&my_charset_bin); decimals= 0; max_length= MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; } @@ -1666,12 +1669,6 @@ Item_func_convert_tz::fix_fields(THD *thd_arg, TABLE_LIST *tables_arg, Item **re tz_tables= thd_arg->lex->time_zone_tables_used; - if (args[1]->const_item()) - from_tz= my_tz_find(args[1]->val_str(&str), tz_tables); - - if (args[2]->const_item()) - to_tz= my_tz_find(args[2]->val_str(&str), tz_tables); - return 0; } @@ -1711,13 +1708,19 @@ bool Item_func_convert_tz::get_date(TIME *ltime, my_time_t my_time_tmp; bool not_used; String str; - - if (!args[1]->const_item()) + + if (!from_tz_cached) + { from_tz= my_tz_find(args[1]->val_str(&str), tz_tables); - - if (!args[2]->const_item()) + from_tz_cached= args[1]->const_item(); + } + + if (!to_tz_cached) + { to_tz= my_tz_find(args[2]->val_str(&str), tz_tables); - + to_tz_cached= args[2]->const_item(); + } + if (from_tz==0 || to_tz==0 || get_arg0_date(ltime, 0)) { null_value= 1; @@ -1739,6 +1742,13 @@ bool Item_func_convert_tz::get_date(TIME *ltime, } +void Item_func_convert_tz::cleanup() +{ + from_tz_cached= to_tz_cached= 0; + Item_date_func::cleanup(); +} + + void Item_date_add_interval::fix_length_and_dec() { enum_field_types arg0_field_type; @@ -2110,19 +2120,24 @@ void Item_char_typecast::print(String *str) String *Item_char_typecast::val_str(String *str) { DBUG_ASSERT(fixed == 1); - String *res, *res1; + String *res; uint32 length; - if (!charset_conversion && !(res= args[0]->val_str(str))) + if (!charset_conversion) { - null_value= 1; - return 0; + if (!(res= args[0]->val_str(str))) + { + null_value= 1; + return 0; + } } else { // Convert character set if differ - if (!(res1= args[0]->val_str(&tmp_value)) || - str->copy(res1->ptr(), res1->length(),res1->charset(), cast_cs)) + uint dummy_errors; + if (!(res= args[0]->val_str(&tmp_value)) || + str->copy(res->ptr(), res->length(), res->charset(), + cast_cs, &dummy_errors)) { null_value= 1; return 0; @@ -2131,13 +2146,13 @@ String *Item_char_typecast::val_str(String *str) } res->set_charset(cast_cs); - + /* Cut the tail if cast with length and the result is longer than cast length, e.g. CAST('string' AS CHAR(1)) */ - if (cast_length >= 0 && + if (cast_length >= 0 && (res->length() > (length= (uint32) res->charpos(cast_length)))) { // Safe even if const arg if (!res->alloced_length()) @@ -2146,7 +2161,7 @@ String *Item_char_typecast::val_str(String *str) res= &str_value; } res->length((uint) length); - } + } null_value= 0; return res; } @@ -2154,9 +2169,18 @@ String *Item_char_typecast::val_str(String *str) void Item_char_typecast::fix_length_and_dec() { uint32 char_length; - charset_conversion= !my_charset_same(args[0]->collation.collation, cast_cs) && - args[0]->collation.collation != &my_charset_bin && - cast_cs != &my_charset_bin; + /* + We always force character set conversion if cast_cs + is a multi-byte character set. It garantees that the + result of CAST is a well-formed string. + For single-byte character sets we allow just to copy + from the argument. A single-byte character sets string + is always well-formed. + */ + charset_conversion= (cast_cs->mbmaxlen > 1) || + !my_charset_same(args[0]->collation.collation, cast_cs) && + args[0]->collation.collation != &my_charset_bin && + cast_cs != &my_charset_bin; collation.set(cast_cs, DERIVATION_IMPLICIT); char_length= (cast_length >= 0) ? cast_length : args[0]->max_length/args[0]->collation.collation->mbmaxlen; @@ -2181,6 +2205,12 @@ String *Item_datetime_typecast::val_str(String *str) bool Item_time_typecast::get_time(TIME *ltime) { bool res= get_arg0_time(ltime); + /* + For MYSQL_TIMESTAMP_TIME value we can have non-zero day part, + which we should not lose. + */ + if (ltime->time_type == MYSQL_TIMESTAMP_DATETIME) + ltime->year= ltime->month= ltime->day= 0; ltime->time_type= MYSQL_TIMESTAMP_TIME; return res; } @@ -2204,6 +2234,7 @@ String *Item_time_typecast::val_str(String *str) bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date) { bool res= get_arg0_date(ltime,1); + ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0; ltime->time_type= MYSQL_TIMESTAMP_DATE; return res; } @@ -2421,8 +2452,7 @@ void Item_func_add_time::print(String *str) String *Item_func_timediff::val_str(String *str) { DBUG_ASSERT(fixed == 1); - longlong seconds; - long microseconds; + longlong microseconds; long days; int l_sign= 1; TIME l_time1 ,l_time2, l_time3; @@ -2446,32 +2476,23 @@ String *Item_func_timediff::val_str(String *str) (uint) l_time2.month, (uint) l_time2.day)); - microseconds= l_time1.second_part - l_sign*l_time2.second_part; - seconds= ((longlong) days*86400L + l_time1.hour*3600L + - l_time1.minute*60L + l_time1.second + microseconds/1000000L - - (longlong)l_sign*(l_time2.hour*3600L+l_time2.minute*60L+ - l_time2.second)); + microseconds= ((longlong)days*86400L + + l_time1.hour*3600L + l_time1.minute*60L + l_time1.second - + (longlong)l_sign*(l_time2.hour*3600L + l_time2.minute*60L + + l_time2.second))*1000000 + + l_time1.second_part - l_sign*l_time2.second_part; l_time3.neg= 0; - if (seconds < 0) - { - seconds= -seconds; - l_time3.neg= 1; - } - else if (seconds == 0 && microseconds < 0) + if (microseconds < 0) { microseconds= -microseconds; l_time3.neg= 1; } - if (microseconds < 0) - { - microseconds+= 1000000L; - seconds--; - } - if ((l_time2.neg == l_time1.neg) && l_time1.neg) + if ((l_time2.neg == l_time1.neg) && l_time1.neg && microseconds) l_time3.neg= l_time3.neg ? 0 : 1; - calc_time_from_sec(&l_time3, (long) seconds, microseconds); + calc_time_from_sec(&l_time3, (long)(microseconds/1000000), + (long)(microseconds%1000000)); if (!make_datetime(l_time1.second_part || l_time2.second_part ? TIME_MICROSECOND : TIME_ONLY, @@ -2596,25 +2617,31 @@ void Item_func_get_format::print(String *str) /* - check_result_type(s, l) returns DATE/TIME type - according to format string - - s: DATE/TIME format string - l: length of s - Result: date_time_format_types value: - DATE_TIME_MICROSECOND, DATE_TIME, - TIME_MICROSECOND, TIME_ONLY - - We don't process day format's characters('D', 'd', 'e') - because day may be a member of all date/time types. - If only day format's character and no time part present - the result type is MYSQL_TYPE_DATE + Get type of datetime value (DATE/TIME/...) which will be produced + according to format string. + + SYNOPSIS + get_date_time_result_type() + format - format string + length - length of format string + + NOTE + We don't process day format's characters('D', 'd', 'e') because day + may be a member of all date/time types. + + Format specifiers supported by this function should be in sync with + specifiers supported by extract_date_time() function. + + RETURN VALUE + One of date_time_format_types values: + DATE_TIME_MICROSECOND, DATE_TIME, DATE_ONLY, TIME_MICROSECOND, TIME_ONLY */ -date_time_format_types check_result_type(const char *format, uint length) +static date_time_format_types +get_date_time_result_type(const char *format, uint length) { const char *time_part_frms= "HISThiklrs"; - const char *date_part_frms= "MUYWabcjmuyw"; + const char *date_part_frms= "MVUXYWabcjmvuxyw"; bool date_part_used= 0, time_part_used= 0, frac_second_used= 0; const char *val= format; @@ -2625,22 +2652,30 @@ date_time_format_types check_result_type(const char *format, uint length) if (*val == '%' && val+1 != end) { val++; - if ((frac_second_used= (*val == 'f')) || - (!time_part_used && strchr(time_part_frms, *val))) + if (*val == 'f') + frac_second_used= time_part_used= 1; + else if (!time_part_used && strchr(time_part_frms, *val)) time_part_used= 1; else if (!date_part_used && strchr(date_part_frms, *val)) date_part_used= 1; - if (time_part_used && date_part_used && frac_second_used) + if (date_part_used && frac_second_used) + { + /* + frac_second_used implies time_part_used, and thus we already + have all types of date-time components and can end our search. + */ return DATE_TIME_MICROSECOND; + } } } + /* We don't have all three types of date-time components */ + if (frac_second_used) + return TIME_MICROSECOND; if (time_part_used) { if (date_part_used) return DATE_TIME; - if (frac_second_used) - return TIME_MICROSECOND; return TIME_ONLY; } return DATE_ONLY; @@ -2671,7 +2706,8 @@ void Item_func_str_to_date::fix_length_and_dec() if ((const_item= args[1]->const_item())) { format= args[1]->val_str(&format_str); - cached_format_type= check_result_type(format->ptr(), format->length()); + cached_format_type= get_date_time_result_type(format->ptr(), + format->length()); switch (cached_format_type) { case DATE_ONLY: cached_timestamp_type= MYSQL_TIMESTAMP_DATE; diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index df0b05d6d42..cc2709bf555 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -545,12 +545,15 @@ class Item_func_convert_tz :public Item_date_func TABLE_LIST *tz_tables; /* If time zone parameters are constants we are caching objects that - represent them. + represent them (we use separate from_tz_cached/to_tz_cached members + to indicate this fact, since NULL is legal value for from_tz/to_tz + members. */ + bool from_tz_cached, to_tz_cached; Time_zone *from_tz, *to_tz; public: Item_func_convert_tz(Item *a, Item *b, Item *c): - Item_date_func(a, b, c) {} + Item_date_func(a, b, c), from_tz_cached(0), to_tz_cached(0) {} longlong val_int(); double val() { return (double) val_int(); } String *val_str(String *str); @@ -558,6 +561,7 @@ class Item_func_convert_tz :public Item_date_func bool fix_fields(THD *, struct st_table_list *, Item **); void fix_length_and_dec(); bool get_date(TIME *res, uint fuzzy_date); + void cleanup(); }; diff --git a/sql/lex.h b/sql/lex.h index c64a7069c32..325d052de90 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -114,6 +114,7 @@ static SYMBOL symbols[] = { { "COMMITTED", SYM(COMMITTED_SYM)}, { "COMPRESSED", SYM(COMPRESSED_SYM)}, { "CONCURRENT", SYM(CONCURRENT)}, + { "CONSISTENT", SYM(CONSISTENT_SYM)}, { "CONSTRAINT", SYM(CONSTRAINT)}, { "CONVERT", SYM(CONVERT_SYM)}, { "CREATE", SYM(CREATE)}, @@ -382,6 +383,7 @@ static SYMBOL symbols[] = { { "SIGNED", SYM(SIGNED_SYM)}, { "SIMPLE", SYM(SIMPLE_SYM)}, { "SLAVE", SYM(SLAVE)}, + { "SNAPSHOT", SYM(SNAPSHOT_SYM)}, { "SMALLINT", SYM(SMALLINT)}, { "SOME", SYM(ANY_SYM)}, { "SONAME", SYM(UDF_SONAME_SYM)}, diff --git a/sql/lock.cc b/sql/lock.cc index 646babea6a1..8f1cd080db7 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -705,15 +705,70 @@ static void print_lock_error(int error) /**************************************************************************** Handling of global read locks + Taking the global read lock is TWO steps (2nd step is optional; without + it, COMMIT of existing transactions will be allowed): + lock_global_read_lock() THEN make_global_read_lock_block_commit(). + The global locks are handled through the global variables: global_read_lock + count of threads which have the global read lock (i.e. have completed at + least the first step above) global_read_lock_blocks_commit - waiting_for_read_lock + count of threads which have the global read lock and block + commits (i.e. are in or have completed the second step above) + waiting_for_read_lock + count of threads which want to take a global read lock but cannot protect_against_global_read_lock + count of threads which have set protection against global read lock. + + How blocking of threads by global read lock is achieved: that's + advisory. Any piece of code which should be blocked by global read lock must + be designed like this: + - call to wait_if_global_read_lock(). When this returns 0, no global read + lock is owned; if argument abort_on_refresh was 0, none can be obtained. + - job + - if abort_on_refresh was 0, call to start_waiting_global_read_lock() to + allow other threads to get the global read lock. I.e. removal of the + protection. + (Note: it's a bit like an implementation of rwlock). + + [ I am sorry to mention some SQL syntaxes below I know I shouldn't but found + no better descriptive way ] + + Why does FLUSH TABLES WITH READ LOCK need to block COMMIT: because it's used + to read a non-moving SHOW MASTER STATUS, and a COMMIT writes to the binary + log. + + Why getting the global read lock is two steps and not one. Because FLUSH + TABLES WITH READ LOCK needs to insert one other step between the two: + flushing tables. So the order is + 1) lock_global_read_lock() (prevents any new table write locks, i.e. stalls + all new updates) + 2) close_cached_tables() (the FLUSH TABLES), which will wait for tables + currently opened and being updated to close (so it's possible that there is + a moment where all new updates of server are stalled *and* FLUSH TABLES WITH + READ LOCK is, too). + 3) make_global_read_lock_block_commit(). + If we have merged 1) and 3) into 1), we would have had this deadlock: + imagine thread 1 and 2, in non-autocommit mode, thread 3, and an InnoDB + table t. + thd1: SELECT * FROM t FOR UPDATE; + thd2: UPDATE t SET a=1; # blocked by row-level locks of thd1 + thd3: FLUSH TABLES WITH READ LOCK; # blocked in close_cached_tables() by the + table instance of thd2 + thd1: COMMIT; # blocked by thd3. + thd1 blocks thd2 which blocks thd3 which blocks thd1: deadlock. + + Note that we need to support that one thread does + FLUSH TABLES WITH READ LOCK; and then COMMIT; + (that's what innobackup does, for some good reason). + So in this exceptional case the COMMIT should not be blocked by the FLUSH + TABLES WITH READ LOCK. + + TODO in MySQL 5.x: make_global_read_lock_block_commit() should be + killable. Normally CPU does not spend a long time in this function (COMMITs + are quite fast), but it would still be nice. - Taking the global read lock is TWO steps (2nd step is optional; without - it, COMMIT of existing transactions will be allowed): - lock_global_read_lock() THEN make_global_read_lock_block_commit(). ****************************************************************************/ volatile uint global_read_lock=0; @@ -828,8 +883,11 @@ void start_waiting_global_read_lock(THD *thd) { bool tmp; DBUG_ENTER("start_waiting_global_read_lock"); + if (unlikely(thd->global_read_lock)) + DBUG_VOID_RETURN; (void) pthread_mutex_lock(&LOCK_open); - tmp= (!--protect_against_global_read_lock && waiting_for_read_lock); + tmp= (!--protect_against_global_read_lock && + (waiting_for_read_lock || global_read_lock_blocks_commit)); (void) pthread_mutex_unlock(&LOCK_open); if (tmp) pthread_cond_broadcast(&COND_refresh); diff --git a/sql/log.cc b/sql/log.cc index ef57a57d3b4..c8a3b512b6d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -23,7 +23,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_repl.h" #include "ha_innodb.h" // necessary to cut the binlog when crash recovery @@ -256,7 +255,9 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, if ((file=my_open(log_file_name,open_flags, MYF(MY_WME | ME_WAITTANG))) < 0 || init_io_cache(&log_file, file, IO_SIZE, io_cache_type, - my_tell(file,MYF(MY_WME)), 0, MYF(MY_WME | MY_NABP))) + my_tell(file,MYF(MY_WME)), 0, + MYF(MY_WME | MY_NABP | + ((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0)))) goto err; switch (log_type) { @@ -334,6 +335,8 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, First open of this class instance Create an index file that will hold all file names uses for logging. Add new entries to the end of it. + Index file (and binlog) are so critical for recovery/replication + that we create them with MY_WAIT_IF_FULL. */ fn_format(index_file_name, index_file_name_arg, mysql_data_home, ".index", opt); @@ -344,7 +347,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, init_io_cache(&index_file, index_file_nr, IO_SIZE, WRITE_CACHE, my_seek(index_file_nr,0L,MY_SEEK_END,MYF(0)), - 0, MYF(MY_WME))) + 0, MYF(MY_WME | MY_WAIT_IF_FULL))) goto err; } else @@ -1271,10 +1274,10 @@ bool MYSQL_LOG::write(Log_event* event_info) binlog_[wild_]{do|ignore}_table?" (WL#1049)" */ if ((thd && !(thd->options & OPTION_BIN_LOG)) || - (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db))) + (!db_ok(local_db, binlog_do_db, binlog_ignore_db))) { VOID(pthread_mutex_unlock(&LOCK_log)); - DBUG_PRINT("error",("!db_ok")); + DBUG_PRINT("error",("!db_ok('%s')", local_db)); DBUG_RETURN(0); } #endif /* HAVE_REPLICATION */ @@ -1317,8 +1320,9 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", (uint) thd->variables.collation_connection->number, (uint) thd->variables.collation_database->number, (uint) thd->variables.collation_server->number); - Query_log_event e(thd, buf, written, 0); + Query_log_event e(thd, buf, written, 0, FALSE); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } @@ -1333,8 +1337,9 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", char *buf_end= strxmov(buf, "SET ONE_SHOT TIME_ZONE='", thd->variables.time_zone->get_name()->ptr(), "'", NullS); - Query_log_event e(thd, buf, buf_end - buf, 0); + Query_log_event e(thd, buf, buf_end - buf, 0, FALSE); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } @@ -1387,6 +1392,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", thd->variables.convert_set->name); Query_log_event e(thd, buf, (ulong) (p - buf), 0); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } @@ -1402,14 +1408,24 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) { - Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0); + Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0, FALSE); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } } - /* Write the SQL command */ + /* + Write the SQL command + + [1] If this statement has an error code, the slave is required to fail + with the same error code or stop. The preamble and epilogue should + *not* have this error code since the execution of those is + guaranteed *not* to produce any error code. This would therefore + stop the slave even if the execution of the real statement can be + handled gracefully by the slave. + */ event_info->set_log_pos(this); if (event_info->write(file)) @@ -1421,8 +1437,9 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", { if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) { - Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0); + Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0, FALSE); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } @@ -1450,7 +1467,8 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", if (flush_io_cache(file) || sync_binlog(file)) goto err; - if (opt_using_transactions && !my_b_tell(&thd->transaction.trans_log)) + if (opt_using_transactions && + !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { /* LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog @@ -1574,6 +1592,7 @@ uint MYSQL_LOG::next_file_id() bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) { + bool should_rotate= 0, error= 0; VOID(pthread_mutex_lock(&LOCK_log)); DBUG_ENTER("MYSQL_LOG::write(cache"); @@ -1596,7 +1615,15 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) we will add the "COMMIT mark and write the buffer to the binlog. */ { - Query_log_event qinfo(thd, "BEGIN", 5, TRUE); + Query_log_event qinfo(thd, "BEGIN", 5, TRUE, FALSE); + /* + Imagine this is rollback due to net timeout, after all statements of + the transaction succeeded. Then we want a zero-error code in BEGIN. + In other words, if there was a really serious error code it's already + in the statement's events. + This is safer than thd->clear_error() against kills at shutdown. + */ + qinfo.error_code= 0; /* Now this Query_log_event has artificial log_pos 0. It must be adjusted to reflect the real position in the log. Not doing it would confuse the @@ -1629,7 +1656,8 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) Query_log_event qinfo(thd, commit_or_rollback ? "COMMIT" : "ROLLBACK", commit_or_rollback ? 6 : 8, - TRUE); + TRUE, FALSE); + qinfo.error_code= 0; qinfo.set_log_pos(this); if (qinfo.write(&log_file) || flush_io_cache(&log_file) || sync_binlog(&log_file)) @@ -1662,7 +1690,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) goto err; signal_update(); DBUG_PRINT("info",("max_size: %lu",max_size)); - if (my_b_tell(&log_file) >= (my_off_t) max_size) + if (should_rotate= (my_b_tell(&log_file) >= (my_off_t) max_size)) { pthread_mutex_lock(&LOCK_index); new_file(0); // inside mutex @@ -1678,7 +1706,16 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) ha_commit_complete(thd); - DBUG_RETURN(0); +#ifdef HAVE_REPLICATION + if (should_rotate && expire_logs_days) + { + long purge_time= time(0) - expire_logs_days*24*60*60; + if (purge_time >= 0) + error= purge_logs_before_date(purge_time); + } +#endif + + DBUG_RETURN(error); err: if (!write_error) @@ -1703,6 +1740,8 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, time_t current_time; if (!is_open()) return 0; + DBUG_ENTER("MYSQL_LOG::write"); + VOID(pthread_mutex_lock(&LOCK_log)); if (is_open()) { // Safety agains reopen @@ -1712,7 +1751,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, if (!(thd->options & OPTION_UPDATE_LOG)) { VOID(pthread_mutex_unlock(&LOCK_log)); - return 0; + DBUG_RETURN(0); } if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT) || query_start_arg) { @@ -1812,7 +1851,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, } } VOID(pthread_mutex_unlock(&LOCK_log)); - return error; + DBUG_RETURN(error); } @@ -1832,16 +1871,19 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, THD::enter_cond() (see NOTES in sql_class.h). */ -void MYSQL_LOG:: wait_for_update(THD* thd, bool master_or_slave) +void MYSQL_LOG::wait_for_update(THD* thd, bool master_or_slave) { - const char* old_msg = thd->enter_cond(&update_cond, &LOCK_log, - master_or_slave ? - "Has read all relay log; waiting for \ -the slave I/O thread to update it" : - "Has sent all binlog to slave; \ -waiting for binlog to be updated"); + const char *old_msg; + DBUG_ENTER("wait_for_update"); + old_msg= thd->enter_cond(&update_cond, &LOCK_log, + master_or_slave ? + "Has read all relay log; waiting for the slave I/O " + "thread to update it" : + "Has sent all binlog to slave; waiting for binlog " + "to be updated"); pthread_cond_wait(&update_cond, &LOCK_log); thd->exit_cond(old_msg); + DBUG_VOID_RETURN; } @@ -2022,6 +2064,7 @@ bool flush_error_log() char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-4); strmov(end, "-old"); + VOID(pthread_mutex_lock(&LOCK_error_log)); #ifdef __WIN__ char err_temp[FN_REFLEN+4]; /* @@ -2042,7 +2085,7 @@ bool flush_error_log() if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0) { while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0) - my_fwrite(stderr, (byte*) buf, (uint) strlen(buf),MYF(0)); + my_fwrite(stderr, (byte*) buf, bytes, MYF(0)); my_close(fd, MYF(0)); } (void) my_delete(err_temp, MYF(0)); @@ -2056,6 +2099,7 @@ bool flush_error_log() else result= 1; #endif + VOID(pthread_mutex_unlock(&LOCK_error_log)); } return result; } @@ -2198,6 +2242,15 @@ void MYSQL_LOG::report_pos_in_innodb() DBUG_VOID_RETURN; } + +void MYSQL_LOG::signal_update() +{ + DBUG_ENTER("MYSQL_LOG::signal_update"); + pthread_cond_broadcast(&update_cond); + DBUG_VOID_RETURN; +} + + #ifdef __NT__ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, uint length, int buffLen) @@ -2208,9 +2261,9 @@ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, DBUG_ENTER("print_buffer_to_nt_eventlog"); buffptr= buff; - if (length > (uint)(buffLen-4)) + if (length > (uint)(buffLen-5)) { - char *newBuff= new char[length + 4]; + char *newBuff= new char[length + 5]; strcpy(newBuff, buff); buffptr= newBuff; } diff --git a/sql/log_event.cc b/sql/log_event.cc index 326f2fc5c59..d1af78dd751 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -373,6 +373,9 @@ int Log_event::exec_event(struct st_relay_log_info* rli) Note that Rotate_log_event::exec_event() does not call this function, so there is no chance that a fake rotate event resets last_master_timestamp. + Note that we update without mutex (probably ok - except in some very + rare cases, only consequence is that value may take some time to + display in Seconds_Behind_Master - not critical). */ rli->last_master_timestamp= when; } @@ -780,7 +783,8 @@ void Query_log_event::pack_info(Protocol *protocol) if (!(buf= my_malloc(9 + db_len + q_len, MYF(MY_WME)))) return; pos= buf; - if (db && db_len) + if (!(flags & LOG_EVENT_SUPPRESS_USE_F) + && db && db_len) { pos= strmov(buf, "use `"); memcpy(pos, db, db_len); @@ -872,9 +876,12 @@ int Query_log_event::write_data(IO_CACHE* file) #ifndef MYSQL_CLIENT Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, - ulong query_length, bool using_trans) - :Log_event(thd_arg, !thd_arg->tmp_table_used ? - 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), + ulong query_length, bool using_trans, + bool suppress_use) + :Log_event(thd_arg, + ((thd_arg->tmp_table_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0) + | (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0)), + using_trans), data_buf(0), query(query_arg), db(thd_arg->db), q_len((uint32) query_length), error_code(thd_arg->killed ? @@ -949,14 +956,20 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) bool different_db= 1; - if (db && last_db) + if (!(flags & LOG_EVENT_SUPPRESS_USE_F)) { - if (different_db= memcmp(last_db, db, db_len + 1)) - memcpy(last_db, db, db_len + 1); + if (db && last_db) + { + if (different_db= memcmp(last_db, db, db_len + 1)) + memcpy(last_db, db, db_len + 1); + } + + if (db && db[0] && different_db) + { + fprintf(file, "use %s;\n", db); + } } - - if (db && db[0] && different_db) - fprintf(file, "use %s;\n", db); + end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10); *end++=';'; *end++='\n'; @@ -977,7 +990,8 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) int Query_log_event::exec_event(struct st_relay_log_info* rli) { int expected_error,actual_error= 0; - thd->db= (char*) rewrite_db(db); // thd->db_length is set later if needed + thd->db_length= db_len; + thd->db= (char*) rewrite_db(db, &thd->db_length); /* InnoDB internally stores the master log position it has processed so far; @@ -995,11 +1009,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) if (db_ok(thd->db, replicate_do_db, replicate_ignore_db)) { thd->set_time((time_t)when); - /* - We cannot use db_len from event to fill thd->db_length, because - rewrite_db() may have changed db. - */ - thd->db_length= thd->db ? strlen(thd->db) : 0; thd->query_length= q_len; thd->query = (char*)query; VOID(pthread_mutex_lock(&LOCK_thread_count)); @@ -1007,7 +1016,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) VOID(pthread_mutex_unlock(&LOCK_thread_count)); thd->variables.pseudo_thread_id= thread_id; // for temp tables - mysql_log.write(thd,COM_QUERY,"%s",thd->query); DBUG_PRINT("query",("%s",thd->query)); if (ignored_error_code((expected_error= error_code)) || !check_expected_error(thd,rli,expected_error)) @@ -1037,6 +1045,10 @@ START SLAVE; . Query: '%s'", expected_error, thd->query); goto end; } + /* If the query was not ignored, it is printed to the general log */ + if (thd->net.last_errno != ER_SLAVE_IGNORED_TABLE) + mysql_log.write(thd,COM_QUERY,"%s",thd->query); + /* If we expected a non-zero error code, and we don't get the same error code, and none of them should be ignored. @@ -1057,7 +1069,7 @@ Default database: '%s'. Query: '%s'", expected_error, actual_error ? thd->net.last_error: "no error", actual_error, - print_slave_db_safe(db), query); + print_slave_db_safe(thd->db), query); thd->query_error= 1; } /* @@ -1078,7 +1090,7 @@ Default database: '%s'. Query: '%s'", "Error '%s' on query. Default database: '%s'. Query: '%s'", (actual_error ? thd->net.last_error : "unexpected success or fatal error"), - print_slave_db_safe(db), query); + print_slave_db_safe(thd->db), query); thd->query_error= 1; } } /* End of if (db_ok(... */ @@ -1090,7 +1102,7 @@ end: thd->query_length= thd->db_length =0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); close_thread_tables(thd); - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); /* If there was an error we stop. Otherwise we increment positions. Note that we will not increment group* positions if we are just after a SET @@ -1409,8 +1421,10 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, const char *db_arg, const char *table_name_arg, List<Item> &fields_arg, enum enum_duplicates handle_dup, - bool using_trans) - :Log_event(thd_arg, 0, using_trans), thread_id(thd_arg->thread_id), + bool ignore, bool using_trans) + :Log_event(thd_arg, !thd_arg->tmp_table_used ? + 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), + thread_id(thd_arg->thread_id), slave_proxy_id(thd_arg->variables.pseudo_thread_id), num_fields(0),fields(0), field_lens(0),field_block_len(0), @@ -1445,9 +1459,6 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, sql_ex.empty_flags= 0; switch (handle_dup) { - case DUP_IGNORE: - sql_ex.opt_flags|= IGNORE_FLAG; - break; case DUP_REPLACE: sql_ex.opt_flags|= REPLACE_FLAG; break; @@ -1455,6 +1466,8 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, case DUP_ERROR: break; } + if (ignore) + sql_ex.opt_flags|= IGNORE_FLAG; if (!ex->field_term->length()) sql_ex.empty_flags |= FIELD_TERM_EMPTY; @@ -1600,6 +1613,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db, commented ? "# " : "", db); + if (flags & LOG_EVENT_THREAD_SPECIFIC_F) + fprintf(file,"%sSET @@session.pseudo_thread_id=%lu;\n", + commented ? "# " : "", (ulong)thread_id); fprintf(file, "%sLOAD DATA ", commented ? "# " : ""); if (check_fname_outside_temp_buf()) @@ -1659,16 +1675,22 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db, /* Load_log_event::set_fields() + + Note that this function can not use the member variable + for the database, since LOAD DATA INFILE on the slave + can be for a different database than the current one. + This is the reason for the affected_db argument to this method. */ #ifndef MYSQL_CLIENT -void Load_log_event::set_fields(List<Item> &field_list) +void Load_log_event::set_fields(const char* affected_db, + List<Item> &field_list) { uint i; const char* field = fields; for (i= 0; i < num_fields; i++) { - field_list.push_back(new Item_field(db, table_name, field)); + field_list.push_back(new Item_field(affected_db, table_name, field)); field+= field_lens[i] + 1; } } @@ -1706,7 +1728,8 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, bool use_rli_only_for_errors) { char *load_data_query= 0; - thd->db= (char*) rewrite_db(db); // thd->db_length is set later if needed + thd->db_length= db_len; + thd->db= (char*) rewrite_db(db, &thd->db_length); DBUG_ASSERT(thd->query == 0); thd->query_length= 0; // Should not be needed thd->query_error= 0; @@ -1741,7 +1764,6 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, if (db_ok(thd->db, replicate_do_db, replicate_ignore_db)) { thd->set_time((time_t)when); - thd->db_length= thd->db ? strlen(thd->db) : 0; VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query_id = query_id++; VOID(pthread_mutex_unlock(&LOCK_thread_count)); @@ -1771,6 +1793,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, { char llbuff[22]; enum enum_duplicates handle_dup; + bool ignore= 0; /* Make a simplified LOAD DATA INFILE query, for the information of the user in SHOW PROCESSLIST. Note that db is known in the 'db' column. @@ -1787,21 +1810,24 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, if (sql_ex.opt_flags & REPLACE_FLAG) handle_dup= DUP_REPLACE; else if (sql_ex.opt_flags & IGNORE_FLAG) - handle_dup= DUP_IGNORE; + { + ignore= 1; + handle_dup= DUP_ERROR; + } else { /* When replication is running fine, if it was DUP_ERROR on the - master then we could choose DUP_IGNORE here, because if DUP_ERROR + master then we could choose IGNORE here, because if DUP_ERROR suceeded on master, and data is identical on the master and slave, - then there should be no uniqueness errors on slave, so DUP_IGNORE is + then there should be no uniqueness errors on slave, so IGNORE is the same as DUP_ERROR. But in the unlikely case of uniqueness errors (because the data on the master and slave happen to be different (user error or bug), we want LOAD DATA to print an error message on the slave to discover the problem. If reading from net (a 3.23 master), mysql_load() will change this - to DUP_IGNORE. + to IGNORE. */ handle_dup= DUP_ERROR; } @@ -1824,7 +1850,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, ex.skip_lines = skip_lines; List<Item> field_list; - set_fields(field_list); + set_fields(thd->db,field_list); thd->variables.pseudo_thread_id= thread_id; if (net) { @@ -1835,19 +1861,19 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, */ thd->net.pkt_nr = net->pkt_nr; } - if (mysql_load(thd, &ex, &tables, field_list, handle_dup, net != 0, + if (mysql_load(thd, &ex, &tables, field_list, handle_dup, ignore, net != 0, TL_WRITE)) thd->query_error = 1; if (thd->cuted_fields) { /* log_pos is the position of the LOAD event in the master log */ - sql_print_error("\ -Slave: load data infile on table '%s' at log position %s in log \ -'%s' produced %ld warning(s). Default database: '%s'", - (char*) table_name, - llstr(log_pos,llbuff), RPL_LOG_NAME, - (ulong) thd->cuted_fields, - print_slave_db_safe(db)); + sql_print_warning("Slave: load data infile on table '%s' at " + "log position %s in log '%s' produced %ld " + "warning(s). Default database: '%s'", + (char*) table_name, + llstr(log_pos,llbuff), RPL_LOG_NAME, + (ulong) thd->cuted_fields, + print_slave_db_safe(thd->db)); } if (net) net->pkt_nr= thd->net.pkt_nr; @@ -1865,6 +1891,7 @@ Slave: load data infile on table '%s' at log position %s in log \ } thd->net.vio = 0; + char *save_db= thd->db; VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->db= 0; thd->query= 0; @@ -1887,17 +1914,17 @@ Slave: load data infile on table '%s' at log position %s in log \ } slave_print_error(rli,sql_errno,"\ Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", - err, (char*)table_name, print_slave_db_safe(db)); - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + err, (char*)table_name, print_slave_db_safe(save_db)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); return 1; } - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); if (thd->is_fatal_error) { slave_print_error(rli,ER_UNKNOWN_ERROR, "\ Fatal error running LOAD DATA INFILE on table '%s'. Default database: '%s'", - (char*)table_name, print_slave_db_safe(db)); + (char*)table_name, print_slave_db_safe(save_db)); return 1; } @@ -2438,7 +2465,7 @@ void User_var_log_event::print(FILE* file, bool short_form, char* last_db) */ fprintf(file, ":=???;\n"); else - fprintf(file, ":=_%s %s COLLATE %s;\n", cs->csname, hex_str, cs->name); + fprintf(file, ":=_%s %s COLLATE `%s`;\n", cs->csname, hex_str, cs->name); my_afree(hex_str); } break; @@ -2504,8 +2531,13 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) 0 can be passed as last argument (reference on item) */ e.fix_fields(thd, 0, 0); - e.update_hash(val, val_len, type, charset, DERIVATION_NONE); - free_root(&thd->mem_root,0); + /* + A variable can just be considered as a table with + a single record and with a single column. Thus, like + a column value, it could always have IMPLICIT derivation. + */ + e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT); + free_root(thd->mem_root,0); rli->inc_event_relay_log_pos(get_event_len()); return 0; @@ -2726,8 +2758,9 @@ Create_file_log_event:: Create_file_log_event(THD* thd_arg, sql_exchange* ex, const char* db_arg, const char* table_name_arg, List<Item>& fields_arg, enum enum_duplicates handle_dup, + bool ignore, char* block_arg, uint block_len_arg, bool using_trans) - :Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup, + :Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup, ignore, using_trans), fake_base(0), block(block_arg), event_buf(0), block_len(block_len_arg), file_id(thd_arg->file_id = mysql_bin_log.next_file_id()) @@ -2839,7 +2872,7 @@ void Create_file_log_event::print(FILE* file, bool short_form, if (enable_local) { - Load_log_event::print(file, 1, last_db, !check_fname_outside_temp_buf()); + Load_log_event::print(file, short_form, last_db, !check_fname_outside_temp_buf()); /* That one is for "file_id: etc" below: in mysqlbinlog we want the #, in SHOW BINLOG EVENTS we don't. diff --git a/sql/log_event.h b/sql/log_event.h index 8070c334d8b..f848f2ae1b9 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -264,6 +264,19 @@ struct sql_ex_info */ #define LOG_EVENT_THREAD_SPECIFIC_F 0x4 +/* + Suppress the generation of 'USE' statements before the actual + statement. This flag should be set for any events that does not need + the current database set to function correctly. Most notable cases + are 'CREATE DATABASE' and 'DROP DATABASE'. + + This flags should only be used in exceptional circumstances, since + it introduce a significant change in behaviour regarding the + replication logic together with the flags --binlog-do-db and + --replicated-do-db. + */ +#define LOG_EVENT_SUPPRESS_USE_F 0x8 + enum Log_event_type { UNKNOWN_EVENT= 0, START_EVENT= 1, QUERY_EVENT= 2, STOP_EVENT= 3, @@ -331,8 +344,9 @@ public: /* Some 16 flags. Only one is really used now; look above for - LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F - for notes. + LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, + LOG_EVENT_THREAD_SPECIFIC_F, and LOG_EVENT_SUPPRESS_USE_F for + notes. */ uint16 flags; @@ -465,7 +479,7 @@ public: #ifndef MYSQL_CLIENT Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length, - bool using_trans); + bool using_trans, bool suppress_use); const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); @@ -585,9 +599,9 @@ public: Load_log_event(THD* thd, sql_exchange* ex, const char* db_arg, const char* table_name_arg, - List<Item>& fields_arg, enum enum_duplicates handle_dup, + List<Item>& fields_arg, enum enum_duplicates handle_dup, bool ignore, bool using_trans); - void set_fields(List<Item> &fields_arg); + void set_fields(const char* db, List<Item> &fields_arg); const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); @@ -894,7 +908,7 @@ public: Create_file_log_event(THD* thd, sql_exchange* ex, const char* db_arg, const char* table_name_arg, List<Item>& fields_arg, - enum enum_duplicates handle_dup, + enum enum_duplicates handle_dup, bool ignore, char* block_arg, uint block_len_arg, bool using_trans); #ifdef HAVE_REPLICATION diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 18944aebad9..6c77a8934dd 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -212,6 +212,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; #define OPTION_RELAXED_UNIQUE_CHECKS (1L << 27) #define SELECT_NO_UNLOCK (1L << 28) +/* If set to 0, then the thread will ignore all warnings with level notes. + Set by executing SET SQL_NOTES=1 */ +#define OPTION_SQL_NOTES (1L << 31) + /* Bits for different SQL modes modes (including ANSI mode) */ #define MODE_REAL_AS_FLOAT 1 #define MODE_PIPES_AS_CONCAT 2 @@ -350,7 +354,6 @@ inline THD *_current_thd(void) #include "sql_udf.h" class user_var_entry; #include "item.h" -#include "tztime.h" typedef Comp_creator* (*chooser_compare_func_creator)(bool invert); /* sql_parse.cc */ void free_items(Item *item); @@ -363,7 +366,6 @@ bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list); int multi_update_precheck(THD *thd, TABLE_LIST *tables); int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count); -int insert_select_precheck(THD *thd, TABLE_LIST *tables); int update_precheck(THD *thd, TABLE_LIST *tables); int delete_precheck(THD *thd, TABLE_LIST *tables); int insert_precheck(THD *thd, TABLE_LIST *tables); @@ -371,12 +373,15 @@ int create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); Item *negate_expression(THD *thd, Item *expr); #include "sql_class.h" +#include "sql_acl.h" +#include "tztime.h" #include "opt_range.h" #ifdef HAVE_QUERY_CACHE struct Query_cache_query_flags { unsigned int client_long_flag:1; + unsigned int client_protocol_41:1; uint character_set_client_num; uint character_set_results_num; uint collation_connection_num; @@ -538,6 +543,7 @@ int mysql_alter_table(THD *thd, char *new_db, char *new_name, List<Key> &keys, uint order_num, ORDER *order, enum enum_duplicates handle_duplicates, + bool ignore, ALTER_INFO *alter_info, bool do_send_ok=1); int mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool do_send_ok); int mysql_create_like_table(THD *thd, TABLE_LIST *table, @@ -557,12 +563,16 @@ int mysql_prepare_update(THD *thd, TABLE_LIST *table_list, int mysql_update(THD *thd,TABLE_LIST *tables,List<Item> &fields, List<Item> &values,COND *conds, uint order_num, ORDER *order, ha_rows limit, - enum enum_duplicates handle_duplicates); + enum enum_duplicates handle_duplicates, bool ignore); int mysql_multi_update(THD *thd, TABLE_LIST *table_list, List<Item> *fields, List<Item> *values, COND *conds, ulong options, - enum enum_duplicates handle_duplicates, + enum enum_duplicates handle_duplicates, bool ignore, SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex); +int mysql_multi_update_lock(THD *thd, + TABLE_LIST *table_list, + List<Item> *fields, + SELECT_LEX *select_lex); int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE_LIST *insert_table_list, TABLE *table, List<Item> &fields, List_item *values, @@ -570,7 +580,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, List<Item> &update_values, enum_duplicates duplic); int mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields, List<List_item> &values, List<Item> &update_fields, - List<Item> &update_values, enum_duplicates flag); + List<Item> &update_values, enum_duplicates flag, bool ignore); int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds); int mysql_delete(THD *thd, TABLE_LIST *table, COND *conds, SQL_LIST *order, ha_rows rows, ulong options); @@ -681,13 +691,15 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags); #define MYSQL_HA_FLUSH_ALL 0x02 /* sql_base.cc */ +#define TMP_TABLE_KEY_EXTRA 8 void set_item_name(Item *item,char *pos,uint length); bool add_field_to_list(THD *thd, char *field_name, enum enum_field_types type, char *length, char *decimal, uint type_modifier, Item *default_value, Item *on_update_value, LEX_STRING *comment, - char *change, TYPELIB *interval,CHARSET_INFO *cs, + char *change, List<String> *interval_list, + CHARSET_INFO *cs, uint uint_geom_type); void store_position_for_column(const char *name); bool add_to_list(THD *thd, SQL_LIST &list,Item *group,bool asc=0); @@ -722,6 +734,7 @@ void wait_for_refresh(THD *thd); int open_tables(THD *thd, TABLE_LIST *tables, uint *counter); int simple_open_n_lock_tables(THD *thd,TABLE_LIST *tables); int open_and_lock_tables(THD *thd,TABLE_LIST *tables); +int open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables); void relink_tables_for_derived(THD *thd); int lock_tables(THD *thd, TABLE_LIST *tables, uint counter); TABLE *open_temporary_table(THD *thd, const char *path, const char *db, @@ -741,7 +754,7 @@ bool close_temporary_table(THD *thd, const char *db, const char *table_name); void close_temporary(TABLE *table, bool delete_table=1); bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, const char *table_name); -void remove_db_from_cache(const my_string db); +void remove_db_from_cache(const char *db); void flush_tables(); bool remove_table_from_cache(THD *thd, const char *db, const char *table, bool return_if_owned_by_thd=0); @@ -757,6 +770,7 @@ bool eval_const_cond(COND *cond); /* sql_load.cc */ int mysql_load(THD *thd,sql_exchange *ex, TABLE_LIST *table_list, List<Item> &fields, enum enum_duplicates handle_duplicates, + bool ignore, bool local_file,thr_lock_type lock_type); int write_record(TABLE *table,COPY_INFO *info); @@ -813,6 +827,7 @@ ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs, char **err_pos, uint *err_len, bool *set_warning); uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match); uint find_type2(TYPELIB *lib, const char *find, uint length, CHARSET_INFO *cs); +void unhex_type2(TYPELIB *lib); uint check_word(TYPELIB *lib, const char *val, const char *end, const char **end_of_word); @@ -846,7 +861,7 @@ extern Gt_creator gt_creator; extern Lt_creator lt_creator; extern Ge_creator ge_creator; extern Le_creator le_creator; -extern char language[LIBLEN],reg_ext[FN_EXTLEN]; +extern char language[FN_REFLEN], reg_ext[FN_EXTLEN]; extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file; extern char log_error_file[FN_REFLEN]; @@ -909,7 +924,7 @@ extern char *default_tz_name; extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; extern FILE *bootstrap_file; -extern pthread_key(MEM_ROOT*,THR_MALLOC); +extern pthread_key(MEM_ROOT**,THR_MALLOC); extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status, LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator, @@ -932,7 +947,6 @@ extern SHOW_COMP_OPTION have_ndbcluster; extern struct system_variables global_system_variables; extern struct system_variables max_system_variables; extern struct rand_struct sql_rand; -extern KEY_CACHE *sql_key_cache; extern const char *opt_date_time_formats[]; extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[]; @@ -1199,6 +1213,23 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) /* + SYNOPSYS + hexchar_to_int() + convert a hex digit into number +*/ + +inline int hexchar_to_int(char c) +{ + if (c <= '9' && c >= '0') + return c-'0'; + c|=32; + if (c <= 'f' && c >= 'a') + return c-'a'+10; + return -1; +} + + +/* Some functions that are different in the embedded library and the normal server */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7062334edbb..f1b1d8a7d86 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -17,7 +17,6 @@ #include "mysql_priv.h" #include <m_ctype.h> #include <my_dir.h> -#include "sql_acl.h" #include "slave.h" #include "sql_repl.h" #include "repl_failsafe.h" @@ -36,6 +35,33 @@ #ifdef HAVE_NDBCLUSTER_DB #include "ha_ndbcluster.h" #endif + +#ifdef HAVE_INNOBASE_DB +#define OPT_INNODB_DEFAULT 1 +#else +#define OPT_INNODB_DEFAULT 0 +#endif +#ifdef HAVE_BERKLEY_DB +#define OPT_BDB_DEFAULT 1 +#else +#define OPT_BDB_DEFAULT 0 +#endif +#ifdef HAVE_ISAM_DB +#define OPT_ISAM_DEFAULT 1 +#else +#define OPT_ISAM_DEFAULT 0 +#endif +#ifdef HAVE_NDBCLUSTER_DB +#define OPT_NDBCLUSTER_DEFAULT 0 +#if defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000 +#define OPT_NDB_SHM_DEFAULT 1 +#else +#define OPT_NDB_SHM_DEFAULT 0 +#endif +#else +#define OPT_NDBCLUSTER_DEFAULT 0 +#endif + #include <nisam.h> #include <thr_alarm.h> #include <ft_global.h> @@ -115,21 +141,16 @@ extern "C" { // Because of SCO 3.2V4.2 int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; -#ifdef __STDC__ -#define my_fromhost(A) fromhost(A) -#define my_hosts_access(A) hosts_access(A) -#define my_eval_client(A) eval_client(A) -#else -#define my_fromhost(A) fromhost() -#define my_hosts_access(A) hosts_access() -#define my_eval_client(A) eval_client() -#endif /* __STDC__ */ #endif /* HAVE_LIBWRAP */ #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif +#define zVOLSTATE_ACTIVE 6 +#define zVOLSTATE_DEACTIVE 2 +#define zVOLSTATE_MAINTENANCE 3 + #ifdef __NETWARE__ #include <nks/vm.h> #include <library.h> @@ -146,6 +167,7 @@ static VolumeID_t datavolid; static event_handle_t eh; static Report_t ref; static void *refneb= NULL; +my_bool event_flag= FALSE; static int volumeid= -1; /* NEB event callback */ @@ -263,6 +285,10 @@ my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; my_bool opt_log_slave_updates= 0; my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam, opt_ndbcluster; +#ifdef HAVE_NDBCLUSTER_DB +const char *opt_ndbcluster_connectstring= 0; +my_bool opt_ndb_shm, opt_ndb_optimized_node_selection; +#endif my_bool opt_readonly, use_temp_pool, relay_log_purge; my_bool opt_sync_bdb_logs, opt_sync_frm; my_bool opt_secure_auth= 0; @@ -272,12 +298,14 @@ my_bool lower_case_file_system= 0; my_bool opt_innodb_safe_binlog= 0; volatile bool mqh_used = 0; +#ifdef HAVE_INITGROUPS +static bool calling_initgroups= FALSE; /* Used in SIGSEGV handler. */ +#endif uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options; uint delay_key_write_options, protocol_version; uint lower_case_table_names; uint opt_crash_binlog_innodb; uint volatile thread_count, thread_running, kill_cached_threads, wake_thread; - ulong back_log, connect_timeout, concurrency; ulong server_id, thd_startup_options; ulong table_cache_size, thread_stack, thread_stack_min, what_to_log; @@ -318,7 +346,7 @@ char *default_tz_name; char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN]; char* log_error_file_ptr= log_error_file; char mysql_real_data_home[FN_REFLEN], - language[LIBLEN],reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], + language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], *mysqld_user,*mysqld_chroot, *opt_init_file, *opt_init_connect, *opt_init_slave, def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; @@ -361,7 +389,6 @@ struct system_variables max_system_variables; MY_TMPDIR mysql_tmpdir_list; MY_BITMAP temp_pool; -KEY_CACHE *sql_key_cache; CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; @@ -374,7 +401,7 @@ SHOW_COMP_OPTION have_crypt, have_compress; /* Thread specific variables */ -pthread_key(MEM_ROOT*,THR_MALLOC); +pthread_key(MEM_ROOT**,THR_MALLOC); pthread_key(THD*, THR_THD); pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count, LOCK_mapped_file, LOCK_status, @@ -468,6 +495,7 @@ Query_cache query_cache; #ifdef HAVE_SMEM char *shared_memory_base_name= default_shared_memory_base_name; bool opt_enable_shared_memory; +HANDLE smem_event_connect_request= 0; #endif #include "sslopt-vars.h" @@ -502,6 +530,7 @@ extern "C" pthread_handler_decl(handle_slave,arg); static ulong find_bit_type(const char *x, TYPELIB *bit_lib); static void clean_up(bool print_message); static void clean_up_mutexes(void); +static void wait_for_signal_thread_to_end(void); static int test_if_case_insensitive(const char *dir_name); static void create_pid_file(); @@ -540,7 +569,7 @@ static void close_connections(void) struct timespec abstime; int error; LINT_INIT(error); - DBUG_PRINT("info",("Waiting for select_thread")); + DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM if (pthread_kill(select_thread,THR_CLIENT_ALARM)) @@ -743,6 +772,15 @@ void kill_mysql(void) CloseHandle(hEvent); */ } +#ifdef HAVE_SMEM + /* + Send event to smem_event_connect_request for aborting + */ + if (!SetEvent(smem_event_connect_request)) + { + DBUG_PRINT("error",("Got error: %ld from SetEvent of smem_event_connect_request",GetLastError())); + } +#endif #endif #elif defined(OS2) pthread_cond_signal( &eventShutdown); // post semaphore @@ -805,7 +843,8 @@ static void __cdecl kill_server(int sig_ptr) else unireg_end(); #ifdef __NETWARE__ - pthread_join(select_thread, NULL); // wait for main thread + if (!event_flag) + pthread_join(select_thread, NULL); // wait for main thread #endif /* __NETWARE__ */ pthread_exit(0); /* purecov: deadcode */ @@ -880,6 +919,7 @@ extern "C" void unireg_abort(int exit_code) sql_print_error("Aborting\n"); clean_up(exit_code || !opt_bootstrap); /* purecov: inspected */ DBUG_PRINT("quit",("done with cleanup in unireg_abort")); + wait_for_signal_thread_to_end(); clean_up_mutexes(); my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); exit(exit_code); /* purecov: inspected */ @@ -914,6 +954,7 @@ void clean_up(bool print_message) item_user_lock_free(); lex_free(); /* Free some memory */ set_var_free(); + free_charsets(); #ifdef HAVE_DLOPEN if (!opt_noacl) udf_free(); @@ -984,6 +1025,29 @@ void clean_up(bool print_message) } /* clean_up */ +/* + This is mainly needed when running with purify, but it's still nice to + know that all child threads have died when mysqld exits +*/ + +static void wait_for_signal_thread_to_end() +{ +#ifndef __NETWARE__ + uint i; + /* + Wait up to 10 seconds for signal thread to die. We use this mainly to + avoid getting warnings that my_thread_end has not been called + */ + for (i= 0 ; i < 100 && signal_thread_in_use; i++) + { + if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL)) + break; + my_sleep(100); // Give it time to die + } +#endif +} + + static void clean_up_mutexes() { (void) pthread_mutex_destroy(&LOCK_mysql_create_db); @@ -1106,7 +1170,15 @@ static void set_user(const char *user, struct passwd *user_info) #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) DBUG_ASSERT(user_info); #ifdef HAVE_INITGROUPS - initgroups((char*) user,user_info->pw_gid); + /* + We can get a SIGSEGV when calling initgroups() on some systems when NSS + is configured to use LDAP and the server is statically linked. We set + calling_initgroups as a flag to the SIGSEGV handler that is then used to + output a specific message to help the user resolve this problem. + */ + calling_initgroups= TRUE; + initgroups((char*) user, user_info->pw_gid); + calling_initgroups= FALSE; #endif if (setgid(user_info->pw_gid) == -1) { @@ -1515,20 +1587,20 @@ static void check_data_home(const char *path) // down server event callback void mysql_down_server_cb(void *, void *) { + event_flag = TRUE; kill_server(0); } // destroy callback resources void mysql_cb_destroy(void *) -{ - UnRegisterEventNotification(eh); // cleanup down event notification +{ + UnRegisterEventNotification(eh); // cleanup down event notification NX_UNWRAP_INTERFACE(ref); - - /* Deregister NSS volume deactivation event */ - NX_UNWRAP_INTERFACE(refneb); + /* Deregister NSS volume deactivation event */ + NX_UNWRAP_INTERFACE(refneb); if (neb_consumer_id) - UnRegisterConsumer(neb_consumer_id, NULL); + UnRegisterConsumer(neb_consumer_id, NULL); } @@ -1548,7 +1620,7 @@ void mysql_cb_init() Register for volume deactivation event Wrap the callback function, as it is called by non-LibC thread */ - (void)NX_WRAP_INTERFACE(neb_event_callback, 1, &refneb); + (void *) NX_WRAP_INTERFACE(neb_event_callback, 1, &refneb); registerwithneb(); NXVmRegisterExitHandler(mysql_cb_destroy, NULL); // clean-up @@ -1635,7 +1707,9 @@ ulong neb_event_callback(struct EventBlock *eblock) voldata= (EventChangeVolStateEnter_s *)eblock->EBEventData; /* Deactivation of a volume */ - if ((voldata->oldState == 6 && voldata->newState == 2)) + if ((voldata->oldState == zVOLSTATE_ACTIVE && + voldata->newState == zVOLSTATE_DEACTIVE || + voldata->newState == zVOLSTATE_MAINTENANCE)) { /* Ensure that we bring down MySQL server only for MySQL data @@ -1645,7 +1719,9 @@ ulong neb_event_callback(struct EventBlock *eblock) { consoleprintf("MySQL data volume is deactivated, shutting down MySQL Server \n"); nw_panic = TRUE; + event_flag= TRUE; kill_server(0); + } } return 0; @@ -1719,8 +1795,8 @@ static void init_signals(void) for (uint i=0 ; i < sizeof(signals)/sizeof(int) ; i++) signal(signals[i], kill_server); mysql_cb_init(); // initialize callbacks -} +} static void start_signal_handler(void) { @@ -1811,14 +1887,14 @@ We will try our best to scrape up some info that will hopefully help diagnose\n\ the problem, but since we have already crashed, something is definitely wrong\n\ and this may fail.\n\n"); fprintf(stderr, "key_buffer_size=%lu\n", - (ulong) sql_key_cache->key_cache_mem_size); + (ulong) dflt_key_cache->key_cache_mem_size); fprintf(stderr, "read_buffer_size=%ld\n", global_system_variables.read_buff_size); fprintf(stderr, "max_used_connections=%ld\n", max_used_connections); fprintf(stderr, "max_connections=%ld\n", max_connections); fprintf(stderr, "threads_connected=%d\n", thread_count); fprintf(stderr, "It is possible that mysqld could use up to \n\ key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = %ld K\n\ -bytes of memory\n", ((ulong) sql_key_cache->key_cache_mem_size + +bytes of memory\n", ((ulong) dflt_key_cache->key_cache_mem_size + (global_system_variables.read_buff_size + global_system_variables.sortbuff_size) * max_connections)/ 1024); @@ -1856,6 +1932,17 @@ information that should help you find out what is causing the crash.\n"); fflush(stderr); #endif /* HAVE_STACKTRACE */ +#ifdef HAVE_INITGROUPS + if (calling_initgroups) + fprintf(stderr, "\n\ +This crash occured while the server was calling initgroups(). This is\n\ +often due to the use of a mysqld that is statically linked against glibc\n\ +and configured to use LDAP in /etc/nsswitch.conf. You will need to either\n\ +upgrade to a version of glibc that does not have this problem (2.3.4 or\n\ +later when used with nscd), disable LDAP in your nsswitch.conf, or use a\n\ +mysqld that is not statically linked.\n"); +#endif + if (test_flags & TEST_CORE_ON_SIGNAL) { fprintf(stderr, "Writing a core file\n"); @@ -2055,6 +2142,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) while ((error=my_sigwait(&set,&sig)) == EINTR) ; if (cleanup_done) { + DBUG_PRINT("quit",("signal_handler: calling my_thread_end()")); my_thread_end(); signal_thread_in_use= 0; pthread_exit(0); // Safety @@ -2085,12 +2173,12 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) case SIGHUP: if (!abort_loop) { + mysql_print_status((THD*) 0); // Print some debug info reload_acl_and_cache((THD*) 0, (REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST | REFRESH_STATUS | REFRESH_GRANT | REFRESH_THREADS | REFRESH_HOSTS), (TABLE_LIST*) 0, NULL); // Flush logs - mysql_print_status((THD*) 0); // Send debug some info } break; #ifdef USE_ONE_SIGNAL_HAND @@ -2227,7 +2315,13 @@ extern "C" pthread_handler_decl(handle_shutdown,arg) #endif -const char *load_default_groups[]= { "mysqld","server",MYSQL_BASE_VERSION,0,0}; +const char *load_default_groups[]= { +#ifdef HAVE_NDBCLUSTER_DB +"mysql_cluster", +#endif +"mysqld","server",MYSQL_BASE_VERSION,0,0}; +static const int load_default_groups_sz= +sizeof(load_default_groups)/sizeof(load_default_groups[0]); bool open_log(MYSQL_LOG *log, const char *hostname, const char *opt_name, const char *extension, @@ -2305,8 +2399,6 @@ bool init_global_datetime_format(timestamp_type format_type, static int init_common_variables(const char *conf_file_name, int argc, char **argv, const char **groups) { - my_umask=0660; // Default umask for new files - my_umask_dir=0700; // Default umask for new directories umask(((~my_umask) & 0666)); tzset(); // Set tzname @@ -2552,8 +2644,10 @@ static int init_server_components() if (opt_bin_log) { - open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin", - opt_binlog_index_name, LOG_BIN, 0, 0, max_binlog_size); + /* If we fail to open binlog, it's going to hinder our recovery, so die */ + if (open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin", + opt_binlog_index_name, LOG_BIN, 0, 0, max_binlog_size)) + unireg_abort(1); using_update_log=1; #ifdef HAVE_REPLICATION if (expire_logs_days) @@ -2658,8 +2752,6 @@ server."); /* call ha_init_key_cache() on all key caches to init them */ process_key_caches(&ha_init_key_cache); - /* We must set dflt_key_cache in case we are using ISAM tables */ - dflt_key_cache= sql_key_cache; #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && !defined(EMBEDDED_LIBRARY) if (locked_in_memory && !getuid()) @@ -2805,6 +2897,7 @@ int win_main(int argc, char **argv) int main(int argc, char **argv) #endif { + DEBUGGER_OFF; MY_INIT(argv[0]); // init my_sys library & pthreads @@ -2871,6 +2964,17 @@ You should consider changing lower_case_table_names to 1 or 2", lower_case_table_names= 2; } } + else if (lower_case_table_names == 2 && + !(lower_case_file_system= + (test_if_case_insensitive(mysql_real_data_home) == 1))) + { + if (global_system_variables.log_warnings) + sql_print_warning("lower_case_table_names was set to 2, even though your " + "the file system '%s' is case sensitive. Now setting " + "lower_case_table_names to 0 to avoid future problems.", + mysql_real_data_home); + lower_case_table_names= 0; + } select_thread=pthread_self(); select_thread_in_use=1; @@ -2918,11 +3022,10 @@ we force server id to 2, but this MySQL server will not act as a slave."); exit(1); #ifdef __WIN__ -#define MYSQL_ERR_FILE "mysql.err" if (!opt_console) { - freopen(MYSQL_ERR_FILE,"a+",stdout); - freopen(MYSQL_ERR_FILE,"a+",stderr); + freopen(log_error_file,"a+",stdout); + freopen(log_error_file,"a+",stderr); FreeConsole(); // Remove window } #endif @@ -3001,7 +3104,7 @@ we force server id to 2, but this MySQL server will not act as a slave."); #endif /* __NT__ */ /* (void) pthread_attr_destroy(&connection_attrib); */ - + DBUG_PRINT("quit",("Exiting main thread")); #ifndef __WIN__ @@ -3034,23 +3137,10 @@ we force server id to 2, but this MySQL server will not act as a slave."); CloseHandle(hEventShutdown); } #endif -#ifndef __NETWARE__ - { - uint i; - /* - Wait up to 10 seconds for signal thread to die. We use this mainly to - avoid getting warnings that my_thread_end has not been called - */ - for (i= 0 ; i < 100 && signal_thread_in_use; i++) - { - if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL)) - break; - my_sleep(100); // Give it time to die - } - } -#endif + wait_for_signal_thread_to_end(); clean_up_mutexes(); my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); + exit(0); return(0); /* purecov: deadcode */ } @@ -3177,7 +3267,7 @@ int main(int argc, char **argv) and we are now stuck with it. */ if (my_strcasecmp(system_charset_info, argv[1],"mysql")) - load_default_groups[3]= argv[1]; + load_default_groups[load_default_groups_sz-2]= argv[1]; start_mode= 1; Service.Init(argv[1], mysql_service); return 0; @@ -3198,7 +3288,7 @@ int main(int argc, char **argv) opt_argv=argv; start_mode= 1; if (my_strcasecmp(system_charset_info, argv[2],"mysql")) - load_default_groups[3]= argv[2]; + load_default_groups[load_default_groups_sz-2]= argv[2]; Service.Init(argv[2], mysql_service); return 0; } @@ -3525,8 +3615,8 @@ extern "C" pthread_handler_decl(handle_connections_sockets, struct request_info req; signal(SIGCHLD, SIG_DFL); request_init(&req, RQ_DAEMON, libwrapName, RQ_FILE, new_sock, NULL); - my_fromhost(&req); - if (!my_hosts_access(&req)) + fromhost(&req); + if (!hosts_access(&req)) { /* This may be stupid but refuse() includes an exit(0) @@ -3534,7 +3624,7 @@ extern "C" pthread_handler_decl(handle_connections_sockets, clean_exit() - same stupid thing ... */ syslog(deny_severity, "refused connect from %s", - my_eval_client(&req)); + eval_client(&req)); /* C++ sucks (the gibberish in front just translates the supplied @@ -3708,7 +3798,6 @@ pthread_handler_decl(handle_connections_shared_memory,arg) /* file-mapping object, use for create shared memory */ HANDLE handle_connect_file_map= 0; char *handle_connect_map= 0; // pointer on shared memory - HANDLE event_connect_request= 0; // for start connection actions HANDLE event_connect_answer= 0; ulong smem_buffer_length= shared_memory_buffer_length + 4; ulong connect_number= 1; @@ -3729,7 +3818,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg) */ suffix_pos= strxmov(tmp,shared_memory_base_name,"_",NullS); strmov(suffix_pos, "CONNECT_REQUEST"); - if ((event_connect_request= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((smem_event_connect_request= CreateEvent(0,FALSE,FALSE,tmp)) == 0) { errmsg= "Could not create request event"; goto error; @@ -3760,7 +3849,13 @@ pthread_handler_decl(handle_connections_shared_memory,arg) while (!abort_loop) { /* Wait a request from client */ - WaitForSingleObject(event_connect_request,INFINITE); + WaitForSingleObject(smem_event_connect_request,INFINITE); + + /* + it can be after shutdown command + */ + if (abort_loop) + goto error; HANDLE handle_client_file_map= 0; char *handle_client_map= 0; @@ -3768,6 +3863,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg) HANDLE event_client_read= 0; // for transfer data server <-> client HANDLE event_server_wrote= 0; HANDLE event_server_read= 0; + HANDLE event_conn_closed= 0; THD *thd= 0; p= int10_to_str(connect_number, connect_number_char, 10); @@ -3798,29 +3894,35 @@ pthread_handler_decl(handle_connections_shared_memory,arg) goto errorconn; } strmov(suffix_pos, "CLIENT_WROTE"); - if ((event_client_wrote= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_client_wrote= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create client write event"; goto errorconn; } strmov(suffix_pos, "CLIENT_READ"); - if ((event_client_read= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_client_read= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create client read event"; goto errorconn; } strmov(suffix_pos, "SERVER_READ"); - if ((event_server_read= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_server_read= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create server read event"; goto errorconn; } strmov(suffix_pos, "SERVER_WROTE"); - if ((event_server_wrote= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_server_wrote= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create server write event"; goto errorconn; } + strmov(suffix_pos, "CONNECTION_CLOSED"); + if ((event_conn_closed= CreateEvent(0, TRUE , FALSE, tmp)) == 0) + { + errmsg= "Could not create closed connection event"; + goto errorconn; + } if (abort_loop) goto errorconn; if (!(thd= new THD)) @@ -3839,13 +3941,14 @@ pthread_handler_decl(handle_connections_shared_memory,arg) goto errorconn; } if (!(thd->net.vio= vio_new_win32shared_memory(&thd->net, - handle_client_file_map, - handle_client_map, - event_client_wrote, - event_client_read, - event_server_wrote, - event_server_read)) || - my_net_init(&thd->net, thd->net.vio)) + handle_client_file_map, + handle_client_map, + event_client_wrote, + event_client_read, + event_server_wrote, + event_server_read, + event_conn_closed)) || + my_net_init(&thd->net, thd->net.vio)) { close_connection(thd, ER_OUT_OF_RESOURCES, 1); errmsg= 0; @@ -3865,12 +3968,20 @@ errorconn: NullS); sql_perror(buff); } - if (handle_client_file_map) CloseHandle(handle_client_file_map); - if (handle_client_map) UnmapViewOfFile(handle_client_map); - if (event_server_wrote) CloseHandle(event_server_wrote); - if (event_server_read) CloseHandle(event_server_read); - if (event_client_wrote) CloseHandle(event_client_wrote); - if (event_client_read) CloseHandle(event_client_read); + if (handle_client_file_map) + CloseHandle(handle_client_file_map); + if (handle_client_map) + UnmapViewOfFile(handle_client_map); + if (event_server_wrote) + CloseHandle(event_server_wrote); + if (event_server_read) + CloseHandle(event_server_read); + if (event_client_wrote) + CloseHandle(event_client_wrote); + if (event_client_read) + CloseHandle(event_client_read); + if (event_conn_closed) + CloseHandle(event_conn_closed); delete thd; } @@ -3885,7 +3996,7 @@ error: if (handle_connect_map) UnmapViewOfFile(handle_connect_map); if (handle_connect_file_map) CloseHandle(handle_connect_file_map); if (event_connect_answer) CloseHandle(event_connect_answer); - if (event_connect_request) CloseHandle(event_connect_request); + if (smem_event_connect_request) CloseHandle(smem_event_connect_request); decrement_handler_count(); DBUG_RETURN(0); @@ -3950,7 +4061,11 @@ enum options_mysqld OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB, OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG, OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG, - OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_SKIP_SAFEMALLOC, + OPT_INNODB, OPT_ISAM, + OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT, + OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, + OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL, @@ -4023,7 +4138,11 @@ enum options_mysqld OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE, - OPT_SYNC_FRM, OPT_SYNC_BINLOG, OPT_BDB_NOSYNC, + OPT_SYNC_FRM, OPT_SYNC_BINLOG, + OPT_SYNC_REPLICATION, + OPT_SYNC_REPLICATION_SLAVE_ID, + OPT_SYNC_REPLICATION_TIMEOUT, + OPT_BDB_NOSYNC, OPT_ENABLE_SHARED_MEMORY, OPT_SHARED_MEMORY_BASE_NAME, OPT_OLD_PASSWORDS, @@ -4062,7 +4181,7 @@ struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"bdb", OPT_BDB, "Enable Berkeley DB (if this version of MySQL supports it). \ Disable with --skip-bdb (will save memory).", - (gptr*) &opt_bdb, (gptr*) &opt_bdb, 0, GET_BOOL, NO_ARG, 1, 0, 0, + (gptr*) &opt_bdb, (gptr*) &opt_bdb, 0, GET_BOOL, NO_ARG, OPT_BDB_DEFAULT, 0, 0, 0, 0, 0}, #ifdef HAVE_BERKELEY_DB {"bdb-home", OPT_BDB_HOME, "Berkeley home directory.", (gptr*) &berkeley_home, @@ -4199,7 +4318,7 @@ Disable with --skip-bdb (will save memory).", REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"innodb", OPT_INNODB, "Enable InnoDB (if this version of MySQL supports it). \ Disable with --skip-innodb (will save memory).", - (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, 1, 0, 0, + (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, OPT_INNODB_DEFAULT, 0, 0, 0, 0, 0}, {"innodb_data_file_path", OPT_INNODB_DATA_FILE_PATH, "Path to individual files and their sizes.", @@ -4243,7 +4362,7 @@ Disable with --skip-innodb (will save memory).", "Percentage of dirty pages allowed in bufferpool.", (gptr*) &srv_max_buf_pool_modified_pct, (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0}, {"innodb_max_purge_lag", OPT_INNODB_MAX_PURGE_LAG, - "", + "Desired maximum length of the purge queue (0 = no limit)", (gptr*) &srv_max_purge_lag, (gptr*) &srv_max_purge_lag, 0, GET_LONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1L, 0}, @@ -4252,14 +4371,14 @@ Disable with --skip-innodb (will save memory).", (gptr*) &innobase_create_status_file, (gptr*) &innobase_create_status_file, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"innodb_table_locks", OPT_INNODB_TABLE_LOCKS, - "If Innodb should enforce LOCK TABLE", + "Enable InnoDB locking in LOCK TABLES", (gptr*) &global_system_variables.innodb_table_locks, (gptr*) &global_system_variables.innodb_table_locks, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, #endif /* End HAVE_INNOBASE_DB */ {"isam", OPT_ISAM, "Enable ISAM (if this version of MySQL supports it). \ Disable with --skip-isam.", - (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, 1, 0, 0, + (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, OPT_ISAM_DEFAULT, 0, 0, 0, 0, 0}, {"language", 'L', "Client error messages in given language. May be given as a full path.", @@ -4386,12 +4505,51 @@ master-ssl", GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"ndbcluster", OPT_NDBCLUSTER, "Enable NDB Cluster (if this version of MySQL supports it). \ Disable with --skip-ndbcluster (will save memory).", - (gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 1, 0, 0, - 0, 0, 0}, + (gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, + OPT_NDBCLUSTER_DEFAULT, 0, 0, 0, 0, 0}, #ifdef HAVE_NDBCLUSTER_DB - {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.", - (gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"ndb-connectstring", OPT_NDB_CONNECTSTRING, + "Connect string for ndbcluster.", + (gptr*) &opt_ndbcluster_connectstring, + (gptr*) &opt_ndbcluster_connectstring, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + "Specify number of autoincrement values that are prefetched.", + (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, + (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, + 0, GET_INT, REQUIRED_ARG, 32, 1, 256, 0, 0, 0}, + {"ndb-force-send", OPT_NDB_FORCE_SEND, + "Force send of buffers to ndb immediately without waiting for " + "other threads.", + (gptr*) &global_system_variables.ndb_force_send, + (gptr*) &global_system_variables.ndb_force_send, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb_force_send", OPT_NDB_FORCE_SEND, + "same as --ndb-force-send.", + (gptr*) &global_system_variables.ndb_force_send, + (gptr*) &global_system_variables.ndb_force_send, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT, + "Use exact records count during query planning and for fast " + "select count(*), disable for faster queries.", + (gptr*) &global_system_variables.ndb_use_exact_count, + (gptr*) &global_system_variables.ndb_use_exact_count, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT, + "same as --ndb-use-exact-count.", + (gptr*) &global_system_variables.ndb_use_exact_count, + (gptr*) &global_system_variables.ndb_use_exact_count, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb-shm", OPT_NDB_SHM, + "Use shared memory connections when available.", + (gptr*) &opt_ndb_shm, + (gptr*) &opt_ndb_shm, + 0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0}, + {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION, + "Select nodes for transactions in a more optimal way.", + (gptr*) &opt_ndb_optimized_node_selection, + (gptr*) &opt_ndb_optimized_node_selection, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, #endif {"new", 'n', "Use very new possible 'unsafe' functions.", (gptr*) &global_system_variables.new_mode, @@ -4692,7 +4850,8 @@ replicating a LOAD DATA INFILE command.", (gptr*) &delayed_queue_size, (gptr*) &delayed_queue_size, 0, GET_ULONG, REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ~0L, 0, 1, 0}, {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS, - "Binary logs will be rotated after expire-log-days days ", + "If non-zero, binary logs will be purged after expire_logs_days " + "days; possible purges happen at startup and at binary log rotation.", (gptr*) &expire_logs_days, (gptr*) &expire_logs_days, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 99, 0, 1, 0}, @@ -4735,7 +4894,7 @@ replicating a LOAD DATA INFILE command.", "Data file autoextend increment in megabytes", (gptr*) &srv_auto_extend_increment, (gptr*) &srv_auto_extend_increment, - 0, GET_LONG, REQUIRED_ARG, 8L, 1L, ~0L, 0, 1L, 0}, + 0, GET_LONG, REQUIRED_ARG, 8L, 1L, 1000L, 0, 1L, 0}, {"innodb_buffer_pool_awe_mem_mb", OPT_INNODB_BUFFER_POOL_AWE_MEM_MB, "If Windows AWE is used, the size of InnoDB buffer pool allocated from the AWE memory.", (gptr*) &innobase_buffer_pool_awe_mem_mb, (gptr*) &innobase_buffer_pool_awe_mem_mb, 0, @@ -4938,7 +5097,7 @@ The minimum value for this variable is 4096.", "Default pointer size to be used for MyISAM tables.", (gptr*) &myisam_data_pointer_size, (gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG, - 4, 2, 7, 0, 1, 0}, + 4, 2, 8, 0, 1, 0}, {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, "Used to help MySQL to decide when to use the slow but safe key cache index create method.", (gptr*) &global_system_variables.myisam_max_extra_sort_file_size, @@ -5026,12 +5185,12 @@ The minimum value for this variable is 4096.", "Persistent buffer for query parsing and execution", (gptr*) &global_system_variables.query_prealloc_size, (gptr*) &max_system_variables.query_prealloc_size, 0, GET_ULONG, - REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, 1024, ~0L, 0, 1024, 0}, + REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, 16384, ~0L, 0, 1024, 0}, {"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE, "Allocation block size for storing ranges during optimization", (gptr*) &global_system_variables.range_alloc_block_size, (gptr*) &max_system_variables.range_alloc_block_size, 0, GET_ULONG, - REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0}, + REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, 4096, ~0L, 0, 1024, 0}, {"read_buffer_size", OPT_RECORD_BUFFER, "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.", (gptr*) &global_system_variables.read_buff_size, @@ -5096,6 +5255,23 @@ The minimum value for this variable is 4096.", (gptr*) &sync_binlog_period, (gptr*) &sync_binlog_period, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1, 0}, +#ifdef DOES_NOTHING_YET + {"sync-replication", OPT_SYNC_REPLICATION, + "Enable synchronous replication", + (gptr*) &global_system_variables.sync_replication, + (gptr*) &global_system_variables.sync_replication, + 0, GET_ULONG, REQUIRED_ARG, 0, 0, 1, 0, 1, 0}, + {"sync-replication-slave-id", OPT_SYNC_REPLICATION_SLAVE_ID, + "Synchronous replication is wished for this slave", + (gptr*) &global_system_variables.sync_replication_slave_id, + (gptr*) &global_system_variables.sync_replication_slave_id, + 0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1, 0}, + {"sync-replication-timeout", OPT_SYNC_REPLICATION_TIMEOUT, + "Synchronous replication timeout", + (gptr*) &global_system_variables.sync_replication_timeout, + (gptr*) &global_system_variables.sync_replication_timeout, + 0, GET_ULONG, REQUIRED_ARG, 10, 0, ~0L, 0, 1, 0}, +#endif {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default", (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, @@ -5480,7 +5656,8 @@ static void mysql_init_variables(void) language_ptr= language; mysql_data_home= mysql_real_data_home; thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL | - OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE); + OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE | + OPTION_SQL_NOTES); protocol_version= PROTOCOL_VERSION; what_to_log= ~ (1L << (uint) COM_TIME); refresh_version= flush_version= 1L; /* Increments on each reload */ @@ -5491,10 +5668,10 @@ static void mysql_init_variables(void) threads.empty(); thread_cache.empty(); key_caches.empty(); - multi_keycache_init(); - if (!(sql_key_cache= get_or_create_key_cache(default_key_cache_base.str, + if (!(dflt_key_cache= get_or_create_key_cache(default_key_cache_base.str, default_key_cache_base.length))) exit(1); + multi_keycache_init(); /* set key_cache_hash.default_value = dflt_key_cache */ /* Initialize structures that is used when processing options */ replicate_rewrite_db.empty(); @@ -6204,6 +6381,24 @@ static void get_options(int argc,char **argv) if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option))) exit(ho_error); + +#ifndef HAVE_NDBCLUSTER_DB + if (opt_ndbcluster) + sql_print_warning("this binary does not contain NDBCLUSTER storage engine"); +#endif +#ifndef HAVE_INNOBASE_DB + if (opt_innodb) + sql_print_warning("this binary does not contain INNODB storage engine"); +#endif +#ifndef HAVE_ISAM + if (opt_isam) + sql_print_warning("this binary does not contain ISAM storage engine"); +#endif +#ifndef HAVE_BERKELEY_DB + if (opt_bdb) + sql_print_warning("this binary does not contain BDB storage engine"); +#endif + if (argc > 0) { fprintf(stderr, "%s: Too many arguments (first extra is '%s').\nUse --help to get a list of available options\n", my_progname, *argv); diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 457b2052a45..5699b5a2f55 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -53,19 +53,9 @@ #include <errno.h> #ifdef EMBEDDED_LIBRARY - #undef MYSQL_SERVER - -#ifndef MYSQL_CLIENT +#undef MYSQL_CLIENT #define MYSQL_CLIENT -#endif - -#undef net_flush - -extern "C" { -my_bool net_flush(NET *net); -} - #endif /*EMBEDDED_LIBRARY */ @@ -175,8 +165,8 @@ my_bool net_realloc(NET *net, ulong length) if (length >= net->max_packet_size) { - DBUG_PRINT("error",("Packet too large. Max sixe: %lu", - net->max_packet_size)); + DBUG_PRINT("error", ("Packet too large. Max size: %lu", + net->max_packet_size)); net->error= 1; net->report_error= 1; net->last_errno= ER_NET_PACKET_TOO_LARGE; @@ -261,6 +251,8 @@ my_bool my_net_write(NET *net,const char *packet,ulong len) { uchar buff[NET_HEADER_SIZE]; + if (unlikely(!net->vio)) /* nowhere to write */ + return 0; /* Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH length. The last packet is always a packet that is < MAX_PACKET_LENGTH. diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 541acc69ec7..d25901e56b1 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -400,7 +400,7 @@ QUICK_SELECT::QUICK_SELECT(THD *thd, TABLE *table, uint key_nr, bool no_alloc) { // Allocates everything through the internal memroot init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0); - my_pthread_setspecific_ptr(THR_MALLOC,&alloc); + thd->mem_root= &alloc; } else bzero((char*) &alloc,sizeof(alloc)); @@ -668,8 +668,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, DBUG_RETURN(0); // Can't use range } key_parts= param.key_parts; - old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC,&alloc); + old_root= thd->mem_root; + thd->mem_root= &alloc; key_info= head->key_info; for (idx=0 ; idx < head->keys ; idx++, key_info++) @@ -769,7 +769,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, } } free_root(&alloc,MYF(0)); // Return memory & allocator - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + thd->mem_root= old_root; thd->no_errors=0; } DBUG_EXECUTE("info",print_quick(quick,&needed_reg);); @@ -1013,13 +1013,22 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part, } /* - We can't use an index when comparing strings of - different collations + 1. Usually we can't use an index if the column collation + differ from the operation collation. + + 2. However, we can reuse a case insensitive index for + the binary searches: + + WHERE latin1_swedish_ci_column = 'a' COLLATE lati1_bin; + + WHERE latin1_swedish_ci_colimn = BINARY 'a ' + */ if (field->result_type() == STRING_RESULT && value->result_type() == STRING_RESULT && key_part->image_type == Field::itRAW && - ((Field_str*)field)->charset() != conf_func->compare_collation()) + ((Field_str*)field)->charset() != conf_func->compare_collation() && + !(conf_func->compare_collation()->state & MY_CS_BINSORT)) DBUG_RETURN(0); if (type == Item_func::LIKE_FUNC) @@ -2554,7 +2563,8 @@ static bool null_part_in_key(KEY_PART *key_part, const char *key, uint length) QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref) { - MEM_ROOT *old_root= my_pthread_getspecific_ptr(MEM_ROOT*, THR_MALLOC); + MEM_ROOT *old_root= thd->mem_root; + /* The following call may change thd->mem_root */ QUICK_SELECT *quick= new QUICK_SELECT(thd, table, ref->key); KEY *key_info = &table->key_info[ref->key]; KEY_PART *key_part; @@ -2615,11 +2625,11 @@ QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref) } ok: - my_pthread_setspecific_ptr(THR_MALLOC, old_root); + thd->mem_root= old_root; return quick; err: - my_pthread_setspecific_ptr(THR_MALLOC, old_root); + thd->mem_root= old_root; delete quick; return 0; } diff --git a/sql/opt_range.h b/sql/opt_range.h index 9b2e9e45bac..5a2044a59f4 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -154,7 +154,7 @@ class FT_SELECT: public QUICK_SELECT { public: FT_SELECT(THD *thd, TABLE *table, uint key): QUICK_SELECT (thd, table, key, 1) { init(); } - + ~FT_SELECT() { file->ft_end(); } int init() { return error= file->ft_init(); } int get_next() { return error= file->ft_read(record); } }; diff --git a/sql/password.c b/sql/password.c index b9f3a07e596..04b3a46bd48 100644 --- a/sql/password.c +++ b/sql/password.c @@ -211,12 +211,13 @@ check_scramble_323(const char *scrambled, const char *message, ulong hash_message[2]; char buff[16],*to,extra; /* Big enough for check */ const char *pos; - + hash_password(hash_message, message, SCRAMBLE_LENGTH_323); randominit(&rand_st,hash_pass[0] ^ hash_message[0], hash_pass[1] ^ hash_message[1]); to=buff; - for (pos=scrambled ; *pos ; pos++) + DBUG_ASSERT(sizeof(buff) > SCRAMBLE_LENGTH_323); + for (pos=scrambled ; *pos && to < buff+sizeof(buff) ; pos++) *to++=(char) (floor(my_rnd(&rand_st)*31)+64); if (pos-scrambled != SCRAMBLE_LENGTH_323) return 1; diff --git a/sql/procedure.h b/sql/procedure.h index 5365b2e1102..abe50bdc0a0 100644 --- a/sql/procedure.h +++ b/sql/procedure.h @@ -59,7 +59,11 @@ public: void set(double nr) { value=nr; } void set(longlong nr) { value=(double) nr; } void set(const char *str,uint length,CHARSET_INFO *cs) - { int err; value=my_strntod(cs,(char*) str,length,(char**)0,&err); } + { + int err; + char *end_not_used; + value= my_strntod(cs, (char*) str, length, &end_not_used, &err); + } double val() { return value; } longlong val_int() { return (longlong) value; } String *val_str(String *s) { s->set(value,decimals,default_charset()); return s; } @@ -99,9 +103,10 @@ public: double val() { int err; - CHARSET_INFO *cs=str_value.charset(); + CHARSET_INFO *cs= str_value.charset(); + char *end_not_used; return my_strntod(cs, (char*) str_value.ptr(), str_value.length(), - (char**) 0, &err); + &end_not_used, &err); } longlong val_int() { diff --git a/sql/protocol.cc b/sql/protocol.cc index 887177c0a19..4cecd016553 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -58,6 +58,7 @@ void send_error(THD *thd, uint sql_errno, const char *err) uint length; char buff[MYSQL_ERRMSG_SIZE+2], *pos; #endif + const char *orig_err= err; NET *net= &thd->net; DBUG_ENTER("send_error"); DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno, @@ -82,6 +83,7 @@ void send_error(THD *thd, uint sql_errno, const char *err) err=ER(sql_errno); /* purecov: inspected */ } } + orig_err= err; } #ifdef EMBEDDED_LIBRARY @@ -120,6 +122,8 @@ void send_error(THD *thd, uint sql_errno, const char *err) } VOID(net_write_command(net,(uchar) 255, "", 0, (char*) err,length)); #endif /* EMBEDDED_LIBRARY*/ + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, sql_errno, + orig_err ? orig_err : ER(sql_errno)); thd->is_fatal_error=0; // Error message is given thd->net.report_error= 0; @@ -247,6 +251,8 @@ net_printf(THD *thd, uint errcode, ...) strmake(net->last_error, text_pos, length); strmake(net->sqlstate, mysql_errno_to_sqlstate(errcode), SQLSTATE_LENGTH); #endif + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, errcode, + text_pos ? text_pos : ER(errcode)); thd->is_fatal_error=0; // Error message is given DBUG_VOID_RETURN; } @@ -470,6 +476,15 @@ void Protocol::init(THD *thd_arg) } +bool Protocol::flush() +{ +#ifndef EMBEDDED_LIBRARY + return net_flush(&thd->net); +#else + return 0; +#endif +} + /* Send name and type of result to client. @@ -540,10 +555,18 @@ bool Protocol::send_fields(List<Item> *list, uint flag) pos= (char*) local_packet->ptr()+local_packet->length(); *pos++= 12; // Length of packed fields if (item->collation.collation == &my_charset_bin || thd_charset == NULL) + { + /* No conversion */ int2store(pos, field.charsetnr); + int4store(pos+2, field.length); + } else - int2store(pos, thd_charset->number); - int4store(pos+2, field.length); + { + /* With conversion */ + int2store(pos, thd_charset->number); + uint char_len= field.length / item->collation.collation->mbmaxlen; + int4store(pos+2, char_len * thd_charset->mbmaxlen); + } pos[6]= field.type; int2store(pos+7,field.flags); pos[9]= (char) field.decimals; @@ -713,7 +736,8 @@ bool Protocol::store_string_aux(const char *from, uint length, fromcs != &my_charset_bin && tocs != &my_charset_bin) { - return convert->copy(from, length, fromcs, tocs) || + uint dummy_errors; + return convert->copy(from, length, fromcs, tocs, &dummy_errors) || net_store_data(convert->ptr(), convert->length()); } return net_store_data(from, length); diff --git a/sql/protocol.h b/sql/protocol.h index d7ce5425ad1..a3b6da55da3 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -75,6 +75,7 @@ public: field_count=item_list->elements; return 0; } + virtual bool flush(); virtual void prepare_for_resend()=0; virtual bool store_null()=0; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 83fceca80ef..85a51ba9b51 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -20,7 +20,6 @@ #include "repl_failsafe.h" #include "sql_repl.h" #include "slave.h" -#include "sql_acl.h" #include "log_event.h" #include <mysql.h> @@ -92,7 +91,7 @@ static int init_failsafe_rpl_thread(THD* thd) VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); #endif - thd->mem_root.free=thd->mem_root.used=0; + thd->mem_root->free= thd->mem_root->used= 0; if (thd->variables.max_join_size == HA_POS_ERROR) thd->options|= OPTION_BIG_SELECTS; @@ -921,8 +920,8 @@ int load_master_data(THD* thd) */ int error; - if (init_master_info(active_mi, master_info_file, relay_log_info_file, - 0)) + if (init_master_info(active_mi, master_info_file, relay_log_info_file, + 0, (SLAVE_IO | SLAVE_SQL))) send_error(thd, ER_MASTER_INFO); strmake(active_mi->master_log_name, row[0], sizeof(active_mi->master_log_name)); diff --git a/sql/set_var.cc b/sql/set_var.cc index 66ed273d531..29ebb2c8817 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -55,7 +55,6 @@ #include "mysql_priv.h" #include <mysql.h> #include "slave.h" -#include "sql_acl.h" #include <my_getopt.h> #include <thr_alarm.h> #include <myisam.h> @@ -334,6 +333,14 @@ sys_var_thd_storage_engine sys_storage_engine("storage_engine", &SV::table_type); #ifdef HAVE_REPLICATION sys_var_sync_binlog_period sys_sync_binlog_period("sync_binlog", &sync_binlog_period); +sys_var_thd_ulong sys_sync_replication("sync_replication", + &SV::sync_replication); +sys_var_thd_ulong sys_sync_replication_slave_id( + "sync_replication_slave_id", + &SV::sync_replication_slave_id); +sys_var_thd_ulong sys_sync_replication_timeout( + "sync_replication_timeout", + &SV::sync_replication_timeout); #endif sys_var_bool_ptr sys_sync_frm("sync_frm", &opt_sync_frm); sys_var_long_ptr sys_table_cache_size("table_cache", @@ -352,12 +359,25 @@ sys_var_thd_ulong sys_net_wait_timeout("wait_timeout", #ifdef HAVE_INNOBASE_DB sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct", &srv_max_buf_pool_modified_pct); +sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag", + &srv_max_purge_lag); sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", &SV::innodb_table_locks); sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); -sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag", - &srv_max_purge_lag); +#endif + +#ifdef HAVE_NDBCLUSTER_DB +/* ndb thread specific variable settings */ +sys_var_thd_ulong +sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz", + &SV::ndb_autoincrement_prefetch_sz); +sys_var_thd_bool +sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send); +sys_var_thd_bool +sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count); +sys_var_thd_bool +sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions); #endif /* Time/date/datetime formats */ @@ -403,6 +423,9 @@ static sys_var_thd_bit sys_log_binlog("sql_log_bin", static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0, set_option_bit, OPTION_WARNINGS); +static sys_var_thd_bit sys_sql_notes("sql_notes", 0, + set_option_bit, + OPTION_SQL_NOTES); static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0, set_option_bit, OPTION_AUTO_IS_NULL); @@ -590,9 +613,13 @@ sys_var *sys_variables[]= &sys_sql_max_join_size, &sys_sql_mode, &sys_sql_warnings, + &sys_sql_notes, &sys_storage_engine, #ifdef HAVE_REPLICATION &sys_sync_binlog_period, + &sys_sync_replication, + &sys_sync_replication_slave_id, + &sys_sync_replication_timeout, #endif &sys_sync_frm, &sys_table_cache_size, @@ -608,10 +635,17 @@ sys_var *sys_variables[]= &sys_os, #ifdef HAVE_INNOBASE_DB &sys_innodb_max_dirty_pages_pct, + &sys_innodb_max_purge_lag, &sys_innodb_table_locks, &sys_innodb_max_purge_lag, &sys_innodb_autoextend_increment, -#endif +#endif +#ifdef HAVE_NDBCLUSTER_DB + &sys_ndb_autoincrement_prefetch_sz, + &sys_ndb_force_send, + &sys_ndb_use_exact_count, + &sys_ndb_use_transactions, +#endif &sys_unique_checks, &sys_warning_count }; @@ -692,11 +726,11 @@ struct show_var_st init_vars[]= { {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL}, {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL}, - {"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL}, {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT}, {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG }, {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG }, + {"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL}, {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR}, {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL}, {"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG }, @@ -704,10 +738,10 @@ struct show_var_st init_vars[]= { {"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG}, {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS}, - {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS}, {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, + {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS}, {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG }, #endif {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, @@ -771,6 +805,13 @@ struct show_var_st init_vars[]= { #ifdef __NT__ {"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL}, #endif +#ifdef HAVE_NDBCLUSTER_DB + {sys_ndb_autoincrement_prefetch_sz.name, + (char*) &sys_ndb_autoincrement_prefetch_sz, SHOW_SYS}, + {sys_ndb_force_send.name, (char*) &sys_ndb_force_send, SHOW_SYS}, + {sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS}, + {sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS}, +#endif {sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS}, {sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS}, {sys_net_retry_count.name, (char*) &sys_net_retry_count, SHOW_SYS}, @@ -822,8 +863,13 @@ struct show_var_st init_vars[]= { {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS}, {sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS}, {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS}, + {"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL}, + {"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL}, #ifdef HAVE_REPLICATION {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS}, + {sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS}, + {sys_sync_replication_slave_id.name, (char*) &sys_sync_replication_slave_id,SHOW_SYS}, + {sys_sync_replication_timeout.name, (char*) &sys_sync_replication_timeout,SHOW_SYS}, #endif {sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS}, #ifdef HAVE_TZNAME @@ -1163,7 +1209,7 @@ static void fix_max_connections(THD *thd, enum_var_type type) static void fix_thd_mem_root(THD *thd, enum_var_type type) { if (type != OPT_GLOBAL) - reset_root_defaults(&thd->mem_root, + reset_root_defaults(thd->mem_root, thd->variables.query_alloc_block_size, thd->variables.query_prealloc_size); } @@ -1183,6 +1229,12 @@ static void fix_server_id(THD *thd, enum_var_type type) server_id_supplied = 1; } +bool sys_var_long_ptr::check(THD *thd, set_var *var) +{ + longlong v= var->value->val_int(); + var->save_result.ulonglong_value= v < 0 ? 0 : v; + return 0; +} bool sys_var_long_ptr::update(THD *thd, set_var *var) { @@ -2148,7 +2200,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var) if (!tmp) // Zero size means delete { - if (key_cache == sql_key_cache) + if (key_cache == dflt_key_cache) goto end; // Ignore default key cache if (key_cache->key_cache_inited) // If initied @@ -2162,7 +2214,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var) base_name->length, &list); key_cache->in_init= 1; pthread_mutex_unlock(&LOCK_global_system_variables); - error= reassign_keycache_tables(thd, key_cache, sql_key_cache); + error= reassign_keycache_tables(thd, key_cache, dflt_key_cache); pthread_mutex_lock(&LOCK_global_system_variables); key_cache->in_init= 0; } @@ -2412,8 +2464,15 @@ bool sys_var_thd_time_zone::check(THD *thd, set_var *var) bool sys_var_thd_time_zone::update(THD *thd, set_var *var) { - /* We are using Time_zone object found during check() phase */ - *get_tz_ptr(thd,var->type)= var->save_result.time_zone; + /* We are using Time_zone object found during check() phase. */ + if (var->type == OPT_GLOBAL) + { + pthread_mutex_lock(&LOCK_global_system_variables); + global_system_variables.time_zone= var->save_result.time_zone; + pthread_mutex_unlock(&LOCK_global_system_variables); + } + else + thd->variables.time_zone= var->save_result.time_zone; return 0; } @@ -2425,27 +2484,25 @@ byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type, We can use ptr() instead of c_ptr() here because String contaning time zone name is guaranteed to be zero ended. */ - return (byte *)((*get_tz_ptr(thd,type))->get_name()->ptr()); -} - - -Time_zone** sys_var_thd_time_zone::get_tz_ptr(THD *thd, - enum_var_type type) -{ if (type == OPT_GLOBAL) - return &global_system_variables.time_zone; + return (byte *)(global_system_variables.time_zone->get_name()->ptr()); else - return &thd->variables.time_zone; + return (byte *)(thd->variables.time_zone->get_name()->ptr()); } void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type) { + pthread_mutex_lock(&LOCK_global_system_variables); if (type == OPT_GLOBAL) { if (default_tz_name) { String str(default_tz_name, &my_charset_latin1); + /* + We are guaranteed to find this time zone since its existence + is checked during start-up. + */ global_system_variables.time_zone= my_tz_find(&str, thd->lex->time_zone_tables_used); } @@ -2454,6 +2511,7 @@ void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type) } else thd->variables.time_zone= global_system_variables.time_zone; + pthread_mutex_unlock(&LOCK_global_system_variables); } /* @@ -2693,21 +2751,25 @@ sys_var *find_sys_var(const char *str, uint length) int sql_set_variables(THD *thd, List<set_var_base> *var_list) { - int error= 0; + int error; List_iterator_fast<set_var_base> it(*var_list); DBUG_ENTER("sql_set_variables"); set_var_base *var; while ((var=it++)) { - if ((error=var->check(thd))) - DBUG_RETURN(error); + if ((error= var->check(thd))) + goto err; } - if (thd->net.report_error) - DBUG_RETURN(1); - it.rewind(); - while ((var=it++)) - error|= var->update(thd); // Returns 0, -1 or 1 + if (!(error= test(thd->net.report_error))) + { + it.rewind(); + while ((var= it++)) + error|= var->update(thd); // Returns 0, -1 or 1 + } + +err: + free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(error); } @@ -2768,7 +2830,8 @@ int set_var::check(THD *thd) return 0; } - if (value->fix_fields(thd, 0, &value) || value->check_cols(1)) + if ((!value->fixed && + value->fix_fields(thd, 0, &value)) || value->check_cols(1)) return -1; if (var->check_update_type(value->result_type())) { @@ -2803,7 +2866,8 @@ int set_var::light_check(THD *thd) if (type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL)) return 1; - if (value && (value->fix_fields(thd, 0, &value) || value->check_cols(1))) + if (value && ((!value->fixed && value->fix_fields(thd, 0, &value)) || + value->check_cols(1))) return -1; return 0; } @@ -2880,8 +2944,8 @@ int set_var_password::check(THD *thd) if (!user->host.str) user->host.str= (char*) thd->host_or_ip; /* Returns 1 as the function sends error to client */ - return check_change_password(thd, user->host.str, user->user.str, password) ? - 1 : 0; + return check_change_password(thd, user->host.str, user->user.str, + password, strlen(password)) ? 1 : 0; #else return 0; #endif @@ -2912,9 +2976,11 @@ bool sys_var_thd_storage_engine::check(THD *thd, set_var *var) if (var->value->result_type() == STRING_RESULT) { + enum db_type db_type; if (!(res=var->value->val_str(&str)) || !(var->save_result.ulong_value= - (ulong) ha_resolve_by_name(res->ptr(), res->length()))) + (ulong) (db_type= ha_resolve_by_name(res->ptr(), res->length()))) || + ha_checktype(db_type) != db_type) { value= res ? res->c_ptr() : "NULL"; goto err; diff --git a/sql/set_var.h b/sql/set_var.h index 4a4e631d88c..080a2a95ae0 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -93,6 +93,7 @@ public: sys_var_long_ptr(const char *name_arg, ulong *value_ptr, sys_after_update_func func) :sys_var(name_arg,func), value(value_ptr) {} + bool check(THD *thd, set_var *var); bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE type() { return SHOW_LONG; } @@ -736,7 +737,6 @@ public: bool update(THD *thd, set_var *var); byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); virtual void set_default(THD *thd, enum_var_type type); - Time_zone **get_tz_ptr(THD *thd, enum_var_type type); }; /**************************************************************************** diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 355e784b156..bb2bd29171a 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -209,7 +209,7 @@ character-set=latin1 "Erreur d'écriture réseau reçue du maître", "Impossible de trouver un index FULLTEXT correspondant à cette liste de colonnes", "Impossible d'exécuter la commande car vous avez des tables verrouillées ou une transaction active", -"Variable système '%-.64' inconnue", +"Variable système '%-.64s' inconnue", "La table '%-.64s' est marquée 'crashed' et devrait être réparée", "La table '%-.64s' est marquée 'crashed' et le dernier 'repair' a échoué", "Attention: certaines tables ne supportant pas les transactions ont été changées et elles ne pourront pas être restituées", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 06f31a79a73..87168431595 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -168,7 +168,7 @@ character-set=greek "You have an error in your SQL syntax", "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", -"Aborted connection %ld to db: '%-.64s' user: '%-32s' (%-.64s)", +"Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)", "Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", diff --git a/sql/share/japanese-sjis/errmsg.txt b/sql/share/japanese-sjis/errmsg.txt new file mode 100644 index 00000000000..a06723727b7 --- /dev/null +++ b/sql/share/japanese-sjis/errmsg.txt @@ -0,0 +1,325 @@ +/* Copyright (C) 2003 MySQL 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 */ + +/* + Shift-JIS Japanese +*/ + +character-set=sjis + +"hashchk", +"isamchk", +"NO", +"YES", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ªì‚ê‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒe[ƒuƒ‹‚ªì‚ê‚Ü‚¹‚ñ.(errno: %d)", +"'%-.64s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ.Šù‚É‚»‚̃f[ƒ^ƒx[ƒX‚ª‘¶Ý‚µ‚Ü‚·", +"'%-.64s' ƒf[ƒ^ƒx[ƒX‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ. ‚»‚̃f[ƒ^ƒx[ƒX‚ª‚È‚¢‚̂ł·.", +"ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.64s' ‚ð휂ł«‚Ü‚¹‚ñ, errno: %d)", +"ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.64s' ‚ð rmdir ‚Å‚«‚Ü‚¹‚ñ, errno: %d)", +"'%-.64s' ‚Ì휂ªƒGƒ‰[ (errno: %d)", +"system table ‚̃ŒƒR[ƒh‚ð“ǂގ–‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½", +"'%-.64s' ‚̃XƒeƒCƒ^ƒX‚ª“¾‚ç‚ê‚Ü‚¹‚ñ. (errno: %d)", +"working directory ‚𓾂鎖‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ (errno: %d)", +"ƒtƒ@ƒCƒ‹‚ðƒƒbƒN‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ðŠJ‚Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ðŒ©•t‚¯‚鎖‚ª‚Å‚«‚Ü‚¹‚ñ.(errno: %d)", +"'%-.64s' ƒfƒBƒŒƒNƒgƒŠ‚ª“ǂ߂܂¹‚ñ.(errno: %d)", +"'%-.64s' ƒfƒBƒŒƒNƒgƒŠ‚É chdir ‚Å‚«‚Ü‚¹‚ñ.(errno: %d)", +"Record has changed since last read in table '%-.64s'", +"Disk full (%s). ’N‚©‚ª‰½‚©‚ðŒ¸‚ç‚·‚܂ł܂Á‚Ä‚‚¾‚³‚¢...", +"table '%-.64s' ‚É key ‚ªd•¡‚µ‚Ä‚¢‚Ä‘‚«‚±‚߂܂¹‚ñ", +"Error on close of '%-.64s' (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚̓ǂݞ‚݃Gƒ‰[ (errno: %d)", +"'%-.64s' ‚ð '%-.64s' ‚É rename ‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ð‘‚Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ‚̓ƒbƒN‚³‚ê‚Ä‚¢‚Ü‚·", +"Sort ’†’f", +"View '%-.64s' ‚ª '%-.64s' ‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"Got error %d from table handler", +"Table handler for '%-.64s' doesn't have this option", +"'%-.64s'‚̂Ȃ©‚ɃŒƒR[ƒh‚ªŒ©•t‚©‚è‚Ü‚¹‚ñ", +"ƒtƒ@ƒCƒ‹ '%-.64s' ‚Ì info ‚ªŠÔˆá‚Á‚Ä‚¢‚邿‚¤‚Å‚·", +"'%-.64s' ƒe[ƒuƒ‹‚Ì key file ‚ªŠÔˆá‚Á‚Ä‚¢‚邿‚¤‚Å‚·. C•œ‚ð‚µ‚Ä‚‚¾‚³‚¢", +"'%-.64s' ƒe[ƒuƒ‹‚͌¢Œ`Ž®‚Ì key file ‚̂悤‚Å‚·; C•œ‚ð‚µ‚Ä‚‚¾‚³‚¢", +"'%-.64s' ‚͓ǂݞ‚Ýê—p‚Å‚·", +"Out of memory. ƒf[ƒ‚ƒ“‚ðƒŠƒXƒ^[ƒg‚µ‚Ă݂Ă‚¾‚³‚¢ (%d bytes •K—v)", +"Out of sort memory. sort buffer size ‚ª‘«‚è‚È‚¢‚悤‚Å‚·.", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ð“ǂݞ‚Ý’†‚É EOF ‚ª—\Šú‚¹‚ÊŠ‚ÅŒ»‚ê‚Ü‚µ‚½. (errno: %d)", +"Ú‘±‚ª‘½‚·‚¬‚Ü‚·", +"Out of memory; mysqld ‚©‚»‚Ì‘¼‚̃vƒƒZƒX‚ªƒƒ‚ƒŠ[‚ð‘S‚ÄŽg‚Á‚Ä‚¢‚é‚©Šm”F‚µ‚Ä‚‚¾‚³‚¢. ƒƒ‚ƒŠ[‚ðŽg‚¢Ø‚Á‚Ä‚¢‚È‚¢ê‡A'ulimit' ‚ðݒ肵‚Ä mysqld ‚̃ƒ‚ƒŠ[Žg—pŒÀŠE—ʂ𑽂‚·‚é‚©Aswap space ‚ð‘‚₵‚Ă݂Ă‚¾‚³‚¢", +"‚»‚Ì address ‚Ì hostname ‚ªˆø‚¯‚Ü‚¹‚ñ.", +"Bad handshake", +"ƒ†[ƒU[ '%-.32s'@'%-.64s' ‚Ì '%-.64s' ƒf[ƒ^ƒx[ƒX‚ւ̃AƒNƒZƒX‚ð‹‘”Û‚µ‚Ü‚·", +"ƒ†[ƒU[ '%-.32s'@'%-.64s' ‚ð‹‘”Û‚µ‚Ü‚·.uUsing password: %s)", +"ƒf[ƒ^ƒx[ƒX‚ª‘I‘ð‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ.", +"‚»‚̃Rƒ}ƒ“ƒh‚͉½H", +"Column '%-.64s' ‚Í null ‚ɂ͂ł«‚È‚¢‚̂ł·", +"'%-.64s' ‚È‚ñ‚ăf[ƒ^ƒx[ƒX‚Í’m‚è‚Ü‚¹‚ñ.", +"Table '%-.64s' ‚ÍŠù‚É‚ ‚è‚Ü‚·", +"table '%-.64s' ‚Í‚ ‚è‚Ü‚¹‚ñ.", +"Column: '%-.64s' in %-.64s is ambiguous", +"Server ‚ð shutdown ’†...", +"'%-.64s' column ‚Í '%-.64s' ‚ɂ͂ ‚è‚Ü‚¹‚ñ.", +"'%-.64s' isn't in GROUP BY", +"Can't group on '%-.64s'", +"Statement has sum functions and columns in same statement", +"Column count doesn't match value count", +"Identifier name '%-.100s' ‚Í’·‚·‚¬‚Ü‚·", +"'%-.64s' ‚Æ‚¢‚¤ column –¼‚Íd•¡‚µ‚Ă܂·", +"'%-.64s' ‚Æ‚¢‚¤ key ‚Ì–¼‘O‚Íd•¡‚µ‚Ä‚¢‚Ü‚·", +"'%-.64s' ‚Í key %d ‚É‚¨‚¢‚Äd•¡‚µ‚Ä‚¢‚Ü‚·", +"Incorrect column specifier for column '%-.64s'", +"%s : '%-.80s' •t‹ß : %d s–Ú", +"Query ‚ª‹ó‚Å‚·.", +"'%-.64s' ‚͈êˆÓ‚Ì table/alias –¼‚ł͂ ‚è‚Ü‚¹‚ñ", +"Invalid default value for '%-.64s'", +"•¡”‚Ì primary key ‚ª’è‹`‚³‚ê‚Ü‚µ‚½", +"key ‚ÌŽw’肪‘½‚·‚¬‚Ü‚·. key ‚ÍÅ‘å %d ‚܂łł·", +"Too many key parts specified; max %d parts allowed", +"key ‚ª’·‚·‚¬‚Ü‚·. key ‚Ì’·‚³‚ÍÅ‘å %d ‚Å‚·", +"Key column '%-.64s' ‚ªƒe[ƒuƒ‹‚É‚ ‚è‚Ü‚¹‚ñ.", +"BLOB column '%-.64s' can't be used in key specification with the used table type", +"column '%-.64s' ‚Í,Šm•Û‚·‚é column ‚̑傫‚³‚ª‘½‚·‚¬‚Ü‚·. (Å‘å %d ‚Ü‚Å). BLOB ‚ð‚©‚í‚è‚ÉŽg—p‚µ‚Ä‚‚¾‚³‚¢.", +"ƒe[ƒuƒ‹‚Ì’è‹`‚ªˆá‚¢‚Ü‚·; there can be only one auto column and it must be defined as a key", +"%s: €”õŠ®—¹", +"%s: Normal shutdown\n", +"%s: Got signal %d. ’†’f!\n", +"%s: Shutdown Š®—¹\n", +"%s: ƒXƒŒƒbƒh %ld ‹§I—¹ user: '%-.64s'\n", +"IP socket ‚ªì‚ê‚Ü‚¹‚ñ", +"Table '%-.64s' ‚Í‚»‚̂悤‚È index ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ(CREATE INDEX ŽÀsŽž‚ÉŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ). ƒe[ƒuƒ‹‚ðì‚è’¼‚µ‚Ä‚‚¾‚³‚¢", +"Field separator argument is not what is expected; check the manual", +"You can't use fixed rowlength with BLOBs; please use 'fields terminated by'.", +"ƒtƒ@ƒCƒ‹ '%-.64s' ‚Í databse ‚Ì directory ‚É‚ ‚é‚©‘S‚Ẵ†[ƒU[‚ª“Ç‚ß‚é‚æ‚¤‚É‹–‰Â‚³‚ê‚Ä‚¢‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ.", +"File '%-.64s' ‚ÍŠù‚É‘¶Ý‚µ‚Ü‚·", +"ƒŒƒR[ƒh”: %ld íœ: %ld Skipped: %ld Warnings: %ld", +"ƒŒƒR[ƒh”: %ld d•¡: %ld", +"Incorrect sub part key; the used key part isn't a string or the used length is longer than the key part", +"ALTER TABLE ‚Å‘S‚Ä‚Ì column ‚Í휂ł«‚Ü‚¹‚ñ. DROP TABLE ‚ðŽg—p‚µ‚Ä‚‚¾‚³‚¢", +"'%-.64s' ‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½; check that column/key exists", +"ƒŒƒR[ƒh”: %ld d•¡”: %ld Warnings: %ld", +"You can't specify target table '%-.64s' for update in FROM clause", +"thread id: %lu ‚Í‚ ‚è‚Ü‚¹‚ñ", +"thread %lu ‚̃I[ƒi[‚ł͂ ‚è‚Ü‚¹‚ñ", +"No tables used", +"Too many strings for column %-.64s and SET", +"Can't generate a unique log-filename %-.64s.(1-999)\n", +"Table '%-.64s' ‚Í READ lock ‚ɂȂÁ‚Ä‚¢‚ÄAXV‚͂ł«‚Ü‚¹‚ñ", +"Table '%-.64s' ‚Í LOCK TABLES ‚É‚æ‚Á‚ăƒbƒN‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"BLOB column '%-.64s' can't have a default value", +"Žw’肵‚½ database –¼ '%-.100s' ‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚·", +"Žw’肵‚½ table –¼ '%-.100s' ‚͂܂¿‚ª‚Á‚Ä‚¢‚Ü‚·", +"The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay", +"Unknown error", +"Unknown procedure '%-.64s'", +"Incorrect parameter count to procedure '%-.64s'", +"Incorrect parameters to procedure '%-.64s'", +"Unknown table '%-.64s' in %s", +"Column '%-.64s' specified twice", +"Invalid use of group function", +"Table '%-.64s' uses an extension that doesn't exist in this MySQL version", +"ƒe[ƒuƒ‹‚ÍÅ’á 1 ŒÂ‚Ì column ‚ª•K—v‚Å‚·", +"table '%-.64s' ‚Í‚¢‚Á‚Ï‚¢‚Å‚·", +"character set '%-.64s' ‚̓Tƒ|[ƒg‚µ‚Ä‚¢‚Ü‚¹‚ñ", +"ƒe[ƒuƒ‹‚ª‘½‚·‚¬‚Ü‚·; MySQL can only use %d tables in a join", +"column ‚ª‘½‚·‚¬‚Ü‚·", +"row size ‚ª‘å‚«‚·‚¬‚Ü‚·. BLOB ‚ðŠÜ‚܂Ȃ¢ê‡‚Ì row size ‚ÌÅ‘å‚Í %d ‚Å‚·. ‚¢‚‚‚©‚Ì field ‚ð BLOB ‚ɕς¦‚Ä‚‚¾‚³‚¢.", +"Thread stack overrun: Used: %ld of a %ld stack. ƒXƒ^ƒbƒN—̈æ‚𑽂‚Ƃ肽‚¢ê‡A'mysqld -O thread_stack=#' ‚ÆŽw’肵‚Ä‚‚¾‚³‚¢", +"Cross dependency found in OUTER JOIN; examine your ON conditions", +"Column '%-.64s' ‚ª UNIQUE ‚© INDEX ‚ÅŽg—p‚³‚ê‚Ü‚µ‚½. ‚±‚̃Jƒ‰ƒ€‚Í NOT NULL ‚Æ’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ.", +"function '%-.64s' ‚ð ƒ[ƒh‚Å‚«‚Ü‚¹‚ñ", +"function '%-.64s' ‚ð‰Šú‰»‚Å‚«‚Ü‚¹‚ñ; %-.80s", +"shared library ‚ւ̃pƒX‚ª’Ê‚Á‚Ä‚¢‚Ü‚¹‚ñ", +"Function '%-.64s' ‚ÍŠù‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚·", +"shared library '%-.64s' ‚ðŠJ‚Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d %s)", +"function '%-.64s' ‚ðƒ‰ƒCƒuƒ‰ƒŠ[’†‚ÉŒ©•t‚¯‚鎖‚ª‚Å‚«‚Ü‚¹‚ñ", +"Function '%-.64s' ‚Í’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"Host '%-.64s' ‚Í many connection error ‚Ì‚½‚ßA‹‘”Û‚³‚ê‚Ü‚µ‚½. 'mysqladmin flush-hosts' ‚ʼn𜂵‚Ä‚‚¾‚³‚¢", +"Host '%-.64s' ‚Í MySQL server ‚ÉÚ‘±‚ð‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"MySQL ‚ð anonymous users ‚ÅŽg—p‚µ‚Ä‚¢‚éó‘Ô‚Å‚ÍAƒpƒXƒ[ƒh‚Ì•ÏX‚͂ł«‚Ü‚¹‚ñ", +"‘¼‚̃†[ƒU[‚̃pƒXƒ[ƒh‚ð•ÏX‚·‚邽‚߂ɂÍ, mysql ƒf[ƒ^ƒx[ƒX‚ɑ΂µ‚Ä update ‚Ì‹–‰Â‚ª‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ.", +"Can't find any matching row in the user table", +"ˆê’v”(Rows matched): %ld •ÏX: %ld Warnings: %ld", +"V‹K‚ɃXƒŒƒbƒh‚ªì‚ê‚Ü‚¹‚ñ‚Å‚µ‚½ (errno %d). ‚à‚µÅ‘åŽg—p‹–‰Âƒƒ‚ƒŠ[”‚ð‰z‚¦‚Ä‚¢‚È‚¢‚̂ɃGƒ‰[‚ª”¶‚µ‚Ä‚¢‚é‚È‚ç, ƒ}ƒjƒ…ƒAƒ‹‚Ì’†‚©‚ç 'possible OS-dependent bug' ‚Æ‚¢‚¤•¶Žš‚ð’T‚µ‚Ä‚‚݂Ă¾‚³‚¢.", +"Column count doesn't match value count at row %ld", +"Can't reopen table: '%-.64s'", +"NULL ’l‚ÌŽg—p•û–@‚ª•s“K؂ł·", +"Got error '%-.64s' from regexp", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", +"ƒ†[ƒU[ '%-.32s' (ƒzƒXƒg '%-.64s' ‚̃†[ƒU[) ‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.32s'@'%-.64s' ,ƒe[ƒuƒ‹ '%-.64s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.32s'@'%-.64s'\n ƒJƒ‰ƒ€ '%-.64s' ƒe[ƒuƒ‹ '%-.64s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used.", +"The host or user argument to GRANT is too long", +"Table '%-.64s.%s' doesn't exist", +"There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", +"The used command is not allowed with this MySQL version", +"Something is wrong in your syntax", +"Delayed insert thread couldn't get requested lock for table %-.64s", +"Too many delayed threads in use", +"Aborted connection %ld to db: '%-.64s' user: '%-.64s' (%s)", +"Got a packet bigger than 'max_allowed_packet' bytes", +"Got a read error from the connection pipe", +"Got an error from fcntl()", +"Got packets out of order", +"Couldn't uncompress communication packet", +"Got an error reading communication packets", +"Got timeout reading communication packets", +"Got an error writing communication packets", +"Got timeout writing communication packets", +"Result string is longer than 'max_allowed_packet' bytes", +"The used table type doesn't support BLOB/TEXT columns", +"The used table type doesn't support AUTO_INCREMENT columns", +"INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", +"Incorrect column name '%-.100s'", +"The used table handler can't index column '%-.64s'", +"All tables in the MERGE table are not defined identically", +"Can't write, because of unique constraint, to table '%-.64s'", +"BLOB column '%-.64s' used in key specification without a key length", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", +"Result consisted of more than one row", +"This table type requires a primary key", +"This version of MySQL is not compiled with RAID support", +"You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column", +"Key '%-.64s' doesn't exist in table '%-.64s'", +"Can't open table", +"The handler for the table doesn't support %s", +"You are not allowed to execute this command in a transaction", +"Got error %d during COMMIT", +"Got error %d during ROLLBACK", +"Got error %d during FLUSH_LOGS", +"Got error %d during CHECKPOINT", +"Aborted connection %ld to db: '%-.64s' user: '%-.32s' host: `%-.64s' (%-.64s)", +"The handler for the table does not support binary table dump", +"Binlog closed while trying to FLUSH MASTER", +"Failed rebuilding the index of dumped table '%-.64s'", +"Error from master: '%-.64s'", +"Net error reading from master", +"Net error writing to master", +"Can't find FULLTEXT index matching the column list", +"Can't execute the given command because you have active locked tables or an active transaction", +"Unknown system variable '%-.64s'", +"Table '%-.64s' is marked as crashed and should be repaired", +"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", +"Some non-transactional changed tables couldn't be rolled back", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", +"User %-.64s has already more than 'max_user_connections' active connections", +"You may only use constant expressions with SET", +"Lock wait timeout exceeded; try restarting transaction", +"The total number of locks exceeds the lock table size", +"Update locks cannot be acquired during a READ UNCOMMITTED transaction", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", +"Incorrect arguments to %s", +"'%-.32s'@'%-.64s' is not allowed to create new users", +"Incorrect table definition; all MERGE tables must be in the same database", +"Deadlock found when trying to get lock; try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", +"Cannot add foreign key constraint", +"Cannot add a child row: a foreign key constraint fails", +"Cannot delete a parent row: a foreign key constraint fails", +"Error connecting to master: %-.128s", +"Error running query on master: %-.128s", +"Error when executing command %s: %-.128s", +"Incorrect usage of %s and %s", +"The used SELECT statements have a different number of columns", +"Can't execute the query because you have a conflicting read lock", +"Mixing of transactional and non-transactional tables is disabled", +"Option '%s' used twice in statement", +"User '%-.64s' has exceeded the '%s' resource (current value: %ld)", +"Access denied; you need the %-.128s privilege for this operation", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", +"Variable '%-.64s' doesn't have a default value", +"Variable '%-.64s' can't be set to the value of '%-.64s'", +"Incorrect argument type to variable '%-.64s'", +"Variable '%-.64s' can only be set, not read", +"Incorrect usage/placement of '%s'", +"This version of MySQL doesn't yet support '%s'", +"Got fatal error %d: '%-.128s' from master when reading data from binary log", +"Slave SQL thread ignored the query because of replicate-*-table rules", +"Variable '%-.64s' is a %s variable", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", +"Operand should contain %d column(s)", +"Subquery returns more than 1 row", +"Unknown prepared statement handler (%.*s) given to %s", +"Help database is corrupt or does not exist", +"Cyclic reference on subqueries", +"Converting column '%s' from %s to %s", +"Reference '%-.64s' not supported (%s)", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", +"Client does not support authentication protocol requested by server; consider upgrading MySQL client", +"All parts of a SPATIAL index must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"Slave is already running", +"Slave has already been stopped", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", +"Row %ld doesn't contain data for all columns", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", +"Data truncated for column '%s' at row %ld", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", +"Can't drop one or more of the requested users", +"Can't revoke all privileges, grant for one or more of the requested users", +"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", +"Illegal mix of collations for operation '%s'", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", +"Unknown collation: '%-.64s'", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", +"Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", +"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", +"SQL thread is not to be started so UNTIL options are ignored", +"Incorrect index name '%-.100s'", +"Incorrect catalog name '%-.100s'", +"Query cache failed to set size %lu, new query cache size is %lu", +"Column '%-.64s' cannot be part of FULLTEXT index", +"Unknown key cache '%-.100s'", +"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", +"'%s' is deprecated, use '%s' instead", +"The target table %-.100s of the %s is not updateable", +"The '%s' feature was disabled; you need MySQL built with '%s' to have it working", +"The MySQL server is running with the %s option so it cannot execute this statement", +"Column '%-.100s' has duplicated value '%-.64s' in %s" +"Truncated wrong %-.32s value: '%-.128s'" +"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", +"This command is not supported in the prepared statement protocol yet", +"Got NDB error %d '%-.100s'", +"Got temporary NDB error %d '%-.100s'", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", +"Invalid %s character string: '%.64s'", +"Result of %s() was larger than max_allowed_packet (%ld) - truncated" +"Conflicting declarations: '%s%s' and '%s%s'" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index c79c346008e..65d80918072 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -211,7 +211,7 @@ character-set=latin1 "Erro de rede gravando no 'master'", "Não pode encontrar um índice para o texto todo que combine com a lista de colunas", "Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma transação ativa", -"Variável de sistema '%-.64' desconhecida", +"Variável de sistema '%-.64s' desconhecida", "Tabela '%-.64s' está marcada como danificada e deve ser reparada", "Tabela '%-.64s' está marcada como danificada e a última reparação (automática?) falhou", "Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas (rolled back)", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 7cb0427dc3f..01c22f00119 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -173,7 +173,7 @@ character-set=latin2 "Aveti o eroare in sintaxa RSQL", "Thread-ul pentru inserarea aminata nu a putut obtine lacatul (lock) pentru tabela %-.64s", "Prea multe threaduri aminate care sint in uz", -"Conectie terminata %ld la baza de date: '%-.64s' utilizator: '%-32s' (%-.64s)", +"Conectie terminata %ld la baza de date: '%-.64s' utilizator: '%-.32s' (%-.64s)", "Un packet mai mare decit 'max_allowed_packet' a fost primit", "Eroare la citire din cauza lui 'connection pipe'", "Eroare obtinuta de la fcntl()", diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 45b56c8269c..06270f621e4 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -202,7 +202,7 @@ character-set=cp1250 "Greška u slanju mrežnih paketa na glavni server u klasteru", "Ne mogu da pronaðem 'FULLTEXT' indeks koli odgovara listi kolona", "Ne mogu da izvršim datu komandu zbog toga što su tabele zakljuèane ili je transakcija u toku", -"Nepoznata sistemska promenljiva '%-.64'", +"Nepoznata sistemska promenljiva '%-.64s'", "Tabela '%-.64s' je markirana kao ošteæena i trebala bi biti popravljena", "Tabela '%-.64s' je markirana kao ošteæena, a zadnja (automatska?) popravka je bila neuspela", "Upozorenje: Neke izmenjene tabele ne podržavaju komandu 'ROLLBACK'", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index bd2439c44a6..c5b4fd34eca 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -238,9 +238,9 @@ character-set=latin1 "No puede adicionar clave extranjera constraint", "No puede adicionar una línea hijo: falla de clave extranjera constraint", "No puede deletar una línea padre: falla de clave extranjera constraint", -"Error de coneccion a master: %-128s", -"Error executando el query en master: %-128%", -"Error de %s: %-128%", +"Error de coneccion a master: %-.128s", +"Error executando el query en master: %-.128s", +"Error de %s: %-.128s", "Equivocado uso de %s y %s", "El comando SELECT usado tiene diferente número de columnas", "No puedo ejecutar el query porque usted tiene conflicto de traba de lectura", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index da75e4fcede..4dc42389d89 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -101,7 +101,7 @@ character-set=latin1 "Tabellen '%-.64s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellen", "Fältseparatorerna är vad som förväntades. Kontrollera mot manualen", "Man kan inte använda fast radlängd med blobs. Använd 'fields terminated by'", -"Textfilen '%' måste finnas i databasbiblioteket eller vara läsbar för alla", +"Textfilen '%.64s' måste finnas i databasbiblioteket eller vara läsbar för alla", "Filen '%-.64s' existerar redan", "Rader: %ld Bortagna: %ld Dubletter: %ld Varningar: %ld", "Rader: %ld Dubletter: %ld", @@ -200,7 +200,7 @@ character-set=latin1 "Fick fel %d vid ROLLBACK", "Fick fel %d vid FLUSH_LOGS", "Fick fel %d vid CHECKPOINT", -"Avbröt länken för tråd %ld till db '%-.64s', användare '%-.32s', host '%-.64s' (%.-64s)", +"Avbröt länken för tråd %ld till db '%-.64s', användare '%-.32s', host '%-.64s' (%-.64s)", "Tabellhanteraren klarar inte en binär kopiering av tabellen", "Binärloggen stängdes medan FLUSH MASTER utfördes", "Failed rebuilding the index of dumped table '%-.64s'", diff --git a/sql/slave.cc b/sql/slave.cc index 4ef8715f1e6..a39cbdbe14b 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -161,7 +161,7 @@ int init_slave() } if (init_master_info(active_mi,master_info_file,relay_log_info_file, - !master_host)) + !master_host, (SLAVE_IO | SLAVE_SQL))) { sql_print_error("Failed to initialize the master info structure"); goto err; @@ -545,7 +545,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, pthread_mutex_t *cond_lock, pthread_cond_t* term_cond, - volatile bool* slave_running) + volatile uint *slave_running) { if (term_lock) { @@ -583,7 +583,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, pthread_mutex_t *cond_lock, pthread_cond_t *start_cond, - volatile bool *slave_running, + volatile uint *slave_running, volatile ulong *slave_run_id, MASTER_INFO* mi, bool high_priority) @@ -759,7 +759,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len) 1 should be logged/replicated */ -int tables_ok(THD* thd, TABLE_LIST* tables) +bool tables_ok(THD* thd, TABLE_LIST* tables) { bool some_tables_updating= 0; DBUG_ENTER("tables_ok"); @@ -963,7 +963,7 @@ void end_slave() static bool io_slave_killed(THD* thd, MASTER_INFO* mi) { DBUG_ASSERT(mi->io_thd == thd); - DBUG_ASSERT(mi->slave_running == 1); // tracking buffer overrun + DBUG_ASSERT(mi->slave_running); // tracking buffer overrun return mi->abort_slave || abort_loop || thd->killed; } @@ -1032,7 +1032,7 @@ bool net_request_file(NET* net, const char* fname) } -const char *rewrite_db(const char* db) +const char *rewrite_db(const char* db, uint32 *new_len) { if (replicate_rewrite_db.is_empty() || !db) return db; @@ -1042,7 +1042,10 @@ const char *rewrite_db(const char* db) while ((tmp=it++)) { if (!strcmp(tmp->key, db)) + { + *new_len= (uint32)strlen(tmp->val); return tmp->val; + } } return db; } @@ -1056,7 +1059,7 @@ const char *rewrite_db(const char* db) const char *print_slave_db_safe(const char* db) { - return (db ? rewrite_db(db) : ""); + return (db ? db : ""); } /* @@ -1240,7 +1243,11 @@ not always make sense; please check the manual before using it)."; values of these 2 are never used (new connections don't use them). We don't test equality of global collation_database either as it's is going to be deprecated (made read-only) in 4.1 very soon. + We don't do it for <3.23.57 because masters <3.23.50 hang on + SELECT @@unknown_var (BUG#7965 - see changelog of 3.23.50). */ + if (mi->old_format == BINLOG_FORMAT_323_LESS_57) + goto err; if (!mysql_real_query(mysql, "SELECT @@GLOBAL.COLLATION_SERVER", 32) && (master_res= mysql_store_result(mysql))) { @@ -1277,6 +1284,7 @@ be equal for replication to work"; mysql_free_result(master_res); } +err: if (errmsg) { sql_print_error(errmsg); @@ -1764,19 +1772,13 @@ void init_master_info_with_options(MASTER_INFO* mi) strmake(mi->ssl_key, master_ssl_key, sizeof(mi->ssl_key)-1); } -static void clear_slave_error(RELAY_LOG_INFO* rli) +void clear_slave_error(RELAY_LOG_INFO* rli) { /* Clear the errors displayed by SHOW SLAVE STATUS */ rli->last_slave_error[0]= 0; rli->last_slave_errno= 0; } -void clear_slave_error_timestamp(RELAY_LOG_INFO* rli) -{ - rli->last_master_timestamp= 0; - clear_slave_error(rli); -} - /* Reset UNTIL condition for RELAY_LOG_INFO SYNOPSYS @@ -1796,7 +1798,8 @@ void clear_until_condition(RELAY_LOG_INFO* rli) int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, - bool abort_if_no_master_info_file) + bool abort_if_no_master_info_file, + int thread_mask) { int fd,error; char fname[FN_REFLEN+128]; @@ -1810,8 +1813,16 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname, last time. If this case pos_in_file would be set and we would get a crash when trying to read the signature for the binary relay log. + + We only rewind the read position if we are starting the SQL + thread. The handle_slave_sql thread assumes that the read + position is at the beginning of the file, and will read the + "signature" and then fast-forward to the last position read. */ - my_b_seek(mi->rli.cur_log, (my_off_t) 0); + if (thread_mask & SLAVE_SQL) + { + my_b_seek(mi->rli.cur_log, (my_off_t) 0); + } DBUG_RETURN(0); } @@ -2154,6 +2165,11 @@ int show_master_info(THD* thd, MASTER_INFO* mi) String *packet= &thd->packet; protocol->prepare_for_resend(); + /* + TODO: we read slave_running without run_lock, whereas these variables + are updated under run_lock and not data_lock. In 5.0 we should lock + run_lock on top of data_lock (with good order). + */ pthread_mutex_lock(&mi->data_lock); pthread_mutex_lock(&mi->rli.data_lock); @@ -2214,7 +2230,12 @@ int show_master_info(THD* thd, MASTER_INFO* mi) protocol->store(mi->ssl_cipher, &my_charset_bin); protocol->store(mi->ssl_key, &my_charset_bin); - if (mi->rli.last_master_timestamp) + /* + Seconds_Behind_Master: if SQL thread is running and I/O thread is + connected, we can compute it otherwise show NULL (i.e. unknown). + */ + if ((mi->slave_running == MYSQL_SLAVE_RUN_CONNECT) && + mi->rli.slave_running) { long tmp= (long)((time_t)time((time_t*) 0) - mi->rli.last_master_timestamp) @@ -2234,9 +2255,13 @@ int show_master_info(THD* thd, MASTER_INFO* mi) slave is 2. At SHOW SLAVE STATUS time, assume that the difference between timestamp of slave and rli->last_master_timestamp is 0 (i.e. they are in the same second), then we get 0-(2-1)=-1 as a result. - This confuses users, so we don't go below 0. + This confuses users, so we don't go below 0: hence the max(). + + last_master_timestamp == 0 (an "impossible" timestamp 1970) is a + special marker to say "consider we have caught up". */ - protocol->store((longlong)(max(0, tmp))); + protocol->store((longlong)(mi->rli.last_master_timestamp ? max(0, tmp) + : 0)); } else protocol->store_null(); @@ -2402,18 +2427,19 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name, init_abort_pos_wait= abort_pos_wait; /* - We'll need to + We'll need to handle all possible log names comparisons (e.g. 999 vs 1000). - We use ulong for string->number conversion ; this is no + We use ulong for string->number conversion ; this is no stronger limitation than in find_uniq_filename in sql/log.cc */ ulong log_name_extension; char log_name_tmp[FN_REFLEN]; //make a char[] from String - char *end= strmake(log_name_tmp, log_name->ptr(), min(log_name->length(), - FN_REFLEN-1)); + + strmake(log_name_tmp, log_name->ptr(), min(log_name->length(), FN_REFLEN-1)); + char *p= fn_ext(log_name_tmp); char *p_end; - if (!*p || log_pos<0) + if (!*p || log_pos<0) { error= -2; //means improper arguments goto err; @@ -2632,7 +2658,7 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi, DBUG_ENTER("request_dump"); // TODO if big log files: Change next to int8store() - int4store(buf, (longlong) mi->master_log_pos); + int4store(buf, (ulong) mi->master_log_pos); int2store(buf + 4, binlog_flags); int4store(buf + 6, server_id); len = (uint) strlen(logname); @@ -3029,6 +3055,8 @@ slave_begin: connected: + // TODO: the assignment below should be under mutex (5.0) + mi->slave_running= MYSQL_SLAVE_RUN_CONNECT; thd->slave_net = &mysql->net; thd->proc_info = "Checking master version"; if (get_master_version_and_clock(mysql, mi)) @@ -3060,6 +3088,7 @@ dump"); goto err; } + mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; thd->proc_info= "Waiting to reconnect after a failed binlog dump request"; #ifdef SIGNAL_WITH_VIO_CLOSE thd->clear_active_vio(); @@ -3136,6 +3165,7 @@ max_allowed_packet", mysql_error(mysql)); goto err; } + mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; thd->proc_info = "Waiting to reconnect after a failed master event read"; #ifdef SIGNAL_WITH_VIO_CLOSE thd->clear_active_vio(); @@ -3311,6 +3341,14 @@ slave_begin: pthread_mutex_lock(&LOCK_thread_count); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); + /* + We are going to set slave_running to 1. Assuming slave I/O thread is + alive and connected, this is going to make Seconds_Behind_Master be 0 + i.e. "caught up". Even if we're just at start of thread. Well it's ok, at + the moment we start we can think we are caught up, and the next second we + start receiving data so we realize we are not caught up and + Seconds_Behind_Master grows. No big deal. + */ rli->slave_running = 1; rli->abort_slave = 0; pthread_mutex_unlock(&rli->run_lock); @@ -4157,6 +4195,21 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", */ if (hot_log) { + /* + We say in Seconds_Behind_Master that we have "caught up". Note that + for example if network link is broken but I/O slave thread hasn't + noticed it (slave_net_timeout not elapsed), then we'll say "caught + up" whereas we're not really caught up. Fixing that would require + internally cutting timeout in smaller pieces in network read, no + thanks. Another example: SQL has caught up on I/O, now I/O has read + a new event and is queuing it; the false "0" will exist until SQL + finishes executing the new event; it will be look abnormal only if + the events have old timestamps (then you get "many", 0, "many"). + Transient phases like this can't really be fixed. + */ + time_t save_timestamp= rli->last_master_timestamp; + rli->last_master_timestamp= 0; + DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count); /* We can, and should release data_lock while we are waiting for @@ -4203,6 +4256,7 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", rli->relay_log.wait_for_update(rli->sql_thd, 1); // re-acquire data lock since we released it earlier pthread_mutex_lock(&rli->data_lock); + rli->last_master_timestamp= save_timestamp; continue; } /* diff --git a/sql/slave.h b/sql/slave.h index 20167094453..bcd79dd4a39 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -98,6 +98,21 @@ enum enum_binlog_formats { BINLOG_FORMAT_323_LESS_57, BINLOG_FORMAT_323_GEQ_57 }; +/* + 3 possible values for MASTER_INFO::slave_running and + RELAY_LOG_INFO::slave_running. + The values 0,1,2 are very important: to keep the diff small, I didn't + substitute places where we use 0/1 with the newly defined symbols. So don't change + these values. + The same way, code is assuming that in RELAY_LOG_INFO we use only values + 0/1. + I started with using an enum, but + enum_variable=1; is not legal so would have required many line changes. +*/ +#define MYSQL_SLAVE_NOT_RUN 0 +#define MYSQL_SLAVE_RUN_NOT_CONNECT 1 +#define MYSQL_SLAVE_RUN_CONNECT 2 + /**************************************************************************** Replication SQL Thread @@ -251,7 +266,8 @@ typedef struct st_relay_log_info /* if not set, the value of other members of the structure are undefined */ bool inited; - volatile bool abort_slave, slave_running; + volatile bool abort_slave; + volatile uint slave_running; /* Condition and its parameters from START SLAVE UNTIL clause. @@ -385,7 +401,8 @@ typedef struct st_master_info #endif bool inited; enum enum_binlog_formats old_format; - volatile bool abort_slave, slave_running; + volatile bool abort_slave; + volatile uint slave_running; volatile ulong slave_run_id; /* The difference in seconds between the clock of the master and the clock of @@ -464,7 +481,7 @@ int terminate_slave_threads(MASTER_INFO* mi, int thread_mask, int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex, pthread_mutex_t* cond_lock, pthread_cond_t* term_cond, - volatile bool* slave_running); + volatile uint* slave_running); int start_slave_threads(bool need_slave_mutex, bool wait_for_start, MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, int thread_mask); @@ -477,7 +494,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock, pthread_mutex_t *cond_lock, pthread_cond_t* start_cond, - volatile bool *slave_running, + volatile uint *slave_running, volatile ulong *slave_run_id, MASTER_INFO* mi, bool high_priority); @@ -496,7 +513,7 @@ int show_master_info(THD* thd, MASTER_INFO* mi); int show_binlog_info(THD* thd); /* See if the query uses any tables that should not be replicated */ -int tables_ok(THD* thd, TABLE_LIST* tables); +bool tables_ok(THD* thd, TABLE_LIST* tables); /* Check to see if the database is ok to operate on with respect to the @@ -510,8 +527,8 @@ int add_table_rule(HASH* h, const char* table_spec); int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec); void init_table_rule_hash(HASH* h, bool* h_inited); void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited); -const char *rewrite_db(const char* db); -const char *print_slave_db_safe(const char* db); +const char *rewrite_db(const char* db, uint32 *new_db_len); +const char *print_slave_db_safe(const char *db); int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code); void skip_load_data_infile(NET* net); void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...); @@ -519,10 +536,11 @@ void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...); void end_slave(); /* clean up */ void init_master_info_with_options(MASTER_INFO* mi); void clear_until_condition(RELAY_LOG_INFO* rli); -void clear_slave_error_timestamp(RELAY_LOG_INFO* rli); +void clear_slave_error(RELAY_LOG_INFO* rli); int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, - bool abort_if_no_master_info_file); + bool abort_if_no_master_info_file, + int thread_mask); void end_master_info(MASTER_INFO* mi); int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname); void end_relay_log_info(RELAY_LOG_INFO* rli); diff --git a/sql/spatial.cc b/sql/spatial.cc index 0668dd2faab..bcfefd9dde8 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -828,9 +828,7 @@ int Gis_polygon::centroid_xy(double *x, double *y) const if (!first_loop) { - double d_area= res_area - cur_area; - if (d_area <= 0) - return 1; + double d_area= fabs(res_area - cur_area); res_cx= (res_area * res_cx - cur_area * cur_cx) / d_area; res_cy= (res_area * res_cy - cur_area * cur_cy) / d_area; } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ff2dfedc30b..46114e2748b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -26,7 +26,6 @@ */ #include "mysql_priv.h" -#include "sql_acl.h" #include "hash_filo.h" #ifdef HAVE_REPLICATION #include "sql_repl.h" //for tables_ok() @@ -140,6 +139,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) MYSQL_LOCK *lock; my_bool return_val=1; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; + char tmp_name[NAME_LEN+1]; DBUG_ENTER("acl_init"); @@ -198,6 +198,23 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) ACL_HOST host; update_hostname(&host.host,get_field(&mem, table->field[0])); host.db= get_field(&mem, table->field[1]); + if (lower_case_table_names) + { + /* + We make a temporary copy of the database, force it to lower case, + and then check it against the original name. + */ + (void)strnmov(tmp_name, host.db, sizeof(tmp_name)); + my_casedn_str(files_charset_info, host.db); + if (strcmp(host.db, tmp_name) != 0) + { + sql_print_warning("'host' entry '%s|%s' had database in mixed " + "case that has been forced to lowercase because " + "lower_case_table_names is set. It will not be " + "possible to remove this privilege using REVOKE.", + host.host.hostname, host.db); + } + } host.access= get_access(table,2); host.access= fix_rights_for_db(host.access); host.sort= get_sort(2,host.host.hostname,host.db); @@ -381,6 +398,23 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) } db.access=get_access(table,3); db.access=fix_rights_for_db(db.access); + if (lower_case_table_names) + { + /* + We make a temporary copy of the database, force it to lower case, + and then check it against the original name. + */ + (void)strnmov(tmp_name, db.db, sizeof(tmp_name)); + my_casedn_str(files_charset_info, db.db); + if (strcmp(db.db, tmp_name) != 0) + { + sql_print_warning("'db' entry '%s %s@%s' had database in mixed " + "case that has been forced to lowercase because " + "lower_case_table_names is set. It will not be " + "possible to remove this privilege using REVOKE.", + db.db, db.user, db.host.hostname, db.host.hostname); + } + } db.sort=get_sort(3,db.host.hostname,db.db,db.user); #ifndef TO_BE_REMOVED if (table->fields <= 9) @@ -439,7 +473,7 @@ void acl_free(bool end) SYNOPSIS acl_reload() - thd Thread handle + thd Thread handle (can be NULL) */ void acl_reload(THD *thd) @@ -965,11 +999,11 @@ static void acl_insert_db(const char *user, const char *host, const char *db, ulong acl_get(const char *host, const char *ip, const char *user, const char *db, my_bool db_is_pattern) { - ulong host_access,db_access; + ulong host_access= ~0,db_access= 0; uint i,key_length; - db_access=0; host_access= ~0; char key[ACL_KEY_LENGTH],*tmp_db,*end; acl_entry *entry; + DBUG_ENTER("acl_get"); VOID(pthread_mutex_lock(&acl_cache->lock)); end=strmov((tmp_db=strmov(strmov(key, ip ? ip : "")+1,user)+1),db); @@ -983,7 +1017,8 @@ ulong acl_get(const char *host, const char *ip, { db_access=entry->access; VOID(pthread_mutex_unlock(&acl_cache->lock)); - return db_access; + DBUG_PRINT("exit", ("access: 0x%lx", db_access)); + DBUG_RETURN(db_access); } /* @@ -1035,7 +1070,8 @@ exit: acl_cache->add(entry); } VOID(pthread_mutex_unlock(&acl_cache->lock)); - return (db_access & host_access); + DBUG_PRINT("exit", ("access: 0x%lx", db_access & host_access)); + DBUG_RETURN(db_access & host_access); } /* @@ -1127,6 +1163,10 @@ bool acl_check_host(const char *host, const char *ip) thd THD host hostname for the user user user name + new_password new password + + NOTE: + new_password cannot be NULL RETURN VALUE 0 OK @@ -1134,7 +1174,7 @@ bool acl_check_host(const char *host, const char *ip) */ bool check_change_password(THD *thd, const char *host, const char *user, - char *new_password) + char *new_password, uint new_password_len) { if (!initialized) { @@ -1185,12 +1225,13 @@ bool check_change_password(THD *thd, const char *host, const char *user, bool change_password(THD *thd, const char *host, const char *user, char *new_password) { + uint new_password_len= strlen(new_password); DBUG_ENTER("change_password"); DBUG_PRINT("enter",("host: '%s' user: '%s' new_password: '%s'", host,user,new_password)); DBUG_ASSERT(host != 0); // Ensured by parent - if (check_change_password(thd, host, user, new_password)) + if (check_change_password(thd, host, user, new_password, new_password_len)) DBUG_RETURN(1); VOID(pthread_mutex_lock(&acl_cache->lock)); @@ -1202,7 +1243,6 @@ bool change_password(THD *thd, const char *host, const char *user, DBUG_RETURN(1); } /* update loaded acl entry: */ - uint new_password_len= new_password ? strlen(new_password) : 0; set_user_salt(acl_user, new_password, new_password_len); if (update_user_table(thd, @@ -1227,7 +1267,7 @@ bool change_password(THD *thd, const char *host, const char *user, new_password)); thd->clear_error(); mysql_update_log.write(thd, buff, query_length); - Query_log_event qinfo(thd, buff, query_length, 0); + Query_log_event qinfo(thd, buff, query_length, 0, FALSE); mysql_bin_log.write(&qinfo); DBUG_RETURN(0); } @@ -1334,7 +1374,7 @@ bool hostname_requires_resolving(const char *hostname) return FALSE; for (; (cur=*hostname); hostname++) { - if ((cur != '%') && (cur != '_') && (cur != '.') && + if ((cur != '%') && (cur != '_') && (cur != '.') && (cur != '/') && ((cur < '0') || (cur > '9'))) return TRUE; } @@ -1381,8 +1421,10 @@ static bool update_user_table(THD *thd, const char *host, const char *user, table->field[0]->store(host,(uint) strlen(host), &my_charset_latin1); table->field[1]->store(user,(uint) strlen(user), &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0],0, - (byte*) table->field[0]->ptr,0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, HA_READ_KEY_EXACT)) { my_error(ER_PASSWORD_NO_MATCH,MYF(0)); /* purecov: deadcode */ @@ -1460,9 +1502,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(combo.user.str,combo.user.length, &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0], 0, - (byte*) table->field[0]->ptr,0, - HA_READ_KEY_EXACT)) + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (!create_user) { @@ -1499,6 +1543,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, Field **tmp_field; ulong priv; + uint next_field; for (tmp_field= table->field+3, priv = SELECT_ACL; *tmp_field && (*tmp_field)->real_type() == FIELD_TYPE_ENUM && ((Field_enum*) (*tmp_field))->typelib->count == 2 ; @@ -1507,56 +1552,62 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, if (priv & rights) // set requested privileges (*tmp_field)->store(&what, 1, &my_charset_latin1); } - rights=get_access(table,3); + rights= get_access(table, 3, &next_field); DBUG_PRINT("info",("table->fields: %d",table->fields)); if (table->fields >= 31) /* From 4.0.0 we have more fields */ { /* We write down SSL related ACL stuff */ switch (thd->lex->ssl_type) { case SSL_TYPE_ANY: - table->field[24]->store("ANY",3, &my_charset_latin1); - table->field[25]->store("", 0, &my_charset_latin1); - table->field[26]->store("", 0, &my_charset_latin1); - table->field[27]->store("", 0, &my_charset_latin1); + table->field[next_field]->store("ANY", 3, &my_charset_latin1); + table->field[next_field+1]->store("", 0, &my_charset_latin1); + table->field[next_field+2]->store("", 0, &my_charset_latin1); + table->field[next_field+3]->store("", 0, &my_charset_latin1); break; case SSL_TYPE_X509: - table->field[24]->store("X509",4, &my_charset_latin1); - table->field[25]->store("", 0, &my_charset_latin1); - table->field[26]->store("", 0, &my_charset_latin1); - table->field[27]->store("", 0, &my_charset_latin1); + table->field[next_field]->store("X509", 4, &my_charset_latin1); + table->field[next_field+1]->store("", 0, &my_charset_latin1); + table->field[next_field+2]->store("", 0, &my_charset_latin1); + table->field[next_field+3]->store("", 0, &my_charset_latin1); break; case SSL_TYPE_SPECIFIED: - table->field[24]->store("SPECIFIED",9, &my_charset_latin1); - table->field[25]->store("", 0, &my_charset_latin1); - table->field[26]->store("", 0, &my_charset_latin1); - table->field[27]->store("", 0, &my_charset_latin1); + table->field[next_field]->store("SPECIFIED", 9, &my_charset_latin1); + table->field[next_field+1]->store("", 0, &my_charset_latin1); + table->field[next_field+2]->store("", 0, &my_charset_latin1); + table->field[next_field+3]->store("", 0, &my_charset_latin1); if (thd->lex->ssl_cipher) - table->field[25]->store(thd->lex->ssl_cipher, - strlen(thd->lex->ssl_cipher), &my_charset_latin1); + table->field[next_field+1]->store(thd->lex->ssl_cipher, + strlen(thd->lex->ssl_cipher), + &my_charset_latin1); if (thd->lex->x509_issuer) - table->field[26]->store(thd->lex->x509_issuer, - strlen(thd->lex->x509_issuer), &my_charset_latin1); + table->field[next_field+2]->store(thd->lex->x509_issuer, + strlen(thd->lex->x509_issuer), + &my_charset_latin1); if (thd->lex->x509_subject) - table->field[27]->store(thd->lex->x509_subject, - strlen(thd->lex->x509_subject), &my_charset_latin1); + table->field[next_field+3]->store(thd->lex->x509_subject, + strlen(thd->lex->x509_subject), + &my_charset_latin1); break; case SSL_TYPE_NOT_SPECIFIED: break; case SSL_TYPE_NONE: - table->field[24]->store("", 0, &my_charset_latin1); - table->field[25]->store("", 0, &my_charset_latin1); - table->field[26]->store("", 0, &my_charset_latin1); - table->field[27]->store("", 0, &my_charset_latin1); + table->field[next_field]->store("", 0, &my_charset_latin1); + table->field[next_field+1]->store("", 0, &my_charset_latin1); + table->field[next_field+2]->store("", 0, &my_charset_latin1); + table->field[next_field+3]->store("", 0, &my_charset_latin1); break; } + /* Skip over SSL related fields to first user limits related field */ + next_field+= 4; + USER_RESOURCES mqh= thd->lex->mqh; if (mqh.bits & 1) - table->field[28]->store((longlong) mqh.questions); + table->field[next_field]->store((longlong) mqh.questions); if (mqh.bits & 2) - table->field[29]->store((longlong) mqh.updates); + table->field[next_field+1]->store((longlong) mqh.updates); if (mqh.bits & 4) - table->field[30]->store((longlong) mqh.connections); + table->field[next_field+2]->store((longlong) mqh.connections); mqh_used = mqh_used || mqh.questions || mqh.updates || mqh.connections; } if (old_row_exists) @@ -1565,6 +1616,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, We should NEVER delete from the user table, as a uses can still use mysqld even if he doesn't have any privileges in the user table! */ + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (cmp_record(table,record[1]) && (error=table->file->update_row(table->record[1],table->record[0]))) { // This should never happen @@ -1642,8 +1694,11 @@ static int replace_db_table(TABLE *table, const char *db, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(db,(uint) strlen(db), &my_charset_latin1); table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); - if (table->file->index_read_idx(table->record[0],0,(byte*) table->field[0]->ptr,0, - HA_READ_KEY_EXACT)) + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); + if (table->file->index_read_idx(table->record[0],0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (what == 'N') { // no row, no revoke @@ -1676,6 +1731,7 @@ static int replace_db_table(TABLE *table, const char *db, /* update old existing row */ if (rights) { + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if ((error=table->file->update_row(table->record[1],table->record[0]))) goto table_error; /* purecov: deadcode */ } @@ -1685,7 +1741,7 @@ static int replace_db_table(TABLE *table, const char *db, goto table_error; /* purecov: deadcode */ } } - else if ((error=table->file->write_row(table->record[0]))) + else if (rights && (error=table->file->write_row(table->record[0]))) { if (error && error != HA_ERR_FOUND_DUPP_KEY) /* purecov: inspected */ goto table_error; /* purecov: deadcode */ @@ -1695,6 +1751,7 @@ static int replace_db_table(TABLE *table, const char *db, if (old_row_exists) acl_update_db(combo.user.str,combo.host.str,db,rights); else + if (rights) acl_insert_db(combo.user.str,combo.host.str,db,rights); DBUG_RETURN(0); @@ -1949,8 +2006,10 @@ static int replace_column_table(GRANT_TABLE *g_t, table->field[4]->store(xx->column.ptr(),xx->column.length(), &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr, - 0, HA_READ_KEY_EXACT)) + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (revoke_grant) { @@ -2018,8 +2077,10 @@ static int replace_column_table(GRANT_TABLE *g_t, if (revoke_grant) { + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr, - key_length, HA_READ_KEY_EXACT)) + key_length, + HA_READ_KEY_EXACT)) goto end; /* Scan through all rows with the same host,db,user and table */ @@ -2108,9 +2169,10 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); table->field[3]->store(table_name,(uint) strlen(table_name), &my_charset_latin1); store_record(table,record[1]); // store at pos 1 - + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0],0, - (byte*) table->field[0]->ptr,0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, HA_READ_KEY_EXACT)) { /* @@ -2232,39 +2294,58 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(-1); } - if (columns.elements && !revoke_grant) + if (!revoke_grant) { - TABLE *table; - class LEX_COLUMN *column; - List_iterator <LEX_COLUMN> column_iter(columns); - - if (!(table=open_ltable(thd,table_list,TL_READ))) - DBUG_RETURN(-1); - while ((column = column_iter++)) + if (columns.elements && !revoke_grant) { - uint unused_field_idx= NO_CACHED_FIELD_INDEX; - if (!find_field_in_table(thd,table,column->column.ptr(), - column->column.length(),0,0, - &unused_field_idx)) + TABLE *table; + class LEX_COLUMN *column; + List_iterator <LEX_COLUMN> column_iter(columns); + + if (!(table=open_ltable(thd,table_list,TL_READ))) + DBUG_RETURN(-1); + while ((column = column_iter++)) { - my_error(ER_BAD_FIELD_ERROR, MYF(0), - column->column.c_ptr(), table_list->alias); - DBUG_RETURN(-1); + uint unused_field_idx= NO_CACHED_FIELD_INDEX; + Field *f= find_field_in_table(thd,table,column->column.ptr(), + column->column.length(),1,0,&unused_field_idx); + if (!f) + { + my_error(ER_BAD_FIELD_ERROR, MYF(0), + column->column.c_ptr(), table_list->alias); + DBUG_RETURN(-1); + } + if (f == (Field*)-1) + { + DBUG_RETURN(-1); + } + column_priv|= column->rights; } - column_priv|= column->rights; + close_thread_tables(thd); } - close_thread_tables(thd); - } - else if (!(rights & CREATE_ACL) && !revoke_grant) - { - char buf[FN_REFLEN]; - sprintf(buf,"%s/%s/%s.frm",mysql_data_home, table_list->db, - table_list->real_name); - fn_format(buf,buf,"","",4+16+32); - if (access(buf,F_OK)) + else { - my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias); - DBUG_RETURN(-1); + if (!(rights & CREATE_ACL)) + { + char buf[FN_REFLEN]; + sprintf(buf,"%s/%s/%s.frm",mysql_data_home, table_list->db, + table_list->real_name); + fn_format(buf,buf,"","",4+16+32); + if (access(buf,F_OK)) + { + my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias); + DBUG_RETURN(-1); + } + } + if (table_list->grant.want_privilege) + { + char command[128]; + get_privilege_desc(command, sizeof(command), + table_list->grant.want_privilege); + my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), + command, thd->priv_user, thd->host_or_ip, table_list->alias); + DBUG_RETURN(-1); + } } } @@ -2309,8 +2390,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, create_new_users= test_if_create_new_users(thd); int result=0; rw_wrlock(&LOCK_grant); - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC,&memex); + MEM_ROOT *old_root= thd->mem_root; + thd->mem_root= &memex; while ((Str = str_list++)) { @@ -2415,7 +2496,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, } } grant_option=TRUE; - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + thd->mem_root= old_root; rw_unlock(&LOCK_grant); if (!result) send_ok(thd); @@ -2549,6 +2630,7 @@ my_bool grant_init(THD *org_thd) THD *thd; TABLE_LIST tables[2]; MYSQL_LOCK *lock; + MEM_ROOT *memex_ptr; my_bool return_val= 1; TABLE *t_table, *c_table; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; @@ -2596,7 +2678,8 @@ my_bool grant_init(THD *org_thd) grant_option= TRUE; /* Will be restored by org_thd->store_globals() */ - my_pthread_setspecific_ptr(THR_MALLOC,&memex); + memex_ptr= &memex; + my_pthread_setspecific_ptr(THR_MALLOC, &memex_ptr); do { GRANT_TABLE *mem_check; @@ -2653,7 +2736,7 @@ end: SYNOPSIS grant_reload() - thd Thread handler + thd Thread handler (can be NULL) NOTES Locked tables are checked by acl_init and doesn't have to be checked here @@ -2747,25 +2830,8 @@ err: rw_unlock(&LOCK_grant); if (!no_errors) // Not a silent skip of table { - const char *command=""; - if (want_access & SELECT_ACL) - command= "select"; - else if (want_access & INSERT_ACL) - command= "insert"; - else if (want_access & UPDATE_ACL) - command= "update"; - else if (want_access & DELETE_ACL) - command= "delete"; - else if (want_access & DROP_ACL) - command= "drop"; - else if (want_access & CREATE_ACL) - command= "create"; - else if (want_access & ALTER_ACL) - command= "alter"; - else if (want_access & INDEX_ACL) - command= "index"; - else if (want_access & GRANT_ACL) - command= "grant"; + char command[128]; + get_privilege_desc(command, sizeof(command), want_access); net_printf(thd,ER_TABLEACCESS_DENIED_ERROR, command, thd->priv_user, @@ -2880,11 +2946,8 @@ bool check_grant_all_columns(THD *thd, ulong want_access, TABLE *table) err: rw_unlock(&LOCK_grant); err2: - const char *command= ""; - if (want_access & SELECT_ACL) - command= "select"; - else if (want_access & INSERT_ACL) - command= "insert"; + char command[128]; + get_privilege_desc(command, sizeof(command), want_access); my_printf_error(ER_COLUMNACCESS_DENIED_ERROR, ER(ER_COLUMNACCESS_DENIED_ERROR), MYF(0), @@ -3565,9 +3628,12 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list) tables[0].table->field[1]->store(user_name->user.str,(uint) user_name->user.length, system_charset_info); + tables[0].table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (!tables[0].table->file->index_read_idx(tables[0].table->record[0],0, (byte*) tables[0].table-> - field[0]->ptr,0, + field[0]->ptr, + tables[0].table-> + key_info[0].key_length, HA_READ_KEY_EXACT)) { int error; diff --git a/sql/sql_acl.h b/sql/sql_acl.h index 68cb1476eb5..dc1b04c063a 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -143,7 +143,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd, uint passwd_len); bool acl_check_host(const char *host, const char *ip); bool check_change_password(THD *thd, const char *host, const char *user, - char *password); + char *password, uint password_len); bool change_password(THD *thd, const char *host, const char *user, char *password); int mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list, diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 1e0aebbc1ec..7ac9a0866df 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -59,6 +59,7 @@ int compare_ulonglong2(void* cmp_arg __attribute__((unused)), return compare_ulonglong(s,t); } +static bool append_escaped(String *to_str, String *from_str); Procedure * proc_analyse_init(THD *thd, ORDER *param, select_result *result, @@ -69,6 +70,9 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, field_info **f_info; DBUG_ENTER("proc_analyse_init"); + if (!pc) + DBUG_RETURN(0); + if (!(param = param->next)) { pc->max_tree_elements = MAX_TREE_ELEMENTS; @@ -80,33 +84,30 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, if ((*param->item)->type() != Item::INT_ITEM || (*param->item)->val() < 0) { - delete pc; my_error(ER_WRONG_PARAMETERS_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } pc->max_tree_elements = (uint) (*param->item)->val_int(); param = param->next; if (param->next) // no third parameter possible { my_error(ER_WRONG_PARAMCOUNT_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } // second parameter if ((*param->item)->type() != Item::INT_ITEM || (*param->item)->val() < 0) { - delete pc; my_error(ER_WRONG_PARAMETERS_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } pc->max_treemem = (uint) (*param->item)->val_int(); } else if ((*param->item)->type() != Item::INT_ITEM || (*param->item)->val() < 0) { - delete pc; my_error(ER_WRONG_PARAMETERS_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } // if only one parameter was given, it will be the value of max_tree_elements else @@ -115,34 +116,39 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, pc->max_treemem = MAX_TREEMEM; } - if (!pc || !(pc->f_info = (field_info**) - sql_alloc(sizeof(field_info*)*field_list.elements))) - DBUG_RETURN(0); + if (!(pc->f_info= + (field_info**)sql_alloc(sizeof(field_info*)*field_list.elements))) + goto err; pc->f_end = pc->f_info + field_list.elements; pc->fields = field_list; - List_iterator_fast<Item> it(pc->fields); - f_info = pc->f_info; - - Item *item; - while ((item = it++)) { - if (item->result_type() == INT_RESULT) + List_iterator_fast<Item> it(pc->fields); + f_info = pc->f_info; + + Item *item; + while ((item = it++)) { - // Check if fieldtype is ulonglong - if (item->type() == Item::FIELD_ITEM && - ((Item_field*) item)->field->type() == FIELD_TYPE_LONGLONG && - ((Field_longlong*) ((Item_field*) item)->field)->unsigned_flag) - *f_info++ = new field_ulonglong(item, pc); - else - *f_info++ = new field_longlong(item, pc); + if (item->result_type() == INT_RESULT) + { + // Check if fieldtype is ulonglong + if (item->type() == Item::FIELD_ITEM && + ((Item_field*) item)->field->type() == FIELD_TYPE_LONGLONG && + ((Field_longlong*) ((Item_field*) item)->field)->unsigned_flag) + *f_info++ = new field_ulonglong(item, pc); + else + *f_info++ = new field_longlong(item, pc); + } + if (item->result_type() == REAL_RESULT) + *f_info++ = new field_real(item, pc); + if (item->result_type() == STRING_RESULT) + *f_info++ = new field_str(item, pc); } - if (item->result_type() == REAL_RESULT) - *f_info++ = new field_real(item, pc); - if (item->result_type() == STRING_RESULT) - *f_info++ = new field_str(item, pc); } DBUG_RETURN(pc); +err: + delete pc; + DBUG_RETURN(0); } @@ -890,7 +896,8 @@ int collect_string(String *element, else info->found = 1; info->str->append('\''); - info->str->append(*element); + if (append_escaped(info->str, element)) + return 1; info->str->append('\''); return 0; } // collect_string @@ -1025,3 +1032,57 @@ uint check_ulonglong(const char *str, uint length) while (*cmp && *cmp++ == *str++) ; return ((uchar) str[-1] <= (uchar) cmp[-1]) ? smaller : bigger; } /* check_ulonlong */ + + +/* + Quote special characters in a string. + + SYNOPSIS + append_escaped(to_str, from_str) + to_str (in) A pointer to a String. + from_str (to) A pointer to an allocated string + + DESCRIPTION + append_escaped() takes a String type variable, where it appends + escaped the second argument. Only characters that require escaping + will be escaped. + + RETURN VALUES + 0 Success + 1 Out of memory +*/ + +static bool append_escaped(String *to_str, String *from_str) +{ + char *from, *end, c; + + if (to_str->realloc(to_str->length() + from_str->length())) + return 1; + + from= (char*) from_str->ptr(); + end= from + from_str->length(); + for (; from < end; from++) + { + c= *from; + switch (c) { + case '\0': + c= '0'; + break; + case '\032': + c= 'Z'; + break; + case '\\': + case '\'': + break; + default: + goto normal_character; + } + if (to_str->append('\\')) + return 1; + + normal_character: + if (to_str->append(c)) + return 1; + } + return 0; +} diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9313f8e2c1b..8d694c48849 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -18,7 +18,6 @@ /* Basic functions needed by many modules */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" #include <m_ctype.h> #include <my_dir.h> @@ -252,13 +251,19 @@ void free_io_cache(TABLE *table) DBUG_VOID_RETURN; } - /* Close all tables which aren't in use by any thread */ +/* + Close all tables which aren't in use by any thread + + THD can be NULL, but then if_wait_for_refresh must be FALSE + and tables must be NULL. +*/ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, TABLE_LIST *tables) { bool result=0; DBUG_ENTER("close_cached_tables"); + DBUG_ASSERT(thd || (!if_wait_for_refresh && !tables)); VOID(pthread_mutex_lock(&LOCK_open)); if (!tables) @@ -334,7 +339,6 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, VOID(pthread_mutex_unlock(&LOCK_open)); if (if_wait_for_refresh) { - THD *thd=current_thd; pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; thd->mysys_var->current_cond= 0; @@ -499,7 +503,7 @@ void close_temporary_tables(THD *thd) */ query_buf_size+= table->key_length+1; - if ((query = alloc_root(&thd->mem_root, query_buf_size))) + if ((query = alloc_root(thd->mem_root, query_buf_size))) // Better add "if exists", in case a RESET MASTER has been done end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS "); @@ -524,7 +528,7 @@ void close_temporary_tables(THD *thd) { /* The -1 is to remove last ',' */ thd->clear_error(); - Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0); + Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0, FALSE); /* Imagine the thread had created a temp table, then was doing a SELECT, and the SELECT was killed. Then it's not clever to mark the statement above as @@ -806,8 +810,9 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name, for (table=thd->temporary_tables; table ; table=table->next) { - if (table->key_length == key_length+8 && - !memcmp(table->table_cache_key,key,key_length+8)) + if (table->key_length == key_length + TMP_TABLE_KEY_EXTRA && + !memcmp(table->table_cache_key, key, + key_length + TMP_TABLE_KEY_EXTRA)) { if (table->query_id == thd->query_id) { @@ -1440,7 +1445,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, { end = strxmov(strmov(query, "DELETE FROM `"), db,"`.`",name,"`", NullS); - Query_log_event qinfo(thd, query, (ulong)(end-query), 0); + Query_log_event qinfo(thd, query, (ulong)(end-query), 0, FALSE); mysql_bin_log.write(&qinfo); my_free(query, MYF(0)); } @@ -1703,6 +1708,34 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables) /* + Open all tables in list and process derived tables + + SYNOPSIS + open_normal_and_derived_tables + thd - thread handler + tables - list of tables for open&locking + + RETURN + FALSE - ok + TRUE - error + + NOTE + This is to be used on prepare stage when you don't read any + data from the tables. +*/ + +int open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables) +{ + uint counter; + DBUG_ENTER("open_normal_and_derived_tables"); + if (open_tables(thd, tables, &counter)) + DBUG_RETURN(-1); /* purecov: inspected */ + relink_tables_for_derived(thd); + DBUG_RETURN(mysql_handle_derived(thd->lex)); +} + + +/* Let us propagate pointers to open tables from global table list to table lists in particular selects if needed. */ @@ -2040,13 +2073,8 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables, strxnmov(buff,sizeof(buff)-1,db,".",table_name,NullS); table_name=buff; } - if (report_error) - { - my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0), - table_name, thd->where); - } - else - return (Field*) not_found_field; + my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0), + table_name, thd->where); } else if (report_error) @@ -2305,23 +2333,20 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, List<Item> *sum_func_list, uint wild_num) { - bool is_stmt_prepare; DBUG_ENTER("setup_wild"); if (!wild_num) DBUG_RETURN(0); - Item_arena *arena= thd->current_arena, backup; - + reg2 Item *item; + List_iterator<Item> it(fields); + Item_arena *arena, backup; /* If we are in preparing prepared statement phase then we have change temporary mem_root to statement mem root to save changes of SELECT list */ - if ((is_stmt_prepare= arena->is_stmt_prepare())) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); - reg2 Item *item; - List_iterator<Item> it(fields); - while ( wild_num && (item= it++)) + while (wild_num && (item= it++)) { if (item->type() == Item::FIELD_ITEM && ((Item_field*) item)->field_name && @@ -2343,7 +2368,7 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, else if (insert_fields(thd,tables,((Item_field*) item)->db_name, ((Item_field*) item)->table_name, &it)) { - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(-1); } @@ -2359,7 +2384,7 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, wild_num--; } } - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(0); } @@ -2380,6 +2405,20 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, thd->allow_sum_func= allow_sum_func; thd->where="field list"; + /* + To prevent fail on forward lookup we fill it with zerows, + then if we got pointer on zero after find_item_in_list we will know + that it is forward lookup. + + There is other way to solve problem: fill array with pointers to list, + but it will be slower. + + TODO: remove it when (if) we made one list for allfields and + ref_pointer_array + */ + if (ref_pointer_array) + bzero(ref_pointer_array, sizeof(Item *) * fields.elements); + Item **ref= ref_pointer_array; while ((item= it++)) { @@ -2588,11 +2627,10 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name, int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { table_map not_null_tables= 0; - Item_arena *arena= thd->current_arena, backup; - bool is_stmt_prepare= arena->is_stmt_prepare(); + Item_arena *arena= 0, backup; DBUG_ENTER("setup_conds"); + thd->set_query_id=1; - thd->lex->current_select->cond_count= 0; if (*conds) { @@ -2627,12 +2665,14 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) !(specialflag & SPECIAL_NO_NEW_FUNC))) { table->outer_join= 0; - if (is_stmt_prepare) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); *conds= and_conds(*conds, table->on_expr); table->on_expr=0; - if (is_stmt_prepare) + if (arena) + { thd->restore_backup_item_arena(arena, &backup); + arena= 0; // Safety if goto err + } if ((*conds) && !(*conds)->fixed && (*conds)->fix_fields(thd, tables, conds)) DBUG_RETURN(1); @@ -2640,8 +2680,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) } if (table->natural_join) { - if (is_stmt_prepare) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); /* Make a join of all fields with have the same name */ TABLE *t1= table->table; TABLE *t2= table->natural_join->table; @@ -2682,11 +2721,12 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { *conds= and_conds(*conds, cond_and); // fix_fields() should be made with temporary memory pool - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); if (*conds && !(*conds)->fixed) { - if ((*conds)->fix_fields(thd, tables, conds)) + if (!(*conds)->fixed && + (*conds)->fix_fields(thd, tables, conds)) DBUG_RETURN(1); } } @@ -2694,21 +2734,25 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { table->on_expr= and_conds(table->on_expr, cond_and); // fix_fields() should be made with temporary memory pool - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); if (table->on_expr && !table->on_expr->fixed) { - if (table->on_expr->fix_fields(thd, tables, &table->on_expr)) + if (!table->on_expr->fixed && + table->on_expr->fix_fields(thd, tables, &table->on_expr)) DBUG_RETURN(1); } } } - else if (is_stmt_prepare) + else if (arena) + { thd->restore_backup_item_arena(arena, &backup); + arena= 0; // Safety if goto err + } } } - if (is_stmt_prepare) + if (thd->current_arena->is_stmt_prepare()) { /* We are in prepared statement preparation code => we should store @@ -2721,8 +2765,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) DBUG_RETURN(test(thd->net.report_error)); err: - if (is_stmt_prepare) - thd->restore_backup_item_arena(arena, &backup); + if (arena) + thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(1); } @@ -2824,8 +2868,18 @@ static void mysql_rm_tmp_tables(void) ** and afterwards delete those marked unused. */ -void remove_db_from_cache(const my_string db) +void remove_db_from_cache(const char *db) { + char name_buff[NAME_LEN+1]; + if (db && lower_case_table_names) + { + /* + convert database to lower case for comparision. + */ + strmake(name_buff, db, sizeof(name_buff)-1); + my_casedn_str(files_charset_info, name_buff); + db= name_buff; + } for (uint idx=0 ; idx < open_cache.records ; idx++) { TABLE *table=(TABLE*) hash_element(&open_cache,idx); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 0b338ebccb8..6eff958257b 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -300,7 +300,6 @@ TODO list: #include <m_ctype.h> #include <my_dir.h> #include <hash.h> -#include "sql_acl.h" #include "ha_myisammrg.h" #ifndef MASTER #include "../srclib/myisammrg/myrg_def.h" @@ -375,7 +374,7 @@ inline Query_cache_block * Query_cache_block_table::block() return (Query_cache_block *)(((byte*)this) - ALIGN_SIZE(sizeof(Query_cache_block_table)*n) - ALIGN_SIZE(sizeof(Query_cache_block))); -}; +} /***************************************************************************** Query_cache_block method(s) @@ -777,6 +776,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= @@ -969,6 +970,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= (thd->variables.character_set_results ? @@ -1025,9 +1028,38 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) for (; block_table != block_table_end; block_table++) { TABLE_LIST table_list; - bzero((char*) &table_list,sizeof(table_list)); + TABLE *tmptable; Query_cache_table *table = block_table->parent; + + /* + Check that we have not temporary tables with same names of tables + of this query. If we have such tables, we will not send data from + query cache, because temporary tables hide real tables by which + query in query cache was made. + */ + for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next) + { + if (tmptable->key_length - TMP_TABLE_KEY_EXTRA == table->key_length() && + !memcmp(tmptable->table_cache_key, table->data(), + table->key_length())) + { + DBUG_PRINT("qcache", + ("Temporary table detected: '%s.%s'", + table_list.db, table_list.alias)); + STRUCT_UNLOCK(&structure_guard_mutex); + /* + We should not store result of this query because it contain + temporary tables => assign following variable to make check + faster. + */ + thd->lex->safe_to_cache_query=0; + BLOCK_UNLOCK_RD(query_block); + DBUG_RETURN(-1); + } + } + + bzero((char*) &table_list,sizeof(table_list)); table_list.db = table->db(); table_list.alias= table_list.real_name= table->table(); #ifndef NO_EMBEDDED_ACCESS_CHECKS @@ -1129,12 +1161,12 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used, DBUG_ASSERT(!using_transactions || tables_used->table!=0); if (tables_used->derived) continue; - if (using_transactions && - (tables_used->table->file->table_cache_type() == + if (using_transactions && + (tables_used->table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT)) - /* + /* Tables_used->table can't be 0 in transaction. - Only 'drop' invalidate not opened table, but 'drop' + Only 'drop' invalidate not opened table, but 'drop' force transaction finish. */ thd->add_changed_table(tables_used->table); @@ -1182,7 +1214,7 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used) */ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used) { - DBUG_ENTER("Query_cache::invalidate (changed table list)"); + DBUG_ENTER("Query_cache::invalidate_locked_for_write"); if (query_cache_size > 0 && tables_used) { STRUCT_LOCK(&structure_guard_mutex); @@ -1389,7 +1421,7 @@ ulong Query_cache::init_cache() init(); approx_additional_data_size = (sizeof(Query_cache) + sizeof(gptr)*(def_query_hash_size+ - def_query_hash_size)); + def_table_hash_size)); if (query_cache_size < approx_additional_data_size) goto err; diff --git a/sql/sql_cache.h b/sql/sql_cache.h index fc458f39e29..c933a2349af 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -143,14 +143,14 @@ struct Query_cache_query struct Query_cache_table { char *tbl; - uint key_len; + uint32 key_len; uint8 table_type; inline char *db() { return (char *) data(); } inline char *table() { return tbl; } inline void table(char *table) { tbl= table; } - inline uint key_length() { return key_len; } - inline void key_length(uint len) { key_len= len; } + inline uint32 key_length() { return key_len; } + inline void key_length(uint32 len) { key_len= len; } inline uint8 type() { return table_type; } inline void type(uint8 t) { table_type= t; } inline gptr data() diff --git a/sql/sql_class.cc b/sql/sql_class.cc index b6fdac03526..c20d5f79277 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -27,7 +27,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include <m_ctype.h> #include <sys/stat.h> #include <thr_alarm.h> @@ -281,6 +280,9 @@ void THD::init(void) variables.date_format); variables.datetime_format= date_time_format_copy((THD*) 0, variables.datetime_format); +#ifdef HAVE_NDBCLUSTER_DB + variables.ndb_use_transactions= 1; +#endif pthread_mutex_unlock(&LOCK_global_system_variables); server_status= SERVER_STATUS_AUTOCOMMIT; options= thd_startup_options; @@ -306,7 +308,7 @@ void THD::init_for_queries() { ha_enable_transaction(this,TRUE); - reset_root_defaults(&mem_root, variables.query_alloc_block_size, + reset_root_defaults(mem_root, variables.query_alloc_block_size, variables.query_prealloc_size); reset_root_defaults(&transaction.mem_root, variables.trans_alloc_block_size, @@ -412,7 +414,7 @@ THD::~THD() dbug_sentry = THD_SENTRY_GONE; #endif /* Reset stmt_backup.mem_root to not double-free memory from thd.mem_root */ - clear_alloc_root(&stmt_backup.mem_root); + clear_alloc_root(&stmt_backup.main_mem_root); DBUG_VOID_RETURN; } @@ -509,13 +511,14 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, { DBUG_ENTER("convert_string"); size_s new_length= to_cs->mbmaxlen * from_length; + uint dummy_errors; if (!(to->str= alloc(new_length+1))) { to->length= 0; // Safety fix DBUG_RETURN(1); // EOM } to->length= copy_and_convert((char*) to->str, new_length, to_cs, - from, from_length, from_cs); + from, from_length, from_cs, &dummy_errors); to->str[to->length]=0; // Safety DBUG_RETURN(0); } @@ -538,7 +541,8 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs) { - if (convert_buffer.copy(s->ptr(), s->length(), from_cs, to_cs)) + uint dummy_errors; + if (convert_buffer.copy(s->ptr(), s->length(), from_cs, to_cs, &dummy_errors)) return TRUE; /* If convert_buffer >> s copying is more efficient long term */ if (convert_buffer.alloced_length() >= convert_buffer.length() * 2 || @@ -704,6 +708,8 @@ struct Item_change_record: public ilink Item *old_value; /* Placement new was hidden by `new' in ilink (TODO: check): */ static void *operator new(size_t size, void *mem) { return mem; } + static void operator delete(void *ptr, size_t size) {} + static void operator delete(void *ptr, void *mem) { /* never called */ } }; @@ -958,7 +964,7 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange, return -1; } /* Create the file world readable */ - if ((file= my_create(path, 0666, O_WRONLY, MYF(MY_WME))) < 0) + if ((file= my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) return file; #ifdef HAVE_FCHMOD (void) fchmod(file, 0666); // Because of umask() @@ -1237,12 +1243,21 @@ bool select_singlerow_subselect::send_data(List<Item> &items) } +void select_max_min_finder_subselect::cleanup() +{ + DBUG_ENTER("select_max_min_finder_subselect::cleanup"); + cache= 0; + DBUG_VOID_RETURN; +} + + bool select_max_min_finder_subselect::send_data(List<Item> &items) { DBUG_ENTER("select_max_min_finder_subselect::send_data"); - Item_singlerow_subselect *it= (Item_singlerow_subselect *)item; + Item_maxmin_subselect *it= (Item_maxmin_subselect *)item; List_iterator_fast<Item> li(items); Item *val_item= li++; + it->register_value(); if (it->assigned()) { cache->store(val_item); @@ -1393,10 +1408,10 @@ void select_dumpvar::cleanup() for memory root initialization. */ Item_arena::Item_arena(THD* thd) - :free_list(0), - state(INITIALIZED) + :free_list(0), mem_root(&main_mem_root), + state(INITIALIZED) { - init_sql_alloc(&mem_root, + init_sql_alloc(&main_mem_root, thd->variables.query_alloc_block_size, thd->variables.query_prealloc_size); } @@ -1419,11 +1434,11 @@ Item_arena::Item_arena(THD* thd) statements. */ Item_arena::Item_arena(bool init_mem_root) - :free_list(0), + :free_list(0), mem_root(&main_mem_root), state(CONVENTIONAL_EXECUTION) { if (init_mem_root) - init_sql_alloc(&mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0); + init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0); } @@ -1517,13 +1532,16 @@ void THD::end_statement() void Item_arena::set_n_backup_item_arena(Item_arena *set, Item_arena *backup) { + DBUG_ENTER("Item_arena::set_n_backup_item_arena"); backup->set_item_arena(this); set_item_arena(set); + DBUG_VOID_RETURN; } void Item_arena::restore_backup_item_arena(Item_arena *set, Item_arena *backup) { + DBUG_ENTER("Item_arena::restore_backup_item_arena"); set->set_item_arena(this); set_item_arena(backup); #ifdef NOT_NEEDED_NOW @@ -1536,18 +1554,19 @@ void Item_arena::restore_backup_item_arena(Item_arena *set, Item_arena *backup) */ clear_alloc_root(&backup->mem_root); #endif + DBUG_VOID_RETURN; } void Item_arena::set_item_arena(Item_arena *set) { - mem_root= set->mem_root; + mem_root= set->mem_root; free_list= set->free_list; state= set->state; } Statement::~Statement() { - free_root(&mem_root, MYF(0)); + free_root(&main_mem_root, MYF(0)); } C_MODE_START diff --git a/sql/sql_class.h b/sql/sql_class.h index e73b35966a9..703bb030ab9 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -29,7 +29,7 @@ class Slave_log_event; enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME }; -enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE, DUP_UPDATE }; +enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE }; enum enum_log_type { LOG_CLOSED, LOG_TO_BE_OPENED, LOG_NORMAL, LOG_NEW, LOG_BIN}; enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON, DELAY_KEY_WRITE_ALL }; @@ -131,7 +131,7 @@ public: DBUG_VOID_RETURN; } void set_max_size(ulong max_size_arg); - void signal_update() { pthread_cond_broadcast(&update_cond);} + void signal_update(); void wait_for_update(THD* thd, bool master_or_slave); void set_need_start_event() { need_start_event = 1; } void init(enum_log_type log_type_arg, @@ -201,7 +201,8 @@ typedef struct st_copy_info { ha_rows error_count; enum enum_duplicates handle_duplicates; int escape_char, last_errno; -/* for INSERT ... UPDATE */ + bool ignore; + /* for INSERT ... UPDATE */ List<Item> *update_fields; List<Item> *update_values; } COPY_INFO; @@ -396,9 +397,20 @@ struct system_variables my_bool low_priority_updates; my_bool new_mode; my_bool query_cache_wlock_invalidate; +#ifdef HAVE_REPLICATION + ulong sync_replication; + ulong sync_replication_slave_id; + ulong sync_replication_timeout; +#endif /* HAVE_REPLICATION */ #ifdef HAVE_INNOBASE_DB my_bool innodb_table_locks; #endif /* HAVE_INNOBASE_DB */ +#ifdef HAVE_NDBCLUSTER_DB + ulong ndb_autoincrement_prefetch_sz; + my_bool ndb_force_send; + my_bool ndb_use_exact_count; + my_bool ndb_use_transactions; +#endif /* HAVE_NDBCLUSTER_DB */ my_bool old_passwords; /* Only charset part of these variables is sensible */ @@ -429,7 +441,8 @@ public: itself to the list on creation (see Item::Item() for details)) */ Item *free_list; - MEM_ROOT mem_root; + MEM_ROOT main_mem_root; + MEM_ROOT *mem_root; // Pointer to current memroot enum enum_state { INITIALIZED= 0, PREPARED= 1, EXECUTED= 3, CONVENTIONAL_EXECUTION= 2, @@ -468,24 +481,24 @@ public: { return state == PREPARED || state == EXECUTED; } inline bool is_conventional_execution() const { return state == CONVENTIONAL_EXECUTION; } - inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); } + inline gptr alloc(unsigned int size) { return alloc_root(mem_root,size); } inline gptr calloc(unsigned int size) { gptr ptr; - if ((ptr=alloc_root(&mem_root,size))) + if ((ptr=alloc_root(mem_root,size))) bzero((char*) ptr,size); return ptr; } inline char *strdup(const char *str) - { return strdup_root(&mem_root,str); } + { return strdup_root(mem_root,str); } inline char *strmake(const char *str, uint size) - { return strmake_root(&mem_root,str,size); } + { return strmake_root(mem_root,str,size); } inline char *memdup(const char *str, uint size) - { return memdup_root(&mem_root,str,size); } + { return memdup_root(mem_root,str,size); } inline char *memdup_w_gap(const char *str, uint size, uint gap) { gptr ptr; - if ((ptr=alloc_root(&mem_root,size+gap))) + if ((ptr=alloc_root(mem_root,size+gap))) memcpy(ptr,str,size); return ptr; } @@ -641,8 +654,8 @@ public: /* Erase all statements (calls Statement destructor) */ void reset() { - hash_reset(&names_hash); - hash_reset(&st_hash); + my_hash_reset(&names_hash); + my_hash_reset(&st_hash); last_found_statement= 0; } @@ -1052,11 +1065,26 @@ public: inline CHARSET_INFO *charset() { return variables.character_set_client; } void update_charset(); + inline Item_arena *change_arena_if_needed(Item_arena *backup) + { + /* + use new arena if we are in a prepared statements and we have not + already changed to use this arena. + */ + if (current_arena->is_stmt_prepare() && + mem_root != ¤t_arena->main_mem_root) + { + set_n_backup_item_arena(current_arena, backup); + return current_arena; + } + return 0; + } + void change_item_tree(Item **place, Item *new_value) { /* TODO: check for OOM condition here */ if (!current_arena->is_conventional_execution()) - nocheck_register_item_tree_change(place, *place, &mem_root); + nocheck_register_item_tree_change(place, *place, mem_root); *place= new_value; } void nocheck_register_item_tree_change(Item **place, Item *old_value, @@ -1070,6 +1098,12 @@ public: void end_statement(); }; +#define tmp_disable_binlog(A) \ + ulong save_options= (A)->options; \ + (A)->options&= ~OPTION_BIN_LOG; + +#define reenable_binlog(A) (A)->options= save_options; + /* Flags for the THD::system_thread (bitmap) variable */ #define SYSTEM_THREAD_DELAYED_INSERT 1 #define SYSTEM_THREAD_SLAVE_IO 2 @@ -1204,15 +1238,28 @@ class select_insert :public select_result_interceptor { COPY_INFO info; select_insert(TABLE *table_par, List<Item> *fields_par, - enum_duplicates duplic) + enum_duplicates duplic, bool ignore) :table(table_par), fields(fields_par), last_insert_id(0) { bzero((char*) &info,sizeof(info)); + info.ignore= ignore; info.handle_duplicates=duplic; } + select_insert(TABLE *table_par, List<Item> *fields_par, + List<Item> *update_fields, List<Item> *update_values, + enum_duplicates duplic, bool ignore) + :table(table_par), fields(fields_par), last_insert_id(0) + { + bzero((char*) &info,sizeof(info)); + info.ignore= ignore; + info.handle_duplicates= duplic; + info.update_fields= update_fields; + info.update_values= update_values; + } ~select_insert(); int prepare(List<Item> &list, SELECT_LEX_UNIT *u); bool send_data(List<Item> &items); + virtual void store_values(List<Item> &values); void send_error(uint errcode,const char *err); bool send_eof(); /* not implemented: select_insert is never re-used in prepared statements */ @@ -1234,20 +1281,25 @@ public: HA_CREATE_INFO *create_info_par, List<create_field> &fields_par, List<Key> &keys_par, - List<Item> &select_fields,enum_duplicates duplic) - :select_insert (NULL, &select_fields, duplic), db(db_name), + List<Item> &select_fields,enum_duplicates duplic, bool ignore) + :select_insert (NULL, &select_fields, duplic, ignore), db(db_name), name(table_name), extra_fields(&fields_par),keys(&keys_par), create_info(create_info_par), lock(0) {} int prepare(List<Item> &list, SELECT_LEX_UNIT *u); - bool send_data(List<Item> &values); + void store_values(List<Item> &values); + void send_error(uint errcode,const char *err); bool send_eof(); void abort(); }; #include <myisam.h> -/* Param to create temporary tables when doing SELECT:s */ +/* + Param to create temporary tables when doing SELECT:s + NOTE + This structure is copied using memcpy as a part of JOIN. +*/ class TMP_TABLE_PARAM :public Sql_alloc { @@ -1259,7 +1311,6 @@ private: public: List<Item> copy_funcs; List<Item> save_copy_funcs; - List_iterator_fast<Item> copy_funcs_it; Copy_field *copy_field, *copy_field_end; Copy_field *save_copy_field, *save_copy_field_end; byte *group_buff; @@ -1276,7 +1327,7 @@ public: uint convert_blob_length; TMP_TABLE_PARAM() - :copy_funcs_it(copy_funcs), copy_field(0), group_parts(0), + :copy_field(0), group_parts(0), group_length(0), group_null_parts(0), convert_blob_length(0) {} ~TMP_TABLE_PARAM() @@ -1289,7 +1340,7 @@ public: if (copy_field) /* Fix for Intel compiler */ { delete [] copy_field; - copy_field=0; + save_copy_field= copy_field= 0; } } }; @@ -1338,6 +1389,7 @@ public: select_max_min_finder_subselect(Item_subselect *item, bool mx) :select_subselect(item), cache(0), fmax(mx) {} + void cleanup(); bool send_data(List<Item> &items); bool cmp_real(); bool cmp_int(); @@ -1485,11 +1537,11 @@ class multi_update :public select_result_interceptor uint table_count; Copy_field *copy_field; enum enum_duplicates handle_duplicates; - bool do_update, trans_safe, transactional_tables, log_delayed; + bool do_update, trans_safe, transactional_tables, log_delayed, ignore; public: multi_update(THD *thd_arg, TABLE_LIST *ut, List<Item> *fields, - List<Item> *values, enum_duplicates handle_duplicates); + List<Item> *values, enum_duplicates handle_duplicates, bool ignore); ~multi_update(); int prepare(List<Item> &list, SELECT_LEX_UNIT *u); bool send_data(List<Item> &items); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index eb851e79d2e..c918480812c 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -19,7 +19,6 @@ #include "mysql_priv.h" #include <mysys_err.h> -#include "sql_acl.h" #include <my_dir.h> #include <m_ctype.h> #ifdef __WIN__ @@ -30,11 +29,6 @@ const char *del_exts[]= {".frm", ".BAK", ".TMD",".opt", NullS}; static TYPELIB deletable_extentions= {array_elements(del_exts)-1,"del_exts", del_exts, NULL}; -const char *known_exts[]= -{".ISM",".ISD",".ISM",".MRG",".MYI",".MYD",".db", ".ibd", NullS}; -static TYPELIB known_extentions= -{array_elements(known_exts)-1,"known_exts", known_exts, NULL}; - static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, const char *path, uint level); @@ -231,7 +225,7 @@ void del_dbopt(const char *path) } -/* +/* Create database options file: DESCRIPTION @@ -250,10 +244,10 @@ static bool write_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create) if (!create->default_table_charset) create->default_table_charset= thd->variables.collation_server; - + if (put_dbopt(path, create)) return 1; - + if ((file=my_create(path, CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0) { ulong length; @@ -395,7 +389,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); - // do not create database if another thread is holding read lock + /* do not create database if another thread is holding read lock */ if (wait_if_global_read_lock(thd, 0, 1)) { error= -1; @@ -472,7 +466,29 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, mysql_update_log.write(thd, query, query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, query, query_length, 0); + Query_log_event qinfo(thd, query, query_length, 0, + /* suppress_use */ TRUE); + + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. If we do not change the "current database" to the + database being created, the CREATE statement will not be + replicated when using --binlog-do-db to select databases to be + replicated. + + An example (--binlog-do-db=sisyfos): + + CREATE DATABASE bob; # Not replicated + USE bob; # 'bob' is the current database + CREATE DATABASE sisyfos; # Not replicated since 'bob' is + # current database. + USE sisyfos; # Will give error on slave since + # database does not exist. + */ + qinfo.db = db; + qinfo.db_len = strlen(db); + mysql_bin_log.write(&qinfo); } send_ok(thd, result); @@ -497,7 +513,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); - // do not alter database if another thread is holding read lock + /* do not alter database if another thread is holding read lock */ if ((error=wait_if_global_read_lock(thd,0,1))) goto exit2; @@ -507,14 +523,14 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) if ((error=write_db_opt(thd, path, create_info))) goto exit; - /* + /* Change options if current database is being altered TODO: Delete this code */ if (thd->db && !strcmp(thd->db,db)) { - thd->db_charset= (create_info && create_info->default_table_charset) ? - create_info->default_table_charset : + thd->db_charset= create_info->default_table_charset ? + create_info->default_table_charset : thd->variables.collation_server; thd->variables.collation_database= thd->db_charset; } @@ -522,7 +538,17 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) mysql_update_log.write(thd,thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, + /* suppress_use */ TRUE); + + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. + */ + qinfo.db = db; + qinfo.db_len = strlen(db); + thd->clear_error(); mysql_bin_log.write(&qinfo); } @@ -552,7 +578,6 @@ exit2: -1 Error generated */ - int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { long deleted=0; @@ -564,7 +589,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); - // do not drop database if another thread is holding read lock + /* do not drop database if another thread is holding read lock */ if (wait_if_global_read_lock(thd, 0, 1)) { error= -1; @@ -595,12 +620,12 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) pthread_mutex_lock(&LOCK_open); remove_db_from_cache(db); pthread_mutex_unlock(&LOCK_open); - + error= -1; if ((deleted= mysql_rm_known_files(thd, dirp, db, path, 0)) >= 0) { ha_drop_database(path); - query_cache_invalidate1(db); + query_cache_invalidate1(db); error = 0; } } @@ -611,7 +636,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) my_casedn_str(files_charset_info, tmp_db); db= tmp_db; } - if (!silent && deleted>=0 && thd) + if (!silent && deleted>=0) { const char *query; ulong query_length; @@ -630,11 +655,22 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) mysql_update_log.write(thd, query, query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, query, query_length, 0); + Query_log_event qinfo(thd, query, query_length, 0, + /* suppress_use */ TRUE); + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. + */ + qinfo.db = db; + qinfo.db_len = strlen(db); + thd->clear_error(); mysql_bin_log.write(&qinfo); } + thd->server_status|= SERVER_STATUS_DB_DROPPED; send_ok(thd, (ulong) deleted); + thd->server_status&= ~SERVER_STATUS_DB_DROPPED; } exit: @@ -652,7 +688,7 @@ exit: have 'if (data_buf) free(data_buf)' data_buf is !=0 so this makes a DOUBLE free(). Side effects of this double free() are, randomly (depends on the machine), - when the slave is replicating a DROP DATABASE: + when the slave is replicating a DROP DATABASE: - garbage characters in the error message: "Error 'Can't drop database 'test2'; database doesn't exist' on query 'h4zI©'" @@ -725,7 +761,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, if ((mysql_rm_known_files(thd, new_dirp, NullS, newpath,1)) < 0) goto err; if (!(copy_of_path= thd->memdup(newpath, length+1)) || - !(dir= new (&thd->mem_root) String(copy_of_path, length, + !(dir= new (thd->mem_root) String(copy_of_path, length, &my_charset_bin)) || raid_dirs.push_back(dir)) goto err; @@ -737,11 +773,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, extension= fn_ext(file->name); if (find_type(extension, &deletable_extentions,1+2) <= 0) { - if (find_type(extension, &known_extentions,1+2) <= 0) + if (find_type(extension, ha_known_exts(),1+2) <= 0) found_other_files++; continue; } - // just for safety we use files_charset_info + /* just for safety we use files_charset_info */ if (db && !my_strcasecmp(files_charset_info, extension, reg_ext)) { @@ -876,7 +912,7 @@ bool mysql_change_db(THD *thd, const char *name) if (!dbname || !(db_length= strlen(dbname))) { x_free(dbname); /* purecov: inspected */ - send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */ + send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */ } if (check_db_name(dbname)) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 09893970803..cecdf8d1c62 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -57,8 +57,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order, DBUG_RETURN(1); } - if (thd->lex->duplicates == DUP_IGNORE) - thd->lex->select_lex.no_error= 1; + thd->lex->select_lex.no_error= thd->lex->ignore; /* Test if the user wants to delete all rows */ if (!using_limit && const_cond && (!conds || conds->val_int()) && @@ -118,6 +117,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order, bzero((char*) &tables,sizeof(tables)); tables.table = table; + tables.alias = table_list->alias; table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE), MYF(MY_FAE | MY_ZEROFILL)); @@ -216,7 +216,7 @@ cleanup: if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; } @@ -565,7 +565,7 @@ bool multi_delete::send_eof() if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && !normal_tables) local_error=1; // Log write failed: roll back the SQL statement } @@ -674,7 +674,7 @@ end: { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - thd->tmp_table); + thd->tmp_table, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); // This should return record count diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 3259e0a4f22..3e627243b9f 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -23,7 +23,6 @@ #include "mysql_priv.h" #include "sql_select.h" -#include "sql_acl.h" static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *s, TABLE_LIST *t); @@ -133,10 +132,16 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, /* Temp table is created so that it hounours if UNION without ALL is to be processed + + As 'distinct' parameter we always pass FALSE (0), because underlying + query will control distinct condition by itself. Correct test of + distinct underlying query will be is_union && + !unit->union_distinct->next_select() (i.e. it is union and last distinct + SELECT is last SELECT of UNION). */ if (!(table= create_tmp_table(thd, &derived_result->tmp_table_param, - unit->types, (ORDER*) 0, - is_union && unit->union_distinct, 1, + unit->types, (ORDER*) 0, + FALSE, 1, (first_select->options | thd->options | TMP_TABLE_ALL_COLUMNS), HA_POS_ERROR, diff --git a/sql/sql_do.cc b/sql/sql_do.cc index 25a8359f3d2..af72632199f 100644 --- a/sql/sql_do.cc +++ b/sql/sql_do.cc @@ -18,7 +18,6 @@ /* Execute DO statement */ #include "mysql_priv.h" -#include "sql_acl.h" int mysql_do(THD *thd, List<Item> &values) { @@ -29,6 +28,7 @@ int mysql_do(THD *thd, List<Item> &values) DBUG_RETURN(-1); while ((value = li++)) value->val_int(); + free_underlaid_joins(thd, &thd->lex->select_lex); thd->clear_error(); // DO always is OK send_ok(thd); DBUG_RETURN(0); diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 87644300535..d19e9fbdb09 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -104,6 +104,10 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, { MYSQL_ERROR *err= 0; DBUG_ENTER("push_warning"); + + if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_SQL_NOTES)) + return(0); + if (thd->query_id != thd->warn_id) mysql_reset_errors(thd); @@ -113,12 +117,12 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, The following code is here to change the allocation to not use the thd->mem_root, which is freed after each query */ - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC, &thd->warn_root); + MEM_ROOT *old_root= thd->mem_root; + thd->mem_root= &thd->warn_root; err= new MYSQL_ERROR(thd, code, level, msg); if (err) thd->warn_list.push_back(err); - my_pthread_setspecific_ptr(THR_MALLOC, old_root); + thd->mem_root= old_root; } thd->warn_count[(uint) level]++; thd->total_warn_count++; diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index f98bb0a9131..f250a00eca1 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -429,7 +429,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, } tables->table=table; - if (cond && (cond->fix_fields(thd, tables, &cond) || cond->check_cols(1))) + if (cond && ((!cond->fixed && + cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1))) goto err0; table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it @@ -516,7 +517,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, for (key_len=0 ; (item=it_ke++) ; key_part++) { // 'item' can be changed by fix_fields() call - if (item->fix_fields(thd, tables, it_ke.ref()) || + if ((!item->fixed && + item->fix_fields(thd, tables, it_ke.ref())) || (item= *it_ke.ref())->check_cols(1)) goto err; if (item->used_tables() & ~RAND_TABLE_BIT) diff --git a/sql/sql_help.cc b/sql/sql_help.cc index ffaaafc26e6..0e0d32a922d 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -127,7 +127,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count, String *name, String *description, String *example) { DBUG_ENTER("memorize_variant_topic"); - MEM_ROOT *mem_root= &thd->mem_root; + MEM_ROOT *mem_root= thd->mem_root; if (count==0) { get_field(mem_root,find_fields[help_topic_name].field, name); @@ -138,7 +138,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count, { if (count == 1) names->push_back(name); - String *new_name= new (&thd->mem_root) String; + String *new_name= new (thd->mem_root) String; get_field(mem_root,find_fields[help_topic_name].field,new_name); names->push_back(new_name); } @@ -351,8 +351,8 @@ int search_categories(THD *thd, TABLE *categories, { if (select && !select->cond->val_int()) continue; - String *lname= new (&thd->mem_root) String; - get_field(&thd->mem_root,pfname,lname); + String *lname= new (thd->mem_root) String; + get_field(thd->mem_root,pfname,lname); if (++count == 1 && res_id) *res_id= (int16) pcat_id->val_int(); names->push_back(lname); @@ -385,8 +385,8 @@ void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname, { if (!select->cond->val_int()) continue; - String *name= new (&thd->mem_root) String(); - get_field(&thd->mem_root,pfname,name); + String *name= new (thd->mem_root) String(); + get_field(thd->mem_root,pfname,name); res->push_back(name); } end_read_record(&read_record_info); @@ -557,7 +557,8 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, TABLE_LIST *tables, TABLE *table, int *error) { - cond->fix_fields(thd, tables, &cond); // can never fail + if (!cond->fixed) + cond->fix_fields(thd, tables, &cond); // can never fail SQL_SELECT *res= make_select(table,0,0,cond,error); if (*error || (res && res->check_quick(thd, 0, HA_POS_ERROR))) { @@ -638,7 +639,7 @@ int mysqld_help(THD *thd, const char *mask) String name, description, example; int res, count_topics, count_categories, error; uint mlen= strlen(mask); - MEM_ROOT *mem_root= &thd->mem_root; + MEM_ROOT *mem_root= thd->mem_root; if (open_and_lock_tables(thd, tables)) { diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 2c48d1dca8f..1f190a450de 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -18,12 +18,11 @@ /* Insert of records */ #include "mysql_priv.h" -#include "sql_acl.h" static int check_null_fields(THD *thd,TABLE *entry); #ifndef EMBEDDED_LIBRARY static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list); -static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, +static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, bool ignore, char *query, uint query_length, int log_on); static void end_delayed_insert(THD *thd); extern "C" pthread_handler_decl(handle_delayed_insert,arg); @@ -112,7 +111,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<List_item> &values_list, List<Item> &update_fields, List<Item> &update_values, - enum_duplicates duplic) + enum_duplicates duplic, + bool ignore) { int error, res; /* @@ -198,15 +198,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, thd->used_tables=0; values= its++; - if (duplic == DUP_UPDATE && !table->insert_values) - { - /* it should be allocated before Item::fix_fields() */ - table->insert_values= - (byte *)alloc_root(&thd->mem_root, table->rec_buff_length); - if (!table->insert_values) - goto abort; - } - if (mysql_prepare_insert(thd, table_list, insert_table_list, table, fields, values, update_fields, update_values, duplic)) @@ -232,9 +223,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, */ info.records= info.deleted= info.copied= info.updated= 0; + info.ignore= ignore; info.handle_duplicates=duplic; - info.update_fields=&update_fields; - info.update_values=&update_values; + info.update_fields= &update_fields; + info.update_values= &update_values; /* Count warnings for all inserts. For single line insert, generate an error if try to set a NOT NULL field @@ -249,7 +241,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, error=0; id=0; thd->proc_info="update"; - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); /* let's *try* to start bulk inserts. It won't necessary @@ -299,7 +291,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, #ifndef EMBEDDED_LIBRARY if (lock_type == TL_WRITE_DELAYED) { - error=write_delayed(thd,table,duplic,query, thd->query_length, log_on); + error=write_delayed(thd, table, duplic, ignore, query, thd->query_length, log_on); query=0; } else @@ -368,7 +360,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; } @@ -388,7 +380,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, table->next_number_field=0; thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->next_insert_id=0; // Reset this if wrongly used - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); /* Reset value of LAST_INSERT_ID if no rows where inserted */ @@ -405,7 +397,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, else { char buff[160]; - if (duplic == DUP_IGNORE) + if (ignore) sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records, (lock_type == TL_WRITE_DELAYED) ? (ulong) 0 : (ulong) (info.records - info.copied), (ulong) thd->cuted_fields); @@ -437,6 +429,7 @@ abort: thd - thread handler table_list - global table list insert_table_list - local table list of INSERT SELECT_LEX + values - values to insert. NULL for INSERT ... SELECT RETURN VALUE 0 - OK @@ -449,19 +442,30 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, enum_duplicates duplic) { DBUG_ENTER("mysql_prepare_insert"); - if (check_insert_fields(thd, table, fields, *values, 1) || + if (duplic == DUP_UPDATE && !table->insert_values) + { + /* it should be allocated before Item::fix_fields() */ + table->insert_values= + (byte *)alloc_root(thd->mem_root, table->rec_buff_length); + if (!table->insert_values) + DBUG_RETURN(-1); + } + if ((values && check_insert_fields(thd, table, fields, *values, 1)) || setup_tables(insert_table_list) || - setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0) || + (values && setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0)) || (duplic == DUP_UPDATE && - (setup_fields(thd, 0, insert_table_list, update_fields, 0, 0, 0) || - setup_fields(thd, 0, insert_table_list, update_values, 0, 0, 0)))) + (setup_fields(thd, 0, insert_table_list, update_fields, 1, 0, 0) || + setup_fields(thd, 0, insert_table_list, update_values, 1, 0, 0)))) DBUG_RETURN(-1); - if (find_real_table_in_list(table_list->next, - table_list->db, table_list->real_name)) + if (values && find_real_table_in_list(table_list->next, table_list->db, + table_list->real_name)) { my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name); DBUG_RETURN(-1); } + if (duplic == DUP_UPDATE || duplic == DUP_REPLACE) + table->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY); + DBUG_RETURN(0); } @@ -548,8 +552,10 @@ int write_record(TABLE *table,COPY_INFO *info) that matches, is updated. If update causes a conflict again, an error is returned */ + DBUG_ASSERT(table->insert_values != NULL); store_record(table,insert_values); restore_record(table,record[1]); + DBUG_ASSERT(info->update_fields->elements==info->update_values->elements); if (fill_record(*info->update_fields, *info->update_values, 0)) goto err; if ((error=table->file->update_row(table->record[1],table->record[0]))) @@ -587,7 +593,7 @@ int write_record(TABLE *table,COPY_INFO *info) } else if ((error=table->file->write_row(table->record[0]))) { - if (info->handle_duplicates != DUP_IGNORE || + if (!info->ignore || (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)) goto err; } @@ -643,14 +649,14 @@ public: char *record,*query; enum_duplicates dup; time_t start_time; - bool query_start_used,last_insert_id_used,insert_id_used; + bool query_start_used,last_insert_id_used,insert_id_used, ignore; int log_query; ulonglong last_insert_id; timestamp_auto_set_type timestamp_field_type; uint query_length; - delayed_row(enum_duplicates dup_arg, int log_query_arg) - :record(0),query(0),dup(dup_arg),log_query(log_query_arg) {} + delayed_row(enum_duplicates dup_arg, bool ignore_arg, int log_query_arg) + :record(0),query(0),dup(dup_arg),ignore(ignore_arg),log_query(log_query_arg) {} ~delayed_row() { x_free(record); @@ -682,7 +688,8 @@ public: thd.current_tablenr=0; thd.version=refresh_version; thd.command=COM_DELAYED_INSERT; - thd.lex->current_select= 0; /* for my_message_sql */ + thd.lex->current_select= 0; // for my_message_sql + thd.lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock() bzero((char*) &thd.net, sizeof(thd.net)); // Safety bzero((char*) &table_list, sizeof(table_list)); // Safety @@ -924,7 +931,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) found_next_number_field=table->found_next_number_field; for (org_field=table->field ; *org_field ; org_field++,field++) { - if (!(*field= (*org_field)->new_field(&client_thd->mem_root,copy))) + if (!(*field= (*org_field)->new_field(client_thd->mem_root,copy))) return 0; (*field)->orig_table= copy; // Remove connection (*field)->move_field(adjust_ptrs); // Point at copy->record[0] @@ -962,7 +969,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) /* Put a question in queue */ -static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, +static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, bool ignore, char *query, uint query_length, int log_on) { delayed_row *row=0; @@ -975,7 +982,7 @@ static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, pthread_cond_wait(&di->cond_client,&di->mutex); thd->proc_info="storing row into queue"; - if (thd->killed || !(row= new delayed_row(duplic, log_on))) + if (thd->killed || !(row= new delayed_row(duplic, ignore, log_on))) goto err; if (!query) @@ -1336,9 +1343,10 @@ bool delayed_insert::handle_inserts(void) thd.insert_id_used=row->insert_id_used; table->timestamp_field_type= row->timestamp_field_type; + info.ignore= row->ignore; info.handle_duplicates= row->dup; - if (info.handle_duplicates == DUP_IGNORE || - info.handle_duplicates == DUP_REPLACE) + if (info.ignore || + info.handle_duplicates != DUP_ERROR) { table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); using_ignore=1; @@ -1361,7 +1369,7 @@ bool delayed_insert::handle_inserts(void) mysql_update_log.write(&thd,row->query, row->query_length); if (row->log_query & DELAYED_LOG_BIN && using_bin_log) { - Query_log_event qinfo(&thd, row->query, row->query_length,0); + Query_log_event qinfo(&thd, row->query, row->query_length,0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -1454,10 +1462,9 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u) restore_record(table,default_values); // Get empty record table->next_number_field=table->found_next_number_field; - thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields thd->cuted_fields=0; - if (info.handle_duplicates == DUP_IGNORE || - info.handle_duplicates == DUP_REPLACE) + if (info.ignore || + info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); DBUG_RETURN(0); @@ -1484,27 +1491,34 @@ select_insert::~select_insert() bool select_insert::send_data(List<Item> &values) { DBUG_ENTER("select_insert::send_data"); + bool error=0; if (unit->offset_limit_cnt) { // using limit offset,count unit->offset_limit_cnt--; DBUG_RETURN(0); } - if (fields->elements) - fill_record(*fields, values, 1); - else - fill_record(table->field, values, 1); - if (thd->net.report_error || write_record(table,&info)) - DBUG_RETURN(1); - if (table->next_number_field) // Clear for next record + thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields + store_values(values); + error=thd->net.report_error || write_record(table,&info); + thd->count_cuted_fields= CHECK_FIELD_IGNORE; + if (!error && table->next_number_field) // Clear for next record { table->next_number_field->reset(); if (! last_insert_id && thd->insert_id_used) last_insert_id=thd->insert_id(); } - DBUG_RETURN(0); + DBUG_RETURN(error); } +void select_insert::store_values(List<Item> &values) +{ + if (fields->elements) + fill_record(*fields, values, 1); + else + fill_record(table->field, values, 1); +} + void select_insert::send_error(uint errcode,const char *err) { DBUG_ENTER("select_insert::send_error"); @@ -1536,7 +1550,7 @@ void select_insert::send_error(uint errcode,const char *err) if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); + table->file->has_transactions(), FALSE); mysql_bin_log.write(&qinfo); } if (!table->tmp_table) @@ -1578,7 +1592,7 @@ bool select_insert::send_eof() if (!error) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); + table->file->has_transactions(), FALSE); mysql_bin_log.write(&qinfo); } if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error) @@ -1591,7 +1605,7 @@ bool select_insert::send_eof() DBUG_RETURN(1); } char buff[160]; - if (info.handle_duplicates == DUP_IGNORE) + if (info.ignore) sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records, (ulong) (info.records - info.copied), (ulong) thd->cuted_fields); else @@ -1634,33 +1648,30 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) table->next_number_field=table->found_next_number_field; restore_record(table,default_values); // Get empty record - thd->count_cuted_fields= CHECK_FIELD_WARN; // count warnings thd->cuted_fields=0; - if (info.handle_duplicates == DUP_IGNORE || - info.handle_duplicates == DUP_REPLACE) + if (info.ignore || + info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); DBUG_RETURN(0); } -bool select_create::send_data(List<Item> &values) +void select_create::store_values(List<Item> &values) { - if (unit->offset_limit_cnt) - { // using limit offset,count - unit->offset_limit_cnt--; - return 0; - } fill_record(field, values, 1); - if (thd->net.report_error ||write_record(table,&info)) - return 1; - if (table->next_number_field) // Clear for next record - { - table->next_number_field->reset(); - if (! last_insert_id && thd->insert_id_used) - last_insert_id=thd->insert_id(); - } - return 0; +} + + +void select_create::send_error(uint errcode,const char *err) +{ + /* + Disable binlog, because we "roll back" partial inserts in ::abort + by removing the table, even for non-transactional tables. + */ + tmp_disable_binlog(thd); + select_insert::send_error(errcode, err); + reenable_binlog(thd); } @@ -1681,9 +1692,10 @@ bool select_create::send_eof() */ if (!table->tmp_table) { + ulong version= table->version; hash_delete(&open_cache,(byte*) table); /* Tell threads waiting for refresh that something has happened */ - if (table->version != refresh_version) + if (version != refresh_version) VOID(pthread_cond_broadcast(&COND_refresh)); } lock=0; @@ -1707,11 +1719,12 @@ void select_create::abort() enum db_type table_type=table->db_type; if (!table->tmp_table) { + ulong version= table->version; hash_delete(&open_cache,(byte*) table); if (!create_info->table_existed) quick_rm_table(table_type, db, name); /* Tell threads waiting for refresh that something has happened */ - if (table->version != refresh_version) + if (version != refresh_version) VOID(pthread_cond_broadcast(&COND_refresh)); } else if (!create_info->table_existed) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 679ffb2140e..d6dcd9ce9ae 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -123,6 +123,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->unit.thd= thd; lex->select_lex.init_query(); lex->value_list.empty(); + lex->update_list.empty(); lex->param_list.empty(); lex->unit.next= lex->unit.master= lex->unit.link_next= lex->unit.return_to= 0; @@ -135,7 +136,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->select_lex.link_prev= (st_select_lex_node**)&(lex->all_selects_list); lex->select_lex.options= 0; lex->describe= 0; - lex->derived_tables= FALSE; + lex->subqueries= lex->derived_tables= FALSE; lex->lock_option= TL_READ; lex->found_colon= 0; lex->safe_to_cache_query= 1; @@ -157,11 +158,16 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE); lex->sql_command=SQLCOM_END; lex->duplicates= DUP_ERROR; + lex->ignore= 0; + lex->proc_list.first= 0; } void lex_end(LEX *lex) { - lex->select_lex.expr_list.delete_elements(); // If error when parsing sql-varargs + for (SELECT_LEX *sl= lex->all_selects_list; + sl; + sl= sl->next_select_in_list()) + sl->expr_list.delete_elements(); // If error when parsing sql-varargs x_free(lex->yacc_yyss); x_free(lex->yacc_yyvs); } @@ -289,7 +295,18 @@ static char *get_text(LEX *lex) found_escape=1; if (lex->ptr == lex->end_of_query) return 0; - yySkip(); +#ifdef USE_MB + int l; + if (use_mb(cs) && + (l = my_ismbchar(cs, + (const char *)lex->ptr, + (const char *)lex->end_of_query))) { + lex->ptr += l; + continue; + } + else +#endif + yySkip(); } else if (c == sep) { @@ -317,6 +334,10 @@ static char *get_text(LEX *lex) else { uchar *to; + + /* Re-use found_escape for tracking state of escapes */ + found_escape= 0; + for (to=start ; str != end ; str++) { #ifdef USE_MB @@ -330,7 +351,7 @@ static char *get_text(LEX *lex) continue; } #endif - if (*str == '\\' && str+1 != end) + if (!found_escape && *str == '\\' && str+1 != end) { switch(*++str) { case 'n': @@ -356,15 +377,20 @@ static char *get_text(LEX *lex) *to++= '\\'; // remember prefix for wildcard /* Fall through */ default: - *to++ = *str; + found_escape= 1; + str--; break; } } - else if (*str == sep) - *to++= *str++; // Two ' or " + else if (!found_escape && *str == sep) + { + found_escape= 1; + } else + { *to++ = *str; - + found_escape= 0; + } } *to=0; lex->yytoklen=(uint) (to-start); @@ -909,6 +935,7 @@ int yylex(void *arg, void *yythd) if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) && (thd->command != COM_PREPARE)) { + lex->safe_to_cache_query=0; lex->found_colon=(char*)lex->ptr; thd->server_status |= SERVER_MORE_RESULTS_EXISTS; lex->next_state=MY_LEX_END; @@ -1681,9 +1708,6 @@ void st_select_lex::print_order(String *str, ORDER *order) void st_select_lex::print_limit(THD *thd, String *str) { - if (!thd) - thd= current_thd; - if (explicit_limit) { str->append(" limit ", 7); @@ -1717,8 +1741,8 @@ st_lex::st_lex() global_first Save first global table here local_first Save first local table here - NORES - global_first & local_first are used to save result for link_first_table_back + NOTES + This function assumes that outer select list is non-empty. RETURN global list without first table @@ -1728,25 +1752,25 @@ TABLE_LIST *st_lex::unlink_first_table(TABLE_LIST *tables, TABLE_LIST **global_first, TABLE_LIST **local_first) { - *global_first= tables; - *local_first= (TABLE_LIST*)select_lex.table_list.first; + DBUG_ASSERT(select_lex.table_list.first != 0); /* - Exclude from global table list + Save pointers to first elements of global table list and list + of tables used in outer select. It does not harm if these lists + are the same. */ + *global_first= tables; + *local_first= (TABLE_LIST*)select_lex.table_list.first; + + /* Exclude first elements from these lists */ + select_lex.table_list.first= (byte*) (*local_first)->next; tables= tables->next; - /* - and from local list if it is not the same - */ - select_lex.table_list.first= ((&select_lex != all_selects_list) ? - (byte*) (*local_first)->next : - (byte*) tables); (*global_first)->next= 0; return tables; } /* - Link table back that was unlinked with unlink_first_table() + Link table which was unlinked with unlink_first_table() back. SYNOPSIS link_first_table_back() @@ -1762,16 +1786,7 @@ TABLE_LIST *st_lex::link_first_table_back(TABLE_LIST *tables, TABLE_LIST *local_first) { global_first->next= tables; - if (&select_lex != all_selects_list) - { - /* - we do not touch local table 'next' field => we need just - put the table in the list - */ - select_lex.table_list.first= (byte*) local_first; - } - else - select_lex.table_list.first= (byte*) global_first; + select_lex.table_list.first= (byte*) local_first; return global_first; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 268198f74a2..f48ff42bbf8 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -125,27 +125,46 @@ enum tablespace_op_type /* The state of the lex parsing for selects + master and slaves are pointers to select_lex. + master is pointer to upper level node. + slave is pointer to lower level node + select_lex is a SELECT without union + unit is container of either + - One SELECT + - UNION of selects + select_lex and unit are both inherited form select_lex_node + neighbors are two select_lex or units on the same level + All select describing structures linked with following pointers: - - list of neighbors (next/prev) (prev of first element point to slave + - list of neighbors (next/prev) (prev of first element point to slave pointer of upper structure) - - one level units for unit (union) structure - - member of one union(unit) for ordinary select_lex - - pointer to master - - outer select_lex for unit (union) - - unit structure for ordinary select_lex - - pointer to slave - - first list element of select_lex belonged to this unit for unit - - first unit in list of units that belong to this select_lex (as - subselects or derived tables) for ordinary select_lex - - list of all select_lex (for group operation like correcting list of opened - tables) - - if unit contain several selects (union) then it have special - select_lex called fake_select_lex. It used for storing global parameters - and executing union. subqueries of global ORDER BY clause will be - attached to this fake_select_lex, which will allow them correctly - resolve fields of 'upper' union and other more outer selects. - - for example for following query: + - For select this is a list of UNION's (or one element list) + - For units this is a list of sub queries for the upper level select + + - pointer to master (master), which is + If this is a unit + - pointer to outer select_lex + If this is a select_lex + - pointer to outer unit structure for select + + - pointer to slave (slave), which is either: + If this is a unit: + - first SELECT that belong to this unit + If this is a select_lex + - first unit that belong to this SELECT (subquries or derived tables) + + - list of all select_lex (link_next/link_prev) + This is to be used for things like derived tables creation, where we + go through this list and create the derived tables. + + If unit contain several selects (UNION now, INTERSECT etc later) + then it have special select_lex called fake_select_lex. It used for + storing global parameters (like ORDER BY, LIMIT) and executing union. + Subqueries used in global ORDER BY clause will be attached to this + fake_select_lex, which will allow them correctly resolve fields of + 'upper' UNION and outer selects. + + For example for following query: select * from table1 @@ -163,6 +182,11 @@ enum tablespace_op_type we will have following structure: + select1: (select * from table1 ...) + select2: (select * from table2 ...) + select3: (select * from table3) + select1.1.1: (select * from table1_1_1) + ... main unit fake0 @@ -185,7 +209,12 @@ enum tablespace_op_type relation in main unit will be following: - + (bigger picture for: + main unit + fake0 + select1 select2 select3 + in the above picture) + main unit |^^^^|fake_select_lex |||||+--------------------------------------------+ @@ -241,7 +270,7 @@ public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) {} - static void operator delete(void *ptr,size_t size, MEM_ROOT *mem_root) {} + static void operator delete(void *ptr, MEM_ROOT *mem_root) {} st_select_lex_node(): linkage(UNSPECIFIED_TYPE) {} virtual ~st_select_lex_node() {} inline st_select_lex_node* get_master() { return master; } @@ -371,6 +400,7 @@ public: ulong init_prepare_fake_select_lex(THD *thd); int change_result(select_subselect *result, select_subselect *old_result); + inline bool is_prepared() { return prepared; } friend void lex_start(THD *thd, uchar *buf, uint length); friend int subselect_union_engine::exec(); @@ -381,7 +411,7 @@ private: typedef class st_select_lex_unit SELECT_LEX_UNIT; /* - SELECT_LEX - store information of parsed SELECT_LEX statment + SELECT_LEX - store information of parsed SELECT statment */ class st_select_lex: public st_select_lex_node { @@ -587,12 +617,11 @@ typedef struct st_lex List<LEX_COLUMN> columns; List<Key> key_list; List<create_field> create_list; - List<Item> *insert_list,field_list,value_list; + List<Item> *insert_list,field_list,value_list,update_list; List<List_item> many_values; List<set_var_base> var_list; List<Item_param> param_list; SQL_LIST proc_list, auxilliary_table_list, save_list; - TYPELIB *interval; create_field *last_field; char *savepoint_name; // Transaction savepoint id udf_func udf; @@ -613,12 +642,13 @@ typedef struct st_lex uint uint_geom_type; uint grant, grant_tot_col, which_columns; uint fk_delete_opt, fk_update_opt, fk_match_option; - uint slave_thd_opt; + uint slave_thd_opt, start_transaction_opt; uint8 describe; bool drop_if_exists, drop_temporary, local_file, one_shot_set; bool in_comment, ignore_space, verbose, no_write_to_binlog; bool derived_tables; bool safe_to_cache_query; + bool subqueries, ignore; ALTER_INFO alter_info; /* Prepared statements SQL syntax:*/ LEX_STRING prepared_stmt_name; /* Statement name (in all queries) */ diff --git a/sql/sql_list.h b/sql/sql_list.h index 38c5af2a4f7..be3e29b0c62 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -41,8 +41,8 @@ public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } - static void operator delete(void *ptr, size_t size, MEM_ROOT *mem_root) - { TRASH(ptr, size); } + static void operator delete(void *ptr, MEM_ROOT *mem_root) + { /* never called */ } static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); } #ifdef HAVE_purify bool dummy; @@ -134,6 +134,15 @@ public: if (!--elements) last= &first; } + inline void concat(base_list *list) + { + if (!list->is_empty()) + { + *last= list->first; + last= list->last; + elements+= list->elements; + } + } inline void *pop(void) { if (first == &end_of_list) return 0; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 17ab472c87b..c4f5b1427af 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -80,6 +80,7 @@ static int read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, List<Item> &fields, enum enum_duplicates handle_duplicates, + bool ignore, bool read_file_from_client,thr_lock_type lock_type) { char name[FN_REFLEN]; @@ -165,7 +166,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, /* We can't give an error in the middle when using LOCAL files */ if (read_file_from_client && handle_duplicates == DUP_ERROR) - handle_duplicates=DUP_IGNORE; + ignore= 1; #ifndef EMBEDDED_LIBRARY if (read_file_from_client) @@ -216,6 +217,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, COPY_INFO info; bzero((char*) &info,sizeof(info)); + info.ignore= ignore; info.handle_duplicates=handle_duplicates; info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX; @@ -237,6 +239,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, lf_info.db = db; lf_info.table_name = table_list->real_name; lf_info.fields = &fields; + lf_info.ignore= ignore; lf_info.handle_dup = handle_duplicates; lf_info.wrote_create_file = 0; lf_info.last_pos_in_file = HA_POS_ERROR; @@ -267,7 +270,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; table->next_number_field=table->found_next_number_field; - if (handle_duplicates == DUP_IGNORE || + if (ignore || handle_duplicates == DUP_REPLACE) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); ha_enable_transaction(thd, FALSE); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e061005ae61..81cc3f00b50 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_repl.h" #include "repl_failsafe.h" #include <m_ctype.h> @@ -48,15 +47,19 @@ extern "C" int gethostname(char *name, int namelen); #endif +static void time_out_user_resource_limits(THD *thd, USER_CONN *uc); #ifndef NO_EMBEDDED_ACCESS_CHECKS static int check_for_max_user_connections(THD *thd, USER_CONN *uc); #endif static void decrease_user_connections(USER_CONN *uc); static bool check_db_used(THD *thd,TABLE_LIST *tables); +static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, + List<Item> *fields, SELECT_LEX *select_lex); static void remove_escape(char *name); static void refresh_status(void); static bool append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name); +static void log_slow_query(THD *thd); const char *any_db="*any*"; // Special symbol for check_access @@ -65,7 +68,7 @@ const char *command_name[]={ "Drop DB", "Refresh", "Shutdown", "Statistics", "Processlist", "Connect","Kill","Debug","Ping","Time","Delayed insert","Change user", "Binlog Dump","Table Dump", "Connect Out", "Register Slave", - "Prepare", "Prepare Execute", "Long Data", "Close stmt", + "Prepare", "Execute", "Long Data", "Close stmt", "Reset stmt", "Set option", "Error" // Last command number }; @@ -441,6 +444,7 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc) error=1; goto end; } + time_out_user_resource_limits(thd, uc); if (uc->user_resources.connections && uc->user_resources.connections <= uc->conn_per_hour) { @@ -542,36 +546,56 @@ bool is_update_query(enum enum_sql_command command) } /* - Check if maximum queries per hour limit has been reached - returns 0 if OK. + Reset per-hour user resource limits when it has been more than + an hour since they were last checked - In theory we would need a mutex in the USER_CONN structure for this to - be 100 % safe, but as the worst scenario is that we would miss counting - a couple of queries, this isn't critical. -*/ + SYNOPSIS: + time_out_user_resource_limits() + thd Thread handler + uc User connection details + NOTE: + This assumes that the LOCK_user_conn mutex has been acquired, so it is + safe to test and modify members of the USER_CONN structure. +*/ -static bool check_mqh(THD *thd, uint check_command) +static void time_out_user_resource_limits(THD *thd, USER_CONN *uc) { -#ifdef NO_EMBEDDED_ACCESS_CHECKS - return(0); -#else - bool error=0; + bool error= 0; time_t check_time = thd->start_time ? thd->start_time : time(NULL); - USER_CONN *uc=thd->user_connect; - DBUG_ENTER("check_mqh"); - DBUG_ASSERT(uc != 0); + DBUG_ENTER("time_out_user_resource_limits"); /* If more than a hour since last check, reset resource checking */ if (check_time - uc->intime >= 3600) { - (void) pthread_mutex_lock(&LOCK_user_conn); uc->questions=1; uc->updates=0; uc->conn_per_hour=0; uc->intime=check_time; - (void) pthread_mutex_unlock(&LOCK_user_conn); } + + DBUG_VOID_RETURN; +} + + +/* + Check if maximum queries per hour limit has been reached + returns 0 if OK. +*/ + +static bool check_mqh(THD *thd, uint check_command) +{ +#ifndef NO_EMBEDDED_ACCESS_CHECKS + bool error= 0; + time_t check_time = thd->start_time ? thd->start_time : time(NULL); + USER_CONN *uc=thd->user_connect; + DBUG_ENTER("check_mqh"); + DBUG_ASSERT(uc != 0); + + (void) pthread_mutex_lock(&LOCK_user_conn); + + time_out_user_resource_limits(thd, uc); + /* Check that we have not done too many questions / hour */ if (uc->user_resources.questions && uc->questions++ >= uc->user_resources.questions) @@ -594,7 +618,10 @@ static bool check_mqh(THD *thd, uint check_command) } } end: + (void) pthread_mutex_unlock(&LOCK_user_conn); DBUG_RETURN(error); +#else + return (0); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ } @@ -655,6 +682,8 @@ static int check_connection(THD *thd) { uint connect_errors= 0; NET *net= &thd->net; + ulong pkt_len= 0; + char *end; DBUG_PRINT("info", ("New connection received on %s", vio_description(net->vio))); @@ -668,6 +697,7 @@ static int check_connection(THD *thd) if (!(thd->ip= my_strdup(ip,MYF(0)))) return (ER_OUT_OF_RESOURCES); thd->host_or_ip= thd->ip; + vio_in_addr(net->vio,&thd->remote.sin_addr); #if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread) /* Fast local hostname resolve for Win32 */ if (!strcmp(thd->ip,"127.0.0.1")) @@ -703,11 +733,10 @@ static int check_connection(THD *thd) DBUG_PRINT("info",("Host: %s",thd->host)); thd->host_or_ip= thd->host; thd->ip= 0; - bzero((char*) &thd->remote, sizeof(struct sockaddr)); + /* Reset sin_addr */ + bzero((char*) &thd->remote, sizeof(thd->remote)); } vio_keepalive(net->vio, TRUE); - ulong pkt_len= 0; - char *end; { /* buff[] needs to big enough to hold the server_version variable */ char buff[SERVER_VERSION_LENGTH + SCRAMBLE_LENGTH + 64]; @@ -867,14 +896,16 @@ static int check_connection(THD *thd) char *user= end; char *passwd= strend(user)+1; char *db= passwd; - char db_buff[NAME_LEN+1]; // buffer to store db in utf8 + char db_buff[NAME_LEN+1]; // buffer to store db in utf8 char user_buff[USERNAME_LENGTH+1]; // buffer to store user in utf8 - /* + uint dummy_errors; + + /* Old clients send null-terminated string as password; new clients send the size (1 byte) + string (not null-terminated). Hence in case of empty password both send '\0'. */ - uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? + uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? *passwd++ : strlen(passwd); db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ? db + passwd_len + 1 : 0; @@ -885,17 +916,14 @@ static int check_connection(THD *thd) db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1, system_charset_info, db, strlen(db), - thd->charset())]= 0; + thd->charset(), &dummy_errors)]= 0; db= db_buff; } - if (user) - { - user_buff[copy_and_convert(user_buff, sizeof(user_buff)-1, - system_charset_info, user, strlen(user), - thd->charset())]= '\0'; - user= user_buff; - } + user_buff[copy_and_convert(user_buff, sizeof(user_buff)-1, + system_charset_info, user, strlen(user), + thd->charset(), &dummy_errors)]= '\0'; + user= user_buff; if (thd->user) x_free(thd->user); @@ -1024,7 +1052,7 @@ pthread_handler_decl(handle_one_connection,arg) } if (thd->user_connect) decrease_user_connections(thd->user_connect); - free_root(&thd->mem_root,MYF(0)); + free_root(thd->mem_root,MYF(0)); if (net->error && net->vio != 0 && net->report_error) { if (!thd->killed && thd->variables.log_warnings > 1) @@ -1100,13 +1128,25 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) thd->init_for_queries(); while (fgets(buff, thd->net.max_packet, file)) { - uint length=(uint) strlen(buff); - if (buff[length-1]!='\n' && !feof(file)) + ulong length= (ulong) strlen(buff); + while (buff[length-1] != '\n' && !feof(file)) { - send_error(thd,ER_NET_PACKET_TOO_LARGE, NullS); - thd->is_fatal_error= 1; - break; + /* + We got only a part of the current string. Will try to increase + net buffer then read the rest of the current string. + */ + if (net_realloc(&(thd->net), 2 * thd->net.max_packet)) + { + send_error(thd, thd->net.last_errno, NullS); + thd->is_fatal_error= 1; + break; + } + buff= (char*) thd->net.buff; + fgets(buff + length, thd->net.max_packet - length, file); + length+= (ulong) strlen(buff + length); } + if (thd->is_fatal_error) + break; while (length && (my_isspace(thd->charset(), buff[length-1]) || buff[length-1] == ';')) length--; @@ -1119,14 +1159,14 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) { thd->net.error = 0; close_thread_tables(thd); // Free tables - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); break; } mysql_parse(thd,thd->query,length); close_thread_tables(thd); // Free tables if (thd->is_fatal_error) break; - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); free_root(&thd->transaction.mem_root,MYF(MY_KEEP_PREALLOC)); } @@ -1380,9 +1420,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } #endif /* Convert database name to utf8 */ + uint dummy_errors; db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1, system_charset_info, db, strlen(db), - thd->charset())]= 0; + thd->charset(), &dummy_errors)]= 0; db= db_buff; /* Save user and privileges */ @@ -1458,6 +1499,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, { if (alloc_query(thd, packet, packet_length)) break; // fatal error is set + char *packet_end= thd->query + thd->query_length; mysql_log.write(thd,command,"%s",thd->query); DBUG_PRINT("query",("%-.4096s",thd->query)); mysql_parse(thd,thd->query, thd->query_length); @@ -1473,7 +1515,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (thd->lock || thd->open_tables || thd->derived_tables) close_thread_tables(thd); #endif - ulong length= thd->query_length-(ulong)(packet-thd->query); + ulong length= (ulong)(packet_end-packet); + + log_slow_query(thd); /* Remove garbage at start of query */ while (my_isspace(thd->charset(), *packet) && length > 0) @@ -1485,6 +1529,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->query_length= length; thd->query= packet; thd->query_id= query_id++; + thd->set_time(); /* Reset the query start time. */ /* TODO: set thd->lex->sql_command to SQLCOM_END here */ VOID(pthread_mutex_unlock(&LOCK_thread_count)); #ifndef EMBEDDED_LIBRARY @@ -1533,7 +1578,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, packet, (uint) (pend-packet), thd->charset()); table_list.alias= table_list.real_name= conv_name.str; packet= pend+1; - // command not cachable => no gap for data base name + thd->query_length= strlen(packet); // for simplicity: don't optimize if (!(thd->query=fields=thd->memdup(packet,thd->query_length+1))) break; mysql_log.write(thd,command,"%s %s",table_list.real_name,fields); @@ -1607,15 +1652,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #ifndef EMBEDDED_LIBRARY case COM_BINLOG_DUMP: { + ulong pos; + ushort flags; + uint32 slave_server_id; + statistic_increment(com_other,&LOCK_status); thd->slow_command = TRUE; if (check_global_access(thd, REPL_SLAVE_ACL)) break; - mysql_log.write(thd,command, 0); - ulong pos; - ushort flags; - uint32 slave_server_id; /* TODO: The following has to be changed to an 8 byte integer */ pos = uint4korr(packet); flags = uint2korr(packet + 4); @@ -1623,6 +1668,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if ((slave_server_id= uint4korr(packet+6))) // mysqlbinlog.server_id==0 kill_zombie_dump_threads(slave_server_id); thd->server_id = slave_server_id; + + mysql_log.write(thd, command, "Log: '%s' Pos: %ld", packet+10, + (long) pos); mysql_binlog_send(thd, thd->strdup(packet + 10), (my_off_t) pos, flags); unregister_slave(thd,1,1); // fake COM_QUIT -- if we get here, the thread needs to terminate @@ -1678,7 +1726,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #endif close_connection(thd, 0, 1); close_thread_tables(thd); // Free before kill - free_root(&thd->mem_root,MYF(0)); + free_root(thd->mem_root,MYF(0)); free_root(&thd->transaction.mem_root,MYF(0)); kill_mysql(); error=TRUE; @@ -1778,6 +1826,24 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (thd->is_fatal_error) send_error(thd,0); // End of memory ? + log_slow_query(thd); + + thd->proc_info="cleaning up"; + VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list + thd->proc_info=0; + thd->command=COM_SLEEP; + thd->query=0; + thd->query_length=0; + thread_running--; + VOID(pthread_mutex_unlock(&LOCK_thread_count)); + thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); + DBUG_RETURN(error); +} + + +static void log_slow_query(THD *thd) +{ time_t start_of_query=thd->start_time; thd->end_time(); // Set start time @@ -1796,17 +1862,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, mysql_slow_log.write(thd, thd->query, thd->query_length, start_of_query); } } - thd->proc_info="cleaning up"; - VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list - thd->proc_info=0; - thd->command=COM_SLEEP; - thd->query=0; - thd->query_length=0; - thread_running--; - VOID(pthread_mutex_unlock(&LOCK_thread_count)); - thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); - DBUG_RETURN(error); } @@ -1869,6 +1924,8 @@ mysql_execute_command(THD *thd) { int res= 0; LEX *lex= thd->lex; + bool slave_fake_lock= 0; + MYSQL_LOCK *fake_prev_lock= 0; SELECT_LEX *select_lex= &lex->select_lex; TABLE_LIST *tables= (TABLE_LIST*) select_lex->table_list.first; SELECT_LEX_UNIT *unit= &lex->unit; @@ -1886,11 +1943,33 @@ mysql_execute_command(THD *thd) #ifdef HAVE_REPLICATION if (thd->slave_thread) { + if (lex->sql_command == SQLCOM_UPDATE_MULTI) + { + DBUG_PRINT("info",("need faked locked tables")); + + if (check_multi_update_lock(thd, tables, &select_lex->item_list, + select_lex)) + goto error; + + /* Fix for replication, the tables are opened and locked, + now we pretend that we have performed a LOCK TABLES action */ + + fake_prev_lock= thd->locked_tables; + if (thd->lock) + thd->locked_tables= thd->lock; + thd->lock= 0; + slave_fake_lock= 1; + } /* Skip if we are in the slave thread, some table rules have been - given and the table list says the query should not be replicated + given and the table list says the query should not be replicated. + Exception is DROP TEMPORARY TABLE IF EXISTS: we always execute it + (otherwise we have stale files on slave caused by exclusion of one tmp + table). */ - if (all_tables_not_ok(thd,tables)) + if (!(lex->sql_command == SQLCOM_DROP_TABLE && + lex->drop_temporary && lex->drop_if_exists) && + all_tables_not_ok(thd,tables)) { /* we warn the slave SQL thread */ my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); @@ -2059,15 +2138,19 @@ mysql_execute_command(THD *thd) query_len= need_conversion? (pstr->length() * to_cs->mbmaxlen) : pstr->length(); - if (!(query_str= alloc_root(&thd->mem_root, query_len+1))) + if (!(query_str= alloc_root(thd->mem_root, query_len+1))) { res= -1; break; // EOM (error should be reported by allocator) } if (need_conversion) - query_len= copy_and_convert(query_str, query_len, to_cs, pstr->ptr(), - pstr->length(), pstr->charset()); + { + uint dummy_errors; + query_len= copy_and_convert(query_str, query_len, to_cs, + pstr->ptr(), pstr->length(), + pstr->charset(), &dummy_errors); + } else memcpy(query_str, pstr->ptr(), pstr->length()); query_str[query_len]= 0; @@ -2372,7 +2455,8 @@ mysql_execute_command(THD *thd) &lex->create_info, lex->create_list, lex->key_list, - select_lex->item_list,lex->duplicates))) + select_lex->item_list, lex->duplicates, + lex->ignore))) { /* CREATE from SELECT give its SELECT_LEX for SELECT, @@ -2408,7 +2492,6 @@ mysql_execute_command(THD *thd) create_table_local); break; -create_error: res= 1; //error reported unsent_create_error: // put tables back for PS rexecuting @@ -2471,7 +2554,7 @@ unsent_create_error: if (lex->name && (!lex->name[0] || strlen(lex->name) > NAME_LEN)) { net_printf(thd, ER_WRONG_TABLE_NAME, lex->name); - res=0; + res= 1; break; } if (!select_lex->db) @@ -2512,7 +2595,7 @@ unsent_create_error: lex->key_list, select_lex->order_list.elements, (ORDER *) select_lex->order_list.first, - lex->duplicates, &lex->alter_info); + lex->duplicates, lex->ignore, &lex->alter_info); } break; } @@ -2578,7 +2661,9 @@ unsent_create_error: check_access(thd, SELECT_ACL | EXTRA_ACL, tables->db, &tables->grant.privilege,0,0)) goto error; - res = mysqld_show_create(thd, tables); + if (grant_option && check_grant(thd, SELECT_ACL, tables, 2, UINT_MAX, 0)) + goto error; + res= mysqld_show_create(thd, tables); break; } #endif @@ -2603,7 +2688,8 @@ unsent_create_error: mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + thd->clear_error(); // No binlog error generated + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -2631,7 +2717,8 @@ unsent_create_error: mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + thd->clear_error(); // No binlog error generated + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -2653,7 +2740,8 @@ unsent_create_error: mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + thd->clear_error(); // No binlog error generated + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -2669,7 +2757,7 @@ unsent_create_error: select_lex->order_list.elements, (ORDER *) select_lex->order_list.first, select_lex->select_limit, - lex->duplicates); + lex->duplicates, lex->ignore); if (thd->net.report_error) res= -1; break; @@ -2682,7 +2770,7 @@ unsent_create_error: &lex->value_list, select_lex->where, select_lex->options, - lex->duplicates, unit, select_lex); + lex->duplicates, lex->ignore, unit, select_lex); break; } case SQLCOM_REPLACE: @@ -2690,9 +2778,9 @@ unsent_create_error: { if ((res= insert_precheck(thd, tables))) break; - res = mysql_insert(thd,tables,lex->field_list,lex->many_values, - select_lex->item_list, lex->value_list, - lex->duplicates); + res= mysql_insert(thd,tables,lex->field_list,lex->many_values, + lex->update_list, lex->value_list, + lex->duplicates, lex->ignore); if (thd->net.report_error) res= -1; break; @@ -2701,7 +2789,7 @@ unsent_create_error: case SQLCOM_INSERT_SELECT: { TABLE_LIST *first_local_table= (TABLE_LIST *) select_lex->table_list.first; - if ((res= insert_select_precheck(thd, tables))) + if ((res= insert_precheck(thd, tables))) break; /* Fix lock for first table */ @@ -2723,13 +2811,23 @@ unsent_create_error: select_lex->options |= OPTION_BUFFER_RESULT; } - - if (!(res= open_and_lock_tables(thd, tables)) && - (result= new select_insert(tables->table, &lex->field_list, - lex->duplicates))) + if ((res= open_and_lock_tables(thd, tables))) + break; + + TABLE *table= tables->table; + /* Skip first table, which is the table we are inserting in */ + lex->select_lex.table_list.first= (byte*) first_local_table->next; + tables= (TABLE_LIST *) lex->select_lex.table_list.first; + first_local_table->next= 0; + + if (!(res= mysql_prepare_insert(thd, tables, first_local_table, + table, lex->field_list, 0, + lex->update_list, lex->value_list, + lex->duplicates)) && + (result= new select_insert(table, &lex->field_list, + &lex->update_list, &lex->value_list, + lex->duplicates, lex->ignore))) { - /* Skip first table, which is the table we are inserting in */ - lex->select_lex.table_list.first= (byte*) first_local_table->next; /* insert/replace from SELECT give its SELECT_LEX for SELECT, and item_list belong to SELECT @@ -2737,14 +2835,16 @@ unsent_create_error: lex->select_lex.resolve_mode= SELECT_LEX::SELECT_MODE; res= handle_select(thd, lex, result); /* revert changes for SP */ - lex->select_lex.table_list.first= (byte*) first_local_table; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; delete result; + table->insert_values= 0; if (thd->net.report_error) res= -1; } else res= -1; + first_local_table->next= tables; + lex->select_lex.table_list.first= (byte*) first_local_table; break; } case SQLCOM_TRUNCATE: @@ -3034,7 +3134,7 @@ unsent_create_error: goto error; } res=mysql_load(thd, lex->exchange, tables, lex->field_list, - lex->duplicates, (bool) lex->local_file, lex->lock_option); + lex->duplicates, lex->ignore, (bool) lex->local_file, lex->lock_option); break; } @@ -3066,6 +3166,12 @@ purposes internal to the MySQL server", MYF(0)); } case SQLCOM_UNLOCK_TABLES: + /* + It is critical for mysqldump --single-transaction --master-data that + UNLOCK TABLES does not implicitely commit a connection which has only + done FLUSH TABLES WITH READ LOCK + BEGIN. If this assumption becomes + false, mysqldump will not work. + */ unlock_locked_tables(thd); if (thd->options & OPTION_TABLE_LOCK) { @@ -3165,35 +3271,41 @@ purposes internal to the MySQL server", MYF(0)); } case SQLCOM_ALTER_DB: { - if (!strip_sp(lex->name) || check_db_name(lex->name)) + char *db= lex->name ? lex->name : thd->db; + if (!db) { - net_printf(thd, ER_WRONG_DB_NAME, lex->name); + send_error(thd, ER_NO_DB_ERROR); + goto error; + } + if (!strip_sp(db) || check_db_name(db)) + { + net_printf(thd, ER_WRONG_DB_NAME, db); break; } /* If in a slave thread : ALTER DATABASE DB may not be preceded by USE DB. - For that reason, maybe db_ok() in sql/slave.cc did not check the + For that reason, maybe db_ok() in sql/slave.cc did not check the do_db/ignore_db. And as this query involves no tables, tables_ok() above was not called. So we have to check rules again here. */ #ifdef HAVE_REPLICATION - if (thd->slave_thread && - (!db_ok(lex->name, replicate_do_db, replicate_ignore_db) || - !db_ok_with_wild_table(lex->name))) + if (thd->slave_thread && + (!db_ok(db, replicate_do_db, replicate_ignore_db) || + !db_ok_with_wild_table(db))) { my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); break; } #endif - if (check_access(thd,ALTER_ACL,lex->name,0,1,0)) + if (check_access(thd, ALTER_ACL, db, 0, 1, 0)) break; if (thd->locked_tables || thd->active_transaction()) { send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION); goto error; } - res=mysql_alter_db(thd,lex->name,&lex->create_info); + res= mysql_alter_db(thd, db, &lex->create_info); break; } case SQLCOM_SHOW_CREATE_DB: @@ -3205,11 +3317,6 @@ purposes internal to the MySQL server", MYF(0)); } if (check_access(thd,SELECT_ACL,lex->name,0,1,0)) break; - if (thd->locked_tables || thd->active_transaction()) - { - send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION); - goto error; - } res=mysqld_show_create_db(thd,lex->name,&lex->create_info); break; } @@ -3243,7 +3350,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); @@ -3259,7 +3366,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); @@ -3270,9 +3377,9 @@ purposes internal to the MySQL server", MYF(0)); case SQLCOM_GRANT: { if (check_access(thd, lex->grant | lex->grant_tot_col | GRANT_ACL, - tables && tables->db ? tables->db : select_lex->db, + tables ? tables->db : select_lex->db, tables ? &tables->grant.privilege : 0, - tables ? 0 : 1,0)) + tables ? 0 : 1, 0)) goto error; /* @@ -3326,7 +3433,7 @@ purposes internal to the MySQL server", MYF(0)); if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -3347,7 +3454,7 @@ purposes internal to the MySQL server", MYF(0)); if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } if (mqh_used && lex->sql_command == SQLCOM_GRANT) @@ -3390,7 +3497,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -3452,7 +3559,9 @@ purposes internal to the MySQL server", MYF(0)); thd->options= ((thd->options & (ulong) ~(OPTION_STATUS_NO_TRANS_UPDATE)) | OPTION_BEGIN); thd->server_status|= SERVER_STATUS_IN_TRANS; - send_ok(thd); + if (!(lex->start_transaction_opt & MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT) || + !(res= ha_start_consistent_snapshot(thd))) + send_ok(thd); } break; case SQLCOM_COMMIT: @@ -3544,13 +3653,21 @@ purposes internal to the MySQL server", MYF(0)); send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0); error: + if (unlikely(slave_fake_lock)) + { + DBUG_PRINT("info",("undoing faked lock")); + thd->lock= thd->locked_tables; + thd->locked_tables= fake_prev_lock; + if (thd->lock == thd->locked_tables) + thd->lock= 0; + } DBUG_VOID_RETURN; } /* Check grants for commands which work only with one table and all other - tables belong to subselects. + tables belonging to subselects or implicitly opened tables. SYNOPSIS check_one_table_access() @@ -3572,7 +3689,7 @@ int check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables) if (grant_option && check_grant(thd, privilege, tables, 0, 1, 0)) return 1; - /* Check rights on tables of subselect (if exists) */ + /* Check rights on tables of subselects and implictly opened tables */ TABLE_LIST *subselects_tables; if ((subselects_tables= tables->next)) { @@ -3919,7 +4036,6 @@ mysql_init_select(LEX *lex) { DBUG_ASSERT(lex->result == 0); lex->exchange= 0; - lex->proc_list.first= 0; } } @@ -3927,18 +4043,20 @@ mysql_init_select(LEX *lex) bool mysql_new_select(LEX *lex, bool move_down) { - SELECT_LEX *select_lex = new(&lex->thd->mem_root) SELECT_LEX(); - if (!select_lex) + SELECT_LEX *select_lex; + if (!(select_lex= new(lex->thd->mem_root) SELECT_LEX())) return 1; select_lex->select_number= ++lex->thd->select_number; select_lex->init_query(); select_lex->init_select(); if (move_down) { + lex->subqueries= TRUE; /* first select_lex of subselect or derived table */ - SELECT_LEX_UNIT *unit= new(&lex->thd->mem_root) SELECT_LEX_UNIT(); - if (!unit) + SELECT_LEX_UNIT *unit; + if (!(unit= new(lex->thd->mem_root) SELECT_LEX_UNIT())) return 1; + unit->init_query(); unit->init_select(); unit->thd= lex->thd; @@ -3960,7 +4078,8 @@ mysql_new_select(LEX *lex, bool move_down) as far as we included SELECT_LEX for UNION unit should have fake SELECT_LEX for UNION processing */ - fake= unit->fake_select_lex= new(&lex->thd->mem_root) SELECT_LEX(); + if (!(fake= unit->fake_select_lex= new(lex->thd->mem_root) SELECT_LEX())) + return 1; fake->include_standalone(unit, (SELECT_LEX_NODE**)&unit->fake_select_lex); fake->select_number= INT_MAX; @@ -4048,6 +4167,20 @@ void mysql_parse(THD *thd, char *inBuf, uint length) send_error(thd, 0, NullS); else { + /* + Binlog logs a string starting from thd->query and having length + thd->query_length; so we set thd->query_length correctly (to not + log several statements in one event, when we executed only first). + We set it to not see the ';' (otherwise it would get into binlog + and Query_log_event::print() would give ';;' output). + This also helps display only the current query in SHOW + PROCESSLIST. + Note that we don't need LOCK_thread_count to modify query_length. + */ + if (lex->found_colon && + (thd->query_length= (ulong)(lex->found_colon - thd->query))) + thd->query_length--; + /* Actually execute the query */ mysql_execute_command(thd); query_cache_end_of_result(thd); } @@ -4092,31 +4225,6 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) #endif -/* - Calculate interval lengths. - Strip trailing spaces from all strings. - After this function call: - - ENUM uses max_length - - SET uses tot_length. -*/ -void calculate_interval_lengths(THD *thd, TYPELIB *interval, - uint *max_length, uint *tot_length) -{ - const char **pos; - uint *len; - CHARSET_INFO *cs= thd->variables.character_set_client; - *max_length= *tot_length= 0; - for (pos= interval->type_names, len= interval->type_lengths; - *pos ; pos++, len++) - { - *len= (uint) strip_sp((char*) *pos); - uint length= cs->cset->numchars(cs, *pos, *pos + *len); - *tot_length+= length; - set_if_bigger(*max_length, length); - } -} - - /***************************************************************************** ** Store field definition for create ** Return 0 if ok @@ -4127,7 +4235,8 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, uint type_modifier, Item *default_value, Item *on_update_value, LEX_STRING *comment, - char *change, TYPELIB *interval, CHARSET_INFO *cs, + char *change, + List<String> *interval_list, CHARSET_INFO *cs, uint uint_geom_type) { register create_field *new_field; @@ -4422,62 +4531,39 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, break; case FIELD_TYPE_SET: { - if (interval->count > sizeof(longlong)*8) + if (interval_list->elements > sizeof(longlong)*8) { - net_printf(thd,ER_TOO_BIG_SET,field_name); /* purecov: inspected */ - DBUG_RETURN(1); /* purecov: inspected */ + net_printf(thd,ER_TOO_BIG_SET,field_name); /* purecov: inspected */ + DBUG_RETURN(1); /* purecov: inspected */ } - new_field->pack_length=(interval->count+7)/8; + new_field->pack_length= (interval_list->elements + 7) / 8; if (new_field->pack_length > 4) - new_field->pack_length=8; - new_field->interval=interval; - uint dummy_max_length; - calculate_interval_lengths(thd, interval, - &dummy_max_length, &new_field->length); - new_field->length+= (interval->count - 1); - set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1); - if (default_value) - { - char *not_used; - uint not_used2; - bool not_used3; - - thd->cuted_fields=0; - String str,*res; - res=default_value->val_str(&str); - (void) find_set(interval, res->ptr(), res->length(), - &my_charset_bin, - ¬_used, ¬_used2, ¬_used3); - if (thd->cuted_fields) - { - net_printf(thd,ER_INVALID_DEFAULT,field_name); - DBUG_RETURN(1); - } - } + new_field->pack_length=8; + + List_iterator<String> it(*interval_list); + String *tmp; + while ((tmp= it++)) + new_field->interval_list.push_back(tmp); + /* + Set fake length to 1 to pass the below conditions. + Real length will be set in mysql_prepare_table() + when we know the character set of the column + */ + new_field->length= 1; } break; case FIELD_TYPE_ENUM: { - new_field->interval=interval; - new_field->pack_length=interval->count < 256 ? 1 : 2; // Should be safe + // Should be safe + new_field->pack_length= interval_list->elements < 256 ? 1 : 2; - uint dummy_tot_length; - calculate_interval_lengths(thd, interval, - &new_field->length, &dummy_tot_length); - set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1); - if (default_value) - { - String str,*res; - res=default_value->val_str(&str); - res->strip_sp(); - if (!find_type(interval, res->ptr(), res->length(), 0)) - { - net_printf(thd,ER_INVALID_DEFAULT,field_name); - DBUG_RETURN(1); - } - } - break; + List_iterator<String> it(*interval_list); + String *tmp; + while ((tmp= it++)) + new_field->interval_list.push_back(tmp); + new_field->length= 1; // See comment for FIELD_TYPE_SET above. } + break; } if ((new_field->length > MAX_FIELD_CHARLENGTH && type != FIELD_TYPE_SET && @@ -4950,6 +5036,7 @@ void kill_one_thread(THD *thd, ulong id) net_printf(thd,error,id); } + /* Clear most status variables */ static void refresh_status(void) @@ -4959,18 +5046,9 @@ static void refresh_status(void) { if (ptr->type == SHOW_LONG) *(ulong*) ptr->value= 0; - else if (ptr->type == SHOW_KEY_CACHE_LONG) - { - /* - Reset value in 'default' key cache. - This needs to be recoded when we have thread specific key values - */ - char *value= (((char*) sql_key_cache) + - (uint) ((char*) (ptr->value) - - (char*) &dflt_key_cache_var)); - *(ulong*) value= 0; - } } + /* Reset the counters of all key caches (default and named). */ + process_key_caches(reset_key_cache_counters); pthread_mutex_unlock(&LOCK_status); } @@ -5027,6 +5105,58 @@ bool check_simple_select() return 0; } +/* + Setup locking for multi-table updates. Used by the replication slave. + Replication slave SQL thread examines (all_tables_not_ok()) the + locking state of referenced tables to determine if the query has to + be executed or ignored. Since in multi-table update, the + 'default' lock is read-only, this lock is corrected early enough by + calling this function, before the slave decides to execute/ignore. + + SYNOPSIS + check_multi_update_lock() + thd Current thread + tables List of user-supplied tables + fields List of fields requiring update + + RETURN VALUES + 0 ok + 1 error +*/ +static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, + List<Item> *fields, SELECT_LEX *select_lex) +{ + bool res= 1; + TABLE_LIST *table; + DBUG_ENTER("check_multi_update_lock"); + + if (check_db_used(thd, tables)) + goto error; + + /* + Ensure that we have UPDATE or SELECT privilege for each table + The exact privilege is checked in mysql_multi_update() + */ + for (table= tables ; table ; table= table->next) + { + TABLE_LIST *save= table->next; + table->next= 0; + if ((check_access(thd, UPDATE_ACL, table->db, &table->grant.privilege,0,1) || + (grant_option && check_grant(thd, UPDATE_ACL, table,0,1,1))) && + check_one_table_access(thd, SELECT_ACL, table)) + goto error; + table->next= save; + } + + if (mysql_multi_update_lock(thd, tables, fields, select_lex)) + goto error; + + res= 0; + +error: + DBUG_RETURN(res); +} + Comp_creator *comp_eq_creator(bool invert) { @@ -5091,9 +5221,9 @@ Item * all_any_subquery_creator(Item *left_expr, Item_allany_subselect *it= new Item_allany_subselect(left_expr, (*cmp)(all), select_lex, all); if (all) - return it->upper_not= new Item_func_not_all(it); /* ALL */ + return it->upper_item= new Item_func_not_all(it); /* ALL */ - return it; /* ANY/SOME */ + return it->upper_item= new Item_func_nop_all(it); /* ANY/SOME */ } @@ -5123,7 +5253,7 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys) DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, fields, keys, 0, (ORDER*)0, - DUP_ERROR, &alter_info)); + DUP_ERROR, 0, &alter_info)); } @@ -5142,7 +5272,7 @@ int mysql_drop_index(THD *thd, TABLE_LIST *table_list, ALTER_INFO *alter_info) DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, fields, keys, 0, (ORDER*)0, - DUP_ERROR, alter_info)); + DUP_ERROR, 0, alter_info)); } @@ -5206,7 +5336,10 @@ int multi_update_precheck(THD *thd, TABLE_LIST *tables) DBUG_PRINT("info",("Checking sub query list")); for (table= tables; table; table= table->next) { - if (table->table_in_update_from_clause) + if (my_tz_check_n_skip_implicit_tables(&table, + lex->time_zone_tables_used)) + continue; + else if (table->table_in_update_from_clause) { /* If we check table by local TABLE_LIST copy then we should copy @@ -5307,33 +5440,6 @@ int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count) /* - INSERT ... SELECT query pre-check - - SYNOPSIS - insert_delete_precheck() - thd Thread handler - tables Global table list - - RETURN VALUE - 0 OK - 1 Error (message is sent to user) - -1 Error (message is not sent to user) -*/ - -int insert_select_precheck(THD *thd, TABLE_LIST *tables) -{ - DBUG_ENTER("insert_select_precheck"); - /* - Check that we have modify privileges for the first table and - select privileges for the rest - */ - ulong privilege= (thd->lex->duplicates == DUP_REPLACE ? - INSERT_ACL | DELETE_ACL : INSERT_ACL); - DBUG_RETURN(check_one_table_access(thd, privilege, tables) ? 1 : 0); -} - - -/* simple UPDATE query pre-check SYNOPSIS @@ -5404,6 +5510,10 @@ int insert_precheck(THD *thd, TABLE_LIST *tables) LEX *lex= thd->lex; DBUG_ENTER("insert_precheck"); + /* + Check that we have modify privileges for the first table and + select privileges for the rest + */ ulong privilege= INSERT_ACL | (lex->duplicates == DUP_REPLACE ? DELETE_ACL : 0) | (lex->duplicates == DUP_UPDATE ? UPDATE_ACL : 0); @@ -5411,7 +5521,7 @@ int insert_precheck(THD *thd, TABLE_LIST *tables) if (check_one_table_access(thd, privilege, tables)) DBUG_RETURN(1); - if (lex->select_lex.item_list.elements != lex->value_list.elements) + if (lex->update_list.elements != lex->value_list.elements) { my_error(ER_WRONG_VALUE_COUNT, MYF(0)); DBUG_RETURN(-1); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 5a311eefacd..1dc46aef4da 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -68,7 +68,6 @@ Long data handling: ***********************************************************************/ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" // for JOIN #include <m_ctype.h> // for isspace() #ifdef EMBEDDED_LIBRARY @@ -153,6 +152,8 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns) { NET *net= &stmt->thd->net; char buff[9]; + DBUG_ENTER("send_prep_stmt"); + buff[0]= 0; /* OK packet indicator */ int4store(buff+1, stmt->id); int2store(buff+5, columns); @@ -161,12 +162,11 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns) Send types and names of placeholders to the client XXX: fix this nasty upcast from List<Item_param> to List<Item> */ - return my_net_write(net, buff, sizeof(buff)) || - (stmt->param_count && - stmt->thd->protocol_simple.send_fields((List<Item> *) - &stmt->lex->param_list, 0)) || - net_flush(net); - return 0; + DBUG_RETURN(my_net_write(net, buff, sizeof(buff)) || + (stmt->param_count && + stmt->thd->protocol_simple.send_fields((List<Item> *) + &stmt->lex->param_list, + 0))); } #else static bool send_prep_stmt(Prepared_statement *stmt, @@ -348,12 +348,6 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) tm.neg= (bool) to[0]; day= (uint) sint4korr(to+1); - /* - Note, that though ranges of hour, minute and second are not checked - here we rely on them being < 256: otherwise - we'll get buffer overflow in make_{date,time} functions, - which are called when time value is converted to string. - */ tm.hour= (uint) to[5] + day * 24; tm.minute= (uint) to[6]; tm.second= (uint) to[7]; @@ -368,7 +362,7 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) tm.day= tm.year= tm.month= 0; } else - set_zero_time(&tm); + set_zero_time(&tm, MYSQL_TIMESTAMP_TIME); param->set_time(&tm, MYSQL_TIMESTAMP_TIME, MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); *pos+= length; @@ -387,11 +381,6 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len) tm.year= (uint) sint2korr(to); tm.month= (uint) to[2]; tm.day= (uint) to[3]; - /* - Note, that though ranges of hour, minute and second are not checked - here we rely on them being < 256: otherwise - we'll get buffer overflow in make_{date,time} functions. - */ if (length > 4) { tm.hour= (uint) to[4]; @@ -404,7 +393,7 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len) tm.second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; } else - set_zero_time(&tm); + set_zero_time(&tm, MYSQL_TIMESTAMP_DATETIME); param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME, MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); *pos+= length; @@ -418,11 +407,7 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) if (length >= 4) { uchar *to= *pos; - /* - Note, that though ranges of hour, minute and second are not checked - here we rely on them being < 256: otherwise - we'll get buffer overflow in make_{date,time} functions. - */ + tm.year= (uint) sint2korr(to); tm.month= (uint) to[2]; tm.day= (uint) to[3]; @@ -432,7 +417,7 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) tm.neg= 0; } else - set_zero_time(&tm); + set_zero_time(&tm, MYSQL_TIMESTAMP_DATE); param->set_time(&tm, MYSQL_TIMESTAMP_DATE, MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); *pos+= length; @@ -441,8 +426,17 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) #else/*!EMBEDDED_LIBRARY*/ void set_param_time(Item_param *param, uchar **pos, ulong len) { - MYSQL_TIME *to= (MYSQL_TIME*)*pos; - param->set_time(to, MYSQL_TIMESTAMP_TIME, + MYSQL_TIME tm= *((MYSQL_TIME*)*pos); + tm.hour+= tm.day * 24; + tm.day= tm.year= tm.month= 0; + if (tm.hour > 838) + { + /* TODO: add warning 'Data truncated' here */ + tm.hour= 838; + tm.minute= 59; + tm.second= 59; + } + param->set_time(&tm, MYSQL_TIMESTAMP_TIME, MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } @@ -903,8 +897,12 @@ static int mysql_test_insert(Prepared_statement *stmt, /* open temporary memory pool for temporary data allocated by derived tables & preparation procedure + Note that this is done without locks (should not be needed as we will not + access any data here) + If we would use locks, then we have to ensure we are not using + TL_WRITE_DELAYED as having two such locks can cause table corruption. */ - if (open_and_lock_tables(thd, table_list)) + if (open_normal_and_derived_tables(thd, table_list)) { DBUG_RETURN(-1); } @@ -914,14 +912,15 @@ static int mysql_test_insert(Prepared_statement *stmt, uint value_count; ulong counter= 0; + table_list->table->insert_values=(byte *)1; // don't allocate insert_values if ((res= mysql_prepare_insert(thd, table_list, insert_table_list, table_list->table, fields, values, update_fields, update_values, duplic))) goto error; - + value_count= values->elements; its.rewind(); - + while ((values= its++)) { counter++; @@ -940,6 +939,7 @@ static int mysql_test_insert(Prepared_statement *stmt, res= 0; error: lex->unit.cleanup(); + table_list->table->insert_values=0; DBUG_RETURN(res); } @@ -1064,7 +1064,7 @@ static int mysql_test_select(Prepared_statement *stmt, DBUG_RETURN(1); #endif - if (!lex->result && !(lex->result= new (&stmt->mem_root) select_send)) + if (!lex->result && !(lex->result= new (stmt->mem_root) select_send)) { send_error(thd); goto err; @@ -1088,7 +1088,7 @@ static int mysql_test_select(Prepared_statement *stmt, { if (lex->describe) { - if (send_prep_stmt(stmt, 0)) + if (send_prep_stmt(stmt, 0) || thd->protocol->flush()) goto err_prep; } else @@ -1106,11 +1106,8 @@ static int mysql_test_select(Prepared_statement *stmt, prepared in unit->prepare call above. */ if (send_prep_stmt(stmt, lex->result->field_count(fields)) || - lex->result->send_fields(fields, 0) -#ifndef EMBEDDED_LIBRARY - || net_flush(&thd->net) -#endif - ) + lex->result->send_fields(fields, 0) || + thd->protocol->flush()) goto err_prep; } } @@ -1352,7 +1349,7 @@ static int mysql_test_insert_select(Prepared_statement *stmt, { int res; LEX *lex= stmt->lex; - if ((res= insert_select_precheck(stmt->thd, tables))) + if ((res= insert_precheck(stmt->thd, tables))) return res; TABLE_LIST *first_local_table= (TABLE_LIST *)lex->select_lex.table_list.first; @@ -1389,7 +1386,6 @@ static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) enum enum_sql_command sql_command= lex->sql_command; int res= 0; DBUG_ENTER("send_prepare_results"); - DBUG_PRINT("enter",("command: %d, param_count: %ld", sql_command, stmt->param_count)); @@ -1442,6 +1438,7 @@ static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) break; case SQLCOM_INSERT_SELECT: + case SQLCOM_REPLACE_SELECT: res= mysql_test_insert_select(stmt, tables); break; @@ -1474,7 +1471,8 @@ static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) goto error; } if (res == 0) - DBUG_RETURN(text_protocol? 0 : send_prep_stmt(stmt, 0)); + DBUG_RETURN(text_protocol? 0 : (send_prep_stmt(stmt, 0) || + thd->protocol->flush())); error: if (res < 0) send_error(thd, thd->killed ? ER_SERVER_SHUTDOWN : 0); @@ -1504,7 +1502,7 @@ static bool init_param_array(Prepared_statement *stmt) List_iterator<Item_param> param_iterator(lex->param_list); /* Use thd->mem_root as it points at statement mem_root */ stmt->param_array= (Item_param **) - alloc_root(&stmt->thd->mem_root, + alloc_root(stmt->thd->mem_root, sizeof(Item_param*) * stmt->param_count); if (!stmt->param_array) { @@ -1521,7 +1519,6 @@ static bool init_param_array(Prepared_statement *stmt) return 0; } - /* Given a query string with parameter markers, create a Prepared Statement from it and send PS info back to the client. @@ -1570,7 +1567,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, if (name) { stmt->name.length= name->length; - if (!(stmt->name.str= memdup_root(&stmt->mem_root, (char*)name->str, + if (!(stmt->name.str= memdup_root(stmt->mem_root, (char*)name->str, name->length))) { delete stmt; @@ -1599,7 +1596,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, DBUG_RETURN(1); } - mysql_log.write(thd, COM_PREPARE, "%s", packet); + mysql_log.write(thd, COM_PREPARE, "[%lu] %s", stmt->id, packet); thd->current_arena= stmt; mysql_init_query(thd, (uchar *) thd->query, thd->query_length); @@ -1609,7 +1606,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, lex->safe_to_cache_query= 0; error= yyparse((void *)thd) || thd->is_fatal_error || - init_param_array(stmt); + thd->net.report_error || init_param_array(stmt); /* While doing context analysis of the query (in send_prepare_results) we allocate a lot of additional memory: for open tables, JOINs, derived @@ -1640,7 +1637,9 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, /* Statement map deletes statement on erase */ thd->stmt_map.erase(stmt); stmt= NULL; - /* error is sent inside yyparse/send_prepare_results */ + if (thd->net.report_error) + send_error(thd); + /* otherwise the error is sent inside yyparse/send_prepare_results */ } else { @@ -1797,6 +1796,9 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query)) goto set_params_data_err; #endif + mysql_log.write(thd, COM_EXECUTE, "[%lu] %s", stmt->id, + expanded_query.length() ? expanded_query.c_ptr() : + stmt->query); thd->protocol= &thd->protocol_prep; // Switch to binary protocol execute_stmt(thd, stmt, &expanded_query, TRUE); thd->protocol= &thd->protocol_simple; // Use normal protocol diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index afaf2ed0923..388034e0f1a 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -84,7 +84,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index a84b63c270b..d02bb5ff0a3 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -18,7 +18,6 @@ #ifdef HAVE_REPLICATION #include "sql_repl.h" -#include "sql_acl.h" #include "log_event.h" #include <my_dir.h> @@ -247,7 +246,7 @@ bool log_in_use(const char* log_name) if ((linfo = tmp->current_linfo)) { pthread_mutex_lock(&linfo->lock); - result = !memcmp(log_name, linfo->log_file_name, log_name_len); + result = !bcmp(log_name, linfo->log_file_name, log_name_len); pthread_mutex_unlock(&linfo->lock); if (result) break; @@ -683,7 +682,8 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report) thread_mask&= thd->lex->slave_thd_opt; if (thread_mask) //some threads are stopped, start them { - if (init_master_info(mi,master_info_file,relay_log_info_file, 0)) + if (init_master_info(mi,master_info_file,relay_log_info_file, 0, + thread_mask)) slave_errno=ER_MASTER_INFO; else if (server_id_supplied && *mi->host) { @@ -880,10 +880,10 @@ int reset_slave(THD *thd, MASTER_INFO* mi) */ init_master_info_with_options(mi); /* - Reset errors, and master timestamp (the idea is that we forget about the + Reset errors (the idea is that we forget about the old master). */ - clear_slave_error_timestamp(&mi->rli); + clear_slave_error(&mi->rli); clear_until_condition(&mi->rli); // close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0 @@ -978,7 +978,8 @@ int change_master(THD* thd, MASTER_INFO* mi) thd->proc_info = "Changing master"; LEX_MASTER_INFO* lex_mi= &thd->lex->mi; // TODO: see if needs re-write - if (init_master_info(mi, master_info_file, relay_log_info_file, 0)) + if (init_master_info(mi, master_info_file, relay_log_info_file, 0, + thread_mask)) { send_error(thd, ER_MASTER_INFO); unlock_slave_threads(mi); @@ -1142,8 +1143,8 @@ int change_master(THD* thd, MASTER_INFO* mi) pthread_mutex_lock(&mi->rli.data_lock); mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */ - /* Clear the errors, for a clean start, and master timestamp */ - clear_slave_error_timestamp(&mi->rli); + /* Clear the errors, for a clean start */ + clear_slave_error(&mi->rli); clear_until_condition(&mi->rli); /* If we don't write new coordinates to disk now, then old will remain in @@ -1379,7 +1380,7 @@ err: int log_loaded_block(IO_CACHE* file) { - LOAD_FILE_INFO* lf_info; + LOAD_FILE_INFO *lf_info; uint block_len ; /* file->request_pos contains position where we started last read */ @@ -1401,7 +1402,7 @@ int log_loaded_block(IO_CACHE* file) { Create_file_log_event c(lf_info->thd,lf_info->ex,lf_info->db, lf_info->table_name, *lf_info->fields, - lf_info->handle_dup, buffer, + lf_info->handle_dup, lf_info->ignore, buffer, block_len, lf_info->log_delayed); mysql_bin_log.write(&c); lf_info->wrote_create_file = 1; diff --git a/sql/sql_repl.h b/sql/sql_repl.h index 3c17540b664..21b3d2955f7 100644 --- a/sql/sql_repl.h +++ b/sql/sql_repl.h @@ -67,7 +67,7 @@ typedef struct st_load_file_info enum enum_duplicates handle_dup; char* db; char* table_name; - bool wrote_create_file, log_delayed; + bool wrote_create_file, log_delayed, ignore; } LOAD_FILE_INFO; int log_loaded_block(IO_CACHE* file); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1610057f877..533a070de23 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -398,7 +398,16 @@ JOIN::prepare(Item ***rref_pointer_array, goto err; } #endif - if (!procedure && result && result->prepare(fields_list, unit_arg)) + /* + We must not yet prepare the result table if it is the same as one of the + source tables (INSERT SELECT). This is checked in mysql_execute_command() + and OPTION_BUFFER_RESULT is added to the select_options. A temporary + table is then used to hold the result. The preparation may disable + 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. + */ + if (! procedure && ! test(select_options & OPTION_BUFFER_RESULT) && + result && result->prepare(fields_list, unit_arg)) goto err; /* purecov: inspected */ if (select_lex->olap == ROLLUP_TYPE && rollup_init()) @@ -468,7 +477,7 @@ JOIN::optimize() optimized= 1; // Ignore errors of execution if option IGNORE present - if (thd->lex->duplicates == DUP_IGNORE) + if (thd->lex->ignore) thd->lex->current_select->no_error= 1; #ifdef HAVE_REF_TO_FIELDS // Not done yet /* Add HAVING to WHERE if possible */ @@ -936,7 +945,7 @@ JOIN::optimize() } } - if (select_lex->master_unit()->uncacheable) + if (thd->lex->subqueries) { if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN)))) DBUG_RETURN(-1); @@ -1043,6 +1052,13 @@ JOIN::exec() DBUG_VOID_RETURN; } } + else if (test(select_options & OPTION_BUFFER_RESULT) && + result && result->prepare(fields_list, unit)) + { + error= 1; + thd->limit_found_rows= thd->examined_row_count= 0; + DBUG_VOID_RETURN; + } if (!tables_list) { // Only test of functions @@ -1306,7 +1322,7 @@ JOIN::exec() curr_join->select_distinct=0; /* Each row is unique */ curr_join->join_free(0); /* Free quick selects */ - if (select_distinct && ! group_list) + if (curr_join->select_distinct && ! curr_join->group_list) { thd->proc_info="Removing duplicates"; if (curr_join->tmp_having) @@ -1420,7 +1436,7 @@ JOIN::exec() WHERE clause for any tables after the sorted one. */ JOIN_TAB *curr_table= &curr_join->join_tab[curr_join->const_tables+1]; - JOIN_TAB *end_table= &curr_join->join_tab[tables]; + JOIN_TAB *end_table= &curr_join->join_tab[curr_join->tables]; for (; curr_table < end_table ; curr_table++) { /* @@ -2156,7 +2172,7 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, COND *cond, bool is_const=1; for (uint i=0; i<num_values; i++) - is_const&= (*value)->const_item(); + is_const&= value[i]->const_item(); if (is_const) stat[0].const_keys.merge(possible_keys); /* @@ -2830,10 +2846,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, x = used key parts (1 <= x <= c) */ double rec_per_key; - if (!(rec_per_key=(double) - keyinfo->rec_per_key[keyinfo->key_parts-1])) - rec_per_key=(double) s->records/rec+1; - + rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1] ? + (double) keyinfo->rec_per_key[keyinfo->key_parts-1] : + (double) s->records/rec+1; if (!s->records) tmp=0; else if (rec_per_key/(double) s->records >= 0.01) @@ -3509,8 +3524,17 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) /* Join with outer join condition */ COND *orig_cond=sel->cond; sel->cond= and_conds(sel->cond, tab->on_expr); + + /* + We can't call sel->cond->fix_fields, + as it will break tab->on_expr if it's AND condition + (fix_fields currently removes extra AND/OR levels). + Yet attributes of the just built condition are not needed. + Thus we call sel->cond->quick_fix_field for safety. + */ if (sel->cond && !sel->cond->fixed) - sel->cond->fix_fields(join->thd, 0, &sel->cond); + sel->cond->quick_fix_field(); + if (sel->test_quick_select(join->thd, tab->keys, used_tables & ~ current_map, (join->select_options & @@ -3826,7 +3850,9 @@ JOIN::join_free(bool full) JOIN_TAB *tab,*end; DBUG_ENTER("JOIN::join_free"); - full= full || !select_lex->uncacheable; + full= full || (!select_lex->uncacheable && + !thd->lex->subqueries && + !thd->lex->describe); // do not cleanup too early on EXPLAIN if (table) { @@ -3855,6 +3881,7 @@ JOIN::join_free(bool full) for (tab= join_tab, end= tab+tables; tab != end; tab++) tab->cleanup(); table= 0; + tables= 0; } else { @@ -4605,7 +4632,7 @@ static Field* create_tmp_field_from_field(THD *thd, Field* org_field, org_field->field_name, table, org_field->charset()); else - new_field= org_field->new_field(&thd->mem_root, table); + new_field= org_field->new_field(thd->mem_root, table); if (new_field) { if (modify_item) @@ -5208,7 +5235,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, if (!using_unique_constraint) { group->buff=(char*) group_buff; - if (!(group->field=field->new_field(&thd->mem_root,table))) + if (!(group->field=field->new_field(thd->mem_root,table))) goto err; /* purecov: inspected */ if (maybe_null) { @@ -5264,6 +5291,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, keyinfo->key_length=(uint16) reclength; keyinfo->name=(char*) "tmp"; keyinfo->algorithm= HA_KEY_ALG_UNDEF; + keyinfo->rec_per_key=0; if (null_pack_length) { key_part_info->null_bit=0; @@ -5995,7 +6023,7 @@ join_read_system(JOIN_TAB *tab) { if (error != HA_ERR_END_OF_FILE) return report_error(table, error); - table->null_row=1; // This is ok. + mark_as_null_row(tab->table); empty_record(table); // Make empty record return -1; } @@ -6025,7 +6053,7 @@ join_read_const(JOIN_TAB *tab) } if (error) { - table->null_row=1; + mark_as_null_row(tab->table); empty_record(table); if (error != HA_ERR_KEY_NOT_FOUND) return report_error(table, error); @@ -7143,11 +7171,24 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, } else { - select->quick->file->ha_index_end(); - select->quick->index= new_ref_key; - select->quick->init(); + /* + The range optimizer constructed QUICK_RANGE for ref_key, and + we want to use instead new_ref_key as the index. We can't + just change the index of the quick select, because this may + result in an incosistent QUICK_SELECT object. Below we + create a new QUICK_SELECT from scratch so that all its + parameres are set correctly by the range optimizer. + */ + key_map new_ref_key_map; + new_ref_key_map.clear_all(); /* Force the creation of quick select */ + new_ref_key_map.set_bit(new_ref_key); /* only for new_ref_key. */ + + if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0, + (tab->join->select_options & OPTION_FOUND_ROWS) ? + HA_POS_ERROR : tab->join->unit->select_limit_cnt) <= 0) + DBUG_RETURN(0); } - ref_key= new_ref_key; + ref_key= new_ref_key; } } /* Check if we get the rows in requested sorted order by using the key */ @@ -7457,13 +7498,14 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having) field_count++; } - if (!field_count) - { // only const items + if (!field_count && !(join->select_options & OPTION_FOUND_ROWS)) + { // only const items with no OPTION_FOUND_ROWS join->unit->select_limit_cnt= 1; // Only send first row DBUG_RETURN(0); } Field **first_field=entry->field+entry->fields - field_count; - offset=entry->field[entry->fields - field_count]->offset(); + offset= field_count ? + entry->field[entry->fields - field_count]->offset() : 0; reclength=entry->reclength-offset; free_io_cache(entry); // Safety @@ -7582,8 +7624,8 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, { byte *key_buffer, *key_pos, *record=table->record[0]; int error; - handler *file=table->file; - ulong extra_length=ALIGN_SIZE(key_length)-key_length; + handler *file= table->file; + ulong extra_length= ALIGN_SIZE(key_length)-key_length; uint *field_lengths,*field_length; HASH hash; DBUG_ENTER("remove_dup_with_hash_index"); @@ -7597,22 +7639,34 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, NullS)) DBUG_RETURN(1); + { + Field **ptr; + ulong total_length= 0; + for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++) + { + uint length= (*ptr)->pack_length(); + (*field_length++)= length; + total_length+= length; + } + DBUG_PRINT("info",("field_count: %u key_length: %lu total_length: %lu", + field_count, key_length, total_length)); + DBUG_ASSERT(total_length <= key_length); + key_length= total_length; + extra_length= ALIGN_SIZE(key_length)-key_length; + } + if (hash_init(&hash, &my_charset_bin, (uint) file->records, 0, - key_length,(hash_get_key) 0, 0, 0)) + key_length, (hash_get_key) 0, 0, 0)) { my_free((char*) key_buffer,MYF(0)); DBUG_RETURN(1); } - { - Field **ptr; - for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++) - (*field_length++)= (*ptr)->pack_length(); - } file->ha_rnd_init(1); key_pos=key_buffer; for (;;) { + byte *org_key_pos; if (thd->killed) { my_error(ER_SERVER_SHUTDOWN,MYF(0)); @@ -7635,6 +7689,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, } /* copy fields to key buffer */ + org_key_pos= key_pos; field_length=field_lengths; for (Field **ptr= first_field ; *ptr ; ptr++) { @@ -7642,14 +7697,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, key_pos+= *field_length++; } /* Check if it exists before */ - if (hash_search(&hash,key_pos-key_length,key_length)) + if (hash_search(&hash, org_key_pos, key_length)) { /* Duplicated found ; Remove the row */ if ((error=file->delete_row(record))) goto err; } else - (void) my_hash_insert(&hash, key_pos-key_length); + (void) my_hash_insert(&hash, org_key_pos); key_pos+=extra_length; } my_free((char*) key_buffer,MYF(0)); @@ -8463,6 +8518,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, res_selected_fields.empty(); res_all_fields.empty(); List_iterator_fast<Item> itr(res_all_fields); + List<Item> extra_funcs; uint i, border= all_fields.elements - elements; DBUG_ENTER("setup_copy_fields"); @@ -8501,7 +8557,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, saved value */ Field *field= item->field; - item->result_field=field->new_field(&thd->mem_root,field->table); + item->result_field=field->new_field(thd->mem_root,field->table); char *tmp=(char*) sql_alloc(field->pack_length()+1); if (!tmp) goto err; @@ -8524,7 +8580,12 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, */ if (!(pos=new Item_copy_string(pos))) goto err; - if (param->copy_funcs.push_back(pos)) + if (i < border) // HAVING, ORDER and GROUP BY + { + if (extra_funcs.push_back(pos)) + goto err; + } + else if (param->copy_funcs.push_back(pos)) goto err; } res_all_fields.push_back(pos); @@ -8536,6 +8597,12 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, for (i= 0; i < border; i++) itr++; itr.sublist(res_selected_fields, elements); + /* + Put elements from HAVING, ORDER BY and GROUP BY last to ensure that any + reference used in these will resolve to a item that is already calculated + */ + param->copy_funcs.concat(&extra_funcs); + DBUG_RETURN(0); err: @@ -8562,8 +8629,7 @@ copy_fields(TMP_TABLE_PARAM *param) for (; ptr != end; ptr++) (*ptr->do_copy)(ptr); - List_iterator_fast<Item> &it=param->copy_funcs_it; - it.rewind(); + List_iterator_fast<Item> it(param->copy_funcs); Item_copy_string *item; while ((item = (Item_copy_string*) it++)) item->copy(); @@ -8888,7 +8954,8 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab) if (thd->is_fatal_error) DBUG_RETURN(TRUE); - cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond); + if (!cond->fixed) + cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond); if (join_tab->select) { error=(int) cond->add(join_tab->select->cond); @@ -8944,7 +9011,7 @@ bool JOIN::rollup_init() return 1; rollup.ref_pointer_arrays= (Item***) (rollup.fields + send_group_parts); ref_array= (Item**) (rollup.ref_pointer_arrays+send_group_parts); - rollup.item_null= new (&thd->mem_root) Item_null(); + rollup.item_null= new (thd->mem_root) Item_null(); /* Prepare space for field list for the different levels diff --git a/sql/sql_select.h b/sql/sql_select.h index 34eaa7e272d..bbd169d1850 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -354,7 +354,7 @@ class store_key :public Sql_alloc field_arg->table, field_arg->charset()); else { - to_field=field_arg->new_field(&thd->mem_root,field_arg->table); + to_field=field_arg->new_field(thd->mem_root,field_arg->table); if (to_field) to_field->move_field(ptr, (uchar*) null, 1); } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 3bf11c0d6b8..8d741b4dc67 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -19,7 +19,6 @@ #include "mysql_priv.h" #include "sql_select.h" // For select_describe -#include "sql_acl.h" #include "repl_failsafe.h" #include <my_dir.h> @@ -752,8 +751,9 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, String def(tmp1,sizeof(tmp1), system_charset_info); type.set(tmp, sizeof(tmp), field->charset()); field->val_str(&type); + uint dummy_errors; def.copy(type.ptr(), type.length(), type.charset(), - system_charset_info); + system_charset_info, &dummy_errors); protocol->store(def.ptr(), def.length(), def.charset()); } else if (field->unireg_check == Field::NEXT_NUMBER || @@ -817,6 +817,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(1); } + buffer.length(0); if (store_create_info(thd, table, &buffer)) DBUG_RETURN(-1); @@ -830,9 +831,6 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(1); protocol->prepare_for_resend(); protocol->store(table->table_name, system_charset_info); - buffer.length(0); - if (store_create_info(thd, table, &buffer)) - DBUG_RETURN(-1); protocol->store(buffer.ptr(), buffer.length(), buffer.charset()); if (protocol->write()) DBUG_RETURN(1); @@ -1027,7 +1025,8 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list) /* Check if we have a key part that only uses part of the field */ if (!(key_info->flags & HA_FULLTEXT) && (!key_part->field || key_part->length != table->field[key_part->fieldnr-1]->key_length())) - protocol->store_tiny((longlong) key_part->length); + protocol->store_tiny((longlong) key_part->length / + key_part->field->charset()->mbmaxlen); else protocol->store_null(); protocol->store_null(); // No pack_information yet @@ -1080,7 +1079,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild) restore_record(table,default_values); // Get empty record if (thd->protocol->send_fields(&field_list,2)) DBUG_VOID_RETURN; - net_flush(&thd->net); + thd->protocol->flush(); DBUG_VOID_RETURN; } @@ -1097,13 +1096,11 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd) if (store_create_info(thd, table, packet)) DBUG_RETURN(-1); - //if (protocol->convert) - // protocol->convert->convert((char*) packet->ptr(), packet->length()); if (fd < 0) { if (protocol->write()) DBUG_RETURN(-1); - net_flush(&thd->net); + protocol->flush(); } else { @@ -1170,6 +1167,15 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) { uchar chr= (uchar) *name; length= my_mbcharlen(system_charset_info, chr); + /* + my_mbcharlen can retur 0 on a wrong multibyte + sequence. It is possible when upgrading from 4.0, + and identifier contains some accented characters. + The manual says it does not work. So we'll just + change length to 1 not to hang in the endless loop. + */ + if (!length) + length= 1; if (length == 1 && chr == (uchar) quote_char) packet->append("e_char, 1, system_charset_info); packet->append(name, length, packet->charset()); @@ -1338,9 +1344,10 @@ store_create_info(THD *thd, TABLE *table, String *packet) if (type.length()) { String def_val; + uint dummy_errors; /* convert to system_charset_info == utf8 */ def_val.copy(type.ptr(), type.length(), field->charset(), - system_charset_info); + system_charset_info, &dummy_errors); append_unescaped(packet, def_val.ptr(), def_val.length()); } else @@ -1398,14 +1405,18 @@ store_create_info(THD *thd, TABLE *table, String *packet) if (!(thd->variables.sql_mode & MODE_NO_KEY_OPTIONS) && !limited_mysql_mode && !foreign_db_mode) { - if (table->db_type == DB_TYPE_HEAP && - key_info->algorithm == HA_KEY_ALG_BTREE) + if (key_info->algorithm == HA_KEY_ALG_BTREE) packet->append(" TYPE BTREE", 11); + if (key_info->algorithm == HA_KEY_ALG_HASH) + packet->append(" TYPE HASH", 10); + // +BAR: send USING only in non-default case: non-spatial rtree if ((key_info->algorithm == HA_KEY_ALG_RTREE) && !(key_info->flags & HA_SPATIAL)) packet->append(" TYPE RTREE", 11); + + // No need to send TYPE FULLTEXT, it is sent as FULLTEXT KEY } packet->append(" (", 2); @@ -2056,7 +2067,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables, #endif /* HAVE_OPENSSL */ case SHOW_KEY_CACHE_LONG: case SHOW_KEY_CACHE_CONST_LONG: - value= (value-(char*) &dflt_key_cache_var)+ (char*) sql_key_cache; + value= (value-(char*) &dflt_key_cache_var)+ (char*) dflt_key_cache; end= int10_to_str(*(long*) value, buff, 10); break; case SHOW_UNDEF: // Show never happen diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 1044dc4e58e..c1701e7e9bf 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -121,12 +121,13 @@ bool String::set(ulonglong num, CHARSET_INFO *cs) bool String::set(double num,uint decimals, CHARSET_INFO *cs) { char buff[331]; + uint dummy_errors; str_charset=cs; if (decimals >= NOT_FIXED_DEC) { uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME - return copy(buff, len, &my_charset_latin1, cs); + return copy(buff, len, &my_charset_latin1, cs, &dummy_errors); } #ifdef HAVE_FCONVERT int decpt,sign; @@ -141,7 +142,8 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs) buff[0]='-'; pos=buff; } - return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs); + uint dummy_errors; + return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs, &dummy_errors); } if (alloc((uint32) ((uint32) decpt+3+decimals))) return TRUE; @@ -191,7 +193,8 @@ end: #else sprintf(buff,"%.*f",(int) decimals,num); #endif - return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs); + return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs, + &dummy_errors); #endif } @@ -331,19 +334,24 @@ bool String::set_or_copy_aligned(const char *str,uint32 arg_length, /* Copy with charset convertion */ bool String::copy(const char *str, uint32 arg_length, - CHARSET_INFO *from_cs, CHARSET_INFO *to_cs) + CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors) { uint32 offset; if (!needs_conversion(arg_length, from_cs, to_cs, &offset)) + { + *errors= 0; return copy(str, arg_length, to_cs); + } if ((from_cs == &my_charset_bin) && offset) + { + *errors= 0; return copy_aligned(str, arg_length, offset, to_cs); - + } uint32 new_length= to_cs->mbmaxlen*arg_length; if (alloc(new_length)) return TRUE; str_length=copy_and_convert((char*) Ptr, new_length, to_cs, - str, arg_length, from_cs); + str, arg_length, from_cs, errors); str_charset=to_cs; return FALSE; } @@ -375,7 +383,8 @@ bool String::set_ascii(const char *str, uint32 arg_length) set(str, arg_length, str_charset); return 0; } - return copy(str, arg_length, &my_charset_latin1, str_charset); + uint dummy_errors; + return copy(str, arg_length, &my_charset_latin1, str_charset, &dummy_errors); } @@ -429,10 +438,12 @@ bool String::append(const char *s,uint32 arg_length) if (str_charset->mbminlen > 1) { uint32 add_length=arg_length * str_charset->mbmaxlen; + uint dummy_errors; if (realloc(str_length+ add_length)) return TRUE; str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset, - s, arg_length, &my_charset_latin1); + s, arg_length, &my_charset_latin1, + &dummy_errors); return FALSE; } @@ -469,10 +480,11 @@ bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs) if (needs_conversion(arg_length, cs, str_charset, &dummy_offset)) { uint32 add_length= arg_length / cs->mbminlen * str_charset->mbmaxlen; + uint dummy_errors; if (realloc(str_length + add_length)) return TRUE; str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset, - s, arg_length, cs); + s, arg_length, cs, &dummy_errors); } else { @@ -769,7 +781,8 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length) uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, - const char *from, uint32 from_length, CHARSET_INFO *from_cs) + const char *from, uint32 from_length, CHARSET_INFO *from_cs, + uint *errors) { int cnvres; my_wc_t wc; @@ -780,6 +793,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, const uchar *) = from_cs->cset->mb_wc; int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)= to_cs->cset->wc_mb; + uint error_count= 0; while (1) { @@ -788,6 +802,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, from+= cnvres; else if (cnvres == MY_CS_ILSEQ) { + error_count++; from++; wc= '?'; } @@ -799,12 +814,14 @@ outp: to+= cnvres; else if (cnvres == MY_CS_ILUNI && wc != '?') { + error_count++; wc= '?'; goto outp; } else break; } + *errors= error_count; return (uint32) (to - to_start); } diff --git a/sql/sql_string.h b/sql/sql_string.h index 2d368991159..3ad4689cf36 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -29,7 +29,7 @@ int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, const char *from, uint32 from_length, - CHARSET_INFO *from_cs); + CHARSET_INFO *from_cs, uint *errors); class String { @@ -73,7 +73,7 @@ public: { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr_arg,size_t size) {} - static void operator delete(void *ptr_arg,size_t size, MEM_ROOT *mem_root) + static void operator delete(void *ptr_arg, MEM_ROOT *mem_root) {} ~String() { free(); } @@ -182,6 +182,11 @@ public: { if (&s != this) { + /* + It is forbidden to do assignments like + some_string = substring_of_that_string + */ + DBUG_ASSERT(!s.uses_buffer_owned_by(this)); free(); Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length; alloced=0; @@ -199,7 +204,7 @@ public: CHARSET_INFO *cs); bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs); bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom, - CHARSET_INFO *csto); + CHARSET_INFO *csto, uint *errors); bool append(const String &s); bool append(const char *s); bool append(const char *s,uint32 arg_length); @@ -313,4 +318,9 @@ public: /* Swap two string objects. Efficient way to exchange data without memcpy. */ void swap(String &s); + + inline bool uses_buffer_owned_by(const String *s) const + { + return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length); + } }; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 79cec85927e..5f3875ba934 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -29,12 +29,6 @@ #include <io.h> #endif -#define tmp_disable_binlog(A) \ - ulong save_options= (A)->options; \ - (A)->options&= ~OPTION_BIN_LOG; - -#define reenable_binlog(A) (A)->options= save_options; - const char *primary_key_name="PRIMARY"; static bool check_if_keyname_exists(const char *name,KEY *start, KEY *end); @@ -42,6 +36,7 @@ static char *make_unique_key_name(const char *field_name,KEY *start,KEY *end); static int copy_data_between_tables(TABLE *from,TABLE *to, List<create_field> &create, enum enum_duplicates handle_duplicates, + bool ignore, uint order_num, ORDER *order, ha_rows *copied,ha_rows *deleted); @@ -282,7 +277,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, if (!error) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - tmp_table_deleted && !some_tables_deleted); + tmp_table_deleted && !some_tables_deleted, + FALSE); mysql_bin_log.write(&qinfo); } } @@ -392,6 +388,41 @@ void check_duplicates_in_interval(const char *set_or_name, } } + +/* + Check TYPELIB (set or enum) max and total lengths + + SYNOPSIS + calculate_interval_lengths() + cs charset+collation pair of the interval + typelib list of values for the column + max_length length of the longest item + tot_length sum of the item lengths + + DESCRIPTION + After this function call: + - ENUM uses max_length + - SET uses tot_length. + + RETURN VALUES + void +*/ +void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval, + uint32 *max_length, uint32 *tot_length) +{ + const char **pos; + uint *len; + *max_length= *tot_length= 0; + for (pos= interval->type_names, len= interval->type_lengths; + *pos ; pos++, len++) + { + uint length= cs->cset->numchars(cs, *pos, *pos + *len); + *tot_length+= length; + set_if_bigger(*max_length, (uint32)length); + } +} + + /* Preparation for table creation @@ -455,6 +486,93 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } + if (sql_field->sql_type == FIELD_TYPE_SET || + sql_field->sql_type == FIELD_TYPE_ENUM) + { + uint32 dummy; + CHARSET_INFO *cs= sql_field->charset; + TYPELIB *interval= sql_field->interval; + + /* + Create typelib from interval_list, and if necessary + convert strings from client character set to the + column character set. + */ + if (!interval) + { + interval= sql_field->interval= typelib(sql_field->interval_list); + List_iterator<String> it(sql_field->interval_list); + String conv, *tmp; + for (uint i= 0; (tmp= it++); i++) + { + if (String::needs_conversion(tmp->length(), tmp->charset(), + cs, &dummy)) + { + uint cnv_errs; + conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); + char *buf= (char*) sql_alloc(conv.length()+1); + memcpy(buf, conv.ptr(), conv.length()); + buf[conv.length()]= '\0'; + interval->type_names[i]= buf; + interval->type_lengths[i]= conv.length(); + } + + // Strip trailing spaces. + uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i], + interval->type_lengths[i]); + interval->type_lengths[i]= lengthsp; + ((uchar *)interval->type_names[i])[lengthsp]= '\0'; + } + sql_field->interval_list.empty(); // Don't need interval_list anymore + } + + /* + Convert the default value from client character + set into the column character set if necessary. + */ + if (sql_field->def) + { + sql_field->def= + sql_field->def->safe_charset_converter(cs); + } + + if (sql_field->sql_type == FIELD_TYPE_SET) + { + if (sql_field->def) + { + char *not_used; + uint not_used2; + bool not_found= 0; + String str, *def= sql_field->def->val_str(&str); + def->length(cs->cset->lengthsp(cs, def->ptr(), def->length())); + (void) find_set(interval, def->ptr(), def->length(), + cs, ¬_used, ¬_used2, ¬_found); + if (not_found) + { + my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); + DBUG_RETURN(-1); + } + } + calculate_interval_lengths(cs, interval, &dummy, &sql_field->length); + sql_field->length+= (interval->count - 1); + } + else /* FIELD_TYPE_ENUM */ + { + if (sql_field->def) + { + String str, *def= sql_field->def->val_str(&str); + def->length(cs->cset->lengthsp(cs, def->ptr(), def->length())); + if (!find_type2(interval, def->ptr(), def->length(), cs)) + { + my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); + DBUG_RETURN(-1); + } + } + calculate_interval_lengths(cs, interval, &sql_field->length, &dummy); + } + set_if_smaller(sql_field->length, MAX_FIELD_WIDTH-1); + } + sql_field->create_length_to_internal_length(); /* Don't pack keys in old tables if the user has requested this */ @@ -814,8 +932,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } } - else - if (key_info->algorithm == HA_KEY_ALG_RTREE) + else if (key_info->algorithm == HA_KEY_ALG_RTREE) { #ifdef HAVE_RTREE_KEYS if ((key_info->key_parts & 1) == 1) @@ -835,10 +952,12 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, #endif } - List_iterator<key_part_spec> cols(key->columns); + List_iterator<key_part_spec> cols(key->columns), cols2(key->columns); CHARSET_INFO *ft_key_charset=0; // for FULLTEXT for (uint column_nr=0 ; (column=cols++) ; column_nr++) { + key_part_spec *dup_column; + it.rewind(); field=0; while ((sql_field=it++) && @@ -853,12 +972,18 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, column->field_name); DBUG_RETURN(-1); } - /* for fulltext keys keyseg length is 1 for blobs (it's ignored in - ft code anyway, and 0 (set to column width later) for char's. - it has to be correct col width for char's, as char data are not - prefixed with length (unlike blobs, where ft code takes data length - from a data prefix, ignoring column->length). - */ + while ((dup_column= cols2++) != column) + { + if (!my_strcasecmp(system_charset_info, + column->field_name, dup_column->field_name)) + { + my_printf_error(ER_DUP_FIELDNAME, + ER(ER_DUP_FIELDNAME),MYF(0), + column->field_name); + DBUG_RETURN(-1); + } + } + cols2.rewind(); if (key->type == Key::FULLTEXT) { if ((sql_field->sql_type != FIELD_TYPE_STRING && @@ -1292,7 +1417,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, test(create_info->options & - HA_LEX_CREATE_TMP_TABLE)); + HA_LEX_CREATE_TMP_TABLE), + FALSE); mysql_bin_log.write(&qinfo); } } @@ -1418,7 +1544,6 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, } table->file->extra(HA_EXTRA_WRITE_CACHE); DBUG_RETURN(table); - /* Note that leaving the function resets binlogging properties */ } @@ -1734,6 +1859,12 @@ end: } +/* + RETURN VALUES + 0 Message sent to net (admin operation went ok) + -1 Message should be sent by caller + (admin operation or network communication failed) +*/ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt, const char *operator_name, @@ -1766,9 +1897,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, for (table = tables; table; table = table->next) { char table_name[NAME_LEN*2+2]; - char* db = (table->db) ? table->db : thd->db; + char* db = table->db; bool fatal_error=0; - strxmov(table_name,db ? db : "",".",table->real_name,NullS); + strxmov(table_name, db, ".", table->real_name, NullS); thd->open_options|= extra_open_options; table->table = open_ltable(thd, table, lock_type); @@ -1780,9 +1911,13 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, if (prepare_func) { switch ((*prepare_func)(thd, table, check_opt)) { - case 1: continue; // error, message written to net - case -1: goto err; // error, message could be written to net - default: ; // should be 0 otherwise + case 1: // error, message written to net + close_thread_tables(thd); + continue; + case -1: // error, message could be written to net + goto err; + default: // should be 0 otherwise + ; } } @@ -2139,6 +2274,8 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, { strxmov(src_path, mysql_data_home, "/", src_db, "/", src_table, reg_ext, NullS); + /* Resolve symlinks (for windows) */ + fn_format(src_path, src_path, "", "", MYF(MY_UNPACK_FILENAME)); if (access(src_path, F_OK)) { my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table); @@ -2167,6 +2304,7 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, { strxmov(dst_path, mysql_data_home, "/", db, "/", table_name, reg_ext, NullS); + fn_format(dst_path, dst_path, "", "", MYF(MY_UNPACK_FILENAME)); if (!access(dst_path, F_OK)) goto table_exists; } @@ -2208,7 +2346,8 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, test(create_info->options & - HA_LEX_CREATE_TMP_TABLE)); + HA_LEX_CREATE_TMP_TABLE), + FALSE); mysql_bin_log.write(&qinfo); } res= 0; @@ -2319,7 +2458,7 @@ mysql_discard_or_import_tablespace(THD *thd, mysql_update_log.write(thd, thd->query,thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } err: @@ -2330,7 +2469,11 @@ err: send_ok(thd); DBUG_RETURN(0); } - DBUG_RETURN(error); + + if (error == HA_ERR_ROW_IS_REFERENCED) + my_error(ER_ROW_IS_REFERENCED, MYF(0)); + + DBUG_RETURN(-1); } @@ -2547,7 +2690,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, TABLE_LIST *table_list, List<create_field> &fields, List<Key> &keys, uint order_num, ORDER *order, - enum enum_duplicates handle_duplicates, + enum enum_duplicates handle_duplicates, bool ignore, ALTER_INFO *alter_info, bool do_send_ok) { TABLE *table,*new_table; @@ -2706,7 +2849,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } if (do_send_ok) @@ -3066,7 +3209,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, copied=deleted=0; if (!new_table->is_view) error=copy_data_between_tables(table,new_table,create_list, - handle_duplicates, + handle_duplicates, ignore, order_num, order, &copied, &deleted); thd->last_insert_id=next_insert_id; // Needed for correct log thd->count_cuted_fields= CHECK_FIELD_IGNORE; @@ -3091,7 +3234,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } /* Remove link to old table and rename the new one */ close_temporary_table(thd,table->table_cache_key,table_name); - if (rename_temporary_table(thd, new_table, new_db, new_alias)) + /* Should pass the 'new_name' as we store table name in the cache */ + if (rename_temporary_table(thd, new_table, new_db, new_name)) { // Fatal error close_temporary_table(thd,new_db,tmp_name); my_free((gptr) new_table,MYF(0)); @@ -3101,7 +3245,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } goto end_temporary; @@ -3236,7 +3380,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } VOID(pthread_cond_broadcast(&COND_refresh)); @@ -3286,6 +3430,7 @@ static int copy_data_between_tables(TABLE *from,TABLE *to, List<create_field> &create, enum enum_duplicates handle_duplicates, + bool ignore, uint order_num, ORDER *order, ha_rows *copied, ha_rows *deleted) @@ -3305,6 +3450,16 @@ copy_data_between_tables(TABLE *from,TABLE *to, ulong save_sql_mode; DBUG_ENTER("copy_data_between_tables"); + /* + Turn off recovery logging since rollback of an alter table is to + delete the new table so there is no need to log the changes to it. + + This needs to be done before external_lock + */ + error= ha_enable_transaction(thd, FALSE); + if (error) + DBUG_RETURN(-1); + if (!(copy= new Copy_field[to->fields])) DBUG_RETURN(-1); /* purecov: inspected */ @@ -3363,23 +3518,12 @@ copy_data_between_tables(TABLE *from,TABLE *to, goto err; }; - /* - Turn off recovery logging since rollback of an alter table is to - delete the new table so there is no need to log the changes to it. - */ - error= ha_enable_transaction(thd,FALSE); - if (error) - { - error= 1; - goto err; - } - /* Handler must be told explicitly to retrieve all columns, because this function does not set field->query_id in the columns to the current query id */ from->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1,1); - if (handle_duplicates == DUP_IGNORE || + if (ignore || handle_duplicates == DUP_REPLACE) to->file->extra(HA_EXTRA_IGNORE_DUP_KEY); thd->row_count= 0; @@ -3405,7 +3549,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, } if ((error=to->file->write_row((byte*) to->record[0]))) { - if ((handle_duplicates != DUP_IGNORE && + if ((!ignore && handle_duplicates != DUP_REPLACE) || (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)) @@ -3481,7 +3625,7 @@ int mysql_recreate_table(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(mysql_alter_table(thd, NullS, NullS, &create_info, table_list, lex->create_list, lex->key_list, 0, (ORDER *) 0, - DUP_ERROR, &lex->alter_info, do_send_ok)); + DUP_ERROR, 0, &lex->alter_info, do_send_ok)); } diff --git a/sql/sql_udf.h b/sql/sql_udf.h index 7b10b80f148..d1f99a6d232 100644 --- a/sql/sql_udf.h +++ b/sql/sql_udf.h @@ -56,8 +56,9 @@ class udf_handler :public Sql_alloc public: table_map used_tables_cache; bool const_item_cache; + bool not_original; udf_handler(udf_func *udf_arg) :u_d(udf_arg), buffers(0), error(0), - is_null(0), initialized(0) + is_null(0), initialized(0), not_original(0) {} ~udf_handler(); const char *name() const { return u_d ? u_d->name.str : "?"; } diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 0be554f58a2..882316d57d7 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -45,10 +45,10 @@ select_union::select_union(TABLE *table_par) { bzero((char*) &info,sizeof(info)); /* - We can always use DUP_IGNORE because the temporary table will only + We can always use IGNORE because the temporary table will only contain a unique key if we are using not using UNION ALL */ - info.handle_duplicates= DUP_IGNORE; + info.ignore= 1; } select_union::~select_union() @@ -148,6 +148,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, SELECT_LEX *sl, *first_select; select_result *tmp_result; bool is_union; + TABLE *empty_table= 0; DBUG_ENTER("st_select_lex_unit::prepare"); describe= test(additional_options & SELECT_DESCRIBE); @@ -239,13 +240,21 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, goto err; if (sl == first_select) { + /* + We need to create an empty table object. It is used + to create tmp_table fields in Item_type_holder. + The main reason of this is that we can't create + field object without table. + */ + DBUG_ASSERT(!empty_table); + empty_table= (TABLE*) thd->calloc(sizeof(TABLE)); types.empty(); List_iterator_fast<Item> it(sl->item_list); Item *item_tmp; while ((item_tmp= it++)) { /* Error's in 'new' will be detected after loop */ - types.push_back(new Item_type_holder(thd_arg, item_tmp)); + types.push_back(new Item_type_holder(thd_arg, item_tmp, empty_table)); } if (thd_arg->is_fatal_error) @@ -264,7 +273,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, Item *type, *item_tmp; while ((type= tp++, item_tmp= it++)) { - if (((Item_type_holder*)type)->join_types(thd_arg, item_tmp)) + if (((Item_type_holder*)type)->join_types(thd_arg, item_tmp, + empty_table)) DBUG_RETURN(-1); } } @@ -313,24 +323,24 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, We're in statement prepare or in execution of a conventional statement. */ - Item_arena backup; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); + Item_arena *tmp_arena,backup; + tmp_arena= thd->change_arena_if_needed(&backup); + Field **field; for (field= table->field; *field; field++) { Item_field *item= new Item_field(*field); if (!item || item_list.push_back(item)) { - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); + if (tmp_arena) + thd->restore_backup_item_arena(tmp_arena, &backup); DBUG_RETURN(-1); } } + if (tmp_arena) + thd->restore_backup_item_arena(tmp_arena, &backup); if (arena->is_stmt_prepare()) { - thd->restore_backup_item_arena(arena, &backup); - /* prepare fake select to initialize it correctly */ ulong options_tmp= init_prepare_fake_select_lex(thd); if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options, @@ -394,6 +404,8 @@ int st_select_lex_unit::exec() if (uncacheable || !item || !item->assigned() || describe) { + if (item) + item->reset_value_registration(); if (optimized && item) { if (item->assigned()) @@ -464,11 +476,14 @@ int st_select_lex_unit::exec() } res= sl->join->error; offset_limit_cnt= sl->offset_limit; - if (!res && union_result->flush()) + if (!res) { - examined_rows+= thd->examined_row_count; - thd->lex->current_select= lex_select_save; - DBUG_RETURN(1); + examined_rows+= thd->examined_row_count; + if (union_result->flush()) + { + thd->lex->current_select= lex_select_save; + DBUG_RETURN(1); + } } } if (res) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d3597f274dc..6c12381b4bd 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -21,7 +21,6 @@ */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields); @@ -55,9 +54,10 @@ int mysql_update(THD *thd, COND *conds, uint order_num, ORDER *order, ha_rows limit, - enum enum_duplicates handle_duplicates) + enum enum_duplicates handle_duplicates, + bool ignore) { - bool using_limit=limit != HA_POS_ERROR; + bool using_limit=limit != HA_POS_ERROR; bool safe_update= thd->options & OPTION_SAFE_UPDATES; bool used_key_is_modified, transactional_table, log_delayed; int error=0; @@ -71,11 +71,10 @@ int mysql_update(THD *thd, TABLE *table; SQL_SELECT *select; READ_RECORD info; - TABLE_LIST *update_table_list= ((TABLE_LIST*) + TABLE_LIST *update_table_list= ((TABLE_LIST*) thd->lex->select_lex.table_list.first); DBUG_ENTER("mysql_update"); - LINT_INIT(used_index); LINT_INIT(timestamp_query_id); if ((open_and_lock_tables(thd, table_list))) @@ -125,7 +124,7 @@ int mysql_update(THD *thd, /* Check values */ table->grant.want_privilege=(SELECT_ACL & ~table->grant.privilege); #endif - if (setup_fields(thd, 0, update_table_list, values, 0, 0, 0)) + if (setup_fields(thd, 0, update_table_list, values, 1, 0, 0)) { free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(-1); /* purecov: inspected */ @@ -160,14 +159,18 @@ int mysql_update(THD *thd, init_ftfuncs(thd, &thd->lex->select_lex, 1); /* Check if we are modifying a key that we are used to search with */ if (select && select->quick) + { + used_index=select->quick->index; used_key_is_modified= (!select->quick->unique_key_range() && - check_if_key_used(table, - (used_index=select->quick->index), - fields)); + check_if_key_used(table, used_index, fields)); + } else if ((used_index=table->file->key_used_on_scan) < MAX_KEY) used_key_is_modified=check_if_key_used(table, used_index, fields); else + { used_key_is_modified=0; + used_index= MAX_KEY; + } if (used_key_is_modified || order) { /* @@ -175,7 +178,7 @@ int mysql_update(THD *thd, matching rows before updating the table! */ table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); - if (old_used_keys.is_set(used_index)) + if (used_index < MAX_KEY && old_used_keys.is_set(used_index)) { table->key_read=1; table->file->extra(HA_EXTRA_KEYREAD); @@ -275,7 +278,7 @@ int mysql_update(THD *thd, } } - if (handle_duplicates == DUP_IGNORE) + if (ignore) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); init_read_record(&info,thd,table,select,0,1); @@ -300,8 +303,7 @@ int mysql_update(THD *thd, { updated++; } - else if (handle_duplicates != DUP_IGNORE || - error != HA_ERR_FOUND_DUPP_KEY) + else if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) { thd->fatal_error(); // Force error message table->file->print_error(error,MYF(0)); @@ -344,7 +346,7 @@ int mysql_update(THD *thd, if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; // Rollback update } @@ -466,30 +468,23 @@ static table_map get_table_map(List<Item> *items) } - /* - Setup multi-update handling and call SELECT to do the join + Prepare tables for multi-update + Analyse which tables need specific privileges and perform locking + as required */ -int mysql_multi_update(THD *thd, - TABLE_LIST *table_list, - List<Item> *fields, - List<Item> *values, - COND *conds, - ulong options, - enum enum_duplicates handle_duplicates, - SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex) +int mysql_multi_update_lock(THD *thd, + TABLE_LIST *table_list, + List<Item> *fields, + SELECT_LEX *select_lex) { int res; - multi_update *result; TABLE_LIST *tl; TABLE_LIST *update_list= (TABLE_LIST*) thd->lex->select_lex.table_list.first; - List<Item> total_list; const bool using_lock_tables= thd->locked_tables != 0; bool initialized_dervied= 0; - DBUG_ENTER("mysql_multi_update"); - - select_lex->select_limit= HA_POS_ERROR; + DBUG_ENTER("mysql_multi_update_lock"); /* The following loop is here to to ensure that we only lock tables @@ -543,8 +538,8 @@ int mysql_multi_update(THD *thd, /* Unlock the tables in preparation for relocking */ if (!using_lock_tables) - { - mysql_unlock_tables(thd, thd->lock); + { + mysql_unlock_tables(thd, thd->lock); thd->lock= 0; } @@ -554,7 +549,9 @@ int mysql_multi_update(THD *thd, */ for (tl= update_list; tl; tl= tl->next) { + TABLE_LIST *save= tl->next; TABLE *table= tl->table; + uint wants; /* if table will be updated then check that it is unique */ if (table->map & update_tables) { @@ -572,17 +569,34 @@ int mysql_multi_update(THD *thd, DBUG_PRINT("info",("setting table `%s` for update", tl->alias)); tl->lock_type= thd->lex->multi_lock_option; tl->updating= 1; + wants= UPDATE_ACL; } else { DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias)); - tl->lock_type= TL_READ; + // If we are using the binary log, we need TL_READ_NO_INSERT to get + // correct order of statements. Otherwise, we use a TL_READ lock to + // improve performance. + tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ; tl->updating= 0; + wants= SELECT_ACL; } + if (tl->derived) derived_tables|= table->map; - else if (!using_lock_tables) - tl->table->reginfo.lock_type= tl->lock_type; + else + { + tl->next= 0; + if (!using_lock_tables) + tl->table->reginfo.lock_type= tl->lock_type; + if (check_access(thd, wants, tl->db, &tl->grant.privilege, 0, 0) || + (grant_option && check_grant(thd, wants, tl, 0, 0, 0))) + { + tl->next= save; + DBUG_RETURN(1); + } + tl->next= save; + } } if (thd->lex->derived_tables && (update_tables & derived_tables)) @@ -602,11 +616,7 @@ int mysql_multi_update(THD *thd, /* Relock the tables with the correct modes */ res= lock_tables(thd, table_list, table_count); if (using_lock_tables) - { - if (res) - DBUG_RETURN(res); break; // Don't have to do setup_field() - } /* We must setup fields again as the file may have been reopened @@ -637,6 +647,32 @@ int mysql_multi_update(THD *thd, */ close_thread_tables(thd); } + + DBUG_RETURN(res); +} + +/* + Setup multi-update handling and call SELECT to do the join +*/ + +int mysql_multi_update(THD *thd, + TABLE_LIST *table_list, + List<Item> *fields, + List<Item> *values, + COND *conds, + ulong options, + enum enum_duplicates handle_duplicates, bool ignore, + SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex) +{ + int res; + TABLE_LIST *tl; + TABLE_LIST *update_list= (TABLE_LIST*) thd->lex->select_lex.table_list.first; + List<Item> total_list; + multi_update *result; + DBUG_ENTER("mysql_multi_update"); + + if ((res= mysql_multi_update_lock(thd, table_list, fields, select_lex))) + DBUG_RETURN(res); /* Setup timestamp handling */ for (tl= update_list; tl; tl= tl->next) @@ -652,7 +688,7 @@ int mysql_multi_update(THD *thd, } if (!(result=new multi_update(thd, update_list, fields, values, - handle_duplicates))) + handle_duplicates, ignore))) DBUG_RETURN(-1); res= mysql_select(thd, &select_lex->ref_pointer_array, @@ -669,11 +705,11 @@ int mysql_multi_update(THD *thd, multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list, List<Item> *field_list, List<Item> *value_list, - enum enum_duplicates handle_duplicates_arg) + enum enum_duplicates handle_duplicates_arg, bool ignore_arg) :all_tables(table_list), update_tables(0), thd(thd_arg), tmp_tables(0), updated(0), found(0), fields(field_list), values(value_list), table_count(0), copy_field(0), handle_duplicates(handle_duplicates_arg), - do_update(1), trans_safe(0), transactional_tables(1) + do_update(1), trans_safe(0), transactional_tables(1), ignore(ignore_arg) {} @@ -1006,8 +1042,7 @@ bool multi_update::send_data(List<Item> ¬_used_values) table->record[0]))) { updated--; - if (handle_duplicates != DUP_IGNORE || - error != HA_ERR_FOUND_DUPP_KEY) + if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) { thd->fatal_error(); // Force error message table->file->print_error(error,MYF(0)); @@ -1139,8 +1174,7 @@ int multi_update::do_updates(bool from_send_error) if ((local_error=table->file->update_row(table->record[1], table->record[0]))) { - if (local_error != HA_ERR_FOUND_DUPP_KEY || - handle_duplicates != DUP_IGNORE) + if (!ignore || local_error != HA_ERR_FOUND_DUPP_KEY) goto err; } updated++; @@ -1221,7 +1255,7 @@ bool multi_update::send_eof() if (local_error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && trans_safe) local_error= 1; // Rollback update } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 142f52b87ab..9f25e17b6fd 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -32,7 +32,6 @@ #define Select Lex->current_select #include "mysql_priv.h" #include "slave.h" -#include "sql_acl.h" #include "lex_symbol.h" #include "item_create.h" #include <myisam.h> @@ -131,6 +130,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token CLIENT_SYM %token COMMENT_SYM %token COMMIT_SYM +%token CONSISTENT_SYM %token COUNT_SYM %token CREATE %token CROSS @@ -165,6 +165,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token SELECT_SYM %token SHOW %token SLAVE +%token SNAPSHOT_SYM %token SQL_THREAD %token START_SYM %token STD_SYM @@ -607,7 +608,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type <simple_string> remember_name remember_end opt_ident opt_db text_or_password - opt_constraint constraint + opt_constraint constraint ident_or_empty %type <string> text_string opt_gconcat_separator @@ -618,6 +619,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct opt_ignore_leaves fulltext_options spatial_type union_option + start_transaction_opts %type <ulong_num> ULONG_NUM raid_types merge_insert_types @@ -1109,7 +1111,7 @@ create_select: SELECT_SYM { LEX *lex=Lex; - lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ; + lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ; if (lex->sql_command == SQLCOM_INSERT) lex->sql_command= SQLCOM_INSERT_SELECT; else if (lex->sql_command == SQLCOM_REPLACE) @@ -1358,7 +1360,7 @@ field_spec: field_ident { LEX *lex=Lex; - lex->length=lex->dec=0; lex->type=0; lex->interval=0; + lex->length=lex->dec=0; lex->type=0; lex->default_value= lex->on_update_value= 0; lex->comment=0; lex->charset=NULL; @@ -1371,7 +1373,7 @@ field_spec: lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, lex->comment, - lex->change,lex->interval,lex->charset, + lex->change,&lex->interval_list,lex->charset, lex->uint_geom_type)) YYABORT; }; @@ -1399,6 +1401,9 @@ type: | BINARY '(' NUM ')' { Lex->length=$3.str; Lex->charset=&my_charset_bin; $$=FIELD_TYPE_STRING; } + | BINARY { Lex->length= (char*) "1"; + Lex->charset=&my_charset_bin; + $$=FIELD_TYPE_STRING; } | varchar '(' NUM ')' opt_binary { Lex->length=$3.str; $$=FIELD_TYPE_VAR_STRING; } | nvarchar '(' NUM ')' { Lex->length=$3.str; @@ -1410,7 +1415,7 @@ type: | YEAR_SYM opt_len field_options { $$=FIELD_TYPE_YEAR; } | DATE_SYM { $$=FIELD_TYPE_DATE; } | TIME_SYM { $$=FIELD_TYPE_TIME; } - | TIMESTAMP + | TIMESTAMP opt_len { if (YYTHD->variables.sql_mode & MODE_MAXDB) $$=FIELD_TYPE_DATETIME; @@ -1423,13 +1428,6 @@ type: $$=FIELD_TYPE_TIMESTAMP; } } - | TIMESTAMP '(' NUM ')' - { - LEX *lex= Lex; - lex->length= $3.str; - lex->type|= NOT_NULL_FLAG; - $$= FIELD_TYPE_TIMESTAMP; - } | DATETIME { $$=FIELD_TYPE_DATETIME; } | TINYBLOB { Lex->charset=&my_charset_bin; $$=FIELD_TYPE_TINY_BLOB; } @@ -1465,17 +1463,9 @@ type: | FIXED_SYM float_options field_options { $$=FIELD_TYPE_DECIMAL;} | ENUM {Lex->interval_list.empty();} '(' string_list ')' opt_binary - { - LEX *lex=Lex; - lex->interval=typelib(lex->interval_list); - $$=FIELD_TYPE_ENUM; - } + { $$=FIELD_TYPE_ENUM; } | SET { Lex->interval_list.empty();} '(' string_list ')' opt_binary - { - LEX *lex=Lex; - lex->interval=typelib(lex->interval_list); - $$=FIELD_TYPE_SET; - } + { $$=FIELD_TYPE_SET; } | LONG_SYM opt_binary { $$=FIELD_TYPE_MEDIUM_BLOB; } | SERIAL_SYM { @@ -1852,8 +1842,9 @@ alter: { THD *thd= YYTHD; LEX *lex= thd->lex; - lex->sql_command = SQLCOM_ALTER_TABLE; - lex->name=0; + lex->sql_command= SQLCOM_ALTER_TABLE; + lex->name= 0; + lex->duplicates= DUP_ERROR; if (!lex->select_lex.add_table_to_list(thd, $4, NULL, TL_OPTION_UPDATING)) YYABORT; @@ -1872,7 +1863,7 @@ alter: } alter_list {} - | ALTER DATABASE ident + | ALTER DATABASE ident_or_empty { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -1881,10 +1872,15 @@ alter: { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; - lex->name=$3.str; + lex->name= $3; }; +ident_or_empty: + /* empty */ { $$= 0; } + | ident { $$= $1.str; }; + + alter_list: | DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } | IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } @@ -1919,7 +1915,7 @@ alter_list_item: | MODIFY_SYM opt_column field_ident { LEX *lex=Lex; - lex->length=lex->dec=0; lex->type=0; lex->interval=0; + lex->length=lex->dec=0; lex->type=0; lex->default_value= lex->on_update_value= 0; lex->comment=0; lex->charset= NULL; @@ -1934,7 +1930,7 @@ alter_list_item: lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, lex->comment, - $3.str, lex->interval, lex->charset, + $3.str, &lex->interval_list, lex->charset, lex->uint_geom_type)) YYABORT; } @@ -2033,8 +2029,9 @@ opt_column: | COLUMN_SYM {}; opt_ignore: - /* empty */ { Lex->duplicates=DUP_ERROR; } - | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; }; + /* empty */ { Lex->ignore= 0;} + | IGNORE_SYM { Lex->ignore= 1;} + ; opt_restrict: /* empty */ {} @@ -2095,10 +2092,21 @@ slave: start: - START_SYM TRANSACTION_SYM { Lex->sql_command = SQLCOM_BEGIN;} - {} + START_SYM TRANSACTION_SYM start_transaction_opts + { + Lex->sql_command = SQLCOM_BEGIN; + Lex->start_transaction_opt= $3; + } ; +start_transaction_opts: + /*empty*/ { $$ = 0; } + | WITH CONSISTENT_SYM SNAPSHOT_SYM + { + $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; + } + ; + slave_thread_opts: { Lex->slave_thd_opt= 0; } slave_thread_opt_list @@ -2381,7 +2389,10 @@ select: select_init: SELECT_SYM select_init2 | - '(' SELECT_SYM select_part2 ')' + '(' select_paren ')' union_opt; + +select_paren: + SELECT_SYM select_part2 { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -2400,7 +2411,8 @@ select_init: if (sel->master_unit()->fake_select_lex) sel->master_unit()->global_parameters= sel->master_unit()->fake_select_lex; - } union_opt; + } + | '(' select_paren ')'; select_init2: select_part2 @@ -2447,10 +2459,11 @@ select_into: select_from: FROM join_table_list where_clause group_clause having_clause opt_order_clause opt_limit_clause procedure_clause - | FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM - clause, and DUAL is system table without fields. - Is "SELECT 1 FROM DUAL" any better than - "SELECT 1" ? Hmmm :) */ + | FROM DUAL_SYM opt_limit_clause + /* oracle compatibility: oracle always requires FROM clause, + and DUAL is system table without fields. + Is "SELECT 1 FROM DUAL" any better than "SELECT 1" ? + Hmmm :) */ ; select_options: @@ -2889,7 +2902,7 @@ simple_expr: | CONCAT '(' expr_list ')' { $$= new Item_func_concat(* $3); } | CONCAT_WS '(' expr ',' expr_list ')' - { $$= new Item_func_concat_ws($3, *$5); } + { $5->push_front($3); $$= new Item_func_concat_ws(*$5); } | CONVERT_TZ_SYM '(' expr ',' expr ',' expr ')' { Lex->time_zone_tables_used= &fake_time_zone_tables_list; @@ -3297,7 +3310,7 @@ opt_distinct: |DISTINCT { $$ = 1; }; opt_gconcat_separator: - /* empty */ { $$ = new (&YYTHD->mem_root) String(",",1,default_charset_info); } + /* empty */ { $$ = new (YYTHD->mem_root) String(",",1,default_charset_info); } |SEPARATOR_SYM text_string { $$ = $2; }; @@ -3395,8 +3408,7 @@ when_list2: }; join_table_list: - '(' join_table_list ')' { $$=$2; } - | join_table { $$=$1; } + join_table { $$=$1; } | join_table_list ',' join_table_list { $$=$3; } | join_table_list normal_join join_table_list { $$=$3; } | join_table_list STRAIGHT_JOIN join_table_list @@ -3473,7 +3485,7 @@ join_table: } | '{' ident join_table LEFT OUTER JOIN_SYM join_table ON expr '}' { add_join_on($7,$9); $7->outer_join|=JOIN_TYPE_LEFT; $$=$7; } - | '(' SELECT_SYM select_derived ')' opt_table_alias + | '(' select_derived union_opt ')' opt_table_alias { LEX *lex=Lex; SELECT_LEX_UNIT *unit= lex->current_select->master_unit(); @@ -3484,9 +3496,27 @@ join_table: (List<String> *)0))) YYABORT; - }; + } + | '(' join_table_list ')' { $$=$2; }; select_derived: + SELECT_SYM select_derived2 + | '(' select_derived ')' + { + LEX *lex= Lex; + SELECT_LEX * sel= lex->current_select; + if (sel->set_braces(1)) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + /* select in braces, can't contain global parameters */ + if (sel->master_unit()->fake_select_lex) + sel->master_unit()->global_parameters= + sel->master_unit()->fake_select_lex; + }; + +select_derived2: { LEX *lex= Lex; lex->derived_tables= 1; @@ -3508,7 +3538,7 @@ select_derived: { Select->parsing_place= NO_MATTER; } - opt_select_from union_opt + opt_select_from ; opt_outer: @@ -3551,15 +3581,15 @@ key_list_or_empty: key_usage_list2: key_usage_list2 ',' ident { Select-> - interval_list.push_back(new (&YYTHD->mem_root) String((const char*) $3.str, $3.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) $3.str, $3.length, system_charset_info)); } | ident { Select-> - interval_list.push_back(new (&YYTHD->mem_root) String((const char*) $1.str, $1.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) $1.str, $1.length, system_charset_info)); } | PRIMARY_SYM { Select-> - interval_list.push_back(new (&YYTHD->mem_root) String("PRIMARY", 7, + interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, system_charset_info)); }; using_list: @@ -3915,11 +3945,12 @@ do: DO_SYM { LEX *lex=Lex; lex->sql_command = SQLCOM_DO; - if (!(lex->insert_list = new List_item)) - YYABORT; + mysql_init_select(lex); + } + expr_list + { + Lex->insert_list= $3; } - values - {} ; /* @@ -3998,7 +4029,9 @@ insert: INSERT { LEX *lex= Lex; - lex->sql_command = SQLCOM_INSERT; + lex->sql_command= SQLCOM_INSERT; + lex->duplicates= DUP_ERROR; + mysql_init_select(lex); /* for subselects */ lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; @@ -4018,6 +4051,7 @@ replace: LEX *lex=Lex; lex->sql_command = SQLCOM_REPLACE; lex->duplicates= DUP_REPLACE; + mysql_init_select(lex); lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; } replace_lock_option insert2 @@ -4147,21 +4181,8 @@ expr_or_default: opt_insert_update: /* empty */ - | ON DUPLICATE_SYM - { - LEX *lex= Lex; - /* - For simplicity, let's forget about INSERT ... SELECT ... UPDATE - for a moment. - */ - if (lex->sql_command != SQLCOM_INSERT) - { - yyerror(ER(ER_SYNTAX_ERROR)); - YYABORT; - } - lex->duplicates= DUP_UPDATE; - } - KEY_SYM UPDATE_SYM update_list + | ON DUPLICATE_SYM { Lex->duplicates= DUP_UPDATE; } + KEY_SYM UPDATE_SYM insert_update_list ; /* Update rows in a table */ @@ -4173,6 +4194,7 @@ update: mysql_init_select(lex); lex->sql_command= SQLCOM_UPDATE; lex->lock_option= TL_UNLOCK; /* Will be set later */ + lex->duplicates= DUP_ERROR; } opt_low_priority opt_ignore join_table_list SET update_list @@ -4197,16 +4219,28 @@ update: ; update_list: - update_list ',' simple_ident equal expr_or_default + update_list ',' update_elem + | update_elem; + +update_elem: + simple_ident equal expr_or_default { - if (add_item_to_list(YYTHD, $3) || add_value_to_list(YYTHD, $5)) + if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3)) YYABORT; - } - | simple_ident equal expr_or_default - { - if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3)) - YYABORT; - }; + }; + +insert_update_list: + insert_update_list ',' insert_update_elem + | insert_update_elem; + +insert_update_elem: + simple_ident equal expr_or_default + { + LEX *lex= Lex; + if (lex->update_list.push_back($1) || + lex->value_list.push_back($3)) + YYABORT; + }; opt_low_priority: /* empty */ { $$= YYTHD->update_lock_default; } @@ -4219,7 +4253,9 @@ delete: { LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; + mysql_init_select(lex); lex->lock_option= lex->thd->update_lock_default; + lex->ignore= 0; lex->select_lex.init_order(); } opt_delete_options single_multi {} @@ -4276,7 +4312,7 @@ opt_delete_options: opt_delete_option: QUICK { Select->options|= OPTION_QUICK; } | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; } - | IGNORE_SYM { Lex->duplicates= DUP_IGNORE; }; + | IGNORE_SYM { Lex->ignore= 1; }; truncate: TRUNCATE_SYM opt_table_sym table_name @@ -4507,7 +4543,7 @@ opt_db: wild: /* empty */ | LIKE TEXT_STRING_sys - { Lex->wild= new (&YYTHD->mem_root) String($2.str, $2.length, + { Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length, system_charset_info); }; opt_full: @@ -4561,7 +4597,7 @@ opt_describe_column: /* empty */ {} | text_string { Lex->wild= $1; } | ident - { Lex->wild= new (&YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); }; + { Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); }; /* flush things */ @@ -4685,6 +4721,8 @@ load: LOAD DATA_SYM load_data_lock opt_local INFILE TEXT_STRING_sys lex->sql_command= SQLCOM_LOAD; lex->lock_option= $3; lex->local_file= $4; + lex->duplicates= DUP_ERROR; + lex->ignore= 0; if (!(lex->exchange= new sql_exchange($6.str,0))) YYABORT; lex->field_list.empty(); @@ -4722,7 +4760,7 @@ load_data_lock: opt_duplicate: /* empty */ { Lex->duplicates=DUP_ERROR; } | REPLACE { Lex->duplicates=DUP_REPLACE; } - | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; }; + | IGNORE_SYM { Lex->ignore= 1; }; opt_field_term: /* empty */ @@ -4802,7 +4840,7 @@ text_literal: text_string: TEXT_STRING_literal - { $$= new (&YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); } + { $$= new (YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); } | HEX_NUM { Item *tmp = new Item_varbinary($1.str,$1.length); @@ -5122,6 +5160,7 @@ keyword: | COMMIT_SYM {} | COMPRESSED_SYM {} | CONCURRENT {} + | CONSISTENT_SYM {} | CUBE_SYM {} | DATA_SYM {} | DATETIME {} @@ -5262,6 +5301,7 @@ keyword: | SHARE_SYM {} | SHUTDOWN {} | SLAVE {} + | SNAPSHOT_SYM {} | SOUNDS_SYM {} | SQL_CACHE_SYM {} | SQL_BUFFER_RESULT {} @@ -5306,6 +5346,7 @@ set: { LEX *lex=Lex; lex->sql_command= SQLCOM_SET_OPTION; + mysql_init_select(lex); lex->option_type=OPT_SESSION; lex->var_list.empty(); lex->one_shot_set= 0; @@ -5612,7 +5653,7 @@ revoke_command: grant_privileges ON opt_table FROM user_list {} | - ALL PRIVILEGES ',' GRANT OPTION FROM user_list + ALL opt_privileges ',' GRANT OPTION FROM user_list { Lex->sql_command = SQLCOM_REVOKE_ALL; } @@ -5638,10 +5679,14 @@ grant: grant_privileges: grant_privilege_list {} - | ALL PRIVILEGES { Lex->grant = GLOBAL_ACLS;} - | ALL { Lex->grant = GLOBAL_ACLS;} + | ALL opt_privileges { Lex->grant = GLOBAL_ACLS;} ; +opt_privileges: + /* empty */ + | PRIVILEGES + ; + grant_privilege_list: grant_privilege | grant_privilege_list ',' grant_privilege; @@ -5821,7 +5866,7 @@ column_list: column_list_id: ident { - String *new_str = new (&YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); + String *new_str = new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); List_iterator <LEX_COLUMN> iter(Lex->columns); class LEX_COLUMN *point; LEX *lex=Lex; @@ -5888,7 +5933,7 @@ grant_option: ; begin: - BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN;} opt_work {} + BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN; Lex->start_transaction_opt= 0;} opt_work {} ; opt_work: diff --git a/sql/strfunc.cc b/sql/strfunc.cc index b5255e9be06..81aca092cec 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -53,8 +53,22 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, { const char *pos= start; uint var_len; + int mblen= 1; - for (; pos != end && *pos != field_separator; pos++) ; + if (cs && cs->mbminlen > 1) + { + for ( ; pos < end; pos+= mblen) + { + my_wc_t wc; + if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) pos, + (const uchar *) end)) < 1) + mblen= 1; // Not to hang on a wrong multibyte sequence + if (wc == (my_wc_t) field_separator) + break; + } + } + else + for (; pos != end && *pos != field_separator; pos++) ; var_len= (uint) (pos - start); uint find= cs ? find_type2(lib, start, var_len, cs) : find_type(lib, start, var_len, (bool) 0); @@ -66,9 +80,9 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, } else found|= ((longlong) 1 << (find - 1)); - if (pos == end) + if (pos >= end) break; - start= pos + 1; + start= pos + mblen; } } return found; @@ -133,7 +147,7 @@ uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match) uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) { - int find,pos,findpos; + int find,pos; const char *j; DBUG_ENTER("find_type2"); DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x,typelib)); @@ -143,7 +157,7 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) DBUG_PRINT("exit",("no count")); DBUG_RETURN(0); } - LINT_INIT(findpos); + for (find=0, pos=0 ; (j=typelib->type_names[pos]) ; pos++) { if (!my_strnncoll(cs, (const uchar*) x, length, @@ -156,6 +170,43 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) /* + Un-hex all elements in a typelib + + SYNOPSIS + unhex_type2() + interval TYPELIB (struct of pointer to values + lengths + count) + + NOTES + + RETURN + N/A +*/ + +void unhex_type2(TYPELIB *interval) +{ + for (uint pos= 0; pos < interval->count; pos++) + { + char *from, *to; + for (from= to= (char*) interval->type_names[pos]; *from; ) + { + /* + Note, hexchar_to_int(*from++) doesn't work + one some compilers, e.g. IRIX. Looks like a compiler + bug in inline functions in combination with arguments + that have a side effect. So, let's use from[0] and from[1] + and increment 'from' by two later. + */ + + *to++= (char) (hexchar_to_int(from[0]) << 4) + + hexchar_to_int(from[1]); + from+= 2; + } + interval->type_lengths[pos] /= 2; + } +} + + +/* Check if the first word in a string is one of the ones in TYPELIB SYNOPSIS diff --git a/sql/structs.h b/sql/structs.h index c30d85f59cb..846b3400fab 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -89,7 +89,12 @@ typedef struct st_key { enum ha_key_alg algorithm; KEY_PART_INFO *key_part; char *name; /* Name of key */ - ulong *rec_per_key; /* Key part distribution */ + /* + Array of AVG(#records with the same field value) for 1st ... Nth key part. + 0 means 'not known'. + For temporary heap tables this member is NULL. + */ + ulong *rec_per_key; union { int bdb_return_if_eq; } handler; diff --git a/sql/table.cc b/sql/table.cc index 3ae3d668407..064d7f1afc1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -24,7 +24,8 @@ /* Functions defined in this file */ -static void frm_error(int error,TABLE *form,const char *name,int errortype); +static void frm_error(int error,TABLE *form,const char *name, + int errortype, int errarg); static void fix_type_pointers(const char ***array, TYPELIB *point_to_type, uint types, char **names); static uint find_field(TABLE *form,uint start,uint length); @@ -57,6 +58,7 @@ static byte* get_field_name(Field **buff,uint *length, 2 Error (see frm_error) 3 Wrong data in .frm file 4 Error (see frm_error) + 5 Error (see frm_error: charset unavailable) */ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, @@ -64,7 +66,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, { reg1 uint i; reg2 uchar *strpos; - int j,error; + int j,error, errarg= 0; uint rec_buff_length,n_length,int_length,records,key_parts,keys, interval_count,interval_parts,read_length,db_create_options; uint key_info_length, com_length; @@ -81,6 +83,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, uchar *null_pos; uint null_bit, new_frm_ver, field_pack_length; SQL_CRYPT *crypted=0; + MEM_ROOT **root_ptr, *old_root; DBUG_ENTER("openfrm"); DBUG_PRINT("enter",("name: '%s' form: %lx",name,outparam)); @@ -91,15 +94,16 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, error=1; init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0); - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC,&outparam->mem_root); + root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); + old_root= *root_ptr; + *root_ptr= &outparam->mem_root; outparam->real_name=strdup_root(&outparam->mem_root, - name+dirname_length(name)); - *fn_ext(outparam->real_name)='\0'; // Remove extension + name+dirname_length(name)); outparam->table_name=my_strdup(alias,MYF(MY_WME)); if (!outparam->real_name || !outparam->table_name) goto err_end; + *fn_ext(outparam->real_name)='\0'; // Remove extension if ((file=my_open(fn_format(index_file,name,"",reg_ext,MY_UNPACK_FILENAME), O_RDONLY | O_SHARE, @@ -141,8 +145,19 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, outparam->table_charset=get_charset((uint) head[38],MYF(0)); null_field_first=1; } - if (!outparam->table_charset) /* unknown charset in head[38] or pre-3.23 frm */ + if (!outparam->table_charset) + { + /* unknown charset in head[38] or pre-3.23 frm */ + if (use_mb(default_charset_info)) + { + /* Warn that we may be changing the size of character columns */ + sql_print_warning("'%s' had no or invalid character set, " + "and default character set is multi-byte, " + "so character column sizes may have changed", + name); + } outparam->table_charset=default_charset_info; + } outparam->db_record_offset=1; if (db_create_options & HA_OPTION_LONG_BLOB_PTR) outparam->blob_ptr_size=portable_sizeof_char_ptr; @@ -180,7 +195,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, goto err_not_open; /* purecov: inspected */ bzero((char*) keyinfo,n_length); outparam->key_info=keyinfo; - outparam->max_key_length= outparam->total_key_length= 0; key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys); strpos=disk_buff+6; @@ -236,11 +250,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } key_part->store_length=key_part->length; } - set_if_bigger(outparam->max_key_length,keyinfo->key_length+ - keyinfo->key_parts); - outparam->total_key_length+= keyinfo->key_length; - if (keyinfo->flags & HA_NOSAME) - set_if_bigger(outparam->max_unique_length,keyinfo->key_length); } keynames=(char*) key_part; strpos+= (strmov(keynames, (char *) strpos) - keynames)+1; @@ -251,9 +260,9 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, #ifdef HAVE_CRYPTED_FRM else if (*(head+26) == 2) { - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + *root_ptr= old_root crypted=get_crypt_for_frm(); - my_pthread_setspecific_ptr(THR_MALLOC,&outparam->mem_root); + *root_ptr= &outparam->mem_root; outparam->crypted=1; } #endif @@ -301,12 +310,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, VOID(my_seek(file,pos,MY_SEEK_SET,MYF(0))); if (my_read(file,(byte*) head,288,MYF(MY_NABP))) goto err_not_open; +#ifdef HAVE_CRYPTED_FRM if (crypted) { crypted->decode((char*) head+256,288-256); if (sint2korr(head+284) != 0) // Should be 0 goto err_not_open; // Wrong password } +#endif outparam->fields= uint2korr(head+258); pos=uint2korr(head+260); /* Length of all screens */ @@ -335,12 +346,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, pos+ (uint) (n_length+int_length+com_length)); if (read_string(file,(gptr*) &disk_buff,read_length)) goto err_not_open; /* purecov: inspected */ +#ifdef HAVE_CRYPTED_FRM if (crypted) { crypted->decode((char*) disk_buff,read_length); delete crypted; crypted=0; } +#endif strpos= disk_buff+pos; outparam->intervals= (TYPELIB*) (field_ptr+outparam->fields+1); @@ -434,10 +447,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } else { - if (!strpos[14]) - charset= &my_charset_bin; - else if (!(charset=get_charset((uint) strpos[14], MYF(0)))) - charset= outparam->table_charset; + if (!strpos[14]) + charset= &my_charset_bin; + else if (!(charset=get_charset((uint) strpos[14], MYF(0)))) + { + error= 5; // Unknown or unavailable charset + errarg= (int) strpos[14]; + goto err_not_open; + } } if (!comment_length) { @@ -461,9 +478,36 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, /* old frm file */ field_type= (enum_field_types) f_packtype(pack_flag); - charset=f_is_binary(pack_flag) ? &my_charset_bin : outparam->table_charset; + if (f_is_binary(pack_flag)) + { + /* + Try to choose the best 4.1 type: + - for 4.0 "CHAR(N) BINARY" or "VARCHAR(N) BINARY" + try to find a binary collation for character set. + - for other types (e.g. BLOB) just use my_charset_bin. + */ + if (!f_is_blob(pack_flag)) + { + // 3.23 or 4.0 string + if (!(charset= get_charset_by_csname(outparam->table_charset->csname, + MY_CS_BINSORT, MYF(0)))) + charset= &my_charset_bin; + } + else + charset= &my_charset_bin; + } + else + charset= outparam->table_charset; bzero((char*) &comment, sizeof(comment)); } + + if (interval_nr && charset->mbminlen > 1) + { + /* Unescape UCS2 intervals from HEX notation */ + TYPELIB *interval= outparam->intervals + interval_nr - 1; + unhex_type2(interval); + } + *field_ptr=reg_field= make_field(record+recpos, (uint32) field_length, @@ -635,6 +679,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } } keyinfo->usable_key_parts=usable_parts; // Filesort + + set_if_bigger(outparam->max_key_length,keyinfo->key_length+ + keyinfo->key_parts); + outparam->total_key_length+= keyinfo->key_length; + if (keyinfo->flags & HA_NOSAME) + set_if_bigger(outparam->max_unique_length,keyinfo->key_length); } if (primary_key < MAX_KEY && (outparam->keys_in_use.is_set(primary_key))) @@ -736,7 +786,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } outparam->db_low_byte_first=outparam->file->low_byte_first(); - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + *root_ptr= old_root; opened_tables++; #ifndef DBUG_OFF if (use_hash) @@ -751,8 +801,8 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, err_end: /* Here when no file */ delete crypted; - my_pthread_setspecific_ptr(THR_MALLOC,old_root); - frm_error(error,outparam,name,ME_ERROR+ME_WAITTANG); + *root_ptr= old_root; + frm_error(error, outparam, name, ME_ERROR + ME_WAITTANG, errarg); delete outparam->file; outparam->file=0; // For easyer errorchecking outparam->db_stat=0; @@ -937,7 +987,8 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames, /* error message when opening a form file */ -static void frm_error(int error, TABLE *form, const char *name, myf errortype) +static void frm_error(int error, TABLE *form, const char *name, + myf errortype, int errarg) { int err_no; char buff[FN_REFLEN]; @@ -968,6 +1019,20 @@ static void frm_error(int error, TABLE *form, const char *name, myf errortype) fn_format(buff,form->real_name,form_dev,datext,2),my_errno); break; } + case 5: + { + const char *csname= get_charset_name((uint) errarg); + char tmp[10]; + if (!csname || csname[0] =='?') + { + my_snprintf(tmp, sizeof(tmp), "#%d", errarg); + csname= tmp; + } + my_printf_error(ER_UNKNOWN_COLLATION, + "Unknown collation '%s' in table '%-.64s' definition", + MYF(0), csname, form->real_name); + break; + } default: /* Better wrong error than none */ case 4: my_error(ER_NOT_FORM_FILE,errortype, @@ -1403,7 +1468,7 @@ bool check_column_name(const char *name) { const char *start= name; bool last_char_is_space= TRUE; - + while (*name) { #if defined(USE_MB) && defined(USE_MB_IDENT) diff --git a/sql/table.h b/sql/table.h index 2eb854f553d..eed9969dac8 100644 --- a/sql/table.h +++ b/sql/table.h @@ -131,8 +131,14 @@ struct st_table { int current_lock; /* Type of lock on table */ enum tmp_table_type tmp_table; my_bool copy_blobs; /* copy_blobs when storing */ - my_bool null_row; /* All columns are null */ - my_bool maybe_null,outer_join; /* Used with OUTER JOIN */ + /* + Used in outer joins: if true, all columns are considered to have NULL + values, including columns declared as "not null". + */ + my_bool null_row; + /* 0 or JOIN_TYPE_{LEFT|RIGHT}, same as TABLE_LIST::outer_join */ + my_bool outer_join; + my_bool maybe_null; /* true if (outer_join != 0) */ my_bool force_index; my_bool distinct,const_table,no_rows; my_bool key_read; diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index fa678ec7de2..3a9ca397bba 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -38,7 +38,7 @@ void init_sql_alloc(MEM_ROOT *mem_root, uint block_size, uint pre_alloc) gptr sql_alloc(uint Size) { - MEM_ROOT *root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); + MEM_ROOT *root= *my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC); char *ptr= (char*) alloc_root(root,Size); return ptr; } @@ -108,8 +108,11 @@ char *sql_strmake_with_convert(const char *str, uint32 arg_length, memcpy(pos, str, new_length); } else + { + uint dummy_errors; new_length= copy_and_convert((char*) pos, new_length, to_cs, str, - arg_length, from_cs); + arg_length, from_cs, &dummy_errors); + } pos[new_length]= 0; *result_length= new_length; return pos; diff --git a/sql/tztime.cc b/sql/tztime.cc index c2143b0d5dd..c45271966f9 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1773,7 +1773,13 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 0, HA_READ_KEY_EXACT)) { - sql_print_error("Can't find description of time zone."); +#ifdef EXTRA_DEBUG + /* + Most probably user has mistyped time zone name, so no need to bark here + unless we need it for debugging. + */ + sql_print_error("Can't find description of time zone '%s'", tz_name_buff); +#endif goto end; } @@ -1794,7 +1800,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 0, HA_READ_KEY_EXACT)) { - sql_print_error("Can't find description of time zone."); + sql_print_error("Can't find description of time zone '%u'", tzid); goto end; } @@ -1825,7 +1831,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) { ttid= (uint)table->field[1]->val_int(); - if (ttid > TZ_MAX_TYPES) + if (ttid >= TZ_MAX_TYPES) { sql_print_error("Error while loading time zone description from " "mysql.time_zone_transition_type table: too big " diff --git a/sql/tztime.h b/sql/tztime.h index 9f969639bd0..2214c1b29d6 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -66,8 +66,8 @@ extern void my_tz_free(); /* - Check if we have pointer to the beggining of list of implictly used - time zone tables and fast-forward to its end. + Check if we have pointer to the begining of list of implicitly used time + zone tables, set SELECT_ACL for them and fast-forward to its end. SYNOPSIS my_tz_check_n_skip_implicit_tables() @@ -87,6 +87,8 @@ inline bool my_tz_check_n_skip_implicit_tables(TABLE_LIST **table, { if (*table == tz_tables) { + for (int i= 0; i < 4; i++) + (*table)[i].grant.privilege= SELECT_ACL; (*table)+= 3; return TRUE; } diff --git a/sql/udf_example.cc b/sql/udf_example.cc index 7e2ee9113b2..50de0f187fe 100644 --- a/sql/udf_example.cc +++ b/sql/udf_example.cc @@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message) return 1; } bzero(initid->ptr,sizeof(longlong)); - // Fool MySQL to think that this function is a constant - // This will ensure that MySQL only evalutes the function - // when the rows are sent to the client and not before any ORDER BY - // clauses + /* + Fool MySQL to think that this function is a constant + This will ensure that MySQL only evalutes the function + when the rows are sent to the client and not before any ORDER BY + clauses + */ initid->const_item=1; return 0; } @@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null, ulonglong val=0; if (args->arg_count) val= *((longlong*) args->args[0]); - return ++ *((longlong*) initid->ptr) + val; + return ++*((longlong*) initid->ptr) + val; } + /**************************************************************************** ** Some functions that handles IP and hostname conversions ** The orignal function was from Zeev Suraski. diff --git a/sql/unireg.cc b/sql/unireg.cc index c82fcc4abef..a550b06a466 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -174,6 +174,17 @@ bool mysql_create_frm(THD *thd, my_string file_name, goto err2; if (my_close(file,MYF(MY_WME))) goto err3; + + { + /* Unescape all UCS2 intervals: were escaped in pack_headers */ + List_iterator<create_field> it(create_fields); + create_field *field; + while ((field=it++)) + { + if (field->interval && field->charset->mbminlen > 1) + unhex_type2(field->interval); + } + } DBUG_RETURN(0); err: @@ -423,6 +434,28 @@ static bool pack_header(uchar *forminfo, enum db_type table_type, if (field->interval) { uint old_int_count=int_count; + + if (field->charset->mbminlen > 1) + { + /* Escape UCS2 intervals using HEX notation */ + for (uint pos= 0; pos < field->interval->count; pos++) + { + char *dst; + uint length= field->interval->type_lengths[pos], hex_length; + const char *src= field->interval->type_names[pos]; + const char *srcend= src + length; + hex_length= length * 2; + field->interval->type_lengths[pos]= hex_length; + field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1); + for ( ; src < srcend; src++) + { + *dst++= _dig_vec_upper[((uchar) *src) >> 4]; + *dst++= _dig_vec_upper[((uchar) *src) & 15]; + } + *dst= '\0'; + } + } + field->interval_id=get_interval_id(&int_count,create_fields,field); if (old_int_count != int_count) { diff --git a/sql/unireg.h b/sql/unireg.h index 4ab2ba26b15..70df9a89c8f 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -72,6 +72,8 @@ #define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3)) #define OUTER_REF_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-2)) #define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1)) +#define PSEUDO_TABLE_BITS (PARAM_TABLE_BIT | OUTER_REF_TABLE_BIT | \ + RAND_TABLE_BIT) #define MAX_FIELDS 4096 /* Limit in the .frm file */ #define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD) diff --git a/strings/Makefile.am b/strings/Makefile.am index d17a4f598a6..83f935a3fd2 100644 --- a/strings/Makefile.am +++ b/strings/Makefile.am @@ -40,7 +40,6 @@ endif libmystrings_a_SOURCES = $(ASRCS) $(CSRCS) noinst_PROGRAMS = conf_to_src -DISTCLEANFILES = ctype_autoconf.c # Default charset definitions EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-win1250ch.c \ ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \ diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 8345c53202c..270b02212af 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -271,7 +271,7 @@ static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)), if (!res && a_length != b_length) { const uchar *end; - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -286,7 +286,7 @@ static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return res; @@ -298,6 +298,7 @@ static int my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)), const uchar * src, uint srclen) { uint16 e; + uint dstlen= len; len = srclen; while (len--) @@ -312,7 +313,9 @@ static int my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)), } else *dest++ = sort_order_big5[(uchar) *src++]; } - return srclen; + if (dstlen > srclen) + bfill(dest, dstlen - srclen, ' '); + return dstlen; } #if 0 diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 7d17f62c8d0..425985e6bc1 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -67,6 +67,13 @@ static uchar bin_char_array[] = }; +static my_bool +my_coll_init_8bit_bin(CHARSET_INFO *cs, + void *(*alloc)(uint) __attribute__((unused))) +{ + cs->max_sort_char=255; + return FALSE; +} static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)), const uchar *s, uint slen, @@ -157,7 +164,7 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -172,7 +179,7 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; @@ -341,13 +348,27 @@ static int my_wildcmp_bin(CHARSET_INFO *cs, static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)), - uchar * dest, uint len, - const uchar *src, - uint srclen __attribute__((unused))) + uchar * dest, uint dstlen, + const uchar *src, uint srclen) +{ + if (dest != src) + memcpy(dest, src, min(dstlen,srclen)); + if (dstlen > srclen) + bfill(dest + srclen, dstlen - srclen, 0); + return dstlen; +} + + +static +int my_strnxfrm_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), + uchar * dest, uint dstlen, + const uchar *src, uint srclen) { if (dest != src) - memcpy(dest,src,len= min(len,srclen)); - return len; + memcpy(dest, src, min(dstlen,srclen)); + if (dstlen > srclen) + bfill(dest + srclen, dstlen - srclen, ' '); + return dstlen; } @@ -414,10 +435,10 @@ skip: MY_COLLATION_HANDLER my_collation_8bit_bin_handler = { - NULL, /* init */ + my_coll_init_8bit_bin, my_strnncoll_8bit_bin, my_strnncollsp_8bit_bin, - my_strnxfrm_bin, + my_strnxfrm_8bit_bin, my_like_range_simple, my_wildcmp_bin, my_strcasecmp_bin, diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 6f9e9f74d35..5725e81b15e 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -296,16 +296,18 @@ static int my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)), int value; const uchar * p, * store; int pass = 0; - int totlen = 0; + uint totlen = 0; p = src; store = src; do { NEXT_CMP_VALUE(src, p, store, pass, value, (int)srclen); - ADD_TO_RESULT(dest, (int)len, totlen, value); + ADD_TO_RESULT(dest, len, totlen, value); } while (value); - return totlen; + if (len > totlen) + bfill(dest + totlen, len - totlen, ' '); + return len; } #undef IS_END @@ -589,12 +591,12 @@ static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler = CHARSET_INFO my_charset_latin2_czech_ci = { - 2,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ - "latin2", /* cs name */ - "latin2_czech_cs", /* name */ - "", /* comment */ - NULL, /* tailoring */ + 2,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ + "latin2", /* cs name */ + "latin2_czech_cs", /* name */ + "", /* comment */ + NULL, /* tailoring */ ctype_czech, to_lower_czech, to_upper_czech, diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 0be56e8d946..9daa9f90f3c 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -2632,7 +2632,7 @@ static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)), if (!res && a_length != b_length) { const uchar *end; - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -2647,7 +2647,7 @@ static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return res; @@ -2659,6 +2659,7 @@ static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)), const uchar * src, uint srclen) { uint16 e; + uint dstlen= len; len = srclen; while (len--) @@ -2673,7 +2674,9 @@ static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)), } else *dest++ = sort_order_gbk[(uchar) *src++]; } - return srclen; + if (dstlen > srclen) + bfill(dest, dstlen - srclen, ' '); + return dstlen; } diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 5f1850b7772..4ab101add5b 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -611,7 +611,7 @@ static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)), if (a != a_end || b != b_end) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -626,7 +626,7 @@ static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)), for ( ; a < a_end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; @@ -637,7 +637,6 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)), uchar * dest, uint len, const uchar * src, uint srclen) { - const uchar *dest_orig = dest; const uchar *de = dest + len; const uchar *se = src + srclen; for ( ; src < se && dest < de ; src++) @@ -647,7 +646,9 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)), if ((chr=combo2map[*src]) && dest < de) *dest++=chr; } - return (int) (dest - dest_orig); + if (dest < de) + bfill(dest, de - dest, ' '); + return (int) len; } diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 7d81766c4cb..6cf48291c91 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -274,7 +274,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, my_wc_t wc; int mblen; - if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <0) + if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0) break; b+= mblen; pos--; @@ -389,7 +389,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -404,7 +404,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; @@ -412,13 +412,14 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), static int my_strnxfrm_mb_bin(CHARSET_INFO *cs __attribute__((unused)), - uchar * dest, uint len, - const uchar *src, - uint srclen __attribute__((unused))) + uchar * dest, uint dstlen, + const uchar *src, uint srclen) { if (dest != src) - memcpy(dest,src,len= min(len,srclen)); - return len; + memcpy(dest, src, min(dstlen, srclen)); + if (dstlen > srclen) + bfill(dest + srclen, dstlen - srclen, ' '); + return dstlen; } @@ -443,6 +444,37 @@ static void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), } } + +/* + Write max key: create a buffer with multibyte + representation of the max_sort_char character, + and copy it into max_str in a loop. +*/ +static void pad_max_char(CHARSET_INFO *cs, char *str, char *end) +{ + char buf[10]; + char buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf, + (uchar*) buf + sizeof(buf)); + DBUG_ASSERT(buflen > 0); + do + { + if ((str + buflen) < end) + { + /* Enough space for the characer */ + memcpy(str, buf, buflen); + str+= buflen; + } + else + { + /* + There is no space for whole multibyte + character, then add trailing spaces. + */ + *str++= ' '; + } + } while (str < end); +} + /* ** Calculate min_str and max_str that ranges a LIKE string. ** Arguments: @@ -467,10 +499,15 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, char *min_str,char *max_str, uint *min_length,uint *max_length) { - const char *end=ptr+ptr_length; - char *min_org=min_str; - char *min_end=min_str+res_length; - char *max_end=max_str+res_length; + const char *end; + char *min_org= min_str; + char *min_end= min_str + res_length; + char *max_end= max_str + res_length; + uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen); + + if (charlen < ptr_length) + ptr_length= charlen; + end= ptr + ptr_length; for (; ptr != end && min_str != min_end ; ptr++) { @@ -482,16 +519,14 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, } if (*ptr == w_one || *ptr == w_many) /* '_' and '%' in SQL */ { - char buf[10]; - uint buflen; - uint charlen= my_charpos(cs, min_org, min_str, res_length/cs->mbmaxlen); + charlen= my_charpos(cs, min_org, min_str, res_length/cs->mbmaxlen); if (charlen < (uint) (min_str - min_org)) min_str= min_org + charlen; /* Write min key */ *min_length= (uint) (min_str - min_org); - *max_length=res_length; + *max_length= res_length; do { *min_str++= (char) cs->min_sort_char; @@ -502,27 +537,7 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, representation of the max_sort_char character, and copy it into max_str in a loop. */ - buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf, - (uchar*) buf + sizeof(buf)); - DBUG_ASSERT(buflen > 0); - do - { - if ((max_str + buflen) <= max_end) - { - /* Enough space for max characer */ - memcpy(max_str, buf, buflen); - max_str+= buflen; - } - else - { - /* - There is no space for whole multibyte - character, then add trailing spaces. - */ - - *max_str++= ' '; - } - } while (max_str != max_end); + pad_max_char(cs, max_str, max_end); return 0; } *min_str++= *max_str++ = *ptr; @@ -530,7 +545,8 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, *min_length= *max_length = (uint) (min_str - min_org); while (min_str != min_end) - *min_str++ = *max_str++ = ' '; /* Because if key compression */ + *min_str++= ' '; /* Because if key compression */ + pad_max_char(cs, max_str, max_end); return 0; } diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index a019665a235..080e0b780b7 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -21,27 +21,68 @@ #include "stdarg.h" +/* + Converts a string into its sort key. + + SYNOPSIS + my_strnxfrm_xxx() + + IMPLEMENTATION + + The my_strxfrm_xxx() function transforms a string pointed to by + 'src' with length 'srclen' according to the charset+collation + pair 'cs' and copies the result key into 'dest'. + + Comparing two strings using memcmp() after my_strnxfrm_xxx() + is equal to comparing two original strings with my_strnncollsp_xxx(). + + Not more than 'dstlen' bytes are written into 'dst'. + To garantee that the whole string is transformed, 'dstlen' must be + at least srclen*cs->strnxfrm_multiply bytes long. Otherwise, + consequent memcmp() may return a non-accurate result. + + If the source string is too short to fill whole 'dstlen' bytes, + then the 'dest' string is padded up to 'dstlen', ensuring that: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + my_strnxfrm_simple() is implemented for 8bit charsets and + simple collations with one-to-one string->key transformation. + + See also implementations for various charsets/collations in + other ctype-xxx.c files. + + RETURN + + Target len 'dstlen'. + +*/ + int my_strnxfrm_simple(CHARSET_INFO * cs, uchar *dest, uint len, const uchar *src, uint srclen) { uchar *map= cs->sort_order; + uint dstlen= len; set_if_smaller(len, srclen); if (dest != src) { const uchar *end; for ( end=src+len; src < end ; ) *dest++= map[*src++]; - return len; } else { const uchar *end; for ( end=dest+len; dest < end ; dest++) *dest= (char) map[(uchar) *dest]; - return len; } + if (dstlen > len) + bfill(dest, dstlen - len, ' '); + return dstlen; } int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen, @@ -102,7 +143,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -112,12 +153,12 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, /* put shorter key in s */ a_length= b_length; a= b; - swap= -1; /* swap sign of result */ + swap= -1; /* swap sign of result */ } for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; @@ -477,7 +518,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)), register unsigned int cutlim; register ulonglong i; register const char *s, *e; - register unsigned char c; const char *save; int overflow; @@ -540,8 +580,9 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)), overflow = 0; i = 0; - for (c = *s; s != e; c = *++s) + for ( ; s != e; s++) { + register unsigned char c= *s; if (c>='0' && c<='9') c -= '0'; else if (c>='A' && c<='Z') @@ -600,7 +641,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs, register unsigned int cutlim; register ulonglong i; register const char *s, *e; - register unsigned char c; const char *save; int overflow; @@ -663,8 +703,10 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs, overflow = 0; i = 0; - for (c = *s; s != e; c = *++s) + for ( ; s != e; s++) { + register unsigned char c= *s; + if (c>='0' && c<='9') c -= '0'; else if (c>='A' && c<='Z') @@ -732,31 +774,10 @@ double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)), char *str, uint length, char **end, int *err) { - char end_char; - double result; - - errno= 0; /* Safety */ - - /* - The following define is to avoid warnings from valgrind as str[length] - may not be defined (which is not fatal in real life) - */ - -#ifdef HAVE_purify if (length == INT_MAX32) -#else - if (length == INT_MAX32 || str[length] == 0) -#endif - result= my_strtod(str, end); - else - { - end_char= str[length]; - str[length]= 0; - result= my_strtod(str, end); - str[length]= end_char; /* Restore end char */ - } - *err= errno; - return result; + length= 65535; /* Should be big enough */ + *end= str + length; + return my_strtod(str, end, err); } diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 4176ff2e538..0cb30a9b6ee 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -251,7 +251,7 @@ static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)), int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length); if (!res && (a != a_end || b != b_end)) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -266,7 +266,7 @@ static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)), for (; a < a_end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return res; @@ -291,7 +291,9 @@ static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)), else *dest++ = sort_order_sjis[(uchar)*src++]; } - return srclen; + if (len > srclen) + bfill(dest, len - srclen, ' '); + return len; } @@ -4581,14 +4583,19 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), */ if (((int8)b[0]) >= 0) { - /* Single byte character */ - b+= 1; + /* Single byte ascii character */ + b++; } else if (issjishead((uchar)*b) && (e-b)>1 && issjistail((uchar)b[1])) { /* Double byte character */ b+= 2; } + else if (((uchar)*b) >= 0xA1 && ((uchar)*b) <= 0xDF) + { + /* Half width kana */ + b++; + } else { /* Wrong byte sequence */ diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index a2ba4783591..6a6c55d214e 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -541,7 +541,7 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)), tc1= buf; if ((len1 + len2 +2) > (int) sizeof(buf)) - tc1= (uchar*) malloc(len1+len2); + tc1= (uchar*) malloc(len1+len2+2); tc2= tc1 + len1+1; memcpy((char*) tc1, (char*) s1, len1); tc1[len1]= 0; /* if length(s1)> len1, need to put 'end of string' */ @@ -562,17 +562,13 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), const uchar *b0, uint b_length) { uchar buf[80] ; - uchar *end, *a, *b; + uchar *end, *a, *b, *alloced= NULL; uint length; int res= 0; - int alloced= 0; a= buf; if ((a_length + b_length +2) > (int) sizeof(buf)) - { - a= (uchar*) malloc(a_length+b_length); - alloced= 1; - } + alloced= a= (uchar*) malloc(a_length+b_length+2); b= a + a_length+1; memcpy((char*) a, (char*) a0, a_length); @@ -593,7 +589,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -609,7 +605,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), { if (*a != ' ') { - res= ((int) *a - (int) ' ') ^ swap; + res= (*a < ' ') ? -swap : swap; goto ret; } } @@ -618,7 +614,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), ret: if (alloced) - free(a); + free(alloced); return res; } @@ -635,9 +631,13 @@ int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)), uchar * dest, uint len, const uchar * src, uint srclen) { + uint dstlen= len; len= (uint) (strmake((char*) dest, (char*) src, min(len, srclen)) - (char*) dest); - return (int) thai2sortable(dest, len); + len= thai2sortable(dest, len); + if (dstlen > len) + bfill(dest + len, dstlen - len, ' '); + return dstlen; } diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 91af7af0c54..7678ee05120 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -36,6 +36,7 @@ #include "m_string.h" #include "m_ctype.h" +#ifdef HAVE_UCA_COLLATIONS #define MY_UCA_NPAGES 256 #define MY_UCA_NCHARS 256 @@ -7214,8 +7215,7 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs, uchar *dst, uint dstlen, const uchar *src, uint srclen) { - uchar *de = dst + dstlen; - const uchar *dst_orig = dst; + uchar *de = dst + (dstlen & (uint) ~1); /* add even length for easier code */ int s_res; my_uca_scanner scanner; scanner_handler->init(&scanner, cs, src, srclen); @@ -7226,8 +7226,17 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs, dst[1]= s_res & 0xFF; dst+= 2; } - for ( ; dst < de; *dst++='\0'); - return dst - dst_orig; + s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]]; + while (dst < de) + { + dst[0]= s_res >> 8; + dst[1]= s_res & 0xFF; + dst+= 2; + } + if (dstlen & 1) /* if odd number then fill the last char */ + *dst= '\0'; + + return dstlen; } @@ -7288,6 +7297,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs, { while (1) { + my_bool escaped= 0; if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, (const uchar*)wildend)) <= 0) return 1; @@ -7305,6 +7315,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs, (const uchar*)wildend)) <= 0) return 1; wildstr+= scan; + escaped= 1; } if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, @@ -7312,7 +7323,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs, return 1; str+= scan; - if (w_wc == (my_wc_t)w_one) + if (!escaped && w_wc == (my_wc_t)w_one) { result= 1; /* Found an anchor char */ } @@ -8567,7 +8578,7 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8594,7 +8605,7 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8621,7 +8632,7 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8648,7 +8659,7 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8675,7 +8686,7 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8702,7 +8713,7 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8729,7 +8740,7 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8756,7 +8767,7 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8783,7 +8794,7 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8810,7 +8821,7 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8838,7 +8849,7 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8865,7 +8876,7 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8892,7 +8903,7 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8919,7 +8930,7 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8946,7 +8957,7 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8973,11 +8984,13 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, &my_collation_any_uca_handler }; -#endif +#endif /* HAVE_CHARSET_utf8 */ + +#endif /* HAVE_UCA_COLLATIONS */ diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 851c2044f47..9c67d1b7846 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -218,11 +218,78 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs, return t_is_prefix ? t-te : ((se-s) - (te-t)); } -static int my_strnncollsp_ucs2(CHARSET_INFO *cs, - const uchar *s, uint slen, +/* + Compare strings, discarding end space + + SYNOPSIS + my_strnncollsp_ucs2() + cs character set handler + a First string to compare + a_length Length of 'a' + b Second string to compare + b_length Length of 'b' + + IMPLEMENTATION + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + RETURN + < 0 a < b + = 0 a == b + > 0 a > b +*/ + +static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s, uint slen, const uchar *t, uint tlen) { - return my_strnncoll_ucs2(cs,s,slen,t,tlen,0); + const uchar *se, *te; + uint minlen; + + /* extra safety to make sure the lengths are even numbers */ + slen= (slen >> 1) << 1; + tlen= (tlen >> 1) << 1; + + se= s + slen; + te= t + tlen; + + for (minlen= min(slen, tlen); minlen; minlen-= 2) + { + int s_wc = uni_plane[s[0]] ? (int) uni_plane[s[0]][s[1]].sort : + (((int) s[0]) << 8) + (int) s[1]; + + int t_wc = uni_plane[t[0]] ? (int) uni_plane[t[0]][t[1]].sort : + (((int) t[0]) << 8) + (int) t[1]; + if ( s_wc != t_wc ) + return s_wc - t_wc; + + s+= 2; + t+= 2; + } + + if (slen != tlen) + { + int swap= 1; + if (slen < tlen) + { + s= t; + se= te; + swap= -1; + } + + for ( ; s < se ; s+= 2) + { + if (s[0] || s[1] != ' ') + return (s[0] == 0 && s[1] < ' ') ? -swap : swap; + } + } + return 0; } @@ -280,7 +347,6 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs, int plane; uchar *de = dst + dstlen; const uchar *se = src + srclen; - const uchar *dst_orig = dst; while( src < se && dst < de ) { @@ -300,7 +366,9 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs, } dst+=res; } - return dst - dst_orig; + if (dst < de) + cs->cset->fill(cs, dst, de - dst, ' '); + return dstlen; } @@ -878,13 +946,10 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)), break; /* Can't be part of double */ *b++= (char) wc; } - *b= 0; - errno= 0; - res=my_strtod(buf, endptr); - *err= errno; - if (endptr) - *endptr=(char*) (*endptr-buf+nptr); + *endptr= b; + res= my_strtod(buf, endptr, err); + *endptr= nptr + (uint) (*endptr- buf); return res; } @@ -1310,7 +1375,9 @@ int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), { if (dst != src) memcpy(dst,src,srclen= min(dstlen,srclen)); - return srclen; + if (dstlen > srclen) + cs->cset->fill(cs, dst + srclen, dstlen - srclen, ' '); + return dstlen; } @@ -1410,6 +1477,29 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs, return 0; } + +ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *end, int sequence_type) +{ + const char *str0= str; + end--; /* for easier loop condition, because of two bytes per character */ + + switch (sequence_type) + { + case MY_SEQ_SPACES: + for ( ; str < end; str+= 2) + { + if (str[0] != '\0' || str[1] != ' ') + break; + } + return str - str0; + default: + return 0; + } +} + + + static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = { NULL, /* init */ @@ -1464,7 +1554,7 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler= my_strntoull_ucs2, my_strntod_ucs2, my_strtoll10_ucs2, - my_scan_8bit + my_scan_ucs2 }; diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 94673a20795..fc1496df280 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8243,7 +8243,6 @@ my_jisx0212_uni_onechar(int code){ } - /* EUC-JP encoding subcomponents: [x00-x7F] # ASCII/JIS-Roman (one-byte/character) @@ -8253,6 +8252,47 @@ my_jisx0212_uni_onechar(int code){ */ static +uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), + const char *beg, const char *end, uint pos) +{ + const uchar *b= (uchar *) beg; + + for ( ; pos && b < (uchar*) end; pos--, b++) + { + char *chbeg; + uint ch= *b; + + if (ch <= 0x7F) /* one byte */ + continue; + + chbeg= (char *) b++; + if (b >= (uchar *) end) /* need more bytes */ + return chbeg - beg; /* unexpected EOL */ + + if (ch == 0x8E) /* [x8E][xA0-xDF] */ + { + if (*b >= 0xA0 && *b <= 0xDF) + continue; + return chbeg - beg; /* invalid sequence */ + } + + if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */ + { + ch= *b++; + if (b >= (uchar*) end) + return chbeg - beg; /* unexpected EOL */ + } + + if (ch >= 0xA1 && ch <= 0xFE && + *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */ + continue; + return chbeg - beg; /* invalid sequence */ + } + return b - (uchar *) beg; +} + + +static uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)), const char *str, const char *strend) { @@ -8475,7 +8515,7 @@ static MY_CHARSET_HANDLER my_charset_handler= mbcharlen_ujis, my_numchars_mb, my_charpos_mb, - my_well_formed_len_mb, + my_well_formed_len_ujis, my_lengthsp_8bit, my_numcells_eucjp, my_mb_wc_euc_jp, /* mb_wc */ diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index b3097649158..69371aa38c2 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -578,7 +578,7 @@ static MY_UNICASE_INFO plane04[]={ {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0418}, + {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, @@ -594,7 +594,7 @@ static MY_UNICASE_INFO plane04[]={ {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0418}, + {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, @@ -1545,31 +1545,33 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, { while (1) { + my_bool escaped= 0; if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, (const uchar*)wildend)) <= 0) return 1; - - if (w_wc == (my_wc_t)escape) - { - wildstr+= scan; - if ((scan= mb_wc(cs,&w_wc, (const uchar*)wildstr, - (const uchar*)wildend)) <= 0) - return 1; - } - + if (w_wc == (my_wc_t)w_many) { result= 1; /* Found an anchor char */ break; } - + wildstr+= scan; + if (w_wc == (my_wc_t)escape) + { + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + wildstr+= scan; + escaped= 1; + } + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, - (const uchar*)str_end)) <=0) + (const uchar*)str_end)) <= 0) return 1; str+= scan; - if (w_wc == (my_wc_t)w_one) + if (!escaped && w_wc == (my_wc_t)w_one) { result= 1; /* Found an anchor char */ } @@ -2075,7 +2077,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, if (slen != tlen) { - int swap= 0; + int swap= 1; if (slen < tlen) { slen= tlen; @@ -2096,7 +2098,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, for ( ; s < se; s++) { if (*s != ' ') - return ((int)*s - (int) ' ') ^ swap; + return (*s < ' ') ? -swap : swap; } } return 0; @@ -2226,7 +2228,6 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs, int plane; uchar *de = dst + dstlen; const uchar *se = src + srclen; - const uchar *dst_orig = dst; while( src < se && dst < de ) { @@ -2246,7 +2247,9 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs, } dst+=res; } - return dst - dst_orig; + if (dst < de) + bfill(dst, de - dst, ' '); + return dstlen; } static int my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e) diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index b4dbda3e8ed..98389a9a5a4 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -503,7 +503,9 @@ static int my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)), dest[totlen] = value; totlen++; } while (value) ; - return totlen; + if (len > totlen) + bfill(dest + totlen, len - totlen, ' '); + return len; } #undef IS_END @@ -624,12 +626,12 @@ static MY_COLLATION_HANDLER my_collation_czech_ci_handler = CHARSET_INFO my_charset_cp1250_czech_ci = { - 34,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ - "cp1250", /* cs name */ - "cp1250_czech_cs", /* name */ - "", /* comment */ - NULL, /* tailoring */ + 34,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ + "cp1250", /* cs name */ + "cp1250_czech_cs", /* name */ + "", /* comment */ + NULL, /* tailoring */ ctype_win1250ch, to_lower_win1250ch, to_upper_win1250ch, diff --git a/strings/strtod.c b/strings/strtod.c index bc8105b8040..61f2c107abe 100644 --- a/strings/strtod.c +++ b/strings/strtod.c @@ -2,7 +2,7 @@ An alternative implementation of "strtod()" that is both simplier, and thread-safe. - From mit-threads as bundled with MySQL 3.23 + Original code from mit-threads as bundled with MySQL 3.23 SQL:2003 specifies a number as @@ -29,6 +29,8 @@ #include "my_base.h" /* Includes errno.h */ #include "m_ctype.h" +#define MAX_DBL_EXP 308 +#define MAX_RESULT_FOR_MAX_EXP 1.79769313486232 static double scaler10[] = { 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90 }; @@ -37,89 +39,157 @@ static double scaler1[] = { }; -double my_strtod(const char *str, char **end) +/* + Convert string to double (string doesn't have to be null terminated) + + SYNOPSIS + my_strtod() + str String to convert + end_ptr Pointer to pointer that points to end of string + Will be updated to point to end of double. + error Will contain error number in case of error (else 0) + + RETURN + value of str as double +*/ + +double my_strtod(const char *str, char **end_ptr, int *error) { double result= 0.0; - int negative, ndigits; - const char *old_str; + uint negative= 0, ndigits, dec_digits= 0, neg_exp= 0; + int exp= 0, digits_after_dec_point= 0; + const char *old_str, *end= *end_ptr, *start_of_number; + char next_char; my_bool overflow=0; + *error= 0; + if (str >= end) + goto done; + while (my_isspace(&my_charset_latin1, *str)) - str++; + { + if (++str == end) + goto done; + } + start_of_number= str; if ((negative= (*str == '-')) || *str=='+') - str++; + { + if (++str == end) + goto done; /* Could be changed to error */ + } + + /* Skip pre-zero for easier calculation of overflows */ + while (*str == '0') + { + if (++str == end) + goto done; + start_of_number= 0; /* Found digit */ + } old_str= str; - while (my_isdigit (&my_charset_latin1, *str)) + while ((next_char= *str) >= '0' && next_char <= '9') { - result= result*10.0 + (*str - '0'); - str++; + result= result*10.0 + (next_char - '0'); + if (++str == end) + { + next_char= 0; /* Found end of string */ + break; + } + start_of_number= 0; /* Found digit */ } - ndigits= str-old_str; + ndigits= (uint) (str-old_str); - if (*str == '.') + if (next_char == '.' && str < end-1) { - double p10=10; - str++; - old_str= str; - while (my_isdigit (&my_charset_latin1, *str)) + /* + Continue to add numbers after decimal point to the result, as if there + was no decimal point. We will later (in the exponent handling) shift + the number down with the required number of fractions. We do it this + way to be able to get maximum precision for numbers like 123.45E+02, + which are normal for some ODBC applications. + */ + old_str= ++str; + while (my_isdigit(&my_charset_latin1, (next_char= *str))) { - result+= (*str++ - '0')/p10; - p10*=10; + result= result*10.0 + (next_char - '0'); + digits_after_dec_point++; + if (++str == end) + { + next_char= 0; + break; + } } - ndigits+= str-old_str; - if (!ndigits) str--; + /* If we found just '+.' or '.' then point at first character */ + if (!(dec_digits= (uint) (str-old_str)) && start_of_number) + str= start_of_number; /* Point at '+' or '.' */ } - if (ndigits && (*str=='e' || *str=='E')) + if ((next_char == 'e' || next_char == 'E') && + dec_digits + ndigits != 0 && str < end-1) { - int exp= 0; - int neg= 0; const char *old_str= str++; - if ((neg= (*str == '-')) || *str == '+') + if ((neg_exp= (*str == '-')) || *str == '+') str++; - if (!my_isdigit (&my_charset_latin1, *str)) + if (str == end || !my_isdigit(&my_charset_latin1, *str)) str= old_str; else { - double scaler= 1.0; - while (my_isdigit (&my_charset_latin1, *str)) + do { - if (exp < 9999) /* protection against exp overflow */ - exp= exp*10 + *str - '0'; + if (exp < 9999) /* prot. against exp overfl. */ + exp= exp*10 + (*str - '0'); str++; - } - if (exp >= 1000) + } while (str < end && my_isdigit(&my_charset_latin1, *str)); + } + } + if ((exp= (neg_exp ? exp + digits_after_dec_point : + exp - digits_after_dec_point))) + { + double scaler; + if (exp < 0) + { + exp= -exp; + neg_exp= 1; /* neg_exp was 0 before */ + } + if (exp + ndigits >= MAX_DBL_EXP + 1 && result) + { + /* + This is not 100 % as we actually will give an owerflow for + 17E307 but not for 1.7E308 but lets cut some corners to make life + simpler + */ + if (exp + ndigits > MAX_DBL_EXP + 1 || + result >= MAX_RESULT_FOR_MAX_EXP) { - if (neg) - result= 0.0; - else + if (neg_exp) + result= 0.0; + else overflow= 1; goto done; } - while (exp >= 100) - { - scaler*= 1.0e100; - exp-= 100; - } - scaler*= scaler10[exp/10]*scaler1[exp%10]; - if (neg) - result/= scaler; - else - result*= scaler; } + scaler= 1.0; + while (exp >= 100) + { + scaler*= 1.0e100; + exp-= 100; + } + scaler*= scaler10[exp/10]*scaler1[exp%10]; + if (neg_exp) + result/= scaler; + else + result*= scaler; } done: - if (end) - *end = (char *)str; + *end_ptr= (char*) str; /* end of number */ if (overflow || isinf(result)) { result= DBL_MAX; - errno= EOVERFLOW; + *error= EOVERFLOW; } return negative ? -result : result; @@ -127,6 +197,7 @@ done: double my_atof(const char *nptr) { - return (my_strtod(nptr, 0)); + int error; + const char *end= nptr+65535; /* Should be enough */ + return (my_strtod(nptr, (char**) &end, &error)); } - diff --git a/strings/uca-dump.c b/strings/uca-dump.c index 6836c321526..dd3b74a55e8 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -23,13 +23,14 @@ struct uca_item_st #define MY_UCA_PSHIFT 8 #endif +static char *pname[]= {"", "2", "3"}; + int main(int ac, char **av) { char str[256]; char *weights[64]; struct uca_item_st uca[64*1024]; - size_t code, page, w; - int pagemaxlen[MY_UCA_NPAGES]; + size_t code, w; int pageloaded[MY_UCA_NPAGES]; bzero(uca, sizeof(uca)); @@ -155,14 +156,20 @@ int main(int ac, char **av) printf("#define MY_UCA_CMASK %d\n",MY_UCA_CMASK); printf("#define MY_UCA_PSHIFT %d\n",MY_UCA_PSHIFT); - for (w=0; w<1; w++) + for (w=0; w<3; w++) { + size_t page; + int pagemaxlen[MY_UCA_NPAGES]; + for (page=0; page < MY_UCA_NPAGES; page++) { size_t offs; size_t maxnum= 0; size_t nchars= 0; size_t mchars; + size_t ndefs= 0; + + pagemaxlen[page]= 0; /* Skip this page if no weights were loaded @@ -183,15 +190,36 @@ int main(int ac, char **av) code= page*MY_UCA_NCHARS+offs; /* Calculate only non-zero weights */ - num=0; - for (i=0; i < uca[code].num; i++) + for (num=0, i=0; i < uca[code].num; i++) if (uca[code].weight[w][i]) num++; maxnum= maxnum < num ? num : maxnum; + + /* Check if default weight */ + if (w == 1 && num == 1) + { + /* 0020 0000 ... */ + if (uca[code].weight[w][0] == 0x0020) + ndefs++; + } + else if (w == 2 && num == 1) + { + /* 0002 0000 ... */ + if (uca[code].weight[w][0] == 0x0002) + ndefs++; + } } maxnum++; + /* + If the page have only default weights + then no needs to dump it, skip. + */ + if (ndefs == MY_UCA_NCHARS) + { + continue; + } switch (maxnum) { case 0: mchars= 8; break; @@ -210,8 +238,8 @@ int main(int ac, char **av) */ - printf("uint16 page%03Xdata[]= { /* %04X (%d weights per char) */\n", - page, page*MY_UCA_NCHARS, maxnum); + printf("uint16 page%03Xdata%s[]= { /* %04X (%d weights per char) */\n", + page, pname[w], page*MY_UCA_NCHARS, maxnum); for (offs=0; offs < MY_UCA_NCHARS; offs++) { @@ -234,7 +262,17 @@ int main(int ac, char **av) for (i=0; i < maxnum; i++) { - printf("0x%04X",(int)weight[i]); + /* + Invert weights for secondary level to + sort upper case letters before their + lower case counter part. + */ + int tmp= weight[i]; + if (w == 2 && tmp) + tmp= (int)(0x20 - weight[i]); + + + printf("0x%04X", tmp); if ((offs+1 != MY_UCA_NCHARS) || (i+1!=maxnum)) printf(","); nchars++; @@ -251,25 +289,28 @@ int main(int ac, char **av) } printf("};\n\n"); } - } - printf("uchar ucal[%d]={\n",MY_UCA_NPAGES); - for (page=0; page < MY_UCA_NPAGES; page++) - { - printf("%d%s%s",pagemaxlen[page],page<MY_UCA_NPAGES-1?",":"",(page+1) % 16 ? "":"\n"); - } - printf("};\n"); - - - printf("uint16 *ucaw[%d]={\n",MY_UCA_NPAGES); - for (page=0; page < MY_UCA_NPAGES; page++) - { - if (!pageloaded[page]) - printf("NULL %s%s",page<MY_UCA_NPAGES-1?",":"", (page+1) % 4 ? "":"\n"); - else - printf("page%03Xdata%s%s",page,page<MY_UCA_NPAGES-1?",":"", (page+1) % 4 ? "":"\n"); + printf("uchar uca_length%s[%d]={\n", pname[w], MY_UCA_NPAGES); + for (page=0; page < MY_UCA_NPAGES; page++) + { + printf("%d%s%s",pagemaxlen[page],page<MY_UCA_NPAGES-1?",":"",(page+1) % 16 ? "":"\n"); + } + printf("};\n"); + + + printf("uint16 *uca_weight%s[%d]={\n", pname[w], MY_UCA_NPAGES); + for (page=0; page < MY_UCA_NPAGES; page++) + { + const char *comma= page < MY_UCA_NPAGES-1 ? "," : ""; + const char *nline= (page+1) % 4 ? "" : "\n"; + if (!pagemaxlen[page]) + printf("NULL %s%s%s", w ? " ": "", comma , nline); + else + printf("page%03Xdata%s%s%s", page, pname[w], comma, nline); + } + printf("};\n"); } - printf("};\n"); + printf("int main(void){ return 0;};\n"); return 0; diff --git a/support-files/Makefile.am b/support-files/Makefile.am index 7ae1071f9ec..0a6077f0efc 100644 --- a/support-files/Makefile.am +++ b/support-files/Makefile.am @@ -27,7 +27,8 @@ EXTRA_DIST = mysql.spec.sh \ mysql.server.sh \ binary-configure.sh \ magic \ - MySQL-shared-compat.spec.sh + MySQL-shared-compat.spec.sh \ + ndb-config-2-node.ini.sh SUBDIRS = MacOSX @@ -38,7 +39,8 @@ pkgdata_DATA = my-small.cnf \ my-innodb-heavy-4G.cnf \ mysql-log-rotate \ mysql-@VERSION@.spec \ - MySQL-shared-compat.spec + MySQL-shared-compat.spec \ + ndb-config-2-node.ini pkgdata_SCRIPTS = mysql.server @@ -52,7 +54,8 @@ CLEANFILES = my-small.cnf \ mysql-log-rotate \ mysql.server \ binary-configure \ - MySQL-shared-compat.spec + MySQL-shared-compat.spec \ + ndb-config-2-node.ini mysql-@VERSION@.spec: mysql.spec rm -f $@ diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh index 068daadab58..e3c88c9415f 100644 --- a/support-files/MySQL-shared-compat.spec.sh +++ b/support-files/MySQL-shared-compat.spec.sh @@ -26,7 +26,8 @@ # # Change this to match the version of the shared libs you want to include # -%define version4 @MYSQL_NO_DASH_VERSION@ +%define version41 @MYSQL_NO_DASH_VERSION@ +%define version40 4.0.23 %define version3 3.23.58 Name: MySQL-shared-compat @@ -36,26 +37,31 @@ License: GPL Group: Applications/Databases URL: http://www.mysql.com/ Autoreqprov: on -Version: %{version4} +Version: %{version41} Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Obsoletes: MySQL-shared, mysql-shared Provides: MySQL-shared -Summary: MySQL shared libraries for MySQL %{version4} and %{version3} -Source0: MySQL-shared-%{version4}-0.%{_arch}.rpm -Source1: MySQL-shared-%{version3}-1.%{_arch}.rpm +Summary: MySQL shared client libraries for MySQL %{version41}, %{version40} and %{version3} +# We simply use the "MySQL-shared" subpackages as input sources instead of +# rebuilding all from source +Source0: MySQL-shared-%{version41}-0.%{_arch}.rpm +Source1: MySQL-shared-%{version40}-0.%{_arch}.rpm +Source2: MySQL-shared-%{version3}-1.%{_arch}.rpm # No need to include the RPMs once more - they can be downloaded seperately # if you want to rebuild this package NoSource: 0 NoSource: 1 +NoSource: 2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description -This package includes the shared libraries for both MySQL %{version3} and -MySQL %{version4}. Install this package instead of "MySQL-shared", if you -have applications installed that are dynamically linked against MySQL -3.23.xx but you want to upgrade to MySQL 4.0.xx without breaking the library -dependencies. +This package includes the shared libraries for both MySQL %{version3}, +MySQL %{version40} as well as MySQL %{version41}. +Install this package instead of "MySQL-shared", if you have applications +installed that are dynamically linked against older versions of the MySQL +client library but you want to upgrade to MySQL 4.1.xx without breaking the +library dependencies. %install [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; @@ -63,6 +69,8 @@ mkdir -p $RPM_BUILD_ROOT cd $RPM_BUILD_ROOT rpm2cpio %{SOURCE0} | cpio -iv --make-directories rpm2cpio %{SOURCE1} | cpio -iv --make-directories +rpm2cpio %{SOURCE2} | cpio -iv --make-directories +/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir} %clean [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 6def311f474..062d106ce6a 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -177,7 +177,7 @@ default_table_type = MYISAM thread_stack = 192K # Set the default transaction isolation level. Levels available are: -# READ-UNCOMMITED, READ-COMMITED, REPEATABLE-READ, SERIALIZABLE +# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE transaction_isolation = REPEATABLE-READ # Maximum size for internal (in-memory) temporary tables. If a table diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh index a1153c66f40..0ee78b0f7ca 100644 --- a/support-files/mysql-log-rotate.sh +++ b/support-files/mysql-log-rotate.sh @@ -1,4 +1,9 @@ -# This logname is set in mysql.server.sh that ends up in /etc/rc.d/init.d/mysql +# This logname can be set in /etc/my.cnf +# by setting the variable "err-log" +# in the [safe_mysqld] section as follows: +# +# [safe_mysqld] +# err-log=@localstatedir@/mysqld.log # # If the root user has a password you have to create a # /root/.my.cnf configuration file with the following @@ -22,8 +27,10 @@ compress postrotate # just if mysqld is really running - if test -n "`ps acx|grep mysqld`"; then - @bindir@/mysqladmin flush-logs + if test -x @bindir@/mysqladmin && \ + @bindir@/mysqladmin ping &>/dev/null + then + @bindir@/mysqladmin flush-logs fi endscript } diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index e7f8a035a15..07c8e6a46fb 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -27,7 +27,7 @@ Packager: Lenz Grimmer <build@mysql.com> Vendor: MySQL AB Requires: fileutils sh-utils Provides: msqlormysql MySQL-server mysql -BuildPrereq: ncurses-devel +BuildRequires: ncurses-devel Obsoletes: mysql # Think about what you use here since the first step is to @@ -104,6 +104,53 @@ This package contains the standard MySQL clients and administration tools. %description client -l pt_BR Este pacote contém os clientes padrão para o MySQL. +%package ndb-storage +Release: %{release} +Summary: MySQL - ndbcluster storage engine +Group: Applications/Databases + +%description ndb-storage +This package contains the ndbcluster storage engine. +It is necessary to have this package installed on all +computers that should store ndbcluster table data. +Note that this storage engine can only be used in conjunction +with the MySQL Max server. + +%{see_base} + +%package ndb-management +Release: %{release} +Summary: MySQL - ndbcluster storage engine management +Group: Applications/Databases + +%description ndb-management +This package contains ndbcluster storage engine management. +It is necessary to have this package installed on at least +one computer in the cluster. + +%{see_base} + +%package ndb-tools +Release: %{release} +Summary: MySQL - ndbcluster storage engine basic tools +Group: Applications/Databases + +%description ndb-tools +This package contains ndbcluster storage engine basic tools. + +%{see_base} + +%package ndb-extra +Release: %{release} +Summary: MySQL - ndbcluster storage engine extra tools +Group: Applications/Databases + +%description ndb-extra +This package contains some extra ndbcluster storage engine tools for the advanced user. +They should be used with caution. + +%{see_base} + %package bench Release: %{release} Requires: %{name}-client perl-DBI perl @@ -152,15 +199,23 @@ languages and applications need to dynamically load and use MySQL. %package Max Release: %{release} -Summary: MySQL - server with Berkeley DB, RAID and UDF support +Summary: MySQL - server with extended functionality Group: Applications/Databases Provides: mysql-Max Obsoletes: mysql-Max Requires: MySQL-server >= 4.0 %description Max -Optional MySQL server binary that supports additional features like -Berkeley DB, RAID and User Defined Functions (UDFs). +Optional MySQL server binary that supports additional features like: + + - Berkeley DB Storage Engine + - Ndbcluster Storage Engine interface + - Archive Storage Engine + - CSV Storage Engine + - Example Storage Engine + - MyISAM RAID + - User Defined Functions (UDFs). + To activate this binary, just install this package in addition to the standard MySQL package. @@ -221,7 +276,6 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ --includedir=%{_includedir} \ --mandir=%{_mandir} \ --enable-thread-safe-client \ - --with-comment=\"Official MySQL RPM\" \ --with-readline ; # Add this for more debugging support # --with-debug @@ -272,8 +326,13 @@ BuildMySQL "--enable-shared \ --without-openssl \ --with-berkeley-db \ --with-innodb \ + --with-ndbcluster \ --with-raid \ + --with-archive \ + --with-csv-storage-engine \ + --with-example-storage-engine \ --with-embedded-server \ + --with-comment=\"MySQL Community Edition - Max (GPL)\" \ --with-server-suffix='-Max'" # Save everything for debug @@ -283,6 +342,9 @@ BuildMySQL "--enable-shared \ mv sql/mysqld sql/mysqld-max nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym +# Install the ndb binaries +(cd ndb; make install DESTDIR=$RBR) + # Install embedded server library in the build root install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/ @@ -317,6 +379,7 @@ BuildMySQL "--disable-shared \ --with-client-ldflags='-all-static' \ $USE_OTHER_LIBC_DIR \ %endif + --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ --with-server-suffix='%{server_suffix}' \ --without-embedded-server \ --without-berkeley-db \ @@ -425,6 +488,14 @@ chmod -R og-rw $mysql_datadir/mysql # Allow safe_mysqld to start mysqld and print a message before we exit sleep 2 + +%post ndb-storage +mysql_clusterdir=/var/lib/mysql-cluster + +# Create cluster directory if needed +if test ! -d $mysql_clusterdir; then mkdir -m755 $mysql_clusterdir; fi + + %post Max # Restart mysqld, to use the new binary. echo "Restarting mysqld." @@ -465,6 +536,7 @@ fi %doc Docs/manual.{html,ps,texi,txt} %doc Docs/manual_toc.html %doc support-files/my-*.cnf +%doc support-files/ndb-*.ini %doc %attr(644, root, root) %{_infodir}/mysql.info* @@ -546,6 +618,32 @@ fi %postun shared /sbin/ldconfig +%files ndb-storage +%defattr(-,root,root,0755) +%attr(755, root, root) %{_sbindir}/ndbd + +%files ndb-management +%defattr(-,root,root,0755) +%attr(755, root, root) %{_sbindir}/ndb_mgmd +%attr(755, root, root) %{_bindir}/ndb_mgm + +%files ndb-tools +%defattr(-,root,root,0755) +%attr(755, root, root) %{_bindir}/ndb_mgm +%attr(755, root, root) %{_bindir}/ndb_restore +%attr(755, root, root) %{_bindir}/ndb_waiter +%attr(755, root, root) %{_bindir}/ndb_select_all +%attr(755, root, root) %{_bindir}/ndb_select_count +%attr(755, root, root) %{_bindir}/ndb_desc +%attr(755, root, root) %{_bindir}/ndb_show_tables +%attr(755, root, root) %{_bindir}/ndb_test_platform + +%files ndb-extra +%defattr(-,root,root,0755) +%attr(755, root, root) %{_bindir}/ndb_drop_index +%attr(755, root, root) %{_bindir}/ndb_drop_table +%attr(755, root, root) %{_bindir}/ndb_delete_all + %files devel %defattr(-, root, root, 0755) %doc EXCEPTIONS-CLIENT @@ -597,6 +695,27 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Mon Feb 14 2005 Lenz Grimmer <lenz@mysql.com> + +* Fixed the compilation comments and moved them into the separate build sections + for Max and Standard + +* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com> + +- enabled the "Ndbcluster" storage engine for the max binary +- added extra make install in ndb subdir after Max build to get ndb binaries +- added packages for ndbcluster storage engine + +* Fri Jan 14 2005 Lenz Grimmer <lenz@mysql.com> + +- replaced obsoleted "BuildPrereq" with "BuildRequires" instead + +* Thu Dec 31 2004 Lenz Grimmer <lenz@mysql.com> + +- enabled the "Archive" storage engine for the max binary +- enabled the "CSV" storage engine for the max binary +- enabled the "Example" storage engine for the max binary + * Thu Aug 26 2004 Lenz Grimmer <lenz@mysql.com> - MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860) diff --git a/support-files/ndb-config-2-node.ini.sh b/support-files/ndb-config-2-node.ini.sh new file mode 100644 index 00000000000..be80f1dd0b3 --- /dev/null +++ b/support-files/ndb-config-2-node.ini.sh @@ -0,0 +1,43 @@ +# Example Ndbcluster storage engine config file. +# +[ndbd default] +NoOfReplicas= 2 +MaxNoOfConcurrentOperations= 10000 +DataMemory= 80M +IndexMemory= 24M +TimeBetweenWatchDogCheck= 30000 +DataDir= /var/lib/mysql-cluster +MaxNoOfOrderedIndexes= 512 + +[ndb_mgmd default] +DataDir= /var/lib/mysql-cluster + +[ndb_mgmd] +Id=1 +HostName= localhost + +[ndbd] +Id= 2 +HostName= localhost + +[ndbd] +Id= 3 +HostName= localhost + +[mysqld] +Id= 4 + +[mysqld] +Id= 5 + +[mysqld] +Id= 6 + +[mysqld] +Id= 7 + +# choose an unused port number +# in this configuration 63132, 63133, and 63134 +# will be used +[tcp default] +PortNumber= 63132 diff --git a/tests/Makefile.am b/tests/Makefile.am index df16ee789a5..de4fbb2a4f2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,7 +26,7 @@ EXTRA_DIST = auto_increment.res auto_increment.tst \ pmail.pl mail_to_db.pl table_types.pl \ udf_test udf_test.res myisam-big-rows.tst -bin_PROGRAMS = client_test +bin_PROGRAMS = mysql_client_test noinst_PROGRAMS = insert_test select_test thread_test # @@ -35,8 +35,8 @@ noinst_PROGRAMS = insert_test select_test thread_test INCLUDES = -I$(top_srcdir)/include $(openssl_includes) LIBS = @CLIENT_LIBS@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la -client_test_LDADD= $(LDADD) $(CXXLDFLAGS) -client_test_SOURCES= client_test.c +mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS) +mysql_client_test_SOURCES= mysql_client_test.c insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) diff --git a/tests/grant.pl b/tests/grant.pl index eb2d00f3e1d..cd6a2eb80de 100644 --- a/tests/grant.pl +++ b/tests/grant.pl @@ -74,9 +74,9 @@ safe_query("revoke select(user) on mysql.user from $user"); safe_query("grant select on *.* to $user"); safe_query("set password FOR ${opt_user}2\@$opt_host = password('test')",1); -safe_query("set password FOR $opt_user=password('test')"); +safe_query("set password FOR $opt_user\@$opt_host=password('test')"); user_connect(1); -safe_query("set password FOR $opt_user=''"); +safe_query("set password FOR $opt_user\@$opt_host=''"); user_connect(0); user_query("select * from mysql.user where user = '$opt_user'"); user_query("select * from mysql.db where user = '$opt_user'"); diff --git a/tests/client_test.c b/tests/mysql_client_test.c index 562f6e307d3..3974bacc2eb 100644 --- a/tests/client_test.c +++ b/tests/mysql_client_test.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (C) 2003-2004 MySQL 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 @@ -24,9 +24,11 @@ #include <my_global.h> #include <my_sys.h> #include <mysql.h> +#include <errmsg.h> #include <my_getopt.h> #include <m_string.h> +#define VER "2.1" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ /* set default options */ @@ -37,7 +39,7 @@ static char *opt_password= 0; static char *opt_host= 0; static char *opt_unix_socket= 0; static unsigned int opt_port; -static my_bool tty_password= 0; +static my_bool tty_password= 0, opt_silent= 0; static MYSQL *mysql= 0; static char query[MAX_TEST_QUERY_LENGTH]; @@ -51,7 +53,14 @@ static double total_time; const char *default_dbug_option= "d:t:o,/tmp/client_test.trace"; +struct my_tests_st +{ + const char *name; + void (*function)(); +}; + #define myheader(str) \ +if (opt_silent < 2) \ { \ fprintf(stdout, "\n\n#####################################\n"); \ fprintf(stdout, "%d of (%d/%d): %s", test_count++, iter_count, \ @@ -59,6 +68,7 @@ const char *default_dbug_option= "d:t:o,/tmp/client_test.trace"; fprintf(stdout, " \n#####################################\n"); \ } #define myheader_r(str) \ +if (!opt_silent) \ { \ fprintf(stdout, "\n\n#####################################\n"); \ fprintf(stdout, "%s", str); \ @@ -94,11 +104,12 @@ void die(const char *file, int line, const char *expr) #define myerror(msg) print_error(msg) #define mysterror(stmt, msg) print_st_error(stmt, msg) -#define myquery(r) \ +#define myquery(RES) \ { \ -if (r) \ - myerror(NULL); \ - DIE_UNLESS(r == 0); \ + int r= (RES); \ + if (r) \ + myerror(NULL); \ + DIE_UNLESS(r == 0); \ } #define myquery_r(r) \ @@ -144,32 +155,39 @@ DIE_UNLESS(stmt == 0);\ static void print_error(const char *msg) { - if (mysql && mysql_errno(mysql)) + if (!opt_silent) { - if (mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); - fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + if (mysql && mysql_errno(mysql)) + { + if (mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); + fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + } + else if (msg) + fprintf(stderr, " [MySQL] %s\n", msg); } - else if (msg) fprintf(stderr, " [MySQL] %s\n", msg); } static void print_st_error(MYSQL_STMT *stmt, const char *msg) { - if (stmt && mysql_stmt_errno(stmt)) + if (!opt_silent) { - if (stmt->mysql && stmt->mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", stmt->mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); + if (stmt && mysql_stmt_errno(stmt)) + { + if (stmt->mysql && stmt->mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", stmt->mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); - fprintf(stdout, "[%d] %s\n", mysql_stmt_errno(stmt), - mysql_stmt_error(stmt)); + fprintf(stdout, "[%d] %s\n", mysql_stmt_errno(stmt), + mysql_stmt_error(stmt)); + } + else if (msg) + fprintf(stderr, " [MySQL] %s\n", msg); } - else if (msg) - fprintf(stderr, " [MySQL] %s\n", msg); } @@ -198,11 +216,13 @@ static void client_connect() int rc; myheader_r("client_connect"); - fprintf(stdout, "\n Establishing a connection to '%s' ...", - opt_host ? opt_host : ""); + if (!opt_silent) + fprintf(stdout, "\n Establishing a connection to '%s' ...", + opt_host ? opt_host : ""); if (!(mysql= mysql_init(NULL))) { + opt_silent= 0; myerror("mysql_init() failed"); exit(1); } @@ -211,18 +231,21 @@ static void client_connect() opt_password, opt_db ? opt_db:"test", opt_port, opt_unix_socket, 0))) { + opt_silent= 0; myerror("connection failed"); mysql_close(mysql); fprintf(stdout, "\n Check the connection options using --help or -?\n"); exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); /* set AUTOCOMMIT to ON*/ mysql_autocommit(mysql, TRUE); - fprintf(stdout, "\n Creating a test database '%s' ...", current_db); + if (!opt_silent) + fprintf(stdout, "\n Creating a test database '%s' ...", current_db); strxmov(query, "CREATE DATABASE IF NOT EXISTS ", current_db, NullS); rc= mysql_query(mysql, query); @@ -232,7 +255,8 @@ static void client_connect() rc= mysql_query(mysql, query); myquery(rc); - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); } @@ -244,13 +268,16 @@ static void client_disconnect() if (mysql) { - fprintf(stdout, "\n dropping the test database '%s' ...", current_db); + if (!opt_silent) + fprintf(stdout, "\n dropping the test database '%s' ...", current_db); strxmov(query, "DROP DATABASE IF EXISTS ", current_db, NullS); mysql_query(mysql, query); - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); - fprintf(stdout, "\n closing the connection ..."); + if (!opt_silent) + fprintf(stdout, "\n closing the connection ..."); mysql_close(mysql); fprintf(stdout, " OK\n"); } @@ -265,38 +292,40 @@ static void client_query() myheader("client_query"); - rc= mysql_query(mysql, "DROP TABLE IF EXISTS myclient_test"); + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE myclient_test(" + rc= mysql_query(mysql, "CREATE TABLE t1(" "id int primary key auto_increment, " "name varchar(20))"); myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE myclient_test(id int, name varchar(20))"); + rc= mysql_query(mysql, "CREATE TABLE t1(id int, name varchar(20))"); myquery_r(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('mysql')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('mysql')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('monty')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('monty')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('venu')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('venu')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('deleted')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('deleted')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('deleted')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('deleted')"); myquery(rc); - rc= mysql_query(mysql, "UPDATE myclient_test SET name= 'updated' " + rc= mysql_query(mysql, "UPDATE t1 SET name= 'updated' " "WHERE name= 'deleted'"); myquery(rc); - rc= mysql_query(mysql, "UPDATE myclient_test SET id= 3 WHERE name= 'updated'"); + rc= mysql_query(mysql, "UPDATE t1 SET id= 3 WHERE name= 'updated'"); myquery_r(rc); + + myquery(mysql_query(mysql, "drop table t1")); } @@ -331,8 +360,11 @@ static void my_print_result_metadata(MYSQL_RES *result) unsigned int field_count; mysql_field_seek(result, 0); - fputc('\n', stdout); - fputc('\n', stdout); + if (!opt_silent) + { + fputc('\n', stdout); + fputc('\n', stdout); + } field_count= mysql_num_fields(result); for(i= 0; i< field_count; i++) @@ -345,18 +377,25 @@ static void my_print_result_metadata(MYSQL_RES *result) j= 4; field->max_length= j; } - my_print_dashes(result); - fputc('\t', stdout); - fputc('|', stdout); + if (!opt_silent) + { + my_print_dashes(result); + fputc('\t', stdout); + fputc('|', stdout); + } mysql_field_seek(result, 0); for(i= 0; i< field_count; i++) { field= mysql_fetch_field(result); - fprintf(stdout, " %-*s |", (int) field->max_length, field->name); + if (!opt_silent) + fprintf(stdout, " %-*s |", (int) field->max_length, field->name); + } + if (!opt_silent) + { + fputc('\n', stdout); + my_print_dashes(result); } - fputc('\n', stdout); - my_print_dashes(result); } @@ -377,31 +416,43 @@ int my_process_result_set(MYSQL_RES *result) while ((row= mysql_fetch_row(result)) != NULL) { mysql_field_seek(result, 0); - fputc('\t', stdout); - fputc('|', stdout); + if (!opt_silent) + { + fputc('\t', stdout); + fputc('|', stdout); + } for(i= 0; i< mysql_num_fields(result); i++) { field= mysql_fetch_field(result); - if (row[i] == NULL) - fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); - else if (IS_NUM(field->type)) - fprintf(stdout, " %*s |", (int) field->max_length, row[i]); - else - fprintf(stdout, " %-*s |", (int) field->max_length, row[i]); + if (!opt_silent) + { + if (row[i] == NULL) + fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); + else if (IS_NUM(field->type)) + fprintf(stdout, " %*s |", (int) field->max_length, row[i]); + else + fprintf(stdout, " %-*s |", (int) field->max_length, row[i]); + } + } + if (!opt_silent) + { + fputc('\t', stdout); + fputc('\n', stdout); } - fputc('\t', stdout); - fputc('\n', stdout); row_count++; } - if (row_count) - my_print_dashes(result); + if (!opt_silent) + { + if (row_count) + my_print_dashes(result); - if (mysql_errno(mysql) != 0) - fprintf(stderr, "\n\tmysql_fetch_row() failed\n"); - else - fprintf(stdout, "\n\t%d %s returned\n", row_count, - row_count == 1 ? "row" : "rows"); + if (mysql_errno(mysql) != 0) + fprintf(stderr, "\n\tmysql_fetch_row() failed\n"); + else + fprintf(stdout, "\n\t%d %s returned\n", row_count, + row_count == 1 ? "row" : "rows"); + } return row_count; } @@ -470,34 +521,44 @@ int my_process_stmt_result(MYSQL_STMT *stmt) mysql_field_seek(result, 0); while (mysql_stmt_fetch(stmt) == 0) { - fputc('\t', stdout); - fputc('|', stdout); - + if (!opt_silent) + { + fputc('\t', stdout); + fputc('|', stdout); + } mysql_field_seek(result, 0); for (i= 0; i < field_count; i++) { field= mysql_fetch_field(result); - if (is_null[i]) - fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); - else if (length[i] == 0) + if (!opt_silent) { - data[i][0]= '\0'; /* unmodified buffer */ - fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + if (is_null[i]) + fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); + else if (length[i] == 0) + { + data[i][0]= '\0'; /* unmodified buffer */ + fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + } + else if (IS_NUM(field->type)) + fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + else + fprintf(stdout, " %-*s |", (int) field->max_length, data[i]); } - else if (IS_NUM(field->type)) - fprintf(stdout, " %*s |", (int) field->max_length, data[i]); - else - fprintf(stdout, " %-*s |", (int) field->max_length, data[i]); } - fputc('\t', stdout); - fputc('\n', stdout); + if (!opt_silent) + { + fputc('\t', stdout); + fputc('\n', stdout); + } row_count++; } - if (row_count) - my_print_dashes(result); - - fprintf(stdout, "\n\t%d %s returned\n", row_count, - row_count == 1 ? "row" : "rows"); + if (!opt_silent) + { + if (row_count) + my_print_dashes(result); + fprintf(stdout, "\n\t%d %s returned\n", row_count, + row_count == 1 ? "row" : "rows"); + } mysql_free_result(result); return row_count; } @@ -511,7 +572,8 @@ int my_stmt_result(const char *buff) int row_count; int rc; - fprintf(stdout, "\n\n %s", buff); + if (!opt_silent) + fprintf(stdout, "\n\n %s", buff); stmt= mysql_simple_prepare(mysql, buff); check_stmt(stmt); @@ -537,7 +599,8 @@ static void verify_col_data(const char *table, const char *col, if (table && col) { strxmov(query, "SELECT ", col, " FROM ", table, " LIMIT 1", NullS); - fprintf(stdout, "\n %s", query); + if (!opt_silent) + fprintf(stdout, "\n %s", query); rc= mysql_query(mysql, query); myquery(rc); @@ -565,42 +628,63 @@ static void verify_col_data(const char *table, const char *col, /* Utility function to verify the field members */ static void verify_prepare_field(MYSQL_RES *result, - unsigned int no, const char *name, const char *org_name, - enum enum_field_types type, const char *table, - const char *org_table, const char *db, - unsigned long length, const char *def) + unsigned int no, const char *name, + const char *org_name, + enum enum_field_types type, + const char *table, + const char *org_table, const char *db, + unsigned long length, const char *def) { MYSQL_FIELD *field; + CHARSET_INFO *cs; if (!(field= mysql_fetch_field_direct(result, no))) { fprintf(stdout, "\n *** ERROR: FAILED TO GET THE RESULT ***"); exit(1); } - fprintf(stdout, "\n field[%d]:", no); - fprintf(stdout, "\n name :`%s`\t(expected: `%s`)", field->name, name); - fprintf(stdout, "\n org_name :`%s`\t(expected: `%s`)", - field->org_name, org_name); - fprintf(stdout, "\n type :`%d`\t(expected: `%d`)", field->type, type); - fprintf(stdout, "\n table :`%s`\t(expected: `%s`)", - field->table, table); - fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)", - field->org_table, org_table); - fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); - fprintf(stdout, "\n length :`%ld`\t(expected: `%ld`)", - field->length, length); - fprintf(stdout, "\n maxlength:`%ld`", field->max_length); - fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); - fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", - field->def ? field->def : "(null)", def ? def: "(null)"); - fprintf(stdout, "\n"); + cs= get_charset(field->charsetnr, 0); + DIE_UNLESS(cs); + if (!opt_silent) + { + fprintf(stdout, "\n field[%d]:", no); + fprintf(stdout, "\n name :`%s`\t(expected: `%s`)", field->name, name); + fprintf(stdout, "\n org_name :`%s`\t(expected: `%s`)", + field->org_name, org_name); + fprintf(stdout, "\n type :`%d`\t(expected: `%d`)", field->type, type); + fprintf(stdout, "\n table :`%s`\t(expected: `%s`)", + field->table, table); + fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)", + field->org_table, org_table); + fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); + fprintf(stdout, "\n length :`%ld`\t(expected: `%ld`)", + field->length, length * cs->mbmaxlen); + fprintf(stdout, "\n maxlength:`%ld`", field->max_length); + fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); + fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", + field->def ? field->def : "(null)", def ? def: "(null)"); + fprintf(stdout, "\n"); + } DIE_UNLESS(strcmp(field->name, name) == 0); DIE_UNLESS(strcmp(field->org_name, org_name) == 0); - DIE_UNLESS(field->type == type); + /* + XXX: silent column specification change works based on number of + bytes a column occupies. So CHAR -> VARCHAR upgrade is possible even + for CHAR(2) column if its character set is multibyte. + VARCHAR -> CHAR downgrade won't work for VARCHAR(3) as one would + expect. + */ + if (cs->mbmaxlen == 1) + DIE_UNLESS(field->type == type); DIE_UNLESS(strcmp(field->table, table) == 0); DIE_UNLESS(strcmp(field->org_table, org_table) == 0); DIE_UNLESS(strcmp(field->db, db) == 0); - DIE_UNLESS(field->length == length); + /* + Character set should be taken into account for multibyte encodings, such + as utf8. Field length is calculated as number of characters * maximum + number of bytes a character can occupy. + */ + DIE_UNLESS(field->length == length * cs->mbmaxlen); if (def) DIE_UNLESS(strcmp(field->def, def) == 0); } @@ -611,8 +695,9 @@ static void verify_prepare_field(MYSQL_RES *result, static void verify_param_count(MYSQL_STMT *stmt, long exp_count) { long param_count= mysql_stmt_param_count(stmt); - fprintf(stdout, "\n total parameters in stmt: `%ld` (expected: `%ld`)", - param_count, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total parameters in stmt: `%ld` (expected: `%ld`)", + param_count, exp_count); DIE_UNLESS(param_count == exp_count); } @@ -622,8 +707,9 @@ static void verify_param_count(MYSQL_STMT *stmt, long exp_count) static void verify_st_affected_rows(MYSQL_STMT *stmt, ulonglong exp_count) { ulonglong affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", - affected_rows, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", + affected_rows, exp_count); DIE_UNLESS(affected_rows == exp_count); } @@ -633,7 +719,8 @@ static void verify_st_affected_rows(MYSQL_STMT *stmt, ulonglong exp_count) static void verify_affected_rows(ulonglong exp_count) { ulonglong affected_rows= mysql_affected_rows(mysql); - fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", affected_rows, exp_count); DIE_UNLESS(affected_rows == exp_count); } @@ -644,8 +731,9 @@ static void verify_affected_rows(ulonglong exp_count) static void verify_field_count(MYSQL_RES *result, uint exp_count) { uint field_count= mysql_num_fields(result); - fprintf(stdout, "\n total fields in the result set: `%d` (expected: `%d`)", - field_count, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total fields in the result set: `%d` (expected: `%d`)", + field_count, exp_count); DIE_UNLESS(field_count == exp_count); } @@ -665,8 +753,9 @@ static void execute_prepare_query(const char *query, ulonglong exp_count) myquery(rc); affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", - affected_rows, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", + affected_rows, exp_count); DIE_UNLESS(affected_rows == exp_count); mysql_stmt_close(stmt); @@ -682,7 +771,7 @@ static void client_store_result() myheader("client_store_result"); - rc= mysql_query(mysql, "SELECT * FROM myclient_test"); + rc= mysql_query(mysql, "SELECT * FROM t1"); myquery(rc); /* get the result */ @@ -702,7 +791,7 @@ static void client_use_result() int rc; myheader("client_use_result"); - rc= mysql_query(mysql, "SELECT * FROM myclient_test"); + rc= mysql_query(mysql, "SELECT * FROM t1"); myquery(rc); /* get the result */ @@ -722,7 +811,8 @@ static my_bool thread_query(char *query) my_bool error; error= 0; - fprintf(stdout, "\n in thread_query(%s)", query); + if (!opt_silent) + fprintf(stdout, "\n in thread_query(%s)", query); if (!(l_mysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -935,6 +1025,56 @@ static void test_tran_innodb() } +/* Test for BUG#7242 */ + +static void test_prepare_insert_update() +{ + MYSQL_STMT *stmt; + int rc; + int i; + const char *testcase[]= { + "CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B))", + "INSERT t1 VALUES (1,2,10), (3,4,20)", + "INSERT t1 VALUES (5,6,30), (7,4,40), (8,9,60) ON DUPLICATE KEY UPDATE c=c+100", + "SELECT * FROM t1", + "INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0", + "SELECT * FROM t1", + "INSERT t1 VALUES (2,1,11), (7,4,40) ON DUPLICATE KEY UPDATE c=c+VALUES(a)", + NULL}; + const char **cur_query; + + myheader("test_prepare_insert_update"); + + for (cur_query= testcase; *cur_query; cur_query++) + { + printf("\nRunning query: %s", *cur_query); + strmov(query, *cur_query); + stmt= mysql_simple_prepare(mysql, query); + check_stmt(stmt); + + verify_param_count(stmt, 0); + rc= mysql_stmt_execute(stmt); + + check_execute(stmt, rc); + /* try the last query several times */ + if (!cur_query[1]) + { + for (i=0; i < 3;i++) + { + printf("\nExecuting last statement again"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + } + } + mysql_stmt_close(stmt); + } + + rc= mysql_commit(mysql); + myquery(rc); +} + /* Test simple prepares of all DML statements */ static void test_prepare_simple() @@ -960,7 +1100,8 @@ static void test_prepare_simple() mysql_stmt_close(stmt); /* update */ - strmov(query, "UPDATE test_prepare_simple SET id=? WHERE id=? AND name= ?"); + strmov(query, "UPDATE test_prepare_simple SET id=? " + "WHERE id=? AND CONVERT(name USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -988,7 +1129,8 @@ static void test_prepare_simple() mysql_stmt_close(stmt); /* select */ - strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? AND name= ?"); + strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? " + "AND CONVERT(name USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1017,7 +1159,7 @@ static void test_prepare_field_result() rc= mysql_query(mysql, "CREATE TABLE test_prepare_field_result(int_c int, " "var_c varchar(50), ts_c timestamp(14), " - "char_c char(3), date_c date, extra tinyint)"); + "char_c char(4), date_c date, extra tinyint)"); myquery(rc); /* insert */ @@ -1033,7 +1175,8 @@ static void test_prepare_field_result() my_print_result_metadata(result); - fprintf(stdout, "\n\n field attributes:\n"); + if (!opt_silent) + fprintf(stdout, "\n\n field attributes:\n"); verify_prepare_field(result, 0, "int_c", "int_c", MYSQL_TYPE_LONG, "t1", "test_prepare_field_result", current_db, 11, 0); verify_prepare_field(result, 1, "var_c", "var_c", MYSQL_TYPE_VAR_STRING, @@ -1042,8 +1185,8 @@ static void test_prepare_field_result() "t1", "test_prepare_field_result", current_db, 10, 0); verify_prepare_field(result, 3, "ts_c", "ts_c", MYSQL_TYPE_TIMESTAMP, "t1", "test_prepare_field_result", current_db, 19, 0); - verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_STRING, - "t1", "test_prepare_field_result", current_db, 3, 0); + verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_VAR_STRING, + "t1", "test_prepare_field_result", current_db, 4, 0); verify_field_count(result, 5); mysql_free_result(result); @@ -1207,17 +1350,20 @@ static void test_prepare() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n"); + if (!opt_silent) + { + fprintf(stdout, "\n"); - fprintf(stdout, "\n\t tiny : %d (%lu)", tiny_data, length[0]); - fprintf(stdout, "\n\t short : %d (%lu)", small_data, length[3]); - fprintf(stdout, "\n\t int : %d (%lu)", int_data, length[2]); - fprintf(stdout, "\n\t big : %lld (%lu)", big_data, length[4]); + fprintf(stdout, "\n\t tiny : %d (%lu)", tiny_data, length[0]); + fprintf(stdout, "\n\t short : %d (%lu)", small_data, length[3]); + fprintf(stdout, "\n\t int : %d (%lu)", int_data, length[2]); + fprintf(stdout, "\n\t big : %lld (%lu)", big_data, length[4]); - fprintf(stdout, "\n\t float : %f (%lu)", real_data, length[5]); - fprintf(stdout, "\n\t double : %f (%lu)", double_data, length[6]); + fprintf(stdout, "\n\t float : %f (%lu)", real_data, length[5]); + fprintf(stdout, "\n\t double : %f (%lu)", double_data, length[6]); - fprintf(stdout, "\n\t str : %s (%lu)", str_data, length[1]); + fprintf(stdout, "\n\t str : %s (%lu)", str_data, length[1]); + } DIE_UNLESS(tiny_data == o_tiny_data); DIE_UNLESS(is_null[0] == 0); @@ -1578,11 +1724,13 @@ static void test_fetch_null() rc++; for (i= 0; i < 10; i++) { - fprintf(stdout, "\n data[%d] : %s", i, - is_null[i] ? "NULL" : "NOT NULL"); + if (!opt_silent) + fprintf(stdout, "\n data[%d] : %s", i, + is_null[i] ? "NULL" : "NOT NULL"); DIE_UNLESS(is_null[i]); } - fprintf(stdout, "\n data[%d]: %d", i, nData); + if (!opt_silent) + fprintf(stdout, "\n data[%d]: %d", i, nData); DIE_UNLESS(nData == 1000 || nData == 88 || nData == 389789); DIE_UNLESS(is_null[i] == 0); DIE_UNLESS(length[i] == 4); @@ -1774,7 +1922,8 @@ static void test_select() rc= mysql_commit(mysql); myquery(rc); - strmov(query, "SELECT * FROM test_select WHERE id= ? AND name=?"); + strmov(query, "SELECT * FROM test_select WHERE id= ? " + "AND CONVERT(name USING utf8) =?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1834,7 +1983,8 @@ static void test_ps_conj_select() "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); myquery(rc); - strmov(query, "select id1, value1 from t1 where id1= ? or value1= ?"); + strmov(query, "select id1, value1 from t1 where id1= ? or " + "CONVERT(value1 USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1913,7 +2063,8 @@ session_id char(9) NOT NULL, \ "(\"abx\", 1, 2, 3, 2003-08-30)"); myquery(rc); - strmov(query, "SELECT * FROM test_select WHERE session_id= ?"); + strmov(query, "SELECT * FROM test_select WHERE " + "CONVERT(session_id USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2367,7 +2518,8 @@ static void test_long_data() /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); rc= mysql_commit(mysql); @@ -2450,7 +2602,8 @@ static void test_long_data_str() } /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); mysql_stmt_close(stmt); @@ -2541,7 +2694,8 @@ static void test_long_data_str1() /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); mysql_stmt_close(stmt); @@ -2692,7 +2846,8 @@ static void test_long_data_bin() } /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); mysql_stmt_close(stmt); @@ -2747,7 +2902,8 @@ static void test_simple_delete() myquery(rc); /* insert by prepare */ - strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND col2= ? AND col3= 100"); + strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND " + "CONVERT(col2 USING utf8)= ? AND col3= 100"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2999,7 +3155,8 @@ static void test_bind_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d, %s(%lu)", nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d, %s(%lu)", nData, szData, length1); DIE_UNLESS(nData == 10); DIE_UNLESS(strcmp(szData, "venu") == 0); DIE_UNLESS(length1 == 4); @@ -3007,7 +3164,8 @@ static void test_bind_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %d, %s(%lu)", nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 2: %d, %s(%lu)", nData, szData, length1); DIE_UNLESS(nData == 20); DIE_UNLESS(strcmp(szData, "MySQL") == 0); DIE_UNLESS(length1 == 5); @@ -3016,7 +3174,7 @@ static void test_bind_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - if (is_null[0]) + if (!opt_silent && is_null[0]) fprintf(stdout, "\n row 3: NULL, %s(%lu)", szData, length1); DIE_UNLESS(is_null[0]); DIE_UNLESS(strcmp(szData, "monty") == 0); @@ -3114,19 +3272,21 @@ static void test_bind_result_ext() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data (tiny) : %d", t_data); - fprintf(stdout, "\n data (short) : %d", s_data); - fprintf(stdout, "\n data (int) : %d", i_data); - fprintf(stdout, "\n data (big) : %lld", b_data); - - fprintf(stdout, "\n data (float) : %f", f_data); - fprintf(stdout, "\n data (double) : %f", d_data); + if (!opt_silent) + { + fprintf(stdout, "\n data (tiny) : %d", t_data); + fprintf(stdout, "\n data (short) : %d", s_data); + fprintf(stdout, "\n data (int) : %d", i_data); + fprintf(stdout, "\n data (big) : %lld", b_data); - fprintf(stdout, "\n data (str) : %s(%lu)", szData, szLength); + fprintf(stdout, "\n data (float) : %f", f_data); + fprintf(stdout, "\n data (double) : %f", d_data); - bData[bLength]= '\0'; /* bData is binary */ - fprintf(stdout, "\n data (bin) : %s(%lu)", bData, bLength); + fprintf(stdout, "\n data (str) : %s(%lu)", szData, szLength); + bData[bLength]= '\0'; /* bData is binary */ + fprintf(stdout, "\n data (bin) : %s(%lu)", bData, bLength); + } DIE_UNLESS(t_data == 19); DIE_UNLESS(s_data == 2999); @@ -3234,16 +3394,19 @@ static void test_bind_result_ext1() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data (tiny) : %s(%lu)", t_data, length[0]); - fprintf(stdout, "\n data (short) : %f(%lu)", s_data, length[1]); - fprintf(stdout, "\n data (int) : %d(%lu)", i_data, length[2]); - fprintf(stdout, "\n data (big) : %d(%lu)", b_data, length[3]); + if (!opt_silent) + { + fprintf(stdout, "\n data (tiny) : %s(%lu)", t_data, length[0]); + fprintf(stdout, "\n data (short) : %f(%lu)", s_data, length[1]); + fprintf(stdout, "\n data (int) : %d(%lu)", i_data, length[2]); + fprintf(stdout, "\n data (big) : %d(%lu)", b_data, length[3]); - fprintf(stdout, "\n data (float) : %d(%lu)", f_data, length[4]); - fprintf(stdout, "\n data (double) : %s(%lu)", d_data, length[5]); + fprintf(stdout, "\n data (float) : %d(%lu)", f_data, length[4]); + fprintf(stdout, "\n data (double) : %s(%lu)", d_data, length[5]); - fprintf(stdout, "\n data (bin) : %ld(%lu)", bData, length[6]); - fprintf(stdout, "\n data (str) : %g(%lu)", szData, length[7]); + fprintf(stdout, "\n data (bin) : %ld(%lu)", bData, length[6]); + fprintf(stdout, "\n data (str) : %g(%lu)", szData, length[7]); + } DIE_UNLESS(strcmp(t_data, "120") == 0); DIE_UNLESS(i_data == 3999); @@ -3368,15 +3531,17 @@ static void bind_fetch(int row_count) rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n"); - fprintf(stdout, "\n tiny : %ld(%lu)", (ulong) i8_data, length[0]); - fprintf(stdout, "\n short : %ld(%lu)", (ulong) i16_data, length[1]); - fprintf(stdout, "\n int : %ld(%lu)", (ulong) i32_data, length[2]); - fprintf(stdout, "\n longlong : %ld(%lu)", (ulong) i64_data, length[3]); - fprintf(stdout, "\n float : %f(%lu)", f_data, length[4]); - fprintf(stdout, "\n double : %g(%lu)", d_data, length[5]); - fprintf(stdout, "\n char : %s(%lu)", s_data, length[6]); - + if (!opt_silent) + { + fprintf(stdout, "\n"); + fprintf(stdout, "\n tiny : %ld(%lu)", (ulong) i8_data, length[0]); + fprintf(stdout, "\n short : %ld(%lu)", (ulong) i16_data, length[1]); + fprintf(stdout, "\n int : %ld(%lu)", (ulong) i32_data, length[2]); + fprintf(stdout, "\n longlong : %ld(%lu)", (ulong) i64_data, length[3]); + fprintf(stdout, "\n float : %f(%lu)", f_data, length[4]); + fprintf(stdout, "\n double : %g(%lu)", d_data, length[5]); + fprintf(stdout, "\n char : %s(%lu)", s_data, length[6]); + } rc= 10+row_count; /* TINY */ @@ -3518,13 +3683,16 @@ static void test_fetch_date() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n date : %s(%lu)", date, d_length); - fprintf(stdout, "\n time : %s(%lu)", time, t_length); - fprintf(stdout, "\n ts : %s(%lu)", ts, ts_length); - fprintf(stdout, "\n year : %d(%lu)", year, y_length); - fprintf(stdout, "\n dt : %s(%lu)", dt, dt_length); - fprintf(stdout, "\n ts(4) : %s(%lu)", ts_4, ts4_length); - fprintf(stdout, "\n ts(6) : %s(%lu)", ts_6, ts6_length); + if (!opt_silent) + { + fprintf(stdout, "\n date : %s(%lu)", date, d_length); + fprintf(stdout, "\n time : %s(%lu)", time, t_length); + fprintf(stdout, "\n ts : %s(%lu)", ts, ts_length); + fprintf(stdout, "\n year : %d(%lu)", year, y_length); + fprintf(stdout, "\n dt : %s(%lu)", dt, dt_length); + fprintf(stdout, "\n ts(4) : %s(%lu)", ts_4, ts4_length); + fprintf(stdout, "\n ts(6) : %s(%lu)", ts_6, ts6_length); + } DIE_UNLESS(strcmp(date, "2002-01-02") == 0); DIE_UNLESS(d_length == 10); @@ -3851,7 +4019,8 @@ static void test_field_names() myheader("test_field_names"); - fprintf(stdout, "\n %d, %d, %d", MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDATE, MYSQL_TYPE_ENUM); + if (!opt_silent) + fprintf(stdout, "\n %d, %d, %d", MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDATE, MYSQL_TYPE_ENUM); rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_field_names1"); myquery(rc); @@ -3902,7 +4071,8 @@ static void test_warnings() rc= mysql_query(mysql, "DROP TABLE if exists test_non_exists"); myquery(rc); - fprintf(stdout, "\n total warnings: %d", mysql_warning_count(mysql)); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", mysql_warning_count(mysql)); rc= mysql_query(mysql, "SHOW WARNINGS"); myquery(rc); @@ -4084,23 +4254,27 @@ static void test_field_flags() mytest(result); mysql_field_seek(result, 0); - fputc('\n', stdout); + if (!opt_silent) + fputc('\n', stdout); for(i= 0; i< mysql_num_fields(result); i++) { field= mysql_fetch_field(result); - fprintf(stdout, "\n field:%d", i); - if (field->flags & NOT_NULL_FLAG) - fprintf(stdout, "\n NOT_NULL_FLAG"); - if (field->flags & PRI_KEY_FLAG) - fprintf(stdout, "\n PRI_KEY_FLAG"); - if (field->flags & UNIQUE_KEY_FLAG) - fprintf(stdout, "\n UNIQUE_KEY_FLAG"); - if (field->flags & MULTIPLE_KEY_FLAG) - fprintf(stdout, "\n MULTIPLE_KEY_FLAG"); - if (field->flags & AUTO_INCREMENT_FLAG) - fprintf(stdout, "\n AUTO_INCREMENT_FLAG"); + if (!opt_silent) + { + fprintf(stdout, "\n field:%d", i); + if (field->flags & NOT_NULL_FLAG) + fprintf(stdout, "\n NOT_NULL_FLAG"); + if (field->flags & PRI_KEY_FLAG) + fprintf(stdout, "\n PRI_KEY_FLAG"); + if (field->flags & UNIQUE_KEY_FLAG) + fprintf(stdout, "\n UNIQUE_KEY_FLAG"); + if (field->flags & MULTIPLE_KEY_FLAG) + fprintf(stdout, "\n MULTIPLE_KEY_FLAG"); + if (field->flags & AUTO_INCREMENT_FLAG) + fprintf(stdout, "\n AUTO_INCREMENT_FLAG"); + } } mysql_free_result(result); } @@ -4119,7 +4293,8 @@ static void test_stmt_close() myheader("test_stmt_close"); - fprintf(stdout, "\n Establishing a test connection ..."); + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); if (!(lmysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -4132,7 +4307,8 @@ static void test_stmt_close() myerror("connection failed"); exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); /* set AUTOCOMMIT to ON*/ @@ -4169,7 +4345,8 @@ static void test_stmt_close() verify_param_count(stmt2, 1); rc= mysql_stmt_close(stmt1); - fprintf(stdout, "\n mysql_close_stmt(1) returned: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n mysql_close_stmt(1) returned: %d", rc); DIE_UNLESS(rc == 0); /* @@ -4203,7 +4380,8 @@ static void test_stmt_close() verify_st_affected_rows(stmt_x, 1); rc= mysql_stmt_close(stmt_x); - fprintf(stdout, "\n mysql_close_stmt(x) returned: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n mysql_close_stmt(x) returned: %d", rc); DIE_UNLESS( rc == 0); rc= mysql_query(mysql, "SELECT id FROM test_stmt_close"); @@ -4262,7 +4440,8 @@ static void test_set_variable() rc= mysql_stmt_fetch(stmt1); check_execute(stmt1, rc); - fprintf(stdout, "\n max_error_count(default): %d", get_count); + if (!opt_silent) + fprintf(stdout, "\n max_error_count(default): %d", get_count); def_count= get_count; DIE_UNLESS(strcmp(var, "max_error_count") == 0); @@ -4292,7 +4471,8 @@ static void test_set_variable() rc= mysql_stmt_fetch(stmt1); check_execute(stmt1, rc); - fprintf(stdout, "\n max_error_count : %d", get_count); + if (!opt_silent) + fprintf(stdout, "\n max_error_count : %d", get_count); DIE_UNLESS(get_count == set_count); rc= mysql_stmt_fetch(stmt1); @@ -4309,7 +4489,8 @@ static void test_set_variable() rc= mysql_stmt_fetch(stmt1); check_execute(stmt1, rc); - fprintf(stdout, "\n max_error_count(default): %d", get_count); + if (!opt_silent) + fprintf(stdout, "\n max_error_count(default): %d", get_count); DIE_UNLESS(get_count == set_count); rc= mysql_stmt_fetch(stmt1); @@ -4367,12 +4548,14 @@ static void test_insert_meta() mysql_field_seek(result, 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col1"); + if (!opt_silent) + fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col1"); DIE_UNLESS(strcmp(field->name, "col1") == 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col3"); + if (!opt_silent) + fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col3"); DIE_UNLESS(strcmp(field->name, "col3") == 0); field= mysql_fetch_field(result); @@ -4429,15 +4612,21 @@ static void test_update_meta() mysql_field_seek(result, 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + } DIE_UNLESS(strcmp(field->name, "col1") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col3"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col3"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + } DIE_UNLESS(strcmp(field->name, "col3") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0); @@ -4493,15 +4682,21 @@ static void test_select_meta() mysql_field_seek(result, 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + } DIE_UNLESS(strcmp(field->name, "col1") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col2"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col2"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + } DIE_UNLESS(strcmp(field->name, "col2") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0); @@ -4545,8 +4740,9 @@ static void test_func_fields() field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, - "test_dateformat"); + if (!opt_silent) + fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, + "test_dateformat"); DIE_UNLESS(strcmp(field->table, "test_dateformat") == 0); field= mysql_fetch_field(result); @@ -4563,7 +4759,8 @@ static void test_func_fields() field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, ""); + if (!opt_silent) + fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, ""); DIE_UNLESS(field->table[0] == '\0'); field= mysql_fetch_field(result); @@ -4580,8 +4777,11 @@ static void test_func_fields() field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n field name: `%s` (expected: `%s`)", field->name, "YEAR"); - fprintf(stdout, "\n field org name: `%s` (expected: `%s`)", field->org_name, ""); + if (!opt_silent) + { + printf("\n field name: `%s` (expected: `%s`)", field->name, "YEAR"); + printf("\n field org name: `%s` (expected: `%s`)", field->org_name, ""); + } DIE_UNLESS(strcmp(field->name, "YEAR") == 0); DIE_UNLESS(field->org_name[0] == '\0'); @@ -4658,8 +4858,11 @@ static void test_multi_stmt() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); - fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + if (!opt_silent) + { + fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); + fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + } DIE_UNLESS(id == 10); DIE_UNLESS(strcmp(name, "mysql") == 0); @@ -4668,7 +4871,8 @@ static void test_multi_stmt() /* alter the table schema now */ stmt1= mysql_simple_prepare(mysql, "DELETE FROM test_multi_table " - "WHERE id= ? AND name=?"); + "WHERE id= ? AND " + "CONVERT(name USING utf8)=?"); check_stmt(stmt1); verify_param_count(stmt1, 2); @@ -4687,8 +4891,11 @@ static void test_multi_stmt() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); - fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + if (!opt_silent) + { + fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); + fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + } DIE_UNLESS(id == 10); DIE_UNLESS(strcmp(name, "updated") == 0); @@ -4762,12 +4969,14 @@ static void test_manual_sample() fprintf(stderr, "\n %s", mysql_error(mysql)); exit(1); } - fprintf(stdout, "\n prepare, insert successful"); + if (!opt_silent) + fprintf(stdout, "\n prepare, insert successful"); /* Get the parameter count from the statement */ param_count= mysql_stmt_param_count(stmt); - fprintf(stdout, "\n total parameters in insert: %d", param_count); + if (!opt_silent) + fprintf(stdout, "\n total parameters in insert: %d", param_count); if (param_count != 3) /* validate parameter count */ { fprintf(stderr, "\n invalid parameter count returned by MySQL"); @@ -4823,7 +5032,8 @@ static void test_manual_sample() /* Get the total rows affected */ affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: %lld", affected_rows); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: %lld", affected_rows); if (affected_rows != 1) /* validate affected rows */ { fprintf(stderr, "\n invalid affected rows by MySQL"); @@ -4847,7 +5057,8 @@ static void test_manual_sample() /* Get the total rows affected */ affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: %lld", affected_rows); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: %lld", affected_rows); if (affected_rows != 1) /* validate affected rows */ { fprintf(stderr, "\n invalid affected rows by MySQL"); @@ -4871,7 +5082,8 @@ static void test_manual_sample() fprintf(stderr, "\n %s", mysql_error(mysql)); exit(1); } - fprintf(stdout, "Success !!!"); + if (!opt_silent) + fprintf(stdout, "Success !!!"); } @@ -4993,13 +5205,14 @@ DROP TABLE IF EXISTS test_multi_tab"; for (count= 0 ; count < array_elements(rows) ; count++) { - fprintf(stdout, "\n Query %d: ", count); + if (!opt_silent) + fprintf(stdout, "\n Query %d: ", count); if ((result= mysql_store_result(mysql_local))) { (void) my_process_result_set(result); mysql_free_result(result); } - else + else if (!opt_silent) fprintf(stdout, "OK, %lld row(s) affected, %d warning(s)\n", mysql_affected_rows(mysql_local), mysql_warning_count(mysql_local)); @@ -5007,7 +5220,7 @@ DROP TABLE IF EXISTS test_multi_tab"; exp_value= (uint) mysql_affected_rows(mysql_local); if (rows[count] != exp_value) { - fprintf(stdout, "row %d had affected rows: %d, should be %d\n", + fprintf(stderr, "row %d had affected rows: %d, should be %d\n", count, exp_value, rows[count]); exit(1); } @@ -5083,7 +5296,7 @@ static void test_prepare_multi_statements() if (!(mysql_local= mysql_init(NULL))) { - fprintf(stdout, "\n mysql_init() failed"); + fprintf(stderr, "\n mysql_init() failed"); exit(1); } @@ -5091,7 +5304,7 @@ static void test_prepare_multi_statements() opt_password, current_db, opt_port, opt_unix_socket, CLIENT_MULTI_STATEMENTS))) { - fprintf(stdout, "\n connection failed(%s)", mysql_error(mysql_local)); + fprintf(stderr, "\n connection failed(%s)", mysql_error(mysql_local)); exit(1); } strmov(query, "select 1; select 'another value'"); @@ -5159,7 +5372,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 10); DIE_UNLESS(strcmp(szData, "venu") == 0); DIE_UNLESS(length1 == 4); @@ -5167,7 +5381,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 20); DIE_UNLESS(strcmp(szData, "mysql") == 0); DIE_UNLESS(length1 == 5); @@ -5176,7 +5391,7 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - if (is_null[0]) + if (!opt_silent && is_null[0]) fprintf(stdout, "\n row 3: NULL, %s(%lu)", szData, length1); DIE_UNLESS(is_null[0]); DIE_UNLESS(strcmp(szData, "monty") == 0); @@ -5194,7 +5409,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 10); DIE_UNLESS(strcmp(szData, "venu") == 0); DIE_UNLESS(length1 == 4); @@ -5202,7 +5418,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 20); DIE_UNLESS(strcmp(szData, "mysql") == 0); DIE_UNLESS(length1 == 5); @@ -5211,7 +5428,7 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - if (is_null[0]) + if (!opt_silent && is_null[0]) fprintf(stdout, "\n row 3: NULL, %s(%lu)", szData, length1); DIE_UNLESS(is_null[0]); DIE_UNLESS(strcmp(szData, "monty") == 0); @@ -5260,7 +5477,8 @@ static void test_store_result1() rc= 0; while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) rc++; - fprintf(stdout, "\n total rows: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows: %d", rc); DIE_UNLESS(rc == 3); rc= mysql_stmt_execute(stmt); @@ -5272,7 +5490,8 @@ static void test_store_result1() rc= 0; while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) rc++; - fprintf(stdout, "\n total rows: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows: %d", rc); DIE_UNLESS(rc == 3); mysql_stmt_close(stmt); @@ -5338,7 +5557,8 @@ static void test_store_result2() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", nData); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", nData); DIE_UNLESS(nData == 10); rc= mysql_stmt_fetch(stmt); @@ -5355,7 +5575,8 @@ static void test_store_result2() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", nData); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", nData); DIE_UNLESS(nData == 20); rc= mysql_stmt_fetch(stmt); @@ -5414,9 +5635,6 @@ static void test_subselect() rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); - check_execute(stmt, rc); - id= 2; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -5458,7 +5676,8 @@ static void test_subselect() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", id); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", id); DIE_UNLESS(id == 1); rc= mysql_stmt_fetch(stmt); @@ -5471,7 +5690,8 @@ static void test_subselect() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", id); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", id); DIE_UNLESS(id == 0); rc= mysql_stmt_fetch(stmt); @@ -5587,21 +5807,21 @@ static void test_bind_date_conv(uint row_count) rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n"); + if (!opt_silent) + fprintf(stdout, "\n"); for (i= 0; i < array_elements(bind); i++) { - fprintf(stdout, "\n"); - fprintf(stdout, " time[%d]: %02d-%02d-%02d %02d:%02d:%02d.%02lu", - i, tm[i].year, tm[i].month, tm[i].day, - tm[i].hour, tm[i].minute, tm[i].second, - tm[i].second_part); - + if (!opt_silent) + fprintf(stdout, "\ntime[%d]: %02d-%02d-%02d %02d:%02d:%02d.%02lu", + i, tm[i].year, tm[i].month, tm[i].day, + tm[i].hour, tm[i].minute, tm[i].second, + tm[i].second_part); DIE_UNLESS(tm[i].year == 0 || tm[i].year == year+count); DIE_UNLESS(tm[i].month == 0 || tm[i].month == month+count); DIE_UNLESS(tm[i].day == 0 || tm[i].day == day+count); DIE_UNLESS(tm[i].hour == 0 || tm[i].hour == hour+count); -#if 0 +#ifdef NOT_USED /* minute causes problems from date<->time, don't assert, instead validate separatly in another routine @@ -5758,7 +5978,7 @@ static void test_pure_coverage() check_execute(stmt, rc); rc= mysql_stmt_bind_result(stmt, (MYSQL_BIND*)0); - check_execute(stmt, rc); + DIE_UNLESS(rc == 1); mysql_stmt_close(stmt); @@ -5856,7 +6076,8 @@ static void test_buffers() buffer[1]= 'X'; rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(buffer[0] == 'M'); DIE_UNLESS(buffer[1] == 'X'); DIE_UNLESS(length == 5); @@ -5867,7 +6088,8 @@ static void test_buffers() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(strncmp(buffer, "Database", 8) == 0); DIE_UNLESS(length == 8); @@ -5877,7 +6099,8 @@ static void test_buffers() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(strcmp(buffer, "Open-Source") == 0); DIE_UNLESS(length == 11); @@ -5887,7 +6110,8 @@ static void test_buffers() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(strncmp(buffer, "Popula", 6) == 0); DIE_UNLESS(length == 7); @@ -6018,7 +6242,8 @@ static void test_fetch_nobuffs() while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) rc++; - fprintf(stdout, "\n total rows : %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows : %d", rc); DIE_UNLESS(rc == 1); bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -6041,12 +6266,16 @@ static void test_fetch_nobuffs() while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) { rc++; - fprintf(stdout, "\n CURRENT_DATABASE(): %s", str[0]); - fprintf(stdout, "\n CURRENT_USER() : %s", str[1]); - fprintf(stdout, "\n CURRENT_DATE() : %s", str[2]); - fprintf(stdout, "\n CURRENT_TIME() : %s", str[3]); + if (!opt_silent) + { + fprintf(stdout, "\n CURRENT_DATABASE(): %s", str[0]); + fprintf(stdout, "\n CURRENT_USER() : %s", str[1]); + fprintf(stdout, "\n CURRENT_DATE() : %s", str[2]); + fprintf(stdout, "\n CURRENT_TIME() : %s", str[3]); + } } - fprintf(stdout, "\n total rows : %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows : %d", rc); DIE_UNLESS(rc == 1); mysql_stmt_close(stmt); @@ -6113,10 +6342,13 @@ static void test_ushort_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n ushort : %d (%ld)", short_value, s_length); - fprintf(stdout, "\n ulong : %lu (%ld)", (ulong) long_value, l_length); - fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); - fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + if (!opt_silent) + { + fprintf(stdout, "\n ushort : %d (%ld)", short_value, s_length); + fprintf(stdout, "\n ulong : %lu (%ld)", (ulong) long_value, l_length); + fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); + fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + } DIE_UNLESS(short_value == 35999); DIE_UNLESS(s_length == 2); @@ -6197,10 +6429,13 @@ static void test_sshort_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); - fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); - fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); - fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + if (!opt_silent) + { + fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); + fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); + fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); + fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + } DIE_UNLESS(short_value == -5999); DIE_UNLESS(s_length == 2); @@ -6281,10 +6516,13 @@ static void test_stiny_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); - fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); - fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); - fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + if (!opt_silent) + { + fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); + fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); + fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); + fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + } DIE_UNLESS(short_value == -128); DIE_UNLESS(s_length == 2); @@ -6373,7 +6611,8 @@ static void test_field_misc() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n default table type: %s(%ld)", table_type, type_length); + if (!opt_silent) + fprintf(stdout, "\n default table type: %s(%ld)", table_type, type_length); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); @@ -6396,7 +6635,7 @@ static void test_field_misc() "@@table_type", "", /* field and its org name */ MYSQL_TYPE_STRING, /* field type */ "", "", /* table and its org name */ - "", type_length*3, 0); /* db name, length */ + "", type_length, 0); /* db name, length */ mysql_free_result(result); mysql_stmt_close(stmt); @@ -6493,7 +6732,8 @@ static void test_set_option() rc= mysql_query(mysql, "INSERT INTO test_limit VALUES(10), (20), (30), (40)"); myquery(rc); - fprintf(stdout, "\n with SQL_SELECT_LIMIT= 2 (direct)"); + if (!opt_silent) + fprintf(stdout, "\n with SQL_SELECT_LIMIT= 2 (direct)"); rc= mysql_query(mysql, "SELECT * FROM test_limit"); myquery(rc); @@ -6505,7 +6745,8 @@ static void test_set_option() mysql_free_result(result); - fprintf(stdout, "\n with SQL_SELECT_LIMIT=2 (prepare)"); + if (!opt_silent) + fprintf(stdout, "\n with SQL_SELECT_LIMIT=2 (prepare)"); stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_limit"); check_stmt(stmt); @@ -6518,7 +6759,8 @@ static void test_set_option() mysql_stmt_close(stmt); /* RESET the LIMIT the rows count to 0 */ - fprintf(stdout, "\n with SQL_SELECT_LIMIT=DEFAULT (prepare)"); + if (!opt_silent) + fprintf(stdout, "\n with SQL_SELECT_LIMIT=DEFAULT (prepare)"); rc= mysql_query(mysql, "SET OPTION SQL_SELECT_LIMIT=DEFAULT"); myquery(rc); @@ -6576,7 +6818,8 @@ static void test_prepare_grant() MYSQL *org_mysql= mysql, *lmysql; MYSQL_STMT *stmt; - fprintf(stdout, "\n Establishing a test connection ..."); + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); if (!(lmysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -6590,7 +6833,8 @@ static void test_prepare_grant() mysql_close(lmysql); exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); mysql= lmysql; rc= mysql_query(mysql, "INSERT INTO test_grant VALUES(NULL)"); @@ -6677,14 +6921,16 @@ static void test_frm_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data directory: %s", data_dir); + if (!opt_silent) + fprintf(stdout, "\n data directory: %s", data_dir); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); strxmov(test_frm, data_dir, "/", current_db, "/", "test_frm_bug.frm", NullS); - fprintf(stdout, "\n test_frm: %s", test_frm); + if (!opt_silent) + fprintf(stdout, "\n test_frm: %s", test_frm); if (!(test_file= my_fopen(test_frm, (int) (O_RDWR | O_CREAT), MYF(MY_WME)))) { @@ -6692,7 +6938,8 @@ static void test_frm_bug() fprintf(stdout, "\n test cancelled"); exit(1); } - fprintf(test_file, "this is a junk file for test"); + if (!opt_silent) + fprintf(test_file, "this is a junk file for test"); rc= mysql_query(mysql, "SHOW TABLE STATUS like 'test_frm_bug'"); myquery(rc); @@ -6708,7 +6955,8 @@ static void test_frm_bug() row= mysql_fetch_row(result); mytest(row); - fprintf(stdout, "\n Comment: %s", row[17]); + if (!opt_silent) + fprintf(stdout, "\n Comment: %s", row[17]); DIE_UNLESS(row[17] != 0); mysql_free_result(result); @@ -6771,7 +7019,8 @@ static void test_decimal_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s", data); + if (!opt_silent) + fprintf(stdout, "\n data: %s", data); DIE_UNLESS(strcmp(data, "8.00") == 0); rc= mysql_stmt_fetch(stmt); @@ -6788,7 +7037,8 @@ static void test_decimal_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s", data); + if (!opt_silent) + fprintf(stdout, "\n data: %s", data); DIE_UNLESS(strcmp(data, "5.61") == 0); rc= mysql_stmt_fetch(stmt); @@ -6812,7 +7062,8 @@ static void test_decimal_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s", data); + if (!opt_silent) + fprintf(stdout, "\n data: %s", data); DIE_UNLESS(strcmp(data, "10.22") == 0); rc= mysql_stmt_fetch(stmt); @@ -6852,8 +7103,9 @@ static void test_explain_bug() result= mysql_stmt_result_metadata(stmt); mytest(result); - fprintf(stdout, "\n total fields in the result: %d", - mysql_num_fields(result)); + if (!opt_silent) + fprintf(stdout, "\n total fields in the result: %d", + mysql_num_fields(result)); DIE_UNLESS(6 == mysql_num_fields(result)); verify_prepare_field(result, 0, "Field", "", MYSQL_TYPE_VAR_STRING, @@ -6889,8 +7141,9 @@ static void test_explain_bug() result= mysql_stmt_result_metadata(stmt); mytest(result); - fprintf(stdout, "\n total fields in the result: %d", - mysql_num_fields(result)); + if (!opt_silent) + fprintf(stdout, "\n total fields in the result: %d", + mysql_num_fields(result)); DIE_UNLESS(10 == mysql_num_fields(result)); verify_prepare_field(result, 0, "id", "", MYSQL_TYPE_LONGLONG, @@ -6911,8 +7164,12 @@ static void test_explain_bug() verify_prepare_field(result, 5, "key", "", MYSQL_TYPE_VAR_STRING, "", "", "", NAME_LEN, 0); - verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_LONGLONG, - "", "", "", 3, 0); + verify_prepare_field(result, 6, "key_len", "", + (mysql_get_server_version(mysql) <= 50000 ? + MYSQL_TYPE_LONGLONG : MYSQL_TYPE_VAR_STRING), + "", "", "", + (mysql_get_server_version(mysql) <= 50000 ? 3 : 4096), + 0); verify_prepare_field(result, 7, "ref", "", MYSQL_TYPE_VAR_STRING, "", "", "", NAME_LEN*16, 0); @@ -6938,11 +7195,14 @@ static void test_explain_bug() static void check_errcode(const unsigned int err) { - if (mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); - fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + if (!opt_silent || mysql_errno(mysql) != err) + { + if (mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); + fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + } DIE_UNLESS(mysql_errno(mysql) == err); } @@ -6988,7 +7248,8 @@ static void test_drop_temp() { MYSQL *org_mysql= mysql, *lmysql; - fprintf(stdout, "\n Establishing a test connection ..."); + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); if (!(lmysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -7007,7 +7268,8 @@ static void test_drop_temp() mysql_close(lmysql); exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); mysql= lmysql; rc= mysql_query(mysql, "INSERT INTO t1 VALUES(10, 'C')"); @@ -7076,14 +7338,16 @@ static void test_cuted_rows() myquery(rc); count= mysql_warning_count(mysql); - fprintf(stdout, "\n total warnings: %d", count); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", count); DIE_UNLESS(count == 0); rc= mysql_query(mysql, "INSERT INTO t2 SELECT * FROM t1"); myquery(rc); count= mysql_warning_count(mysql); - fprintf(stdout, "\n total warnings: %d", count); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", count); DIE_UNLESS(count == 2); rc= mysql_query(mysql, "SHOW WARNINGS"); @@ -7100,7 +7364,8 @@ static void test_cuted_rows() myquery(rc); count= mysql_warning_count(mysql); - fprintf(stdout, "\n total warnings: %d", count); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", count); DIE_UNLESS(count == 2); rc= mysql_query(mysql, "SHOW WARNINGS"); @@ -7213,8 +7478,11 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n id : %d", id); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + { + fprintf(stdout, "\n id : %d", id); + fprintf(stdout, "\n name : %s(%ld)", data, length); + } DIE_UNLESS(id == 9876); DIE_UNLESS(length == 19); /* Due to VARCHAR(20) */ @@ -7223,7 +7491,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 1); DIE_UNLESS(strcmp(data, "'") == 0); @@ -7231,7 +7500,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 1); DIE_UNLESS(strcmp(data, "\"") == 0); @@ -7239,7 +7509,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 7); DIE_UNLESS(strcmp(data, "my\'sql\'") == 0); @@ -7247,7 +7518,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 7); /*DIE_UNLESS(strcmp(data, "my\"sql\"") == 0); */ @@ -7293,7 +7565,8 @@ static void test_nstmts() for (i= 0; i < total_stmts; i++) { - fprintf(stdout, "\r stmt: %d", i); + if (!opt_silent) + fprintf(stdout, "\r stmt: %d", i); strmov(query, "insert into test_nstmts values(?)"); stmt= mysql_simple_prepare(mysql, query); @@ -7320,7 +7593,8 @@ static void test_nstmts() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n total rows: %d", i); + if (!opt_silent) + fprintf(stdout, "\n total rows: %d", i); DIE_UNLESS( i == total_stmts); rc= mysql_stmt_fetch(stmt); @@ -7345,17 +7619,17 @@ static void test_fetch_seek() char c2[11], c3[20]; myheader("test_fetch_seek"); + rc= mysql_query(mysql, "drop table if exists t1"); - rc= mysql_query(mysql, "drop table if exists test_seek"); myquery(rc); - rc= mysql_query(mysql, "create table test_seek(c1 int primary key auto_increment, c2 char(10), c3 timestamp(14))"); + rc= mysql_query(mysql, "create table t1(c1 int primary key auto_increment, c2 char(10), c3 timestamp(14))"); myquery(rc); - rc= mysql_query(mysql, "insert into test_seek(c2) values('venu'), ('mysql'), ('open'), ('source')"); + rc= mysql_query(mysql, "insert into t1(c2) values('venu'), ('mysql'), ('open'), ('source')"); myquery(rc); - stmt= mysql_simple_prepare(mysql, "select * from test_seek"); + stmt= mysql_simple_prepare(mysql, "select * from t1"); check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; @@ -7386,7 +7660,8 @@ static void test_fetch_seek() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); row= mysql_stmt_row_tell(stmt); @@ -7395,21 +7670,24 @@ static void test_fetch_seek() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); row= mysql_stmt_row_seek(stmt, row); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); mysql_stmt_data_seek(stmt, 0); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); @@ -7424,6 +7702,7 @@ static void test_fetch_seek() DIE_UNLESS(rc == MYSQL_NO_DATA); mysql_stmt_close(stmt); + myquery(mysql_query(mysql, "drop table t1")); } @@ -7441,16 +7720,16 @@ static void test_fetch_offset() myheader("test_fetch_offset"); - rc= mysql_query(mysql, "drop table if exists test_column"); + rc= mysql_query(mysql, "drop table if exists t1"); myquery(rc); - rc= mysql_query(mysql, "create table test_column(a char(10))"); + rc= mysql_query(mysql, "create table t1(a char(10))"); myquery(rc); - rc= mysql_query(mysql, "insert into test_column values('abcdefghij'), (null)"); + rc= mysql_query(mysql, "insert into t1 values('abcdefghij'), (null)"); myquery(rc); - stmt= mysql_simple_prepare(mysql, "select * from test_column"); + stmt= mysql_simple_prepare(mysql, "select * from t1"); check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -7477,17 +7756,20 @@ static void test_fetch_offset() data[0]= '\0'; rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s (%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "abcd", 4) == 0 && length == 10); rc= mysql_stmt_fetch_column(stmt, bind, 0, 5); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s (%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "fg", 2) == 0 && length == 10); rc= mysql_stmt_fetch_column(stmt, bind, 0, 9); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %s (%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n col 0: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "j", 1) == 0 && length == 10); rc= mysql_stmt_fetch(stmt); @@ -7507,6 +7789,8 @@ static void test_fetch_offset() check_execute_r(stmt, rc); mysql_stmt_close(stmt); + + myquery(mysql_query(mysql, "drop table t1")); } @@ -7522,16 +7806,16 @@ static void test_fetch_column() myheader("test_fetch_column"); - rc= mysql_query(mysql, "drop table if exists test_column"); + rc= mysql_query(mysql, "drop table if exists t1"); myquery(rc); - rc= mysql_query(mysql, "create table test_column(c1 int primary key auto_increment, c2 char(10))"); + rc= mysql_query(mysql, "create table t1(c1 int primary key auto_increment, c2 char(10))"); myquery(rc); - rc= mysql_query(mysql, "insert into test_column(c2) values('venu'), ('mysql')"); + rc= mysql_query(mysql, "insert into t1(c2) values('venu'), ('mysql')"); myquery(rc); - stmt= mysql_simple_prepare(mysql, "select * from test_column order by c2 desc"); + stmt= mysql_simple_prepare(mysql, "select * from t1 order by c2 desc"); check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; @@ -7560,7 +7844,8 @@ static void test_fetch_column() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 0: %d, %s", bc1, bc2); + if (!opt_silent) + fprintf(stdout, "\n row 0: %d, %s", bc1, bc2); c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -7571,13 +7856,15 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "venu", 4) == 0 && l2 == 4); c2[0]= '\0'; l2= 0; rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strcmp(c2, "venu") == 0 && l2 == 4); c1= 0; @@ -7589,13 +7876,15 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); DIE_UNLESS(c1 == 1 && l1 == 4); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d, %s", bc1, bc2); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d, %s", bc1, bc2); c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -7606,13 +7895,15 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "mysq", 4) == 0 && l2 == 5); c2[0]= '\0'; l2= 0; rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %si(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %si(%ld)", c2, l2); DIE_UNLESS(strcmp(c2, "mysql") == 0 && l2 == 5); c1= 0; @@ -7624,7 +7915,8 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); DIE_UNLESS(c1 == 2 && l1 == 4); rc= mysql_stmt_fetch(stmt); @@ -7634,6 +7926,7 @@ static void test_fetch_column() check_execute_r(stmt, rc); mysql_stmt_close(stmt); + myquery(mysql_query(mysql, "drop table t1")); } @@ -7645,27 +7938,28 @@ static void test_list_fields() int rc; myheader("test_list_fields"); - rc= mysql_query(mysql, "drop table if exists test_list_fields"); + rc= mysql_query(mysql, "drop table if exists t1"); myquery(rc); - rc= mysql_query(mysql, "create table test_list_fields(c1 int primary key auto_increment, c2 char(10) default 'mysql')"); + rc= mysql_query(mysql, "create table t1(c1 int primary key auto_increment, c2 char(10) default 'mysql')"); myquery(rc); - result= mysql_list_fields(mysql, "test_list_fields", NULL); + result= mysql_list_fields(mysql, "t1", NULL); mytest(result); rc= my_process_result_set(result); DIE_UNLESS(rc == 0); verify_prepare_field(result, 0, "c1", "c1", MYSQL_TYPE_LONG, - "test_list_fields", "test_list_fields", + "t1", "t1", current_db, 11, "0"); verify_prepare_field(result, 1, "c2", "c2", MYSQL_TYPE_STRING, - "test_list_fields", "test_list_fields", + "t1", "t1", current_db, 10, "mysql"); mysql_free_result(result); + myquery(mysql_query(mysql, "drop table t1")); } @@ -7678,7 +7972,6 @@ static void test_mem_overun() MYSQL_RES *field_res; int rc, i, length; - myheader("test_mem_overun"); /* @@ -7728,7 +8021,8 @@ static void test_mem_overun() field_res= mysql_stmt_result_metadata(stmt); mytest(field_res); - fprintf(stdout, "\n total fields : %d", mysql_num_fields(field_res)); + if (!opt_silent) + fprintf(stdout, "\n total fields : %d", mysql_num_fields(field_res)); DIE_UNLESS( 1000 == mysql_num_fields(field_res)); rc= mysql_stmt_store_result(stmt); @@ -7795,7 +8089,8 @@ static void test_free_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 0: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "1", 1) == 0 && l2 == 1); rc= mysql_stmt_fetch(stmt); @@ -7810,7 +8105,8 @@ static void test_free_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); DIE_UNLESS(c1 == 2 && l2 == 4); rc= mysql_query(mysql, "drop table test_free_result"); @@ -7877,7 +8173,8 @@ static void test_free_store_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "1", 1) == 0 && l2 == 1); rc= mysql_stmt_fetch(stmt); @@ -7892,7 +8189,8 @@ static void test_free_store_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); DIE_UNLESS(c1 == 2 && l2 == 4); rc= mysql_stmt_free_result(stmt); @@ -7924,16 +8222,19 @@ static void test_sqlmode() /* PIPES_AS_CONCAT */ strcpy(query, "SET SQL_MODE= \"PIPES_AS_CONCAT\""); - fprintf(stdout, "\n With %s", query); + if (!opt_silent) + fprintf(stdout, "\n With %s", query); rc= mysql_query(mysql, query); myquery(rc); strcpy(query, "INSERT INTO test_piping VALUES(?||?)"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); + if (!opt_silent) + fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); /* We need to bzero bind structure because mysql_stmt_bind_param checks all @@ -7963,21 +8264,25 @@ static void test_sqlmode() myquery(rc); strcpy(query, "SELECT connection_id ()"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt_r(stmt); /* ANSI */ strcpy(query, "SET SQL_MODE= \"ANSI\""); - fprintf(stdout, "\n With %s", query); + if (!opt_silent) + fprintf(stdout, "\n With %s", query); rc= mysql_query(mysql, query); myquery(rc); strcpy(query, "INSERT INTO test_piping VALUES(?||?)"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); + if (!opt_silent) + fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); @@ -7991,7 +8296,8 @@ static void test_sqlmode() /* ANSI mode spaces ... */ strcpy(query, "SELECT connection_id ()"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -8003,18 +8309,21 @@ static void test_sqlmode() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); - fprintf(stdout, "\n returned 1 row\n"); + if (!opt_silent) + fprintf(stdout, "\n returned 1 row\n"); mysql_stmt_close(stmt); /* IGNORE SPACE MODE */ strcpy(query, "SET SQL_MODE= \"IGNORE_SPACE\""); - fprintf(stdout, "\n With %s", query); + if (!opt_silent) + fprintf(stdout, "\n With %s", query); rc= mysql_query(mysql, query); myquery(rc); strcpy(query, "SELECT connection_id ()"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -8026,7 +8335,8 @@ static void test_sqlmode() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); - fprintf(stdout, "\n returned 1 row"); + if (!opt_silent) + fprintf(stdout, "\n returned 1 row"); mysql_stmt_close(stmt); } @@ -8118,7 +8428,8 @@ static void test_ts() sprintf(query, "SELECT a, b, c FROM test_ts WHERE %c=?", name); - fprintf(stdout, "\n %s", query); + if (!opt_silent) + fprintf(stdout, "\n %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -8131,7 +8442,8 @@ static void test_ts() while (mysql_stmt_fetch(stmt) == 0) row_count++; - fprintf(stdout, "\n returned '%d' rows", row_count); + if (!opt_silent) + fprintf(stdout, "\n returned '%d' rows", row_count); DIE_UNLESS(row_count == 2); mysql_stmt_close(stmt); } @@ -8273,7 +8585,8 @@ static void test_bug1946() check_stmt(stmt); rc= mysql_real_query(mysql, query, strlen(query)); DIE_UNLESS(rc != 0); - fprintf(stdout, "Got error (as expected):\n"); + if (!opt_silent) + fprintf(stdout, "Got error (as expected):\n"); myerror(NULL); mysql_stmt_close(stmt); @@ -8291,19 +8604,23 @@ static void test_parse_error_and_bad_length() rc= mysql_query(mysql, "SHOW DATABAAAA"); DIE_UNLESS(rc); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); rc= mysql_real_query(mysql, "SHOW DATABASES", 100); DIE_UNLESS(rc); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); stmt= mysql_simple_prepare(mysql, "SHOW DATABAAAA"); DIE_UNLESS(!stmt); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); stmt= mysql_stmt_init(mysql); DIE_UNLESS(stmt); rc= mysql_stmt_prepare(stmt, "SHOW DATABASES", 100); DIE_UNLESS(rc != 0); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_stmt_error(stmt)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_stmt_error(stmt)); mysql_stmt_close(stmt); } @@ -8324,7 +8641,8 @@ static void test_bug2247() myheader("test_bug2247"); - fprintf(stdout, "\nChecking if stmt_affected_rows is not affected by\n" + if (!opt_silent) + fprintf(stdout, "\nChecking if stmt_affected_rows is not affected by\n" "mysql_query ... "); /* create table and insert few rows */ rc= mysql_query(mysql, drop); @@ -8381,7 +8699,8 @@ static void test_bug2247() DIE_UNLESS(mysql_stmt_affected_rows(stmt) == exp_count); mysql_stmt_close(stmt); - fprintf(stdout, "OK"); + if (!opt_silent) + fprintf(stdout, "OK"); } @@ -8659,7 +8978,8 @@ static void test_bug3117() check_execute(stmt, rc); DIE_UNLESS(is_null == 0 && lii == 1); - fprintf(stdout, "\n\tLAST_INSERT_ID()= 1 ok\n"); + if (!opt_silent) + fprintf(stdout, "\n\tLAST_INSERT_ID()= 1 ok\n"); rc= mysql_query(mysql, "INSERT INTO t1 VALUES (NULL)"); myquery(rc); @@ -8671,7 +8991,8 @@ static void test_bug3117() check_execute(stmt, rc); DIE_UNLESS(is_null == 0 && lii == 2); - fprintf(stdout, "\tLAST_INSERT_ID()= 2 ok\n"); + if (!opt_silent) + fprintf(stdout, "\tLAST_INSERT_ID()= 2 ok\n"); mysql_stmt_close(stmt); @@ -8821,7 +9142,8 @@ static void test_create_drop() { rc= mysql_stmt_execute(stmt_create); check_execute(stmt_create, rc); - fprintf(stdout, "created %i\n", i); + if (!opt_silent) + fprintf(stdout, "created %i\n", i); rc= mysql_stmt_execute(stmt_select); check_execute(stmt_select, rc); @@ -8830,11 +9152,13 @@ static void test_create_drop() rc= mysql_stmt_execute(stmt_drop); check_execute(stmt_drop, rc); - fprintf(stdout, "droped %i\n", i); + if (!opt_silent) + fprintf(stdout, "droped %i\n", i); rc= mysql_stmt_execute(stmt_create_select); check_execute(stmt_create, rc); - fprintf(stdout, "created select %i\n", i); + if (!opt_silent) + fprintf(stdout, "created select %i\n", i); rc= mysql_stmt_execute(stmt_select); check_execute(stmt_select, rc); @@ -8843,7 +9167,8 @@ static void test_create_drop() rc= mysql_stmt_execute(stmt_drop); check_execute(stmt_drop, rc); - fprintf(stdout, "droped %i\n", i); + if (!opt_silent) + fprintf(stdout, "droped %i\n", i); } mysql_stmt_close(stmt_create); @@ -8874,25 +9199,29 @@ static void test_rename() rc= mysql_stmt_execute(stmt); check_execute_r(stmt, rc); - fprintf(stdout, "rename without t3\n"); + if (!opt_silent) + fprintf(stdout, "rename without t3\n"); rc= mysql_query(mysql, "create table t3 (a int)"); myquery(rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - fprintf(stdout, "rename with t3\n"); + if (!opt_silent) + fprintf(stdout, "rename with t3\n"); rc= mysql_stmt_execute(stmt); check_execute_r(stmt, rc); - fprintf(stdout, "rename renamed\n"); + if (!opt_silent) + fprintf(stdout, "rename renamed\n"); rc= mysql_query(mysql, "rename table t2 to t1, t4 to t3"); myquery(rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - fprintf(stdout, "rename reverted\n"); + if (!opt_silent) + fprintf(stdout, "rename reverted\n"); mysql_stmt_close(stmt); @@ -8926,10 +9255,12 @@ static void test_do_set() { rc= mysql_stmt_execute(stmt_do); check_execute(stmt_do, rc); - fprintf(stdout, "do %i\n", i); + if (!opt_silent) + fprintf(stdout, "do %i\n", i); rc= mysql_stmt_execute(stmt_set); check_execute(stmt_set, rc); - fprintf(stdout, "set %i\n", i); + if (!opt_silent) + fprintf(stdout, "set %i\n", i); } mysql_stmt_close(stmt_do); @@ -8995,11 +9326,13 @@ static void test_multi() rc= mysql_stmt_execute(stmt_update); check_execute(stmt_update, rc); - fprintf(stdout, "update %ld\n", (long) param); + if (!opt_silent) + fprintf(stdout, "update %ld\n", (long) param); rc= mysql_stmt_execute(stmt_delete); check_execute(stmt_delete, rc); - fprintf(stdout, "delete %ld\n", (long) param); + if (!opt_silent) + fprintf(stdout, "delete %ld\n", (long) param); rc= mysql_stmt_execute(stmt_select1); check_execute(stmt_select1, rc); @@ -9055,7 +9388,8 @@ static void test_insert_select() { rc= mysql_stmt_execute(stmt_insert); check_execute(stmt_insert, rc); - fprintf(stdout, "insert %u\n", i); + if (!opt_silent) + fprintf(stdout, "insert %u\n", i); rc= mysql_stmt_execute(stmt_select); check_execute(stmt_select, rc); @@ -9915,7 +10249,8 @@ static void test_bug3796() mysql_stmt_bind_result(stmt, bind); rc= mysql_stmt_fetch(stmt); - printf("Concat result: '%s'\n", out_buff); + if (!opt_silent) + printf("Concat result: '%s'\n", out_buff); check_execute(stmt, rc); strcpy(canonical_buff, concat_arg0); strcat(canonical_buff, "ONE"); @@ -9927,7 +10262,8 @@ static void test_bug3796() strcpy(canonical_buff + strlen(concat_arg0), "TWO"); DIE_UNLESS(strlen(canonical_buff) == out_length && strncmp(out_buff, canonical_buff, out_length) == 0); - printf("Concat result: '%s'\n", out_buff); + if (!opt_silent) + printf("Concat result: '%s'\n", out_buff); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); @@ -10001,12 +10337,15 @@ static void test_bug4026() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, - time_out.second_part); - printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, - datetime_out.day, datetime_out.hour, - datetime_out.minute, datetime_out.second, - datetime_out.second_part); + if (!opt_silent) + { + printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, + time_out.second_part); + printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, + datetime_out.day, datetime_out.hour, + datetime_out.minute, datetime_out.second, + datetime_out.second_part); + } DIE_UNLESS(memcmp(&time_in, &time_out, sizeof(time_in)) == 0); DIE_UNLESS(memcmp(&datetime_in, &datetime_out, sizeof(datetime_in)) == 0); mysql_stmt_close(stmt); @@ -10049,8 +10388,9 @@ static void test_bug4079() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc != 0 && rc != MYSQL_NO_DATA); - printf("Got error from mysql_stmt_fetch (as expected):\n%s\n", - mysql_stmt_error(stmt)); + if (!opt_silent) + printf("Got error from mysql_stmt_fetch (as expected):\n%s\n", + mysql_stmt_error(stmt)); /* buggy version of libmysql hanged up here */ mysql_stmt_close(stmt); } @@ -10144,13 +10484,16 @@ static void test_bug4030() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, - time_out.second_part); - printf("%d-%d-%d\n", date_out.year, date_out.month, date_out.day); - printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, - datetime_out.day, datetime_out.hour, - datetime_out.minute, datetime_out.second, - datetime_out.second_part); + if (!opt_silent) + { + printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, + time_out.second_part); + printf("%d-%d-%d\n", date_out.year, date_out.month, date_out.day); + printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, + datetime_out.day, datetime_out.hour, + datetime_out.minute, datetime_out.second, + datetime_out.second_part); + } DIE_UNLESS(memcmp(&time_canonical, &time_out, sizeof(time_out)) == 0); DIE_UNLESS(memcmp(&date_canonical, &date_out, sizeof(date_out)) == 0); DIE_UNLESS(memcmp(&datetime_canonical, &datetime_out, sizeof(datetime_out)) == 0); @@ -10200,7 +10543,8 @@ static void test_bug5126() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); DIE_UNLESS(c1 == 8386608 && c2 == 1); - printf("%ld, %ld\n", (long) c1, (long) c2); + if (!opt_silent) + printf("%ld, %ld\n", (long) c1, (long) c2); mysql_stmt_close(stmt); } @@ -10306,7 +10650,8 @@ static void test_bug5399() check_execute(*stmt, rc); mysql_stmt_bind_result(*stmt, bind); } - printf("%d statements prepared.\n", NUM_OF_USED_STMT); + if (!opt_silent) + printf("%d statements prepared.\n", NUM_OF_USED_STMT); for (stmt= stmt_list; stmt != stmt_list + NUM_OF_USED_STMT; ++stmt) { @@ -10434,6 +10779,12 @@ static void test_bug5194() if (bind == 0 || query == 0 || param_str == 0) { fprintf(stderr, "Can't allocate enough memory for query structs\n"); + if (bind) + free(bind); + if (query) + free(query); + if (param_str) + free(param_str); return; } @@ -10478,15 +10829,17 @@ static void test_bug5194() rc= mysql_stmt_prepare(stmt, query, query_ptr - query); if (rc && nrows * COLUMN_COUNT > uint16_max) { - printf("Failed to prepare a statement with %d placeholders " - "(as expected).\n", nrows * COLUMN_COUNT); + if (!opt_silent) + printf("Failed to prepare a statement with %d placeholders " + "(as expected).\n", nrows * COLUMN_COUNT); break; } else check_execute(stmt, rc); - printf("Insert: query length= %d, row count= %d, param count= %lu\n", - strlen(query), nrows, mysql_stmt_param_count(stmt)); + if (!opt_silent) + printf("Insert: query length= %d, row count= %d, param count= %lu\n", + strlen(query), nrows, mysql_stmt_param_count(stmt)); /* bind the parameter array and execute the query */ rc= mysql_stmt_bind_param(stmt, bind); @@ -10522,7 +10875,10 @@ static void test_bug5315() rc= mysql_stmt_execute(stmt); DIE_UNLESS(rc != 0); if (rc) - printf("Got error (as expected):\n%s", mysql_stmt_error(stmt)); + { + if (!opt_silent) + printf("Got error (as expected):\n%s", mysql_stmt_error(stmt)); + } /* check that connection is OK */ mysql_stmt_close(stmt); stmt= mysql_stmt_init(mysql); @@ -10570,8 +10926,11 @@ static void test_bug6049() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("Result from query: %s\n", row[0]); - printf("Result from prepared statement: %s\n", (char*) buffer); + if (!opt_silent) + { + printf("Result from query: %s\n", row[0]); + printf("Result from prepared statement: %s\n", (char*) buffer); + } DIE_UNLESS(strcmp(row[0], (char*) buffer) == 0); @@ -10616,8 +10975,11 @@ static void test_bug6058() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("Result from query: %s\n", row[0]); - printf("Result from prepared statement: %s\n", buffer); + if (!opt_silent) + { + printf("Result from query: %s\n", row[0]); + printf("Result from prepared statement: %s\n", buffer); + } DIE_UNLESS(strcmp(row[0], buffer) == 0); @@ -10656,17 +11018,17 @@ static void test_bug6046() stmt_text= "DROP TABLE IF EXISTS t1"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); - stmt_text= "CREATE TABLE a1 (a int, b int)"; + stmt_text= "CREATE TABLE t1 (a int, b int)"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); - stmt_text= "INSERT INTO a1 VALUES (1,1),(2,2),(3,1),(4,2)"; + stmt_text= "INSERT INTO t1 VALUES (1,1),(2,2),(3,1),(4,2)"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); stmt= mysql_stmt_init(mysql); - stmt_text= "SELECT a1.a FROM a1 NATURAL JOIN a1 as X1 " - "WHERE a1.b > ? ORDER BY a1.a"; + stmt_text= "SELECT t1.a FROM t1 NATURAL JOIN t1 as X1 " + "WHERE t1.b > ? ORDER BY t1.a"; rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); @@ -10713,10 +11075,585 @@ static void test_bug6081() rc= simple_command(mysql, COM_CREATE_DB, current_db, (ulong)strlen(current_db), 0); myquery_r(rc); + rc= mysql_select_db(mysql, current_db); + myquery(rc); +} + + +static void test_bug6096() +{ + MYSQL_STMT *stmt; + MYSQL_RES *query_result, *stmt_metadata; + const char *stmt_text; + MYSQL_BIND bind[12]; + MYSQL_FIELD *query_field_list, *stmt_field_list; + ulong query_field_count, stmt_field_count; + int rc; + uint i; + + myheader("test_bug6096"); + + stmt_text= "drop table if exists t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "create table t1 (c_tinyint tinyint, c_smallint smallint, " + " c_mediumint mediumint, c_int int, " + " c_bigint bigint, c_float float, " + " c_double double, c_varchar varchar(20), " + " c_char char(20), c_time time, c_date date, " + " c_datetime datetime)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "insert into t1 values (-100, -20000, 30000000, 4, 8, 1.0, " + "2.0, 'abc', 'def', now(), now(), now())"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "select * from t1"; + + /* Run select in prepared and non-prepared mode and compare metadata */ + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + query_result= mysql_store_result(mysql); + query_field_list= mysql_fetch_fields(query_result); + query_field_count= mysql_num_fields(query_result); + + stmt= mysql_stmt_init(mysql); + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + rc= 1; + mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*)&rc); + mysql_stmt_store_result(stmt); + stmt_metadata= mysql_stmt_result_metadata(stmt); + stmt_field_list= mysql_fetch_fields(stmt_metadata); + stmt_field_count= mysql_num_fields(stmt_metadata); + DIE_UNLESS(stmt_field_count == query_field_count); + + /* Print out and check the metadata */ + + if (!opt_silent) + { + printf(" ------------------------------------------------------------\n"); + printf(" | Metadata \n"); + printf(" ------------------------------------------------------------\n"); + printf(" | Query | Prepared statement \n"); + printf(" ------------------------------------------------------------\n"); + printf(" field name | length | max_length | length | max_length\n"); + printf(" ------------------------------------------------------------\n"); + + for (i= 0; i < query_field_count; ++i) + { + MYSQL_FIELD *f1= &query_field_list[i], *f2= &stmt_field_list[i]; + printf(" %-11s | %9lu | %10lu | %9lu | %10lu \n", + f1->name, f1->length, f1->max_length, f2->length, f2->max_length); + DIE_UNLESS(f1->length == f2->length); + } + printf(" ---------------------------------------------------------------\n"); + } + + /* Bind and fetch the data */ + + bzero(bind, sizeof(bind)); + for (i= 0; i < stmt_field_count; ++i) + { + bind[i].buffer_type= MYSQL_TYPE_STRING; + bind[i].buffer_length= stmt_field_list[i].max_length + 1; + bind[i].buffer= malloc(bind[i].buffer_length); + } + mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_fetch(stmt); + check_execute(stmt, rc); + rc= mysql_stmt_fetch(stmt); + DIE_UNLESS(rc == MYSQL_NO_DATA); + + /* Clean up */ + + for (i= 0; i < stmt_field_count; ++i) + free(bind[i].buffer); + mysql_stmt_close(stmt); + mysql_free_result(query_result); + mysql_free_result(stmt_metadata); + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); } /* + Test of basic checks that are performed in server for components + of MYSQL_TIME parameters. +*/ + +static void test_datetime_ranges() +{ + const char *stmt_text; + int rc, i; + MYSQL_STMT *stmt; + MYSQL_BIND bind[6]; + MYSQL_TIME tm[6]; + + myheader("test_datetime_ranges"); + + stmt_text= "drop table if exists t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "create table t1 (year datetime, month datetime, day datetime, " + "hour datetime, min datetime, sec datetime)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_simple_prepare(mysql, + "INSERT INTO t1 VALUES (?, ?, ?, ?, ?, ?)"); + check_stmt(stmt); + verify_param_count(stmt, 6); + + bzero(bind, sizeof(bind)); + for (i= 0; i < 6; i++) + { + bind[i].buffer_type= MYSQL_TYPE_DATETIME; + bind[i].buffer= &tm[i]; + } + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + tm[0].year= 2004; tm[0].month= 11; tm[0].day= 10; + tm[0].hour= 12; tm[0].minute= 30; tm[0].second= 30; + tm[0].second_part= 0; tm[0].neg= 0; + + tm[5]= tm[4]= tm[3]= tm[2]= tm[1]= tm[0]; + tm[0].year= 10000; tm[1].month= 13; tm[2].day= 32; + tm[3].hour= 24; tm[4].minute= 60; tm[5].second= 60; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + DIE_UNLESS(mysql_warning_count(mysql) != 6); + + verify_col_data("t1", "year", "0000-00-00 00:00:00"); + verify_col_data("t1", "month", "0000-00-00 00:00:00"); + verify_col_data("t1", "day", "0000-00-00 00:00:00"); + verify_col_data("t1", "hour", "0000-00-00 00:00:00"); + verify_col_data("t1", "min", "0000-00-00 00:00:00"); + verify_col_data("t1", "sec", "0000-00-00 00:00:00"); + + mysql_stmt_close(stmt); + + stmt_text= "delete from t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_simple_prepare(mysql, "INSERT INTO t1 (year, month, day) " + "VALUES (?, ?, ?)"); + check_stmt(stmt); + verify_param_count(stmt, 3); + + /* + We reuse contents of bind and tm arrays left from previous part of test. + */ + for (i= 0; i < 3; i++) + bind[i].buffer_type= MYSQL_TYPE_DATE; + + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + DIE_UNLESS(mysql_warning_count(mysql) != 3); + + verify_col_data("t1", "year", "0000-00-00 00:00:00"); + verify_col_data("t1", "month", "0000-00-00 00:00:00"); + verify_col_data("t1", "day", "0000-00-00 00:00:00"); + + mysql_stmt_close(stmt); + + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "create table t1 (day_ovfl time, day time, hour time, min time, sec time)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_simple_prepare(mysql, + "INSERT INTO t1 VALUES (?, ?, ?, ?, ?)"); + check_stmt(stmt); + verify_param_count(stmt, 5); + + /* + Again we reuse what we can from previous part of test. + */ + for (i= 0; i < 5; i++) + bind[i].buffer_type= MYSQL_TYPE_TIME; + + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + tm[0].year= 0; tm[0].month= 0; tm[0].day= 10; + tm[0].hour= 12; tm[0].minute= 30; tm[0].second= 30; + tm[0].second_part= 0; tm[0].neg= 0; + + tm[4]= tm[3]= tm[2]= tm[1]= tm[0]; + tm[0].day= 35; tm[1].day= 34; tm[2].hour= 30; tm[3].minute= 60; tm[4].second= 60; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + DIE_UNLESS(mysql_warning_count(mysql) != 2); + + verify_col_data("t1", "day_ovfl", "838:59:59"); + verify_col_data("t1", "day", "828:30:30"); + verify_col_data("t1", "hour", "270:30:30"); + verify_col_data("t1", "min", "00:00:00"); + verify_col_data("t1", "sec", "00:00:00"); + + mysql_stmt_close(stmt); + + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + + +static void test_bug4172() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[3]; + const char *stmt_text; + MYSQL_RES *res; + MYSQL_ROW row; + int rc; + char f[100], d[100], e[100]; + ulong f_len, d_len, e_len; + + myheader("test_bug4172"); + + mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + mysql_query(mysql, "CREATE TABLE t1 (f float, d double, e decimal(10,4))"); + mysql_query(mysql, "INSERT INTO t1 VALUES (12345.1234, 123456.123456, " + "123456.1234)"); + + stmt= mysql_stmt_init(mysql); + stmt_text= "SELECT f, d, e FROM t1"; + + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + bzero(bind, sizeof(bind)); + bind[0].buffer_type= MYSQL_TYPE_STRING; + bind[0].buffer= f; + bind[0].buffer_length= sizeof(f); + bind[0].length= &f_len; + bind[1].buffer_type= MYSQL_TYPE_STRING; + bind[1].buffer= d; + bind[1].buffer_length= sizeof(d); + bind[1].length= &d_len; + bind[2].buffer_type= MYSQL_TYPE_STRING; + bind[2].buffer= e; + bind[2].buffer_length= sizeof(e); + bind[2].length= &e_len; + + mysql_stmt_bind_result(stmt, bind); + + mysql_stmt_store_result(stmt); + rc= mysql_stmt_fetch(stmt); + check_execute(stmt, rc); + + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + res= mysql_store_result(mysql); + row= mysql_fetch_row(res); + + if (!opt_silent) + { + printf("Binary protocol: float=%s, double=%s, decimal(10,4)=%s\n", + f, d, e); + printf("Text protocol: float=%s, double=%s, decimal(10,4)=%s\n", + row[0], row[1], row[2]); + } + DIE_UNLESS(!strcmp(f, row[0]) && !strcmp(d, row[1]) && !strcmp(e, row[2])); + + mysql_free_result(res); + mysql_stmt_close(stmt); +} + + +static void test_conversion() +{ + MYSQL_STMT *stmt; + const char *stmt_text; + int rc; + MYSQL_BIND bind[1]; + char buff[4]; + ulong length; + + myheader("test_conversion"); + + stmt_text= "DROP TABLE IF EXISTS t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "CREATE TABLE t1 (a TEXT) DEFAULT CHARSET latin1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "SET character_set_connection=utf8, character_set_client=utf8, " + " character_set_results=latin1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + + stmt_text= "INSERT INTO t1 (a) VALUES (?)"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + + bzero(bind, sizeof(bind)); + bind[0].buffer= buff; + bind[0].length= &length; + bind[0].buffer_type= MYSQL_TYPE_STRING; + + mysql_stmt_bind_param(stmt, bind); + + buff[0]= (uchar) 0xC3; + buff[1]= (uchar) 0xA0; + length= 2; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + stmt_text= "SELECT a FROM t1"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + bind[0].buffer_length= sizeof(buff); + mysql_stmt_bind_result(stmt, bind); + + rc= mysql_stmt_fetch(stmt); + DIE_UNLESS(rc == 0); + DIE_UNLESS(length == 1); + DIE_UNLESS((uchar) buff[0] == 0xE0); + rc= mysql_stmt_fetch(stmt); + DIE_UNLESS(rc == MYSQL_NO_DATA); + + mysql_stmt_close(stmt); + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "SET NAMES DEFAULT"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + +static void test_rewind(void) +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind; + int rc = 0; + const char *stmt_text; + long unsigned int length=4, Data=0; + my_bool isnull=0; + + myheader("test_rewind"); + + stmt_text= "CREATE TABLE t1 (a int)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "INSERT INTO t1 VALUES(2),(3),(4)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + + stmt_text= "SELECT * FROM t1"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + + bzero(&bind,sizeof(MYSQL_BIND)); + bind.buffer_type= MYSQL_TYPE_LONG; + bind.buffer= (void *)&Data; /* this buffer won't be altered */ + bind.length= &length; + bind.is_null= &isnull; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + rc= mysql_stmt_store_result(stmt); + DIE_UNLESS(rc == 0); + + rc= mysql_stmt_bind_result(stmt, &bind); + DIE_UNLESS(rc == 0); + + /* retreive all result sets till we are at the end */ + while(!mysql_stmt_fetch(stmt)) + printf("fetched result:%ld\n", Data); + + DIE_UNLESS(rc != MYSQL_NO_DATA); + + /* seek to the first row */ + mysql_stmt_data_seek(stmt, 0); + + /* now we should be able to fetch the results again */ + /* but mysql_stmt_fetch returns MYSQL_NO_DATA */ + while(!(rc= mysql_stmt_fetch(stmt))) + printf("fetched result after seek:%ld\n", Data); + + DIE_UNLESS(rc == MYSQL_NO_DATA); + + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + rc= mysql_stmt_free_result(stmt); + rc= mysql_stmt_close(stmt); +} + + +/* Bug#6761 - mysql_list_fields doesn't work */ + +static void test_bug6761(void) +{ + const char *stmt_text; + MYSQL_RES *res; + int rc; + myheader("test_bug6761"); + + stmt_text= "CREATE TABLE t1 (a int, b char(255), c decimal)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + res= mysql_list_fields(mysql, "t1", "%"); + DIE_UNLESS(res && mysql_num_fields(res) == 3); + mysql_free_result(res); + + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + + +/* Bug#8330 - mysql_stmt_execute crashes (libmysql) */ + +static void test_bug8330() +{ + const char *stmt_text; + MYSQL_STMT *stmt[2]; + int i, rc; + char *query= "select a,b from t1 where a=?"; + MYSQL_BIND bind[2]; + long lval[2]; + + myheader("test_bug8330"); + + stmt_text= "drop table if exists t1"; + /* in case some previos test failed */ + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "create table t1 (a int, b int)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + bzero(bind, sizeof(bind)); + for (i=0; i < 2; i++) + { + stmt[i]= mysql_stmt_init(mysql); + rc= mysql_stmt_prepare(stmt[i], query, strlen(query)); + check_execute(stmt[i], rc); + + bind[i].buffer_type= MYSQL_TYPE_LONG; + bind[i].buffer= (void*) &lval[i]; + bind[i].is_null= 0; + mysql_stmt_bind_param(stmt[i], &bind[i]); + } + + rc= mysql_stmt_execute(stmt[0]); + check_execute(stmt[0], rc); + + rc= mysql_stmt_execute(stmt[1]); + DIE_UNLESS(rc && mysql_stmt_errno(stmt[1]) == CR_COMMANDS_OUT_OF_SYNC); + rc= mysql_stmt_execute(stmt[0]); + check_execute(stmt[0], rc); + + mysql_stmt_close(stmt[0]); + mysql_stmt_close(stmt[1]); + + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + + +/* Bug#7990 - mysql_stmt_close doesn't reset mysql->net.last_error */ + +static void test_bug7990() +{ + MYSQL_STMT *stmt; + int rc; + myheader("test_bug7990"); + + stmt= mysql_stmt_init(mysql); + rc= mysql_stmt_prepare(stmt, "foo", 3); + /* + XXX: the fact that we store errno both in STMT and in + MYSQL is not documented and is subject to change in 5.0 + */ + DIE_UNLESS(rc && mysql_stmt_errno(stmt) && mysql_errno(mysql)); + mysql_stmt_close(stmt); + DIE_UNLESS(!mysql_errno(mysql)); +} + + +/* + Test mysql_real_escape_string() with gbk charset + + The important part is that 0x27 (') is the second-byte in a invalid + two-byte GBK character here. But 0xbf5c is a valid GBK character, so + it needs to be escaped as 0x5cbf27 +*/ +#define TEST_BUG8378_IN "\xef\xbb\xbf\x27\xbf\x10" +#define TEST_BUG8378_OUT "\xef\xbb\x5c\xbf\x5c\x27\x5c\xbf\x10" + +static void test_bug8378() +{ + MYSQL *lmysql; + char out[9]; /* strlen(TEST_BUG8378)*2+1 */ + int len; + + myheader("test_bug8378"); + + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); + if (!(lmysql= mysql_init(NULL))) + { + myerror("mysql_init() failed"); + exit(1); + } + if (mysql_options(lmysql, MYSQL_SET_CHARSET_NAME, "gbk")) + { + myerror("mysql_options() failed"); + exit(1); + } + if (!(mysql_real_connect(lmysql, opt_host, opt_user, + opt_password, current_db, opt_port, + opt_unix_socket, 0))) + { + myerror("connection failed"); + exit(1); + } + if (!opt_silent) + fprintf(stdout, " OK"); + + len= mysql_real_escape_string(lmysql, out, TEST_BUG8378_IN, 4); + + /* No escaping should have actually happened. */ + DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0); + + mysql_close(lmysql); +} + +/* Read and parse arguments and MySQL options from my.cnf */ @@ -10725,62 +11662,211 @@ static char **defaults_argv; static struct my_option client_test_long_options[] = { - {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, - 0, 0, 0, 0, 0}, + {"count", 't', "Number of times test to be executed", (char **) &opt_count, + (char **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, {"database", 'D', "Database to use", (char **) &opt_db, (char **) &opt_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"debug", '#', "Output debug log", (gptr*) &default_dbug_option, (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host", (char **) &opt_host, (char **) &opt_host, 0, GET_STR_ALLOC, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, + 0, 0, 0, 0, 0}, + {"host", 'h', "Connect to host", (char **) &opt_host, (char **) &opt_host, + 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"port", 'P', "Port number to use for connection", (char **) &opt_port, + (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"show-tests", 'T', "Show all tests' names", 0, 0, 0, GET_NO_ARG, NO_ARG, + 0, 0, 0, 0, 0, 0}, + {"silent", 's', "Be more silent", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, + 0}, + {"socket", 'S', "Socket file to use for connection", + (char **) &opt_unix_socket, (char **) &opt_unix_socket, 0, GET_STR, + REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"testcase", 'c', + "May disable some code when runs as mysql-test-run testcase.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE {"user", 'u', "User for login if not current user", (char **) &opt_user, (char **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection", (char **) &opt_port, - (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"socket", 'S', "Socket file to use for connection", (char **) &opt_unix_socket, - (char **) &opt_unix_socket, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"testcase", 'c', "May disable some code when runs as mysql-test-run testcase.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"count", 't', "Number of times test to be executed", (char **) &opt_count, - (char **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void client_test_print_version(void) -{ - fprintf(stdout, "%s Distrib %s, for %s (%s)\n\n", - my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); -} - static void usage(void) { - /* - * show the usage string when the user asks for this - */ + /* show the usage string when the user asks for this */ putc('\n', stdout); - puts("***********************************************************************\n"); - puts(" Test for client-server protocol 4.1"); - puts(" By Monty & Venu \n"); - puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software, "); - puts("and you are welcome to modify and redistribute it under the GPL license\n"); - puts(" Copyright (C) 1995-2003 MySQL AB "); - puts("-----------------------------------------------------------------------\n"); - client_test_print_version(); - fprintf(stdout, "Usage: %s [OPTIONS]\n\n", my_progname); - + printf("%s Ver %s Distrib %s, for %s (%s)\n", + my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); + puts("By Monty, Venu, Kent and others\n"); + printf("\ +Copyright (C) 2002-2004 MySQL AB\n\ +This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ +and you are welcome to modify and redistribute it under the GPL license\n"); + printf("Usage: %s [OPTIONS] [TESTNAME1 TESTNAME2...]\n", my_progname); my_print_help(client_test_long_options); print_defaults("my", client_test_load_default_groups); my_print_variables(client_test_long_options); - - puts("***********************************************************************\n"); } + +static struct my_tests_st my_tests[]= { + { "client_query", client_query }, + { "test_prepare_insert_update", test_prepare_insert_update}, +#if NOT_YET_WORKING + { "test_drop_temp", test_drop_temp }, +#endif + { "test_fetch_seek", test_fetch_seek }, + { "test_fetch_nobuffs", test_fetch_nobuffs }, + { "test_open_direct", test_open_direct }, + { "test_fetch_null", test_fetch_null }, + { "test_ps_null_param", test_ps_null_param }, + { "test_fetch_date", test_fetch_date }, + { "test_fetch_str", test_fetch_str }, + { "test_fetch_long", test_fetch_long }, + { "test_fetch_short", test_fetch_short }, + { "test_fetch_tiny", test_fetch_tiny }, + { "test_fetch_bigint", test_fetch_bigint }, + { "test_fetch_float", test_fetch_float }, + { "test_fetch_double", test_fetch_double }, + { "test_bind_result_ext", test_bind_result_ext }, + { "test_bind_result_ext1", test_bind_result_ext1 }, + { "test_select_direct", test_select_direct }, + { "test_select_prepare", test_select_prepare }, + { "test_select", test_select }, + { "test_select_version", test_select_version }, + { "test_ps_conj_select", test_ps_conj_select }, + { "test_select_show_table", test_select_show_table }, + { "test_func_fields", test_func_fields }, + { "test_long_data", test_long_data }, + { "test_insert", test_insert }, + { "test_set_variable", test_set_variable }, + { "test_select_show", test_select_show }, + { "test_prepare_noparam", test_prepare_noparam }, + { "test_bind_result", test_bind_result }, + { "test_prepare_simple", test_prepare_simple }, + { "test_prepare", test_prepare }, + { "test_null", test_null }, + { "test_debug_example", test_debug_example }, + { "test_update", test_update }, + { "test_simple_update", test_simple_update }, + { "test_simple_delete", test_simple_delete }, + { "test_double_compare", test_double_compare }, + { "client_store_result", client_store_result }, + { "client_use_result", client_use_result }, + { "test_tran_bdb", test_tran_bdb }, + { "test_tran_innodb", test_tran_innodb }, + { "test_prepare_ext", test_prepare_ext }, + { "test_prepare_syntax", test_prepare_syntax }, + { "test_field_names", test_field_names }, + { "test_field_flags", test_field_flags }, + { "test_long_data_str", test_long_data_str }, + { "test_long_data_str1", test_long_data_str1 }, + { "test_long_data_bin", test_long_data_bin }, + { "test_warnings", test_warnings }, + { "test_errors", test_errors }, + { "test_prepare_resultset", test_prepare_resultset }, + { "test_stmt_close", test_stmt_close }, + { "test_prepare_field_result", test_prepare_field_result }, + { "test_multi_stmt", test_multi_stmt }, + { "test_multi_statements", test_multi_statements }, + { "test_prepare_multi_statements", test_prepare_multi_statements }, + { "test_store_result", test_store_result }, + { "test_store_result1", test_store_result1 }, + { "test_store_result2", test_store_result2 }, + { "test_subselect", test_subselect }, + { "test_date", test_date }, + { "test_date_date", test_date_date }, + { "test_date_time", test_date_time }, + { "test_date_ts", test_date_ts }, + { "test_date_dt", test_date_dt }, + { "test_prepare_alter", test_prepare_alter }, + { "test_manual_sample", test_manual_sample }, + { "test_pure_coverage", test_pure_coverage }, + { "test_buffers", test_buffers }, + { "test_ushort_bug", test_ushort_bug }, + { "test_sshort_bug", test_sshort_bug }, + { "test_stiny_bug", test_stiny_bug }, + { "test_field_misc", test_field_misc }, + { "test_set_option", test_set_option }, +#ifndef EMBEDDED_LIBRARY + { "test_prepare_grant", test_prepare_grant }, +#endif + { "test_frm_bug", test_frm_bug }, + { "test_explain_bug", test_explain_bug }, + { "test_decimal_bug", test_decimal_bug }, + { "test_nstmts", test_nstmts }, + { "test_logs;", test_logs }, + { "test_cuted_rows", test_cuted_rows }, + { "test_fetch_offset", test_fetch_offset }, + { "test_fetch_column", test_fetch_column }, + { "test_mem_overun", test_mem_overun }, + { "test_list_fields", test_list_fields }, + { "test_free_result", test_free_result }, + { "test_free_store_result", test_free_store_result }, + { "test_sqlmode", test_sqlmode }, + { "test_ts", test_ts }, + { "test_bug1115", test_bug1115 }, + { "test_bug1180", test_bug1180 }, + { "test_bug1500", test_bug1500 }, + { "test_bug1644", test_bug1644 }, + { "test_bug1946", test_bug1946 }, + { "test_bug2248", test_bug2248 }, + { "test_parse_error_and_bad_length", test_parse_error_and_bad_length }, + { "test_bug2247", test_bug2247 }, + { "test_subqueries", test_subqueries }, + { "test_bad_union", test_bad_union }, + { "test_distinct", test_distinct }, + { "test_subqueries_ref", test_subqueries_ref }, + { "test_union", test_union }, + { "test_bug3117", test_bug3117 }, + { "test_join", test_join }, + { "test_selecttmp", test_selecttmp }, + { "test_create_drop", test_create_drop }, + { "test_rename", test_rename }, + { "test_do_set", test_do_set }, + { "test_multi", test_multi }, + { "test_insert_select", test_insert_select }, + { "test_bind_nagative", test_bind_nagative }, + { "test_derived", test_derived }, + { "test_xjoin", test_xjoin }, + { "test_bug3035", test_bug3035 }, + { "test_union2", test_union2 }, + { "test_bug1664", test_bug1664 }, + { "test_union_param", test_union_param }, + { "test_order_param", test_order_param }, + { "test_ps_i18n", test_ps_i18n }, + { "test_bug3796", test_bug3796 }, + { "test_bug4026", test_bug4026 }, + { "test_bug4079", test_bug4079 }, + { "test_bug4236", test_bug4236 }, + { "test_bug4030", test_bug4030 }, + { "test_bug5126", test_bug5126 }, + { "test_bug4231", test_bug4231 }, + { "test_bug5399", test_bug5399 }, + { "test_bug5194", test_bug5194 }, + { "test_bug5315", test_bug5315 }, + { "test_bug6049", test_bug6049 }, + { "test_bug6058", test_bug6058 }, + { "test_bug6059", test_bug6059 }, + { "test_bug6046", test_bug6046 }, + { "test_bug6081", test_bug6081 }, + { "test_bug6096", test_bug6096 }, + { "test_datetime_ranges", test_datetime_ranges }, + { "test_bug4172", test_bug4172 }, + { "test_conversion", test_conversion }, + { "test_rewind", test_rewind }, + { "test_bug6761", test_bug6761 }, + { "test_bug8330", test_bug8330 }, + { "test_bug7990", test_bug7990 }, + { "test_bug8378", test_bug8378 }, + { 0, 0 } +}; + + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) @@ -10805,6 +11891,22 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else tty_password= 1; break; + case 's': + if (argument == disabled_my_option) + opt_silent= 0; + else + opt_silent++; + break; + case 'T': + { + struct my_tests_st *fptr; + + printf("All possible test names:\n\n"); + for (fptr= my_tests; fptr->name; fptr++) + printf("%s\n", fptr->name); + exit(0); + break; + } case '?': case 'I': /* Info */ usage(); @@ -10814,11 +11916,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), return 0; } -static void get_options(int argc, char **argv) +static void get_options(int *argc, char ***argv) { int ho_error; - if ((ho_error= handle_options(&argc, &argv, client_test_long_options, + if ((ho_error= handle_options(argc, argv, client_test_long_options, get_one_option))) exit(ho_error); @@ -10833,14 +11935,17 @@ static void get_options(int argc, char **argv) static void print_test_output() { - fprintf(stdout, "\n\n"); - fprintf(stdout, "All '%d' tests were successful (in '%d' iterations)", - test_count-1, opt_count); - fprintf(stdout, "\n Total execution time: %g SECS", total_time); - if (opt_count > 1) - fprintf(stdout, " (Avg: %g SECS)", total_time/opt_count); - - fprintf(stdout, "\n\n!!! SUCCESS !!!\n"); + if (opt_silent < 3) + { + fprintf(stdout, "\n\n"); + fprintf(stdout, "All '%d' tests were successful (in '%d' iterations)", + test_count-1, opt_count); + fprintf(stdout, "\n Total execution time: %g SECS", total_time); + if (opt_count > 1) + fprintf(stdout, " (Avg: %g SECS)", total_time/opt_count); + + fprintf(stdout, "\n\n!!! SUCCESS !!!\n"); + } } @@ -10848,14 +11953,17 @@ static void print_test_output() main routine ***************************************************************************/ + int main(int argc, char **argv) { + struct my_tests_st *fptr; + DEBUGGER_OFF; MY_INIT(argv[0]); - + load_defaults("my", client_test_load_default_groups, &argc, &argv); defaults_argv= argv; - get_options(argc, argv); + get_options(&argc, &argv); client_connect(); /* connect to server */ @@ -10864,173 +11972,37 @@ int main(int argc, char **argv) { /* Start of tests */ test_count= 1; - start_time= time((time_t *)0); - client_query(); /* simple client query test */ -#if NOT_YET_WORKING - /* Used for internal new development debugging */ - test_drop_temp(); /* Test DROP TEMPORARY TABLE Access checks */ -#endif - test_fetch_seek(); /* Test stmt seek() functions */ - test_fetch_nobuffs(); /* to fecth without prior bound buffers */ - test_open_direct(); /* direct execution in the middle of open stmts */ - test_fetch_null(); /* to fetch null data */ - test_ps_null_param(); /* Fetch value of null parameter */ - test_fetch_date(); /* to fetch date, time and timestamp */ - test_fetch_str(); /* to fetch string to all types */ - test_fetch_long(); /* to fetch long to all types */ - test_fetch_short(); /* to fetch short to all types */ - test_fetch_tiny(); /* to fetch tiny to all types */ - test_fetch_bigint(); /* to fetch bigint to all types */ - test_fetch_float(); /* to fetch float to all types */ - test_fetch_double(); /* to fetch double to all types */ - test_bind_result_ext(); /* result bind test - extension */ - test_bind_result_ext1(); /* result bind test - extension */ - test_select_direct(); /* direct select - protocol_simple debug */ - test_select_prepare(); /* prepare select - protocol_prep debug */ - test_select(); /* simple select test */ - test_select_version(); /* select with variables */ - test_ps_conj_select(); /* prepare select with "where a=? or b=?" */ - test_select_show_table();/* simple show prepare */ -#if NOT_USED - /* - Enable this tests from 4.1.1 when mysql_param_result() is - supported - */ - test_select_meta(); /* select param meta information */ - test_update_meta(); /* update param meta information */ - test_insert_meta(); /* insert param meta information */ -#endif - test_func_fields(); /* test for new 4.1 MYSQL_FIELD members */ - test_long_data(); /* test for sending text data in chunks */ - test_insert(); /* simple insert test - prepare */ - test_set_variable(); /* prepare with set variables */ - test_select_show(); /* prepare - show test */ - test_prepare_noparam(); /* prepare without parameters */ - test_bind_result(); /* result bind test */ - test_prepare_simple(); /* simple prepare */ - test_prepare(); /* prepare test */ - test_null(); /* test null data handling */ - test_debug_example(); /* some debugging case */ - test_update(); /* prepare-update test */ - test_simple_update(); /* simple prepare with update */ - test_simple_delete(); /* prepare with delete */ - test_double_compare(); /* float comparision */ - client_store_result(); /* usage of mysql_store_result() */ - client_use_result(); /* usage of mysql_use_result() */ - test_tran_bdb(); /* transaction test on BDB table type */ - test_tran_innodb(); /* transaction test on InnoDB table type */ - test_prepare_ext(); /* test prepare with all types - conversion -- TODO */ - test_prepare_syntax(); /* syntax check for prepares */ - test_field_names(); /* test for field names */ - test_field_flags(); /* test to help .NET provider team */ - test_long_data_str(); /* long data handling */ - test_long_data_str1(); /* yet another long data handling */ - test_long_data_bin(); /* long binary insertion */ - test_warnings(); /* show warnings test */ - test_errors(); /* show errors test */ - test_prepare_resultset();/* prepare meta info test */ - test_stmt_close(); /* mysql_stmt_close() test -- hangs */ - test_prepare_field_result(); /* prepare meta info */ - test_multi_stmt(); /* multi stmt test */ - test_multi_statements();/* test multi statement execution */ - test_prepare_multi_statements(); /* check that multi statements are - disabled in PS */ - test_store_result(); /* test the store_result */ - test_store_result1(); /* test store result without buffers */ - test_store_result2(); /* test store result for misc case */ - test_subselect(); /* test subselect prepare -TODO*/ - test_date(); /* test the MYSQL_TIME conversion */ - test_date_date(); /* test conversion from DATE to all */ - test_date_time(); /* test conversion from TIME to all */ - test_date_ts() ; /* test conversion from TIMESTAMP to all */ - test_date_dt() ; /* test conversion from DATETIME to all */ - test_prepare_alter(); /* change table schema in middle of prepare */ - test_manual_sample(); /* sample in the manual */ - test_pure_coverage(); /* keep pure coverage happy */ - test_buffers(); /* misc buffer handling */ - test_ushort_bug(); /* test a simple conv bug from php */ - test_sshort_bug(); /* test a simple conv bug from php */ - test_stiny_bug(); /* test a simple conv bug from php */ - test_field_misc(); /* check the field info for misc case, bug: #74 */ - test_set_option(); /* test the SET OPTION feature, bug #85 */ - /*TODO HF: here should be NO_EMBEDDED_ACCESS_CHECKS*/ -#ifndef EMBEDDED_LIBRARY - test_prepare_grant(); /* Test the GRANT command, bug #89 */ -#endif - test_frm_bug(); /* test the crash when .frm is invalid, bug #93 */ - test_explain_bug(); /* test for the EXPLAIN, bug #115 */ - test_decimal_bug(); /* test for the decimal bug */ - test_nstmts(); /* test n statements */ - test_logs(); ; /* Test logs */ - test_cuted_rows(); /* Test for WARNINGS from cuted rows */ - test_fetch_offset(); /* Test mysql_stmt_fetch_column with offset */ - test_fetch_column(); /* Test mysql_stmt_fetch_column */ - test_mem_overun(); /* test DBD ovverun bug */ - test_list_fields(); /* test COM_LIST_FIELDS for DEFAULT */ - test_free_result(); /* test mysql_stmt_free_result() */ - test_free_store_result(); /* test to make sure stmt results are cleared - during stmt_free_result() */ - test_sqlmode(); /* test for SQL_MODE */ - test_ts(); /* test for timestamp BR#819 */ - test_bug1115(); /* BUG#1115 */ - test_bug1180(); /* BUG#1180 */ - test_bug1500(); /* BUG#1500 */ - test_bug1644(); /* BUG#1644 */ - test_bug1946(); /* test that placeholders are allowed only in - prepared queries */ - test_bug2248(); /* BUG#2248 */ - test_parse_error_and_bad_length(); /* test if bad length param in - mysql_stmt_prepare() triggers error */ - test_bug2247(); /* test that mysql_stmt_affected_rows() returns - number of rows affected by last prepared - statement execution */ - test_subqueries(); /* repeatable subqueries */ - test_bad_union(); /* correct setup of UNION */ - test_distinct(); /* distinct aggregate functions */ - test_subqueries_ref(); /* outer reference in subqueries converted - Item_field -> Item_ref */ - test_union(); /* test union with prepared statements */ - test_bug3117(); /* BUG#3117: LAST_INSERT_ID() */ - test_join(); /* different kinds of join, BUG#2794 */ - test_selecttmp(); /* temporary table used in select execution */ - test_create_drop(); /* some table manipulation BUG#2811 */ - test_rename(); /* rename test */ - test_do_set(); /* DO & SET commands test BUG#3393 */ - test_multi(); /* test of multi delete & update */ - test_insert_select(); /* test INSERT ... SELECT */ - test_bind_nagative(); /* bind negative to unsigned BUG#3223 */ - test_derived(); /* derived table with parameter BUG#3020 */ - test_xjoin(); /* complex join test */ - test_bug3035(); /* inserts of INT32_MAX/UINT32_MAX */ - test_union2(); /* repeatable execution of union (Bug #3577) */ - test_bug1664(); /* test for bugs in mysql_stmt_send_long_data() - call (Bug #1664) */ - test_union_param(); - test_order_param(); /* ORDER BY with parameters in select list - (Bug #3686 */ - test_ps_i18n(); /* test for i18n support in binary protocol */ - test_bug3796(); /* test for select concat(?, <string>) */ - test_bug4026(); /* test microseconds precision of time types */ - test_bug4079(); /* erroneous subquery in prepared statement */ - test_bug4236(); /* init -> execute */ - test_bug4030(); /* test conversion string -> time types in - libmysql */ - test_bug5126(); /* support for mediumint type in libmysql */ - test_bug4231(); /* proper handling of all-zero times and - dates in the server */ - test_bug5399(); /* check that statement id uniquely identifies - statement */ - test_bug5194(); /* bulk inserts in prepared mode */ - test_bug5315(); /* check that mysql_change_user closes all - prepared statements */ - test_bug6049(); /* check support for negative TIME values */ - test_bug6058(); /* check support for 0000-00-00 dates */ - test_bug6059(); /* correct metadata for SELECT ... INTO OUTFILE */ - test_bug6046(); /* NATURAL JOIN transformation works in PS */ - test_bug6081(); /* test of mysql_create_db()/mysql_rm_db() */ + if (!argc) + { + for (fptr= my_tests; fptr->name; fptr++) + (*fptr->function)(); + } + else + { + for ( ; *argv ; argv++) + { + for (fptr= my_tests; fptr->name; fptr++) + { + if (!strcmp(fptr->name, *argv)) + { + (*fptr->function)(); + break; + } + } + if (!fptr->name) + { + fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv); + fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n", + my_progname); + client_disconnect(); + free_defaults(defaults_argv); + exit(1); + } + } + } + /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. diff --git a/vio/vio.c b/vio/vio.c index a356d8edeff..978780d2632 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -171,22 +171,24 @@ Vio *vio_new_win32pipe(HANDLE hPipe) #ifdef HAVE_SMEM Vio *vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE handle_map, HANDLE event_server_wrote, HANDLE event_server_read, - HANDLE event_client_wrote, HANDLE event_client_read) + HANDLE event_client_wrote, HANDLE event_client_read, + HANDLE event_conn_closed) { Vio *vio; DBUG_ENTER("vio_new_win32shared_memory"); if ((vio = (Vio*) my_malloc(sizeof(Vio),MYF(MY_WME)))) { vio_reset(vio, VIO_TYPE_SHARED_MEMORY, 0, 0, TRUE); - vio->handle_file_map = handle_file_map; - vio->handle_map = handle_map; - vio->event_server_wrote = event_server_wrote; - vio->event_server_read = event_server_read; - vio->event_client_wrote = event_client_wrote; - vio->event_client_read = event_client_read; - vio->shared_memory_remain = 0; - vio->shared_memory_pos = handle_map; - vio->net = net; + vio->handle_file_map= handle_file_map; + vio->handle_map= handle_map; + vio->event_server_wrote= event_server_wrote; + vio->event_server_read= event_server_read; + vio->event_client_wrote= event_client_wrote; + vio->event_client_read= event_client_read; + vio->event_conn_closed= event_conn_closed; + vio->shared_memory_remain= 0; + vio->shared_memory_pos= handle_map; + vio->net= net; strmov(vio->desc, "shared memory"); } DBUG_RETURN(vio); diff --git a/vio/viosocket.c b/vio/viosocket.c index 48a9058480a..77922594469 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -142,23 +142,29 @@ int vio_fastsend(Vio * vio __attribute__((unused))) int r=0; DBUG_ENTER("vio_fastsend"); -#ifdef IPTOS_THROUGHPUT +#if defined(IPTOS_THROUGHPUT) && !defined(__EMX__) { -#ifndef __EMX__ int tos = IPTOS_THROUGHPUT; - if (!setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos))) -#endif /* !__EMX__ */ - { - int nodelay = 1; - if (setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void *) &nodelay, - sizeof(nodelay))) { - DBUG_PRINT("warning", - ("Couldn't set socket option for fast send")); - r= -1; - } - } + r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos)); + } +#endif /* IPTOS_THROUGHPUT && !__EMX__ */ + if (!r) + { +#ifdef __WIN__ + BOOL nodelay= 1; + r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (const char*) &nodelay, + sizeof(nodelay)); +#else + int nodelay = 1; + r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay, + sizeof(nodelay)); +#endif /* __WIN__ */ + } + if (r) + { + DBUG_PRINT("warning", ("Couldn't set socket option for fast send")); + r= -1; } -#endif /* IPTOS_THROUGHPUT */ DBUG_PRINT("exit", ("%d", r)); DBUG_RETURN(r); } @@ -266,11 +272,23 @@ my_bool vio_peer_addr(Vio * vio, char *buf, uint16 *port) } +/* + Get in_addr for a TCP/IP connection + + SYNOPSIS + vio_in_addr() + vio vio handle + in put in_addr here + + NOTES + one must call vio_peer_addr() before calling this one +*/ + void vio_in_addr(Vio *vio, struct in_addr *in) { DBUG_ENTER("vio_in_addr"); if (vio->localhost) - bzero((char*) in, sizeof(*in)); /* This should never be executed */ + bzero((char*) in, sizeof(*in)); else *in=vio->remote.sin_addr; DBUG_VOID_RETURN; @@ -381,10 +399,21 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size) { if (vio->shared_memory_remain == 0) { - if (WaitForSingleObject(vio->event_server_wrote,vio->net->read_timeout*1000) != WAIT_OBJECT_0) + HANDLE events[2]; + events[0]= vio->event_server_wrote; + events[1]= vio->event_conn_closed; + /* + WaitForMultipleObjects can return next values: + WAIT_OBJECT_0+0 - event from vio->event_server_wrote + WAIT_OBJECT_0+1 - event from vio->event_conn_closed. We can't read anything + WAIT_ABANDONED_0 and WAIT_TIMEOUT - fail. We can't read anything + */ + if (WaitForMultipleObjects(2, (HANDLE*)&events,FALSE, + vio->net->read_timeout*1000) != WAIT_OBJECT_0) { DBUG_RETURN(-1); }; + vio->shared_memory_pos = vio->handle_map; vio->shared_memory_remain = uint4korr((ulong*)vio->shared_memory_pos); vio->shared_memory_pos+=4; @@ -429,7 +458,8 @@ int vio_write_shared_memory(Vio * vio, const gptr buf, int size) current_postion = buf; while (remain != 0) { - if (WaitForSingleObject(vio->event_server_read,vio->net->write_timeout*1000) != WAIT_OBJECT_0) + if (WaitForSingleObject(vio->event_server_read, vio->net->write_timeout*1000) + != WAIT_OBJECT_0) { DBUG_RETURN(-1); }; @@ -454,17 +484,29 @@ int vio_close_shared_memory(Vio * vio) { int r; DBUG_ENTER("vio_close_shared_memory"); - r=UnmapViewOfFile(vio->handle_map) || CloseHandle(vio->event_server_wrote) || - CloseHandle(vio->event_server_read) || CloseHandle(vio->event_client_wrote) || - CloseHandle(vio->event_client_read) || CloseHandle(vio->handle_file_map); - if (r) + if (vio->type != VIO_CLOSED) { - DBUG_PRINT("vio_error", ("close() failed, error: %d",r)); - /* FIXME: error handling (not critical for MySQL) */ + /* + Set event_conn_closed for notification of both client and server that + connection is closed + */ + SetEvent(vio->event_conn_closed); + /* + Close all handlers. UnmapViewOfFile and CloseHandle return non-zero + result if they are success. + */ + r= UnmapViewOfFile(vio->handle_map) || CloseHandle(vio->event_server_wrote) || + CloseHandle(vio->event_server_read) || CloseHandle(vio->event_client_wrote) || + CloseHandle(vio->event_client_read) || CloseHandle(vio->handle_file_map); + if (!r) + { + DBUG_PRINT("vio_error", ("close() failed, error: %d",r)); + /* FIXME: error handling (not critical for MySQL) */ + } } vio->type= VIO_CLOSED; vio->sd= -1; - DBUG_RETURN(r); + DBUG_RETURN(!r); } #endif /* HAVE_SMEM */ #endif /* __WIN__ */ diff --git a/vio/viossl.c b/vio/viossl.c index a489cb98f98..07713c83763 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -259,7 +259,7 @@ void vio_ssl_in_addr(Vio *vio, struct in_addr *in) { DBUG_ENTER("vio_ssl_in_addr"); if (vio->localhost) - bzero((char*) in, sizeof(*in)); /* This should never be executed */ + bzero((char*) in, sizeof(*in)); else *in=vio->remote.sin_addr; DBUG_VOID_RETURN; diff --git a/zlib/Makefile.am b/zlib/Makefile.am index 58d3811cd7c..e94d184a841 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -16,7 +16,7 @@ # Process this file with automake to create Makefile.in -noinst_LTLIBRARIES=libz.la +pkglib_LTLIBRARIES=libz.la noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ inftrees.h trees.h zconf.h zlib.h zutil.h |