summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-03-04 18:34:29 +0300
committerAlexander Nozdrin <alik@sun.com>2010-03-04 18:34:29 +0300
commit366a68bb460fea577719335efcfac8e14f13a077 (patch)
treec71732b18ac0ea5ad53cb5f568fbf1be35dc11fa /mysql-test
parentb0ab907b4290cd3aa24a9305387ed5aaeaf5d213 (diff)
parent0b1d317b232db27d04afc0f51eab4a019108fda4 (diff)
downloadmariadb-git-366a68bb460fea577719335efcfac8e14f13a077.tar.gz
Auto-merge from mysql-next-mr-bugfixing.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/CMakeLists.txt12
-rw-r--r--mysql-test/Makefile.am4
-rw-r--r--mysql-test/collections/default.experimental2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test13
-rw-r--r--mysql-test/include/ctype_datetime.inc11
-rw-r--r--mysql-test/include/ctype_like.inc50
-rw-r--r--mysql-test/include/ctype_numconv.inc1606
-rw-r--r--mysql-test/include/have_utf16.inc4
-rw-r--r--mysql-test/include/have_utf32.inc4
-rw-r--r--mysql-test/include/have_utf8mb4.inc7
-rw-r--r--mysql-test/include/mtr_warnings.sql8
-rw-r--r--mysql-test/include/not_binlog_format_row.inc4
-rw-r--r--mysql-test/lib/My/Options.pm20
-rw-r--r--mysql-test/lib/mtr_cases.pm2
-rw-r--r--mysql-test/lib/t/Options.t14
-rw-r--r--mysql-test/lib/v1/mtr_io.pl2
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl2
-rw-r--r--mysql-test/r/archive.result9
-rw-r--r--mysql-test/r/backup.result26
-rw-r--r--mysql-test/r/bigint.result34
-rw-r--r--mysql-test/r/bug39022.result32
-rw-r--r--mysql-test/r/case.result14
-rw-r--r--mysql-test/r/create.result4
-rw-r--r--mysql-test/r/csv.result31
-rw-r--r--mysql-test/r/ctype_binary.result2568
-rw-r--r--mysql-test/r/ctype_cp1251.result2567
-rw-r--r--mysql-test/r/ctype_latin1.result2567
-rw-r--r--mysql-test/r/ctype_ldml.result33
-rw-r--r--mysql-test/r/ctype_many.result56
-rw-r--r--mysql-test/r/ctype_ucs.result2578
-rw-r--r--mysql-test/r/ctype_utf16.result1038
-rw-r--r--mysql-test/r/ctype_utf16_uca.result2373
-rw-r--r--mysql-test/r/ctype_utf32.result1052
-rw-r--r--mysql-test/r/ctype_utf32_uca.result2373
-rw-r--r--mysql-test/r/ctype_utf8.result14
-rw-r--r--mysql-test/r/ctype_utf8mb4.result2238
-rw-r--r--mysql-test/r/default.result3
-rw-r--r--mysql-test/r/delete.result24
-rw-r--r--mysql-test/r/fulltext.result20
-rw-r--r--mysql-test/r/func_gconcat.result21
-rw-r--r--mysql-test/r/func_str.result8
-rw-r--r--mysql-test/r/group_by.result88
-rw-r--r--mysql-test/r/group_min_max.result13
-rw-r--r--mysql-test/r/have_utf16.require2
-rw-r--r--mysql-test/r/have_utf32.require2
-rw-r--r--mysql-test/r/have_utf8mb4.require2
-rw-r--r--mysql-test/r/having.result20
-rw-r--r--mysql-test/r/innodb_mysql.result22
-rw-r--r--mysql-test/r/join.result28
-rw-r--r--mysql-test/r/metadata.result2
-rw-r--r--mysql-test/r/multi_update.result11
-rw-r--r--mysql-test/r/myisam.result26
-rw-r--r--mysql-test/r/mysqld--help-notwin.result45
-rw-r--r--mysql-test/r/mysqld--help-win.result45
-rw-r--r--mysql-test/r/no_binlog.result2
-rw-r--r--mysql-test/r/partition_debug_sync.result65
-rw-r--r--mysql-test/r/ps_2myisam.result72
-rw-r--r--mysql-test/r/ps_3innodb.result72
-rw-r--r--mysql-test/r/ps_4heap.result72
-rw-r--r--mysql-test/r/ps_5merge.result144
-rw-r--r--mysql-test/r/sp-bugs.result29
-rw-r--r--mysql-test/r/sp_notembedded.result11
-rw-r--r--mysql-test/r/subselect.result12
-rw-r--r--mysql-test/r/type_bit.result15
-rw-r--r--mysql-test/r/type_datetime.result4
-rw-r--r--mysql-test/r/type_ranges.result2
-rw-r--r--mysql-test/r/union.result12
-rw-r--r--mysql-test/r/view.result30
-rw-r--r--mysql-test/r/view_grant.result11
-rw-r--r--mysql-test/std_data/Index.xml30
-rw-r--r--mysql-test/std_data/bug48449.frm12
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_binlog-master.opt2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt2
-rw-r--r--mysql-test/suite/ndb/r/ps_7ndb.result72
-rw-r--r--mysql-test/suite/rpl/r/rpl_slow_query_log.result43
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_symlink.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_slow_query_log.test116
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_database_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_basic.resultbin16478 -> 16478 bytes
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_func.result16
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_connection_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_database_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_results_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_func.test21
-rw-r--r--mysql-test/t/archive.test11
-rw-r--r--mysql-test/t/bigint.test35
-rw-r--r--mysql-test/t/bug39022.test63
-rw-r--r--mysql-test/t/cache_innodb-master.opt2
-rw-r--r--mysql-test/t/count_distinct2-master.opt2
-rw-r--r--mysql-test/t/csv.test20
-rw-r--r--mysql-test/t/ctype_binary.test12
-rw-r--r--mysql-test/t/ctype_cp1251.test10
-rw-r--r--mysql-test/t/ctype_latin1.test11
-rw-r--r--mysql-test/t/ctype_ldml.test21
-rw-r--r--mysql-test/t/ctype_many.test73
-rw-r--r--mysql-test/t/ctype_ucs.test14
-rw-r--r--mysql-test/t/ctype_utf16.test733
-rw-r--r--mysql-test/t/ctype_utf16_uca.test290
-rw-r--r--mysql-test/t/ctype_utf32.test784
-rw-r--r--mysql-test/t/ctype_utf32_uca.test291
-rw-r--r--mysql-test/t/ctype_utf8.test11
-rw-r--r--mysql-test/t/ctype_utf8mb4.test1671
-rw-r--r--mysql-test/t/delete.test29
-rw-r--r--mysql-test/t/fulltext.test21
-rw-r--r--mysql-test/t/func_gconcat.test15
-rw-r--r--mysql-test/t/func_str.test2
-rw-r--r--mysql-test/t/group_by.test50
-rw-r--r--mysql-test/t/group_min_max.test10
-rw-r--r--mysql-test/t/having.test26
-rw-r--r--mysql-test/t/init_connect-master.opt2
-rw-r--r--mysql-test/t/innodb_mysql.test22
-rw-r--r--mysql-test/t/join.test25
-rw-r--r--mysql-test/t/multi_update-master.opt2
-rw-r--r--mysql-test/t/multi_update.test12
-rw-r--r--mysql-test/t/multi_update2-master.opt2
-rw-r--r--mysql-test/t/multi_update_tiny_hash-master.opt2
-rw-r--r--mysql-test/t/myisam.test24
-rw-r--r--mysql-test/t/no_binlog.test6
-rw-r--r--mysql-test/t/order_fill_sortbuf-master.opt2
-rw-r--r--mysql-test/t/partition_debug_sync.test89
-rw-r--r--mysql-test/t/sp-bugs.test43
-rw-r--r--mysql-test/t/sp_notembedded.test37
-rw-r--r--mysql-test/t/subselect.test17
-rw-r--r--mysql-test/t/type_bit.test13
-rw-r--r--mysql-test/t/view.test46
-rw-r--r--mysql-test/t/view_grant.test14
137 files changed, 26809 insertions, 427 deletions
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 794f286ac56..2cc65a9c82f 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -64,12 +64,6 @@ ELSE()
ENDIF()
-ADD_CUSTOM_TARGET(test-force
- COMMAND ${SETCONFIG_COMMAND}
- COMMAND ${SETOS_COMMAND}
- COMMAND perl mysql-test-run.pl --force
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
SET(EXP --experimental=collections/default.experimental)
IF(WIN32)
@@ -100,6 +94,11 @@ SET(TEST_BT_START
COMMAND ${SET_ENV} MTR_BUILD_THREAD=auto
)
+ADD_CUSTOM_TARGET(test-force
+ ${TEST_BT_START}
+ COMMAND ${MTR_FORCE}
+)
+
ADD_CUSTOM_TARGET(test-bt
${TEST_BT_START}
COMMAND ${MTR_FORCE} --comment=normal --timer --skip-ndbcluster --report-features ${EXP}
@@ -124,4 +123,3 @@ ADD_CUSTOM_TARGET(test-bt-debug
COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
)
-
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index ebfef321db3..713751b9355 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -138,12 +138,12 @@ uninstall-local:
# mtr - a shortcut for executing mysql-test-run.pl
mtr:
$(RM) -f mtr
- $(LN_S) mysql-test-run.pl mtr
+ $(LN_S) $(srcdir)/mysql-test-run.pl mtr
# mysql-test-run - a shortcut for executing mysql-test-run.pl
mysql-test-run:
$(RM) -f mysql-test-run
- $(LN_S) mysql-test-run.pl mysql-test-run
+ $(LN_S) $(srcdir)/mysql-test-run.pl mysql-test-run
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 52291c2b8f8..8a8ffd6f84a 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -1,12 +1,10 @@
# For easier human reading (MTR doesn't care), please keep entries
# in alphabetical order. This also helps with merge conflict resolution.
-binlog.binlog_tmp_table* # Bug#45578:2009-07-10 alik Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
funcs_1.charset_collation_1 # depends on compile-time decisions
-main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index 0e1005cd6d9..a2900090c1e 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -219,6 +219,19 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- echo ### assertion: works without stating the default database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
+
+# We cannot disconnect right away because when inserting
+# concurrently in a MyISAM table, the server is sending an OK
+# to the client before updating the table state (where the
+# number of records is kept). See: BUG#37521 and BUG#29334.
+# So we need to wait, otherwise we would be having sporadic
+# failures as reported here: BUG#50451.
+
+# 12 = 3 rows per each LOAD DATA executed x 4
+-- let $count= 12
+-- let $table= $db1.t1
+--source include/wait_until_rows_count.inc
+
-- echo ### disconnect and switch back to master connection
-- disconnect conn2
-- connection master
diff --git a/mysql-test/include/ctype_datetime.inc b/mysql-test/include/ctype_datetime.inc
new file mode 100644
index 00000000000..dc70f1f38a9
--- /dev/null
+++ b/mysql-test/include/ctype_datetime.inc
@@ -0,0 +1,11 @@
+#
+# Bug#32390 Character sets: casting utf32 to/from date doesn't work
+#
+CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0;
+SET timestamp=1216359724;
+INSERT INTO t1 VALUES (current_date);
+INSERT INTO t1 VALUES (current_time);
+INSERT INTO t1 VALUES (current_timestamp);
+SELECT s1, hex(s1) FROM t1;
+DROP TABLE t1;
+SET timestamp=0;
diff --git a/mysql-test/include/ctype_like.inc b/mysql-test/include/ctype_like.inc
new file mode 100644
index 00000000000..38de0bf2671
--- /dev/null
+++ b/mysql-test/include/ctype_like.inc
@@ -0,0 +1,50 @@
+select @@collation_connection;
+
+#
+# Create a table with a nullable varchar(10) column
+# using currect character_set_connection.
+create table t1 as select repeat(' ',10) as a union select null;
+alter table t1 add key(a);
+show create table t1;
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+explain select * from t1 where a like concat('abc','%');
+select * from t1 where a like "abc%";
+select * from t1 where a like concat("abc","%");
+select * from t1 where a like "ABC%";
+select * from t1 where a like "test%";
+select * from t1 where a like "te_t";
+select * from t1 where a like "%a%";
+select * from t1 where a like "%abcd%";
+select * from t1 where a like "%abc\d%";
+drop table t1;
+
+#
+# Bug #2619 ucs2 LIKE comparison fails in some cases
+#
+
+select 'AA' like 'AA';
+select 'AA' like 'A%A';
+select 'AA' like 'A%%A';
+select 'AA' like 'AA%';
+select 'AA' like '%AA%';
+select 'AA' like '%A';
+select 'AA' like '%AA';
+select 'AA' like 'A%A%';
+select 'AA' like '_%_%';
+select 'AA' like '%A%A';
+select 'AAA'like 'A%A%A';
+
+select 'AZ' like 'AZ';
+select 'AZ' like 'A%Z';
+select 'AZ' like 'A%%Z';
+select 'AZ' like 'AZ%';
+select 'AZ' like '%AZ%';
+select 'AZ' like '%Z';
+select 'AZ' like '%AZ';
+select 'AZ' like 'A%Z%';
+select 'AZ' like '_%_%';
+select 'AZ' like '%A%Z';
+select 'AZ' like 'A_';
+select 'AZ' like '_Z';
+select 'AMZ'like 'A%M%Z';
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
new file mode 100644
index 00000000000..959ca7dfeea
--- /dev/null
+++ b/mysql-test/include/ctype_numconv.inc
@@ -0,0 +1,1606 @@
+--echo #
+--echo # Start of WL#2649 Number-to-string conversions
+--echo #
+#
+# Basic constants
+#
+select hex(concat(1));
+create table t1 as select concat(1) as c1;
+show create table t1;
+select hex(c1) from t1;
+drop table t1;
+
+select hex(concat(18446744073709551615));
+create table t1 as select concat(18446744073709551615) as c1;
+show create table t1;
+select hex(c1) from t1;
+drop table t1;
+
+select hex(concat(1.1));
+create table t1 as select concat(1.1) as c1;
+show create table t1;
+select hex(c1) from t1;
+drop table t1;
+
+
+#
+# Arithmetic operators
+#
+
+select hex(concat('a', 1+2)), charset(concat(1+2));
+create table t1 as select concat(1+2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(1-2));
+create table t1 as select concat(1-2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(1*2));
+create table t1 as select concat(1*2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(1/2));
+create table t1 as select concat(1/2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(1 div 2));
+create table t1 as select concat(1 div 2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(1 % 2));
+create table t1 as select concat(1 % 2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(-1));
+create table t1 as select concat(-1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(-(1+2)));
+create table t1 as select concat(-(1+2)) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# Bit functions
+#
+
+select hex(concat(1|2));
+create table t1 as select concat(1|2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(1&2));
+create table t1 as select concat(1&2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(bit_count(12)));
+create table t1 as select concat(bit_count(12)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(2<<1));
+create table t1 as select concat(2<<1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(2>>1));
+create table t1 as select concat(2>>1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(~0));
+create table t1 as select concat(~0) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(3^2));
+create table t1 as select concat(3^2) as c1;
+show create table t1;
+drop table t1;
+
+
+
+#
+# Math functions
+#
+# Note, some tests use LEFT(func(),1) to avoid
+# non-deterministic results on various platforms.
+#
+
+select hex(concat(abs(-2)));
+create table t1 as select concat(abs(-2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(exp(2)),1));
+create table t1 as select concat(exp(2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(log(2)),1));
+create table t1 as select concat(log(2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(log2(2)),1));
+create table t1 as select concat(log2(2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(log10(2)),1));
+create table t1 as select concat(log10(2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(sqrt(2)),1));
+create table t1 as select concat(sqrt(2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(pow(2,2)),1));
+create table t1 as select concat(pow(2,2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(acos(0.5)),1));
+create table t1 as select concat(acos(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(asin(0.5)),1));
+create table t1 as select concat(asin(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(atan(0.5)),1));
+create table t1 as select concat(atan(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(cos(0.5)),1));
+create table t1 as select concat(cos(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(sin(0.5)),1));
+create table t1 as select concat(sin(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(tan(0.5)),1));
+create table t1 as select concat(tan(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(degrees(0)));
+create table t1 as select concat(degrees(0)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(radians(0)));
+create table t1 as select concat(radians(0)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(ceiling(0.5)));
+create table t1 as select concat(ceiling(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(floor(0.5)));
+create table t1 as select concat(floor(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(round(0.5)));
+create table t1 as select concat(round(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(sign(0.5)));
+create table t1 as select concat(sign(0.5)) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(rand()) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# String functions
+#
+
+select hex(concat(length('a')));
+create table t1 as select concat(length('a')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(char_length('a')));
+create table t1 as select concat(char_length('a')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(bit_length('a')));
+create table t1 as select concat(bit_length('a')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(coercibility('a')));
+create table t1 as select concat(coercibility('a')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(locate('a','a')));
+create table t1 as select concat(locate('a','a')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(field('c','a','b','c')));
+create table t1 as select concat(field('c','a','b','c')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(ascii(61)));
+create table t1 as select concat(ascii(61)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(ord(61)));
+create table t1 as select concat(ord(61)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(find_in_set('b','a,b,c,d')));
+create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# String hash functions
+#
+
+select md5('a'), hex(md5('a'));
+create table t1 as select md5('a') as c1;
+show create table t1;
+drop table t1;
+
+select old_password('a'), hex(old_password('a'));
+create table t1 as select old_password('a') as c1;
+show create table t1;
+drop table t1;
+
+select password('a'), hex(password('a'));
+create table t1 as select password('a') as c1;
+show create table t1;
+drop table t1;
+
+select sha('a'), hex(sha('a'));
+create table t1 as select sha('a') as c1;
+show create table t1;
+drop table t1;
+
+select sha1('a'), hex(sha1('a'));
+create table t1 as select sha1('a') as c1;
+show create table t1;
+drop table t1;
+
+#select sha2('a',224), hex(sha2('a',224));
+#create table t1 as select sha2('a',224) as c1;
+#show create table t1;
+#drop table t1;
+
+
+
+#
+# CAST
+#
+
+select hex(concat(cast('-1' as signed)));
+create table t1 as select concat(cast('-1' as signed)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(cast('1' as unsigned)));
+create table t1 as select concat(cast('1' as unsigned)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(cast(1/2 as decimal(5,5))));
+create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(cast('2001-01-02 03:04:05' as date)));
+create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1;
+show create table t1;
+select * from t1;
+drop table t1;
+
+select hex(concat(cast('2001-01-02 03:04:05' as time)));
+create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1;
+show create table t1;
+select * from t1;
+drop table t1;
+
+select hex(concat(cast('2001-01-02' as datetime)));
+create table t1 as select concat(cast('2001-01-02' as datetime)) as c1;
+show create table t1;
+select * from t1;
+drop table t1;
+
+
+#
+# Aggregation: LEAST, GREATEST
+#
+select hex(concat(least(1,2)));
+create table t1 as select concat(least(1,2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(greatest(1,2)));
+create table t1 as select concat(greatest(1,2)) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# Aggregation: CASE
+#
+select hex(concat(case when 11 then 22 else 33 end));
+create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# Aggregation: COALESCE
+#
+select hex(concat(coalesce(1,2)));
+create table t1 as select concat(coalesce(1,2)) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# Aggregation: CONCAT_WS, GROUP_CONCAT
+#
+select hex(concat_ws(1,2,3));
+create table t1 as select concat_ws(1,2,3) as c1;
+show create table t1;
+drop table t1;
+
+select hex(group_concat(1,2,3));
+create table t1 as select group_concat(1,2,3) as c1;
+show create table t1;
+drop table t1;
+
+#
+# Aggregation: UNION
+#
+create table t1 as select 1 as c1 union select 'a';
+show create table t1;
+select hex(c1) from t1 order by c1;
+drop table t1;
+
+
+#
+# Miscelaneous functions
+#
+
+create table t1 as select concat(last_insert_id()) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(benchmark(0,0)));
+create table t1 as select concat(benchmark(0,0)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(sleep(0)));
+create table t1 as select concat(sleep(0)) as c1;
+show create table t1;
+drop table t1;
+
+# Fails with "mtr --ps-protocol" for some reasons.
+#select hex(concat(get_lock('a',0)));
+#select hex(concat(release_lock('a')));
+#create table t1 as select concat(get_lock('a',0)) as c1;
+#show create table t1;
+#drop table t1;
+
+select hex(concat(is_free_lock('xxxx')));
+create table t1 as select concat(is_free_lock('xxxx')) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(is_used_lock('a')) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(release_lock('a')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(crc32('')));
+create table t1 as select concat(crc32('')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(uncompressed_length('')));
+create table t1 as select concat(uncompressed_length('')) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(connection_id()) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(inet_aton('127.1.1.1')));
+create table t1 as select concat(inet_aton('127.1.1.1')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(inet_ntoa(2130772225)));
+create table t1 as select concat(inet_ntoa(2130772225)) as c1;
+select * from t1;
+show create table t1;
+drop table t1;
+
+select hex(concat(row_count()));
+create table t1 as select concat(row_count()) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(found_rows()));
+create table t1 as select concat(found_rows()) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(uuid_short()) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(uuid()) as c1;
+show create table t1;
+drop table t1;
+
+#
+# Make sure we can mix uuid() to a latin1 object
+# with DERIVATION_IMPLICIT (and higher):
+# (DERIVATION_COERCIBLE + MY_REPERTOIRE_ASCII allow to do so)
+#
+select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
+select charset(concat(uuid(), cast('a' as char character set latin1)));
+create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# User and system variable functions
+#
+
+# User variables: INT
+select hex(concat(@a1:=1));
+create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2;
+select hex(c1) from t1;
+show create table t1;
+drop table t1;
+
+set @a2=1;
+select hex(concat(@a2));
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+show create table t1;
+drop table t1;
+
+# User variables: REAL
+select hex(concat(@a1:=sqrt(1)));
+create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2;
+select hex(c1) from t1;
+show create table t1;
+drop table t1;
+
+set @a2=sqrt(1);
+select hex(concat(@a2));
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+show create table t1;
+drop table t1;
+
+# User variables: DECIMAL
+select hex(concat(@a1:=1.1));
+create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2;
+select hex(c1) from t1;
+show create table t1;
+drop table t1;
+
+set @a2=1.1;
+select hex(concat(@a2));
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+show create table t1;
+drop table t1;
+
+
+select hex(concat(@@ft_max_word_len));
+create table t1 as select concat(@@ft_max_word_len) as c1;
+select hex(c1) from t1;
+show create table t1;
+drop table t1;
+
+#
+# Comparison functions
+#
+
+select hex(concat('a'='a' IS TRUE));
+create table t1 as select concat('a'='a' IS TRUE) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat('a'='a' IS NOT TRUE));
+create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(NOT 'a'='a'));
+create table t1 as select concat(NOT 'a'='a') as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat('a' IS NULL));
+create table t1 as select concat('a' IS NULL) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat('a' IS NOT NULL));
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat('a' rlike 'a'));
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(strcmp('a','b')));
+create table t1 as select concat(strcmp('a','b')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat('a' like 'a'));
+create table t1 as select concat('a' like 'b') as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat('a' between 'b' and 'c'));
+create table t1 as select concat('a' between 'b' and 'c') as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat('a' in ('a','b')));
+create table t1 as select concat('a' in ('a','b')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
+create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 (a varchar(10), fulltext key(a));
+insert into t1 values ('a');
+select hex(concat(match (a) against ('a'))) from t1;
+create table t2 as select concat(match (a) against ('a')) as a from t1;
+show create table t2;
+drop table t1, t2;
+
+select hex(ifnull(1,'a'));
+create table t1 as select ifnull(1,'a') as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(ifnull(1,1)));
+create table t1 as select concat(ifnull(1,1)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(ifnull(1.1,1.1)));
+create table t1 as select concat(ifnull(1.1,1.1)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(if(1,'b',1));
+create table t1 as select if(1,'b',1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(if(1,1,'b'));
+create table t1 as select if(1,1,'b') as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(if(1,1,1)));
+create table t1 as select concat(if(1,1,1)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(nullif(1,2)));
+create table t1 as select concat(nullif(1,2)) as c1;
+show create table t1;
+drop table t1;
+
+#
+# GIS functions
+#
+
+select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))));
+create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))));
+create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))));
+create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))));
+create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(IsSimple(GeomFromText('POINT(1 1)'))));
+create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
+create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
+create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1;
+drop table t1;
+
+select hex(concat(x(GeomFromText('Point(1 2)'))));
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(y(GeomFromText('Point(1 2)'))));
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))));
+create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))));
+create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(GeometryType(GeomFromText('Point(1 2)'))));
+create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(AsText(GeomFromText('Point(1 2)'))));
+create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+drop table t1;
+
+
+
+#
+# Date/Time functions
+#
+
+select hex(concat(period_add(200902, 2)));
+create table t1 as select concat(period_add(200902, 2)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(period_diff(200902, 200802)));
+create table t1 as select concat(period_add(200902, 200802)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(to_days(20090224)));
+create table t1 as select concat(to_days(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(dayofmonth(20090224)));
+create table t1 as select concat(dayofmonth(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(dayofyear(20090224)));
+create table t1 as select concat(dayofyear(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(hour('10:11:12')));
+create table t1 as select concat(hour('10:11:12')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(minute('10:11:12')));
+create table t1 as select concat(minute('10:11:12')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(second('10:11:12')));
+create table t1 as select concat(second('10:11:12')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(quarter(20090224)));
+create table t1 as select concat(quarter(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(week(20090224)));
+create table t1 as select concat(week(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(yearweek(20090224)));
+create table t1 as select concat(yearweek(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(year(20090224)));
+create table t1 as select concat(year(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(weekday(20090224)));
+create table t1 as select concat(weekday(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(dayofweek(20090224)));
+create table t1 as select concat(dayofweek(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(unix_timestamp(20090224)));
+create table t1 as select concat(unix_timestamp(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(time_to_sec('10:11:12')));
+create table t1 as select concat(time_to_sec('10:11:12')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(extract(year from 20090702)));
+create table t1 as select concat(extract(year from 20090702)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(microsecond('12:00:00.123456')));
+create table t1 as select concat(microsecond('12:00:00.123456')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(month(20090224)));
+create table t1 as select concat(month(20090224)) as c1;
+show create table t1;
+drop table t1;
+
+
+create table t1 as select concat(last_day('2003-02-05')) as c1;
+show create table t1;
+select c1, hex(c1) from t1;
+drop table t1;
+
+create table t1 as select concat(from_days(730669)) as c1;
+show create table t1;
+select c1, hex(c1) from t1;
+drop table t1;
+
+create table t1 as select concat(curdate()) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(utc_date()) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(curtime()) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select repeat('a',20) as c1 limit 0;
+set timestamp=1216359724;
+insert into t1 values (current_date);
+insert into t1 values (current_time);
+select c1, hex(c1) from t1;
+drop table t1;
+
+create table t1 as select concat(utc_time()) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(sec_to_time(2378)));
+create table t1 as select concat(sec_to_time(2378)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')));
+create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(maketime(10,11,12)));
+create table t1 as select concat(maketime(10,11,12)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(get_format(DATE,'USA'));
+create table t1 as select get_format(DATE,'USA') as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(concat(from_unixtime(1111885200)),4));
+create table t1 as select concat(from_unixtime(1111885200)) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')));
+create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)));
+create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1;
+show create table t1;
+select * from t1;
+drop table t1;
+
+select hex(concat(makedate(2009,1)));
+create table t1 as select concat(makedate(2009,1)) as c1;
+show create table t1;
+select * from t1;
+drop table t1;
+
+create table t1 as select concat(now()) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(utc_timestamp()) as c1;
+show create table t1;
+drop table t1;
+
+create table t1 as select concat(sysdate()) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(addtime('00:00:00','11:22:33')));
+create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1;
+show create table t1;
+drop table t1;
+
+select hex(concat(subtime('23:59:59','11:22:33')));
+create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# Other string functions with numeric input
+#
+select hex(elt(1,2,3));
+create table t1 as select elt(1,2,3) as c1;
+show create table t1;
+drop table t1;
+
+select hex(export_set(1,2,3,4,2));
+create table t1 as select export_set(1,2,3,4,2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(insert(1133,3,0,22));
+create table t1 as select insert(1133,3,0,22) as c1;
+show create table t1;
+drop table t1;
+
+select hex(lcase(123));
+create table t1 as select lcase(123) as c1;
+show create table t1;
+drop table t1;
+
+select hex(left(123,1));
+create table t1 as select left(123,1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(lower(123));
+create table t1 as select lower(123) as c1;
+show create table t1;
+drop table t1;
+
+select hex(lpad(1,2,0));
+create table t1 as select lpad(1,2,0) as c1;
+show create table t1;
+drop table t1;
+
+select hex(ltrim(1));
+create table t1 as select ltrim(1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(mid(1,1,1));
+create table t1 as select mid(1,1,1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(repeat(1,2));
+create table t1 as select repeat(1,2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(replace(1,1,2));
+create table t1 as select replace(1,1,2) as c1;
+show create table t1;
+drop table t1;
+
+select hex(reverse(12));
+create table t1 as select reverse(12) as c1;
+show create table t1;
+drop table t1;
+
+select hex(right(123,1));
+create table t1 as select right(123,1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(rpad(1,2,0));
+create table t1 as select rpad(1,2,0) as c1;
+show create table t1;
+drop table t1;
+
+select hex(rtrim(1));
+create table t1 as select rtrim(1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(soundex(1));
+create table t1 as select soundex(1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(substring(1,1,1));
+create table t1 as select substring(1,1,1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(trim(1));
+create table t1 as select trim(1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(ucase(1));
+create table t1 as select ucase(1) as c1;
+show create table t1;
+drop table t1;
+
+select hex(upper(1));
+create table t1 as select upper(1) as c1;
+show create table t1;
+drop table t1;
+
+
+#
+# Bug#8204
+#
+create table t1 as select repeat(' ', 64) as a limit 0;
+show create table t1;
+insert into t1 values ("1.1"), ("2.1");
+select a, hex(a) from t1;
+update t1 set a= a + 0.1;
+select a, hex(a) from t1;
+drop table t1;
+
+
+#
+# Columns
+#
+create table t1 (a tinyint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a tinyint(4) zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a smallint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a mediumint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a int);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a bigint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a float);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+select concat(a) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a double);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+select concat(a) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+drop table t1;
+
+create table t1 (a year(2));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a year);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a bit(64));
+# BIT is always BINARY
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+select hex(concat(a)) from t1;
+select concat(a) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+select hex(concat(a)) from t1;
+select concat(a) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+select hex(concat(a)) from t1;
+create table t2 as select concat(a) from t1;
+show create table t2;
+drop table t1, t2;
+
+
+#
+# create view with string functions with numeric input
+#
+# Switched off in ucs tests due to bug#50716
+if ($not_ucs)
+{
+create view v1 as select concat(1,2,3) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select concat_ws(',',1,2,3) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select elt(1,2,3) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select export_set(1,2,3,4,2) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select insert(1133,3,0,22) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select lcase(123) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select left(123,1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select lower(123) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select lpad(1,2,0) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select ltrim(1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select mid(1,1,1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select repeat(1,2) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select replace(1,1,2) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select reverse(12) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select right(123,1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select rpad(1,2,0) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select rtrim(1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select soundex(1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select substring(1,1,1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select trim(1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select ucase(1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+
+create view v1 as select upper(1) as c1;
+show columns from v1;
+select hex(c1) from v1;
+drop view v1;
+}
+
+
+#
+# Views from tables with numeric columns
+#
+create table t1 (a tinyint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a tinyint(30) zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a smallint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a mediumint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a int);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a bigint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a float);
+insert into t1 values (123.456);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a double);
+insert into t1 values (123.456);
+select concat(a) from t1;
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a year(2));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a year);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a bit(64));
+# BIT is always BINARY
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+select hex(a) from v1;
+drop table t1;
+drop view v1;
+
+#
+# User defined function returning numeric result
+#
+delimiter |;
+create function f1 (par1 int) returns int
+begin
+return concat(par1);
+end|
+delimiter ;|
+
+set @a= f1(1);
+select hex(@a);
+select hex(concat(f1(1)));
+create table t1 as select f1(1) as c1;
+show create table t1;
+drop table t1;
+create table t1 as select concat(f1(1)) as c1;
+show create table t1;
+create view v1 as select concat(f1(1)) as c1;
+show columns from v1;
+drop table t1;
+drop view v1;
+drop function f1;
+
+delimiter |;
+create function f1 (par1 decimal(18,2)) returns decimal(18,2)
+begin
+return concat(par1);
+end|
+delimiter ;|
+
+set @a= f1(123.45);
+select hex(@a);
+select hex(concat(f1(123.45)));
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+drop table t1;
+drop view v1;
+drop function f1;
+
+delimiter |;
+create function f1 (par1 float) returns float
+begin
+return concat(par1);
+end|
+delimiter ;|
+
+set @a= f1(123.45);
+select hex(@a);
+select hex(concat(f1(123.45)));
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+drop table t1;
+drop view v1;
+drop function f1;
+
+delimiter |;
+create function f1 (par1 date) returns date
+begin
+return concat(par1);
+end|
+delimiter ;|
+
+set @a= f1(cast('2001-01-02' as date));
+select hex(@a);
+select hex(concat(f1(cast('2001-01-02' as date))));
+create table t1 as select f1(cast('2001-01-02' as date)) as c1;
+show create table t1;
+drop table t1;
+create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show create table t1;
+create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show columns from v1;
+drop table t1;
+drop view v1;
+drop function f1;
+
+
+--echo #
+--echo # End of WL#2649 Number-to-string conversions
+--echo #
+
diff --git a/mysql-test/include/have_utf16.inc b/mysql-test/include/have_utf16.inc
new file mode 100644
index 00000000000..ab22c255c88
--- /dev/null
+++ b/mysql-test/include/have_utf16.inc
@@ -0,0 +1,4 @@
+-- require r/have_utf16.require
+disable_query_log;
+show collation like 'utf16_general_ci';
+enable_query_log;
diff --git a/mysql-test/include/have_utf32.inc b/mysql-test/include/have_utf32.inc
new file mode 100644
index 00000000000..f5b5353c9fd
--- /dev/null
+++ b/mysql-test/include/have_utf32.inc
@@ -0,0 +1,4 @@
+-- require r/have_utf32.require
+disable_query_log;
+show collation like 'utf32_general_ci';
+enable_query_log;
diff --git a/mysql-test/include/have_utf8mb4.inc b/mysql-test/include/have_utf8mb4.inc
new file mode 100644
index 00000000000..6eb91b1c23c
--- /dev/null
+++ b/mysql-test/include/have_utf8mb4.inc
@@ -0,0 +1,7 @@
+--require r/have_utf8mb4.require
+
+--disable_query_log
+
+SHOW COLLATION LIKE 'utf8mb4_general_ci';
+
+--enable_query_log
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index dc21410c435..bf0a58788d6 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -185,14 +185,6 @@ INSERT INTO global_suppressions VALUES
("Master server does not support or not configured semi-sync replication, fallback to asynchronous"),
(": The MySQL server is running with the --secure-backup-file-priv option so it cannot execute this statement"),
("Slave: Unknown table 't1' Error_code: 1051"),
- /*
- Transient network failures that cause warnings on reconnect.
- BUG#47743 and BUG#47983.
- */
- ("Slave I/O: Get master SERVER_ID failed with error:.*"),
- ("Slave I/O: Get master clock failed with error:.*"),
- ("Slave I/O: Get master COLLATION_SERVER failed with error:.*"),
- ("Slave I/O: Get master TIME_ZONE failed with error:.*"),
/* Messages from valgrind */
("==[0-9]*== Memcheck,"),
diff --git a/mysql-test/include/not_binlog_format_row.inc b/mysql-test/include/not_binlog_format_row.inc
new file mode 100644
index 00000000000..f9354e7cd33
--- /dev/null
+++ b/mysql-test/include/not_binlog_format_row.inc
@@ -0,0 +1,4 @@
+if (`SELECT @@binlog_format = 'ROW'`)
+{
+ skip Test cannot run with binlog_format row;
+}
diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm
index 40f05c41d1c..3bfbe1fc90e 100644
--- a/mysql-test/lib/My/Options.pm
+++ b/mysql-test/lib/My/Options.pm
@@ -67,9 +67,6 @@ sub _split_option {
elsif ($option=~ /^(.*)=(.*)$/){
return ($1, $2)
}
- elsif ($option=~ /^-O$/){
- return (undef, undef);
- }
die "Unknown option format '$option'";
}
@@ -169,20 +166,11 @@ sub toSQL {
my @sql;
foreach my $option (@options) {
- my ($name, $value)= _split_option($option);
- #print "name: $name\n";
+ my ($sql_name, $value)= _split_option($option);
+ #print "name: $sql_name\n";
#print "value: $value\n";
- if ($name =~ /^O, (.*)/){
- push(@sql, "SET GLOBAL $1=$value");
- }
- elsif ($name =~ /^set-variable=(.*)/){
- push(@sql, "SET GLOBAL $1=$value");
- }
- else {
- my $sql_name= $name;
- $sql_name=~ s/-/_/g;
- push(@sql, "SET GLOBAL $sql_name=$value");
- }
+ $sql_name=~ s/-/_/g;
+ push(@sql, "SET GLOBAL $sql_name=$value");
}
return join("; ", @sql);
}
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 7b7dd70a696..cb893402258 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -1150,7 +1150,7 @@ sub opts_from_file ($) {
{
chomp;
- # --set-variable=init_connect=set @a='a\\0c'
+ # --init_connect=set @a='a\\0c'
s/^\s+//; # Remove leading space
s/\s+$//; # Remove ending space
diff --git a/mysql-test/lib/t/Options.t b/mysql-test/lib/t/Options.t
index 7012f3da8de..3824c838627 100644
--- a/mysql-test/lib/t/Options.t
+++ b/mysql-test/lib/t/Options.t
@@ -45,42 +45,30 @@ my @tests=
[
[ ],
- ['-O', 'max_binlog_size=1' ],
['--max_binlog_size=1' ]
],
[
- ['-O', 'max_binlog_size=1' ],
- ['-O', 'max_binlog_size=1' ],
- [ ],
- ],
-
- [
- ['-O', 'max_binlog_size=1' ],
[ ],
['--max_binlog_size=default' ]
],
[
[ ],
- ['-O', 'max_binlog_size=1', '--binlog-format=row' ],
['--max_binlog_size=1', '--binlog-format=row' ]
],
[
['--binlog-format=statement' ],
- ['-O', 'max_binlog_size=1', '--binlog-format=row' ],
['--max_binlog_size=1', '--binlog-format=row']
],
[
[ '--binlog-format=statement' ],
- ['-O', 'max_binlog_size=1', '--binlog-format=statement' ],
['--max_binlog_size=1' ]
],
[
[ '--binlog-format=statement' ],
- ['-O', 'max_binlog_size=1', '--binlog-format=statement' ],
['--max_binlog_size=1' ]
],
@@ -93,7 +81,7 @@ my @tests=
[
[ '--binlog-format=statement' ],
- ['--relay-log=/path/to/a/relay-log', '-O', 'max_binlog_size=1'],
+ ['--relay-log=/path/to/a/relay-log', '--max_binlog_size=1'],
['--max_binlog_size=1', '--relay-log=/path/to/a/relay-log', '--binlog-format=default' ]
],
diff --git a/mysql-test/lib/v1/mtr_io.pl b/mysql-test/lib/v1/mtr_io.pl
index aa671c0f4f7..952b8f1f4ba 100644
--- a/mysql-test/lib/v1/mtr_io.pl
+++ b/mysql-test/lib/v1/mtr_io.pl
@@ -80,7 +80,7 @@ sub mtr_get_opts_from_file ($) {
{
chomp;
- # --set-variable=init_connect=set @a='a\\0c'
+ # --init_connect=set @a='a\\0c'
s/^\s+//; # Remove leading space
s/\s+$//; # Remove ending space
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index 5d9b0dbb221..f2c8252c47d 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -3997,7 +3997,7 @@ sub mysqld_arguments ($$$$) {
my $slave_load_path= "../tmp";
mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
$slave_load_path);
- mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix);
+ mtr_add_arg($args, "%s--slave_net_timeout=120", $prefix);
if ( @$slave_master_info )
{
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index aaab9d27edb..f76511ee84c 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12739,3 +12739,12 @@ Table Op Msg_type Msg_text
test.t1 repair Error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
test.t1 repair error Corrupt
DROP TABLE t1;
+#
+# BUG#48757 - missing .ARZ file causes server crash
+#
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+FLUSH TABLE t1;
+SELECT * FROM t1;
+ERROR HY000: Can't find file: 't1' (errno: 2)
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result
index bab2c83448c..89be20aee70 100644
--- a/mysql-test/r/backup.result
+++ b/mysql-test/r/backup.result
@@ -4,23 +4,23 @@ create table t4(n int);
backup table t4 to '../../bogus';
Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X)
-test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t4 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
test.t4 backup status Operation failed
backup table t4 to '../../tmp';
Table Op Msg_type Msg_text
-test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t4 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup status OK
backup table t4 to '../../tmp';
Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X)
-test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t4 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
test.t4 backup status Operation failed
drop table t4;
restore table t4 from '../../tmp';
Table Op Msg_type Msg_text
-test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t4 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 restore status OK
select count(*) from t4;
count(*)
@@ -29,18 +29,18 @@ create table t1(n int);
insert into t1 values (23),(45),(67);
backup table t1 to '../../tmp';
Table Op Msg_type Msg_text
-test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t1 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 backup status OK
drop table t1;
restore table t1 from '../../bogus';
Table Op Msg_type Msg_text
t1 restore error Failed copying .frm file
Warnings:
-Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+Warning 1287 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
restore table t1 from '../../tmp';
Table Op Msg_type Msg_text
-test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
select n from t1;
n
@@ -53,13 +53,13 @@ insert into t2 values (123),(145),(167);
insert into t3 values (223),(245),(267);
backup table t2,t3 to '../../tmp';
Table Op Msg_type Msg_text
-test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t2 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t2 backup status OK
test.t3 backup status OK
drop table t1,t2,t3;
restore table t1,t2,t3 from '../../tmp';
Table Op Msg_type Msg_text
-test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
test.t2 restore status OK
test.t3 restore status OK
@@ -81,14 +81,14 @@ k
drop table t1,t2,t3,t4;
restore table t1 from '../../tmp';
Table Op Msg_type Msg_text
-test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
rename table t1 to t5;
lock tables t5 write;
backup table t5 to '../../tmp';
unlock tables;
Table Op Msg_type Msg_text
-test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t5 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t5 backup status OK
drop table t5;
DROP TABLE IF EXISTS `t+1`;
@@ -96,12 +96,12 @@ CREATE TABLE `t+1` (c1 INT);
INSERT INTO `t+1` VALUES (1), (2), (3);
BACKUP TABLE `t+1` TO '../../tmp';
Table Op Msg_type Msg_text
-test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t+1 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 backup status OK
DROP TABLE `t+1`;
RESTORE TABLE `t+1` FROM '../../tmp';
Table Op Msg_type Msg_text
-test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t+1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 restore status OK
SELECT * FROM `t+1`;
c1
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 6b0954655e9..47a45efa5fd 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -404,3 +404,37 @@ describe t1;
Field Type Null Key Default Extra
bi decimal(19,0) NO 0
drop table t1;
+#
+# Bug #45360: wrong results
+#
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY,
+a BIGINT(20) UNSIGNED,
+b VARCHAR(20));
+INSERT INTO t1 (a) VALUES
+(0),
+(CAST(0x7FFFFFFFFFFFFFFF AS UNSIGNED)),
+(CAST(0x8000000000000000 AS UNSIGNED)),
+(CAST(0xFFFFFFFFFFFFFFFF AS UNSIGNED));
+UPDATE t1 SET b = a;
+# FFFFFFFFFFFFFFFF
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 18446744073709551615 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 18446744073709551615) and ('18446744073709551615' = `test`.`t1`.`b`))
+# 8000000000000000
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775808 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775808) and ('9223372036854775808' = `test`.`t1`.`b`))
+# 7FFFFFFFFFFFFFFF
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775807 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775807) and ('9223372036854775807' = `test`.`t1`.`b`))
+# 0
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 0 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`))
+DROP TABLE t1;
+# End of 5.1 tests
diff --git a/mysql-test/r/bug39022.result b/mysql-test/r/bug39022.result
new file mode 100644
index 00000000000..5963709aa2a
--- /dev/null
+++ b/mysql-test/r/bug39022.result
@@ -0,0 +1,32 @@
+#
+# Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
+#
+CREATE TABLE t1(a TINYINT NOT NULL,b TINYINT,PRIMARY KEY(b)) ENGINE=innodb;
+CREATE TABLE t2(d TINYINT NOT NULL,UNIQUE KEY(d)) ENGINE=innodb;
+INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
+(11,5),(11,6),(7,7),(7,8),(4,9),(6,10),(3,11),(11,12),
+(12,13),(7,14);
+INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
+(11),(12),(13),(14);
+# in thread1
+START TRANSACTION;
+# in thread2
+REPLACE INTO t2 VALUES (-17);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+d
+# in thread1
+REPLACE INTO t1(a,b) VALUES (67,20);
+# in thread2
+COMMIT;
+START TRANSACTION;
+REPLACE INTO t1(a,b) VALUES (65,-50);
+REPLACE INTO t2 VALUES (-91);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+# in thread1
+# should not crash
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+# in thread2
+d
+# in thread1;
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index 0c0e2d623c8..fcbf5812312 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -101,16 +101,16 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
`c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
- `c3` varbinary(1) NOT NULL DEFAULT '',
- `c4` varbinary(1) NOT NULL DEFAULT '',
- `c5` varbinary(4) NOT NULL DEFAULT '',
- `c6` varbinary(4) NOT NULL DEFAULT '',
+ `c3` varchar(1) NOT NULL DEFAULT '',
+ `c4` varchar(1) NOT NULL DEFAULT '',
+ `c5` varchar(4) NOT NULL DEFAULT '',
+ `c6` varchar(4) NOT NULL DEFAULT '',
`c7` decimal(2,1) NOT NULL DEFAULT '0.0',
`c8` decimal(2,1) NOT NULL DEFAULT '0.0',
`c9` decimal(2,1) DEFAULT NULL,
`c10` double NOT NULL DEFAULT '0',
`c11` double NOT NULL DEFAULT '0',
- `c12` varbinary(5) NOT NULL DEFAULT ''
+ `c12` varchar(5) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT CASE
@@ -155,8 +155,8 @@ t1 CREATE TABLE `t1` (
`COALESCE(1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
`COALESCE('a')` varchar(1) NOT NULL DEFAULT '',
`COALESCE(1,1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
- `COALESCE(1,'1')` varbinary(1) NOT NULL DEFAULT '',
- `COALESCE(1.1,'1')` varbinary(4) NOT NULL DEFAULT '',
+ `COALESCE(1,'1')` varchar(1) NOT NULL DEFAULT '',
+ `COALESCE(1.1,'1')` varchar(4) NOT NULL DEFAULT '',
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 61fd7b79fc9..eb1437414e7 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -438,7 +438,7 @@ explain t2;
Field Type Null Key Default Extra
a int(11) YES NULL
b bigint(11) NO 0
-c bigint(11) unsigned NO 0
+c bigint(10) unsigned NO 0
d date YES NULL
e varchar(1) NO
f datetime YES NULL
@@ -457,7 +457,7 @@ Table Create Table
t2 CREATE TABLE `t2` (
`ifnull(a,a)` tinyint(4) DEFAULT NULL,
`ifnull(b,b)` smallint(6) DEFAULT NULL,
- `ifnull(c,c)` mediumint(8) DEFAULT NULL,
+ `ifnull(c,c)` mediumint(9) DEFAULT NULL,
`ifnull(d,d)` int(11) DEFAULT NULL,
`ifnull(e,e)` bigint(20) DEFAULT NULL,
`ifnull(f,f)` float(3,2) DEFAULT NULL,
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 97996b484bb..c1710e82ba6 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5394,19 +5394,26 @@ select * from t1;
ERROR HY000: File 'MYSQLD_DATADIR/test/t1.CSV' not found (Errcode: 2)
unlock tables;
drop table t1;
-create table t1(a enum ('a') not null) engine=csv;
-insert into t1 values (2);
+CREATE TABLE t1 (e enum('foo','bar') NOT NULL) ENGINE = CSV;
+INSERT INTO t1 VALUES();
+INSERT INTO t1 VALUES(default);
+INSERT INTO t1 VALUES(0);
Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-select * from t1 limit 1;
-ERROR HY000: Table 't1' is marked as crashed and should be repaired
-repair table t1;
-Table Op Msg_type Msg_text
-test.t1 repair Warning Data truncated for column 'a' at row 1
-test.t1 repair status OK
-select * from t1 limit 1;
-a
-drop table t1;
+Warning 1265 Data truncated for column 'e' at row 1
+INSERT INTO t1 VALUES(3);
+Warnings:
+Warning 1265 Data truncated for column 'e' at row 1
+INSERT INTO t1 VALUES(-1);
+Warnings:
+Warning 1265 Data truncated for column 'e' at row 1
+SELECT * FROM t1;
+e
+foo
+foo
+
+
+
+DROP TABLE t1;
#
# Test for the following cases
# 1) integers and strings enclosed in quotes
diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result
new file mode 100644
index 00000000000..55faa72c6ab
--- /dev/null
+++ b/mysql-test/r/ctype_binary.result
@@ -0,0 +1,2568 @@
+set names binary;
+#
+# Start of 5.5 tests
+#
+#
+# Start of WL#2649 Number-to-string conversions
+#
+select hex(concat(1));
+hex(concat(1))
+31
+create table t1 as select concat(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+31
+drop table t1;
+select hex(concat(18446744073709551615));
+hex(concat(18446744073709551615))
+3138343436373434303733373039353531363135
+create table t1 as select concat(18446744073709551615) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(20) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+3138343436373434303733373039353531363135
+drop table t1;
+select hex(concat(1.1));
+hex(concat(1.1))
+312E31
+create table t1 as select concat(1.1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+312E31
+drop table t1;
+select hex(concat('a', 1+2)), charset(concat(1+2));
+hex(concat('a', 1+2)) charset(concat(1+2))
+6133 binary
+create table t1 as select concat(1+2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1-2));
+hex(concat(1-2))
+2D31
+create table t1 as select concat(1-2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1*2));
+hex(concat(1*2))
+32
+create table t1 as select concat(1*2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1/2));
+hex(concat(1/2))
+302E35303030
+create table t1 as select concat(1/2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(7) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 div 2));
+hex(concat(1 div 2))
+30
+create table t1 as select concat(1 div 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 % 2));
+hex(concat(1 % 2))
+31
+create table t1 as select concat(1 % 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-1));
+hex(concat(-1))
+2D31
+create table t1 as select concat(-1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-(1+2)));
+hex(concat(-(1+2)))
+2D33
+create table t1 as select concat(-(1+2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1|2));
+hex(concat(1|2))
+33
+create table t1 as select concat(1|2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1&2));
+hex(concat(1&2))
+30
+create table t1 as select concat(1&2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_count(12)));
+hex(concat(bit_count(12)))
+32
+create table t1 as select concat(bit_count(12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2<<1));
+hex(concat(2<<1))
+34
+create table t1 as select concat(2<<1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2>>1));
+hex(concat(2>>1))
+31
+create table t1 as select concat(2>>1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(~0));
+hex(concat(~0))
+3138343436373434303733373039353531363135
+create table t1 as select concat(~0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(3^2));
+hex(concat(3^2))
+31
+create table t1 as select concat(3^2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(abs(-2)));
+hex(concat(abs(-2)))
+32
+create table t1 as select concat(abs(-2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(exp(2)),1));
+hex(left(concat(exp(2)),1))
+37
+create table t1 as select concat(exp(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log(2)),1));
+hex(left(concat(log(2)),1))
+30
+create table t1 as select concat(log(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log2(2)),1));
+hex(left(concat(log2(2)),1))
+31
+create table t1 as select concat(log2(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log10(2)),1));
+hex(left(concat(log10(2)),1))
+30
+create table t1 as select concat(log10(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sqrt(2)),1));
+hex(left(concat(sqrt(2)),1))
+31
+create table t1 as select concat(sqrt(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(pow(2,2)),1));
+hex(left(concat(pow(2,2)),1))
+34
+create table t1 as select concat(pow(2,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(acos(0.5)),1));
+hex(left(concat(acos(0.5)),1))
+31
+create table t1 as select concat(acos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(asin(0.5)),1));
+hex(left(concat(asin(0.5)),1))
+30
+create table t1 as select concat(asin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(atan(0.5)),1));
+hex(left(concat(atan(0.5)),1))
+30
+create table t1 as select concat(atan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(cos(0.5)),1));
+hex(left(concat(cos(0.5)),1))
+30
+create table t1 as select concat(cos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sin(0.5)),1));
+hex(left(concat(sin(0.5)),1))
+30
+create table t1 as select concat(sin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(tan(0.5)),1));
+hex(left(concat(tan(0.5)),1))
+30
+create table t1 as select concat(tan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(degrees(0)));
+hex(concat(degrees(0)))
+30
+create table t1 as select concat(degrees(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(radians(0)));
+hex(concat(radians(0)))
+30
+create table t1 as select concat(radians(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ceiling(0.5)));
+hex(concat(ceiling(0.5)))
+31
+create table t1 as select concat(ceiling(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(floor(0.5)));
+hex(concat(floor(0.5)))
+30
+create table t1 as select concat(floor(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(round(0.5)));
+hex(concat(round(0.5)))
+31
+create table t1 as select concat(round(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sign(0.5)));
+hex(concat(sign(0.5)))
+31
+create table t1 as select concat(sign(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(rand()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(length('a')));
+hex(concat(length('a')))
+31
+create table t1 as select concat(length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(char_length('a')));
+hex(concat(char_length('a')))
+31
+create table t1 as select concat(char_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_length('a')));
+hex(concat(bit_length('a')))
+38
+create table t1 as select concat(bit_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coercibility('a')));
+hex(concat(coercibility('a')))
+34
+create table t1 as select concat(coercibility('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(locate('a','a')));
+hex(concat(locate('a','a')))
+31
+create table t1 as select concat(locate('a','a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(11) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(field('c','a','b','c')));
+hex(concat(field('c','a','b','c')))
+33
+create table t1 as select concat(field('c','a','b','c')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ascii(61)));
+hex(concat(ascii(61)))
+3534
+create table t1 as select concat(ascii(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ord(61)));
+hex(concat(ord(61)))
+3534
+create table t1 as select concat(ord(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(find_in_set('b','a,b,c,d')));
+hex(concat(find_in_set('b','a,b,c,d')))
+32
+create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select md5('a'), hex(md5('a'));
+md5('a') hex(md5('a'))
+0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631
+create table t1 as select md5('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(32) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select old_password('a'), hex(old_password('a'));
+old_password('a') hex(old_password('a'))
+60671c896665c3fa 36303637316338393636363563336661
+create table t1 as select old_password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(16) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select password('a'), hex(password('a'));
+password('a') hex(password('a'))
+*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445
+create table t1 as select password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(41) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha('a'), hex(sha('a'));
+sha('a') hex(sha('a'))
+86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
+create table t1 as select sha('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(40) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha1('a'), hex(sha1('a'));
+sha1('a') hex(sha1('a'))
+86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
+create table t1 as select sha1('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(40) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('-1' as signed)));
+hex(concat(cast('-1' as signed)))
+2D31
+create table t1 as select concat(cast('-1' as signed)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('1' as unsigned)));
+hex(concat(cast('1' as unsigned)))
+31
+create table t1 as select concat(cast('1' as unsigned)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast(1/2 as decimal(5,5))));
+hex(concat(cast(1/2 as decimal(5,5))))
+302E3530303030
+create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(7) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as date)));
+hex(concat(cast('2001-01-02 03:04:05' as date)))
+323030312D30312D3032
+create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as time)));
+hex(concat(cast('2001-01-02 03:04:05' as time)))
+30333A30343A3035
+create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+03:04:05
+drop table t1;
+select hex(concat(cast('2001-01-02' as datetime)));
+hex(concat(cast('2001-01-02' as datetime)))
+323030312D30312D30322030303A30303A3030
+create table t1 as select concat(cast('2001-01-02' as datetime)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02 00:00:00
+drop table t1;
+select hex(concat(least(1,2)));
+hex(concat(least(1,2)))
+31
+create table t1 as select concat(least(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(greatest(1,2)));
+hex(concat(greatest(1,2)))
+32
+create table t1 as select concat(greatest(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(case when 11 then 22 else 33 end));
+hex(concat(case when 11 then 22 else 33 end))
+3232
+create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coalesce(1,2)));
+hex(concat(coalesce(1,2)))
+31
+create table t1 as select concat(coalesce(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat_ws(1,2,3));
+hex(concat_ws(1,2,3))
+323133
+create table t1 as select concat_ws(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(group_concat(1,2,3));
+hex(group_concat(1,2,3))
+313233
+create table t1 as select group_concat(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` blob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select 1 as c1 union select 'a';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1 order by c1;
+hex(c1)
+31
+61
+drop table t1;
+create table t1 as select concat(last_insert_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(benchmark(0,0)));
+hex(concat(benchmark(0,0)))
+30
+create table t1 as select concat(benchmark(0,0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sleep(0)));
+hex(concat(sleep(0)))
+30
+create table t1 as select concat(sleep(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(is_free_lock('xxxx')));
+hex(concat(is_free_lock('xxxx')))
+31
+create table t1 as select concat(is_free_lock('xxxx')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(is_used_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(release_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(crc32('')));
+hex(concat(crc32('')))
+30
+create table t1 as select concat(crc32('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(uncompressed_length('')));
+hex(concat(uncompressed_length('')))
+30
+create table t1 as select concat(uncompressed_length('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(connection_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_aton('127.1.1.1')));
+hex(concat(inet_aton('127.1.1.1')))
+32313330373732323235
+create table t1 as select concat(inet_aton('127.1.1.1')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_ntoa(2130772225)));
+hex(concat(inet_ntoa(2130772225)))
+3132372E312E312E31
+create table t1 as select concat(inet_ntoa(2130772225)) as c1;
+select * from t1;
+c1
+127.1.1.1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(31) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(row_count()));
+hex(concat(row_count()))
+2D31
+create table t1 as select concat(row_count()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(found_rows()));
+hex(concat(found_rows()))
+30
+create table t1 as select concat(found_rows()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid_short()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
+coercibility(uuid()) coercibility(cast('a' as char character set latin1))
+4 2
+select charset(concat(uuid(), cast('a' as char character set latin1)));
+charset(concat(uuid(), cast('a' as char character set latin1)))
+latin1
+create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(37) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1));
+hex(concat(@a1:=1))
+31
+create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2;
+select hex(c1) from t1;
+hex(c1)
+32
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT '',
+ `c2` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1;
+select hex(concat(@a2));
+hex(concat(@a2))
+31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(20) DEFAULT NULL,
+ `c2` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=sqrt(1)));
+hex(concat(@a1:=sqrt(1)))
+31
+create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=sqrt(1);
+select hex(concat(@a2));
+hex(concat(@a2))
+31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1.1));
+hex(concat(@a1:=1.1))
+312E31
+create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2;
+select hex(c1) from t1;
+hex(c1)
+312E31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) NOT NULL DEFAULT '',
+ `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1.1;
+select hex(concat(@a2));
+hex(concat(@a2))
+312E31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+312E31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(83) DEFAULT NULL,
+ `c2` decimal(65,30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@@ft_max_word_len));
+hex(concat(@@ft_max_word_len))
+3834
+create table t1 as select concat(@@ft_max_word_len) as c1;
+select hex(c1) from t1;
+hex(c1)
+3834
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS TRUE));
+hex(concat('a'='a' IS TRUE))
+31
+create table t1 as select concat('a'='a' IS TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS NOT TRUE));
+hex(concat('a'='a' IS NOT TRUE))
+30
+create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NOT 'a'='a'));
+hex(concat(NOT 'a'='a'))
+30
+create table t1 as select concat(NOT 'a'='a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NULL));
+hex(concat('a' IS NULL))
+30
+create table t1 as select concat('a' IS NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NOT NULL));
+hex(concat('a' IS NOT NULL))
+31
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' rlike 'a'));
+hex(concat('a' rlike 'a'))
+31
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(strcmp('a','b')));
+hex(concat(strcmp('a','b')))
+2D31
+create table t1 as select concat(strcmp('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' like 'a'));
+hex(concat('a' like 'a'))
+31
+create table t1 as select concat('a' like 'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' between 'b' and 'c'));
+hex(concat('a' between 'b' and 'c'))
+30
+create table t1 as select concat('a' between 'b' and 'c') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' in ('a','b')));
+hex(concat('a' in ('a','b')))
+31
+create table t1 as select concat('a' in ('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
+hex(concat(interval(23, 1, 15, 17, 30, 44, 200)))
+33
+create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(10), fulltext key(a));
+insert into t1 values ('a');
+select hex(concat(match (a) against ('a'))) from t1;
+hex(concat(match (a) against ('a')))
+30
+create table t2 as select concat(match (a) against ('a')) as a from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+select hex(ifnull(1,'a'));
+hex(ifnull(1,'a'))
+31
+create table t1 as select ifnull(1,'a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1,1)));
+hex(concat(ifnull(1,1)))
+31
+create table t1 as select concat(ifnull(1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1.1,1.1)));
+hex(concat(ifnull(1.1,1.1)))
+312E31
+create table t1 as select concat(ifnull(1.1,1.1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,'b',1));
+hex(if(1,'b',1))
+62
+create table t1 as select if(1,'b',1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,1,'b'));
+hex(if(1,1,'b'))
+31
+create table t1 as select if(1,1,'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(if(1,1,1)));
+hex(concat(if(1,1,1)))
+31
+create table t1 as select concat(if(1,1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(nullif(1,2)));
+hex(concat(nullif(1,2)))
+31
+create table t1 as select concat(nullif(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))))
+31
+create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+32
+create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))))
+32
+create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+30
+create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))));
+hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))))
+31
+create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))));
+hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))))
+30
+create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsSimple(GeomFromText('POINT(1 1)'))));
+hex(concat(IsSimple(GeomFromText('POINT(1 1)'))))
+30
+create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
+hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))))
+30
+create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
+hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))))
+31
+create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1;
+drop table t1;
+select hex(concat(x(GeomFromText('Point(1 2)'))));
+hex(concat(x(GeomFromText('Point(1 2)'))))
+31
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(y(GeomFromText('Point(1 2)'))));
+hex(concat(y(GeomFromText('Point(1 2)'))))
+32
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))));
+hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))))
+31
+create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))));
+hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))))
+31
+create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GeometryType(GeomFromText('Point(1 2)'))));
+hex(concat(GeometryType(GeomFromText('Point(1 2)'))))
+504F494E54
+create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(AsText(GeomFromText('Point(1 2)'))));
+hex(concat(AsText(GeomFromText('Point(1 2)'))))
+504F494E542831203229
+create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_add(200902, 2)));
+hex(concat(period_add(200902, 2)))
+323030393034
+create table t1 as select concat(period_add(200902, 2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(6) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_diff(200902, 200802)));
+hex(concat(period_diff(200902, 200802)))
+3132
+create table t1 as select concat(period_add(200902, 200802)) as c1;
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(6) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(to_days(20090224)));
+hex(concat(to_days(20090224)))
+373333383237
+create table t1 as select concat(to_days(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofmonth(20090224)));
+hex(concat(dayofmonth(20090224)))
+3234
+create table t1 as select concat(dayofmonth(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofyear(20090224)));
+hex(concat(dayofyear(20090224)))
+3535
+create table t1 as select concat(dayofyear(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(hour('10:11:12')));
+hex(concat(hour('10:11:12')))
+3130
+create table t1 as select concat(hour('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(minute('10:11:12')));
+hex(concat(minute('10:11:12')))
+3131
+create table t1 as select concat(minute('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(second('10:11:12')));
+hex(concat(second('10:11:12')))
+3132
+create table t1 as select concat(second('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(quarter(20090224)));
+hex(concat(quarter(20090224)))
+31
+create table t1 as select concat(quarter(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(week(20090224)));
+hex(concat(week(20090224)))
+38
+create table t1 as select concat(week(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(yearweek(20090224)));
+hex(concat(yearweek(20090224)))
+323030393038
+create table t1 as select concat(yearweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(year(20090224)));
+hex(concat(year(20090224)))
+32303039
+create table t1 as select concat(year(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(weekday(20090224)));
+hex(concat(weekday(20090224)))
+31
+create table t1 as select concat(weekday(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofweek(20090224)));
+hex(concat(dayofweek(20090224)))
+33
+create table t1 as select concat(dayofweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(unix_timestamp(20090224)));
+hex(concat(unix_timestamp(20090224)))
+31323335343232383030
+create table t1 as select concat(unix_timestamp(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(time_to_sec('10:11:12')));
+hex(concat(time_to_sec('10:11:12')))
+3336363732
+create table t1 as select concat(time_to_sec('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(extract(year from 20090702)));
+hex(concat(extract(year from 20090702)))
+32303039
+create table t1 as select concat(extract(year from 20090702)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(microsecond('12:00:00.123456')));
+hex(concat(microsecond('12:00:00.123456')))
+313233343536
+create table t1 as select concat(microsecond('12:00:00.123456')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(month(20090224)));
+hex(concat(month(20090224)))
+32
+create table t1 as select concat(month(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(last_day('2003-02-05')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2003-02-28 323030332D30322D3238
+drop table t1;
+create table t1 as select concat(from_days(730669)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2000-07-03 323030302D30372D3033
+drop table t1;
+create table t1 as select concat(curdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_date()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(curtime()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(8) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat('a',20) as c1 limit 0;
+set timestamp=1216359724;
+insert into t1 values (current_date);
+insert into t1 values (current_time);
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2008-07-18 323030382D30372D3138
+08:42:04 30383A34323A3034
+drop table t1;
+create table t1 as select concat(utc_time()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(8) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sec_to_time(2378)));
+hex(concat(sec_to_time(2378)))
+30303A33393A3338
+create table t1 as select concat(sec_to_time(2378)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')));
+hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')))
+32343A30303A3030
+create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(maketime(10,11,12)));
+hex(concat(maketime(10,11,12)))
+31303A31313A3132
+create table t1 as select concat(maketime(10,11,12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(get_format(DATE,'USA'));
+hex(get_format(DATE,'USA'))
+256D2E25642E2559
+create table t1 as select get_format(DATE,'USA') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(17) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(from_unixtime(1111885200)),4));
+hex(left(concat(from_unixtime(1111885200)),4))
+32303035
+create table t1 as select concat(from_unixtime(1111885200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')));
+hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')))
+323030332D31322D33312032303A30303A3030
+create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)));
+hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)))
+323030342D30312D30322031323A30303A3030
+create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2004-01-02 12:00:00
+drop table t1;
+select hex(concat(makedate(2009,1)));
+hex(concat(makedate(2009,1)))
+323030392D30312D3031
+create table t1 as select concat(makedate(2009,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2009-01-01
+drop table t1;
+create table t1 as select concat(now()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_timestamp()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(sysdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(addtime('00:00:00','11:22:33')));
+hex(concat(addtime('00:00:00','11:22:33')))
+31313A32323A3333
+create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(subtime('23:59:59','11:22:33')));
+hex(concat(subtime('23:59:59','11:22:33')))
+31323A33373A3236
+create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(elt(1,2,3));
+hex(elt(1,2,3))
+32
+create table t1 as select elt(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(export_set(1,2,3,4,2));
+hex(export_set(1,2,3,4,2))
+323433
+create table t1 as select export_set(1,2,3,4,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(127) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(insert(1133,3,0,22));
+hex(insert(1133,3,0,22))
+313132323333
+create table t1 as select insert(1133,3,0,22) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(6) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lcase(123));
+hex(lcase(123))
+313233
+create table t1 as select lcase(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(123,1));
+hex(left(123,1))
+31
+create table t1 as select left(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lower(123));
+hex(lower(123))
+313233
+create table t1 as select lower(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lpad(1,2,0));
+hex(lpad(1,2,0))
+3031
+create table t1 as select lpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ltrim(1));
+hex(ltrim(1))
+31
+create table t1 as select ltrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(mid(1,1,1));
+hex(mid(1,1,1))
+31
+create table t1 as select mid(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(repeat(1,2));
+hex(repeat(1,2))
+3131
+create table t1 as select repeat(1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(replace(1,1,2));
+hex(replace(1,1,2))
+32
+create table t1 as select replace(1,1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(reverse(12));
+hex(reverse(12))
+3231
+create table t1 as select reverse(12) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(right(123,1));
+hex(right(123,1))
+33
+create table t1 as select right(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rpad(1,2,0));
+hex(rpad(1,2,0))
+3130
+create table t1 as select rpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rtrim(1));
+hex(rtrim(1))
+31
+create table t1 as select rtrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(soundex(1));
+hex(soundex(1))
+
+create table t1 as select soundex(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(substring(1,1,1));
+hex(substring(1,1,1))
+31
+create table t1 as select substring(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(trim(1));
+hex(trim(1))
+31
+create table t1 as select trim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ucase(1));
+hex(ucase(1))
+31
+create table t1 as select ucase(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(upper(1));
+hex(upper(1))
+31
+create table t1 as select upper(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varbinary(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat(' ', 64) as a limit 0;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varbinary(64) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ("1.1"), ("2.1");
+select a, hex(a) from t1;
+a hex(a)
+1.1 312E31
+2.1 322E31
+update t1 set a= a + 0.1;
+select a, hex(a) from t1;
+a hex(a)
+1.2000000000000002 312E32303030303030303030303030303032
+2.2 322E32
+drop table t1;
+create table t1 (a tinyint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+303031 001
+303130 010
+313030 100
+drop table t1;
+create table t1 (a tinyint(4) zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303031 0001
+30303130 0010
+30313030 0100
+drop table t1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E3435
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303031 00001
+3030303130 00010
+3030313030 00100
+3031303030 01000
+3130303030 10000
+drop table t1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303030303031 00000001
+3030303030303130 00000010
+3030303030313030 00000100
+3030303031303030 00001000
+3030303130303030 00010000
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303030303030303031 0000000001
+30303030303030303130 0000000010
+30303030303030313030 0000000100
+30303030303031303030 0000001000
+30303030303130303030 0000010000
+drop table t1;
+create table t1 (a bigint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303030303030303030303030303030303031 00000000000000000001
+3030303030303030303030303030303030303130 00000000000000000010
+3030303030303030303030303030303030313030 00000000000000000100
+3030303030303030303030303030303031303030 00000000000000001000
+3030303030303030303030303030303130303030 00000000000000010000
+drop table t1;
+create table t1 (a float);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E343536
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+303030303030303030312E31 0000000001.1
+303030303030303031302E31 0000000010.1
+303030303030303130302E31 0000000100.1
+303030303030313030302E31 0000001000.1
+303030303031303030302E31 0000010000.1
+drop table t1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E343536
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(22) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303030303030303030303030303030303030312E31 00000000000000000001.1
+30303030303030303030303030303030303031302E31 00000000000000000010.1
+30303030303030303030303030303030303130302E31 00000000000000000100.1
+30303030303030303030303030303030313030302E31 00000000000000001000.1
+30303030303030303030303030303031303030302E31 00000000000000010000.1
+drop table t1;
+create table t1 (a year(2));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a year);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+32303031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bit(64));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0000000000000001
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+select hex(concat(a)) from t1;
+hex(concat(a))
+303030302D30302D30302030303A30303A3030
+323030312D30322D30332030343A30353A3036
+313938302D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+select concat(a) from t1;
+concat(a)
+0000-00-00 00:00:00
+2001-02-03 04:05:06
+1980-02-03 04:05:06
+2001-02-03 04:05:06
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+select hex(concat(a)) from t1;
+hex(concat(a))
+323030312D30322D3033
+323030312D30322D3033
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+select hex(concat(a)) from t1;
+hex(concat(a))
+30303A30303A3031
+30313A30323A3033
+select concat(a) from t1;
+concat(a)
+00:00:01
+01:02:03
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(8) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+select hex(concat(a)) from t1;
+hex(concat(a))
+323030312D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(4) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(3) YES NULL
+select hex(a) from v1;
+hex(a)
+303031
+303130
+313030
+drop table t1;
+drop view v1;
+create table t1 (a tinyint(30) zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(30) YES NULL
+select hex(a) from v1;
+hex(a)
+303030303030303030303030303030303030303030303030303030303031
+303030303030303030303030303030303030303030303030303030303130
+303030303030303030303030303030303030303030303030303030313030
+drop table t1;
+drop view v1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(12) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E3435
+drop table t1;
+drop view v1;
+create table t1 (a smallint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(6) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(5) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303031
+3030303130
+3030313030
+3031303030
+3130303030
+drop table t1;
+drop view v1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(9) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(8) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303030303031
+3030303030303130
+3030303030313030
+3030303031303030
+3030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(11) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(10) YES NULL
+select hex(a) from v1;
+hex(a)
+30303030303030303031
+30303030303030303130
+30303030303030313030
+30303030303031303030
+30303030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a bigint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(20) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(20) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303030303030303030303030303030303031
+3030303030303030303030303030303030303130
+3030303030303030303030303030303030313030
+3030303030303030303030303030303031303030
+3030303030303030303030303030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a float);
+insert into t1 values (123.456);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(12) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E343536
+drop table t1;
+drop view v1;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(12) YES NULL
+select hex(a) from v1;
+hex(a)
+303030303030303030312E31
+303030303030303031302E31
+303030303030303130302E31
+303030303030313030302E31
+303030303031303030302E31
+drop table t1;
+drop view v1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select concat(a) from t1;
+concat(a)
+123.456
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(22) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E343536
+drop table t1;
+drop view v1;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(22) YES NULL
+select hex(a) from v1;
+hex(a)
+30303030303030303030303030303030303030312E31
+30303030303030303030303030303030303031302E31
+30303030303030303030303030303030303130302E31
+30303030303030303030303030303030313030302E31
+30303030303030303030303030303031303030302E31
+drop table t1;
+drop view v1;
+create table t1 (a year(2));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(2) YES NULL
+select hex(a) from v1;
+hex(a)
+3031
+drop table t1;
+drop view v1;
+create table t1 (a year);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(4) YES NULL
+select hex(a) from v1;
+hex(a)
+32303031
+drop table t1;
+drop view v1;
+create table t1 (a bit(64));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(64) YES NULL
+select hex(a) from v1;
+hex(a)
+0000000000000001
+drop table t1;
+drop view v1;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(19) NO
+select hex(a) from v1;
+hex(a)
+303030302D30302D30302030303A30303A3030
+323030312D30322D30332030343A30353A3036
+313938302D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+drop table t1;
+drop view v1;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(10) YES NULL
+select hex(a) from v1;
+hex(a)
+323030312D30322D3033
+323030312D30322D3033
+drop table t1;
+drop view v1;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(8) YES NULL
+select hex(a) from v1;
+hex(a)
+30303A30303A3031
+30313A30323A3033
+drop table t1;
+drop view v1;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(19) YES NULL
+select hex(a) from v1;
+hex(a)
+323030312D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+drop table t1;
+drop view v1;
+create function f1 (par1 int) returns int
+begin
+return concat(par1);
+end|
+set @a= f1(1);
+select hex(@a);
+hex(@a)
+1
+select hex(concat(f1(1)));
+hex(concat(f1(1)))
+31
+create table t1 as select f1(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(1)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(11) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 decimal(18,2)) returns decimal(18,2)
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` decimal(18,2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(20) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 float) returns float
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` float DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(12) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 date) returns date
+begin
+return concat(par1);
+end|
+set @a= f1(cast('2001-01-02' as date));
+select hex(@a);
+hex(@a)
+323030312D30312D3032
+select hex(concat(f1(cast('2001-01-02' as date))));
+hex(concat(f1(cast('2001-01-02' as date))))
+323030312D30312D3032
+create table t1 as select f1(cast('2001-01-02' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(10) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+#
+# End of WL#2649 Number-to-string conversions
+#
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result
index bf0bc07c50e..cb932c38a27 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -81,3 +81,2570 @@ t1 CREATE TABLE `t1` (
`e2` enum('') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
DROP TABLE t1;
+#
+# Start of 5.5 tests
+#
+#
+# Start of WL#2649 Number-to-string conversions
+#
+select hex(concat(1));
+hex(concat(1))
+31
+create table t1 as select concat(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+31
+drop table t1;
+select hex(concat(18446744073709551615));
+hex(concat(18446744073709551615))
+3138343436373434303733373039353531363135
+create table t1 as select concat(18446744073709551615) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+3138343436373434303733373039353531363135
+drop table t1;
+select hex(concat(1.1));
+hex(concat(1.1))
+312E31
+create table t1 as select concat(1.1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+312E31
+drop table t1;
+select hex(concat('a', 1+2)), charset(concat(1+2));
+hex(concat('a', 1+2)) charset(concat(1+2))
+6133 cp1251
+create table t1 as select concat(1+2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1-2));
+hex(concat(1-2))
+2D31
+create table t1 as select concat(1-2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1*2));
+hex(concat(1*2))
+32
+create table t1 as select concat(1*2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1/2));
+hex(concat(1/2))
+302E35303030
+create table t1 as select concat(1/2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(7) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 div 2));
+hex(concat(1 div 2))
+30
+create table t1 as select concat(1 div 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 % 2));
+hex(concat(1 % 2))
+31
+create table t1 as select concat(1 % 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-1));
+hex(concat(-1))
+2D31
+create table t1 as select concat(-1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-(1+2)));
+hex(concat(-(1+2)))
+2D33
+create table t1 as select concat(-(1+2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1|2));
+hex(concat(1|2))
+33
+create table t1 as select concat(1|2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1&2));
+hex(concat(1&2))
+30
+create table t1 as select concat(1&2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_count(12)));
+hex(concat(bit_count(12)))
+32
+create table t1 as select concat(bit_count(12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2<<1));
+hex(concat(2<<1))
+34
+create table t1 as select concat(2<<1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2>>1));
+hex(concat(2>>1))
+31
+create table t1 as select concat(2>>1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(~0));
+hex(concat(~0))
+3138343436373434303733373039353531363135
+create table t1 as select concat(~0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(3^2));
+hex(concat(3^2))
+31
+create table t1 as select concat(3^2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(abs(-2)));
+hex(concat(abs(-2)))
+32
+create table t1 as select concat(abs(-2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(exp(2)),1));
+hex(left(concat(exp(2)),1))
+37
+create table t1 as select concat(exp(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log(2)),1));
+hex(left(concat(log(2)),1))
+30
+create table t1 as select concat(log(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log2(2)),1));
+hex(left(concat(log2(2)),1))
+31
+create table t1 as select concat(log2(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log10(2)),1));
+hex(left(concat(log10(2)),1))
+30
+create table t1 as select concat(log10(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sqrt(2)),1));
+hex(left(concat(sqrt(2)),1))
+31
+create table t1 as select concat(sqrt(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(pow(2,2)),1));
+hex(left(concat(pow(2,2)),1))
+34
+create table t1 as select concat(pow(2,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(acos(0.5)),1));
+hex(left(concat(acos(0.5)),1))
+31
+create table t1 as select concat(acos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(asin(0.5)),1));
+hex(left(concat(asin(0.5)),1))
+30
+create table t1 as select concat(asin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(atan(0.5)),1));
+hex(left(concat(atan(0.5)),1))
+30
+create table t1 as select concat(atan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(cos(0.5)),1));
+hex(left(concat(cos(0.5)),1))
+30
+create table t1 as select concat(cos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sin(0.5)),1));
+hex(left(concat(sin(0.5)),1))
+30
+create table t1 as select concat(sin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(tan(0.5)),1));
+hex(left(concat(tan(0.5)),1))
+30
+create table t1 as select concat(tan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(degrees(0)));
+hex(concat(degrees(0)))
+30
+create table t1 as select concat(degrees(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(radians(0)));
+hex(concat(radians(0)))
+30
+create table t1 as select concat(radians(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ceiling(0.5)));
+hex(concat(ceiling(0.5)))
+31
+create table t1 as select concat(ceiling(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(floor(0.5)));
+hex(concat(floor(0.5)))
+30
+create table t1 as select concat(floor(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(round(0.5)));
+hex(concat(round(0.5)))
+31
+create table t1 as select concat(round(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sign(0.5)));
+hex(concat(sign(0.5)))
+31
+create table t1 as select concat(sign(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(rand()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(length('a')));
+hex(concat(length('a')))
+31
+create table t1 as select concat(length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(char_length('a')));
+hex(concat(char_length('a')))
+31
+create table t1 as select concat(char_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_length('a')));
+hex(concat(bit_length('a')))
+38
+create table t1 as select concat(bit_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coercibility('a')));
+hex(concat(coercibility('a')))
+34
+create table t1 as select concat(coercibility('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(locate('a','a')));
+hex(concat(locate('a','a')))
+31
+create table t1 as select concat(locate('a','a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(11) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(field('c','a','b','c')));
+hex(concat(field('c','a','b','c')))
+33
+create table t1 as select concat(field('c','a','b','c')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ascii(61)));
+hex(concat(ascii(61)))
+3534
+create table t1 as select concat(ascii(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ord(61)));
+hex(concat(ord(61)))
+3534
+create table t1 as select concat(ord(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(find_in_set('b','a,b,c,d')));
+hex(concat(find_in_set('b','a,b,c,d')))
+32
+create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select md5('a'), hex(md5('a'));
+md5('a') hex(md5('a'))
+0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631
+create table t1 as select md5('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(32) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select old_password('a'), hex(old_password('a'));
+old_password('a') hex(old_password('a'))
+60671c896665c3fa 36303637316338393636363563336661
+create table t1 as select old_password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(16) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select password('a'), hex(password('a'));
+password('a') hex(password('a'))
+*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445
+create table t1 as select password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(41) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha('a'), hex(sha('a'));
+sha('a') hex(sha('a'))
+86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
+create table t1 as select sha('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(40) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha1('a'), hex(sha1('a'));
+sha1('a') hex(sha1('a'))
+86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
+create table t1 as select sha1('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(40) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('-1' as signed)));
+hex(concat(cast('-1' as signed)))
+2D31
+create table t1 as select concat(cast('-1' as signed)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('1' as unsigned)));
+hex(concat(cast('1' as unsigned)))
+31
+create table t1 as select concat(cast('1' as unsigned)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast(1/2 as decimal(5,5))));
+hex(concat(cast(1/2 as decimal(5,5))))
+302E3530303030
+create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(7) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as date)));
+hex(concat(cast('2001-01-02 03:04:05' as date)))
+323030312D30312D3032
+create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as time)));
+hex(concat(cast('2001-01-02 03:04:05' as time)))
+30333A30343A3035
+create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+03:04:05
+drop table t1;
+select hex(concat(cast('2001-01-02' as datetime)));
+hex(concat(cast('2001-01-02' as datetime)))
+323030312D30312D30322030303A30303A3030
+create table t1 as select concat(cast('2001-01-02' as datetime)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02 00:00:00
+drop table t1;
+select hex(concat(least(1,2)));
+hex(concat(least(1,2)))
+31
+create table t1 as select concat(least(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(greatest(1,2)));
+hex(concat(greatest(1,2)))
+32
+create table t1 as select concat(greatest(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(case when 11 then 22 else 33 end));
+hex(concat(case when 11 then 22 else 33 end))
+3232
+create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coalesce(1,2)));
+hex(concat(coalesce(1,2)))
+31
+create table t1 as select concat(coalesce(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat_ws(1,2,3));
+hex(concat_ws(1,2,3))
+323133
+create table t1 as select concat_ws(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(group_concat(1,2,3));
+hex(group_concat(1,2,3))
+313233
+create table t1 as select group_concat(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` text CHARACTER SET cp1251
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select 1 as c1 union select 'a';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1 order by c1;
+hex(c1)
+31
+61
+drop table t1;
+create table t1 as select concat(last_insert_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(benchmark(0,0)));
+hex(concat(benchmark(0,0)))
+30
+create table t1 as select concat(benchmark(0,0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sleep(0)));
+hex(concat(sleep(0)))
+30
+create table t1 as select concat(sleep(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(is_free_lock('xxxx')));
+hex(concat(is_free_lock('xxxx')))
+31
+create table t1 as select concat(is_free_lock('xxxx')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(is_used_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(release_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(crc32('')));
+hex(concat(crc32('')))
+30
+create table t1 as select concat(crc32('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(uncompressed_length('')));
+hex(concat(uncompressed_length('')))
+30
+create table t1 as select concat(uncompressed_length('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(connection_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_aton('127.1.1.1')));
+hex(concat(inet_aton('127.1.1.1')))
+32313330373732323235
+create table t1 as select concat(inet_aton('127.1.1.1')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_ntoa(2130772225)));
+hex(concat(inet_ntoa(2130772225)))
+3132372E312E312E31
+create table t1 as select concat(inet_ntoa(2130772225)) as c1;
+select * from t1;
+c1
+127.1.1.1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(31) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(row_count()));
+hex(concat(row_count()))
+2D31
+create table t1 as select concat(row_count()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(found_rows()));
+hex(concat(found_rows()))
+30
+create table t1 as select concat(found_rows()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid_short()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
+coercibility(uuid()) coercibility(cast('a' as char character set latin1))
+4 2
+select charset(concat(uuid(), cast('a' as char character set latin1)));
+charset(concat(uuid(), cast('a' as char character set latin1)))
+latin1
+create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(37) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1));
+hex(concat(@a1:=1))
+31
+create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2;
+select hex(c1) from t1;
+hex(c1)
+32
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '',
+ `c2` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1;
+select hex(concat(@a2));
+hex(concat(@a2))
+31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) CHARACTER SET cp1251 DEFAULT NULL,
+ `c2` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=sqrt(1)));
+hex(concat(@a1:=sqrt(1)))
+31
+create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=sqrt(1);
+select hex(concat(@a2));
+hex(concat(@a2))
+31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1.1));
+hex(concat(@a1:=1.1))
+312E31
+create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2;
+select hex(c1) from t1;
+hex(c1)
+312E31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '',
+ `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1.1;
+select hex(concat(@a2));
+hex(concat(@a2))
+312E31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+312E31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(83) CHARACTER SET cp1251 DEFAULT NULL,
+ `c2` decimal(65,30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@@ft_max_word_len));
+hex(concat(@@ft_max_word_len))
+3834
+create table t1 as select concat(@@ft_max_word_len) as c1;
+select hex(c1) from t1;
+hex(c1)
+3834
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS TRUE));
+hex(concat('a'='a' IS TRUE))
+31
+create table t1 as select concat('a'='a' IS TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS NOT TRUE));
+hex(concat('a'='a' IS NOT TRUE))
+30
+create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NOT 'a'='a'));
+hex(concat(NOT 'a'='a'))
+30
+create table t1 as select concat(NOT 'a'='a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NULL));
+hex(concat('a' IS NULL))
+30
+create table t1 as select concat('a' IS NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NOT NULL));
+hex(concat('a' IS NOT NULL))
+31
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' rlike 'a'));
+hex(concat('a' rlike 'a'))
+31
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(strcmp('a','b')));
+hex(concat(strcmp('a','b')))
+2D31
+create table t1 as select concat(strcmp('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' like 'a'));
+hex(concat('a' like 'a'))
+31
+create table t1 as select concat('a' like 'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' between 'b' and 'c'));
+hex(concat('a' between 'b' and 'c'))
+30
+create table t1 as select concat('a' between 'b' and 'c') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' in ('a','b')));
+hex(concat('a' in ('a','b')))
+31
+create table t1 as select concat('a' in ('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
+hex(concat(interval(23, 1, 15, 17, 30, 44, 200)))
+33
+create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(10), fulltext key(a));
+insert into t1 values ('a');
+select hex(concat(match (a) against ('a'))) from t1;
+hex(concat(match (a) against ('a')))
+30
+create table t2 as select concat(match (a) against ('a')) as a from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+select hex(ifnull(1,'a'));
+hex(ifnull(1,'a'))
+31
+create table t1 as select ifnull(1,'a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1,1)));
+hex(concat(ifnull(1,1)))
+31
+create table t1 as select concat(ifnull(1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1.1,1.1)));
+hex(concat(ifnull(1.1,1.1)))
+312E31
+create table t1 as select concat(ifnull(1.1,1.1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,'b',1));
+hex(if(1,'b',1))
+62
+create table t1 as select if(1,'b',1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,1,'b'));
+hex(if(1,1,'b'))
+31
+create table t1 as select if(1,1,'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(if(1,1,1)));
+hex(concat(if(1,1,1)))
+31
+create table t1 as select concat(if(1,1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(nullif(1,2)));
+hex(concat(nullif(1,2)))
+31
+create table t1 as select concat(nullif(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))))
+31
+create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+32
+create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))))
+32
+create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+30
+create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))));
+hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))))
+31
+create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))));
+hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))))
+30
+create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsSimple(GeomFromText('POINT(1 1)'))));
+hex(concat(IsSimple(GeomFromText('POINT(1 1)'))))
+30
+create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
+hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))))
+30
+create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
+hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))))
+31
+create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1;
+drop table t1;
+select hex(concat(x(GeomFromText('Point(1 2)'))));
+hex(concat(x(GeomFromText('Point(1 2)'))))
+31
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(y(GeomFromText('Point(1 2)'))));
+hex(concat(y(GeomFromText('Point(1 2)'))))
+32
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))));
+hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))))
+31
+create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))));
+hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))))
+31
+create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GeometryType(GeomFromText('Point(1 2)'))));
+hex(concat(GeometryType(GeomFromText('Point(1 2)'))))
+504F494E54
+create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(AsText(GeomFromText('Point(1 2)'))));
+hex(concat(AsText(GeomFromText('Point(1 2)'))))
+504F494E542831203229
+create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` longtext CHARACTER SET cp1251
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_add(200902, 2)));
+hex(concat(period_add(200902, 2)))
+323030393034
+create table t1 as select concat(period_add(200902, 2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_diff(200902, 200802)));
+hex(concat(period_diff(200902, 200802)))
+3132
+create table t1 as select concat(period_add(200902, 200802)) as c1;
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(to_days(20090224)));
+hex(concat(to_days(20090224)))
+373333383237
+create table t1 as select concat(to_days(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofmonth(20090224)));
+hex(concat(dayofmonth(20090224)))
+3234
+create table t1 as select concat(dayofmonth(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofyear(20090224)));
+hex(concat(dayofyear(20090224)))
+3535
+create table t1 as select concat(dayofyear(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(hour('10:11:12')));
+hex(concat(hour('10:11:12')))
+3130
+create table t1 as select concat(hour('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(minute('10:11:12')));
+hex(concat(minute('10:11:12')))
+3131
+create table t1 as select concat(minute('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(second('10:11:12')));
+hex(concat(second('10:11:12')))
+3132
+create table t1 as select concat(second('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(quarter(20090224)));
+hex(concat(quarter(20090224)))
+31
+create table t1 as select concat(quarter(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(week(20090224)));
+hex(concat(week(20090224)))
+38
+create table t1 as select concat(week(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(yearweek(20090224)));
+hex(concat(yearweek(20090224)))
+323030393038
+create table t1 as select concat(yearweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(year(20090224)));
+hex(concat(year(20090224)))
+32303039
+create table t1 as select concat(year(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(weekday(20090224)));
+hex(concat(weekday(20090224)))
+31
+create table t1 as select concat(weekday(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofweek(20090224)));
+hex(concat(dayofweek(20090224)))
+33
+create table t1 as select concat(dayofweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(unix_timestamp(20090224)));
+hex(concat(unix_timestamp(20090224)))
+31323335343232383030
+create table t1 as select concat(unix_timestamp(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(time_to_sec('10:11:12')));
+hex(concat(time_to_sec('10:11:12')))
+3336363732
+create table t1 as select concat(time_to_sec('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(extract(year from 20090702)));
+hex(concat(extract(year from 20090702)))
+32303039
+create table t1 as select concat(extract(year from 20090702)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(microsecond('12:00:00.123456')));
+hex(concat(microsecond('12:00:00.123456')))
+313233343536
+create table t1 as select concat(microsecond('12:00:00.123456')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(month(20090224)));
+hex(concat(month(20090224)))
+32
+create table t1 as select concat(month(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(last_day('2003-02-05')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2003-02-28 323030332D30322D3238
+drop table t1;
+create table t1 as select concat(from_days(730669)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2000-07-03 323030302D30372D3033
+drop table t1;
+create table t1 as select concat(curdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_date()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(curtime()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(8) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat('a',20) as c1 limit 0;
+set timestamp=1216359724;
+insert into t1 values (current_date);
+insert into t1 values (current_time);
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2008-07-18 323030382D30372D3138
+08:42:04 30383A34323A3034
+drop table t1;
+create table t1 as select concat(utc_time()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(8) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sec_to_time(2378)));
+hex(concat(sec_to_time(2378)))
+30303A33393A3338
+create table t1 as select concat(sec_to_time(2378)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')));
+hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')))
+32343A30303A3030
+create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(maketime(10,11,12)));
+hex(concat(maketime(10,11,12)))
+31303A31313A3132
+create table t1 as select concat(maketime(10,11,12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(get_format(DATE,'USA'));
+hex(get_format(DATE,'USA'))
+256D2E25642E2559
+create table t1 as select get_format(DATE,'USA') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(17) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(from_unixtime(1111885200)),4));
+hex(left(concat(from_unixtime(1111885200)),4))
+32303035
+create table t1 as select concat(from_unixtime(1111885200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')));
+hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')))
+323030332D31322D33312032303A30303A3030
+create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)));
+hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)))
+323030342D30312D30322031323A30303A3030
+create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2004-01-02 12:00:00
+drop table t1;
+select hex(concat(makedate(2009,1)));
+hex(concat(makedate(2009,1)))
+323030392D30312D3031
+create table t1 as select concat(makedate(2009,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2009-01-01
+drop table t1;
+create table t1 as select concat(now()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_timestamp()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(sysdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(addtime('00:00:00','11:22:33')));
+hex(concat(addtime('00:00:00','11:22:33')))
+31313A32323A3333
+create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(subtime('23:59:59','11:22:33')));
+hex(concat(subtime('23:59:59','11:22:33')))
+31323A33373A3236
+create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(elt(1,2,3));
+hex(elt(1,2,3))
+32
+create table t1 as select elt(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(export_set(1,2,3,4,2));
+hex(export_set(1,2,3,4,2))
+323433
+create table t1 as select export_set(1,2,3,4,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(127) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(insert(1133,3,0,22));
+hex(insert(1133,3,0,22))
+313132323333
+create table t1 as select insert(1133,3,0,22) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lcase(123));
+hex(lcase(123))
+313233
+create table t1 as select lcase(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(123,1));
+hex(left(123,1))
+31
+create table t1 as select left(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lower(123));
+hex(lower(123))
+313233
+create table t1 as select lower(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lpad(1,2,0));
+hex(lpad(1,2,0))
+3031
+create table t1 as select lpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ltrim(1));
+hex(ltrim(1))
+31
+create table t1 as select ltrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(mid(1,1,1));
+hex(mid(1,1,1))
+31
+create table t1 as select mid(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(repeat(1,2));
+hex(repeat(1,2))
+3131
+create table t1 as select repeat(1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(replace(1,1,2));
+hex(replace(1,1,2))
+32
+create table t1 as select replace(1,1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(reverse(12));
+hex(reverse(12))
+3231
+create table t1 as select reverse(12) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(right(123,1));
+hex(right(123,1))
+33
+create table t1 as select right(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rpad(1,2,0));
+hex(rpad(1,2,0))
+3130
+create table t1 as select rpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rtrim(1));
+hex(rtrim(1))
+31
+create table t1 as select rtrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(soundex(1));
+hex(soundex(1))
+
+create table t1 as select soundex(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(substring(1,1,1));
+hex(substring(1,1,1))
+31
+create table t1 as select substring(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(trim(1));
+hex(trim(1))
+31
+create table t1 as select trim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ucase(1));
+hex(ucase(1))
+31
+create table t1 as select ucase(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(upper(1));
+hex(upper(1))
+31
+create table t1 as select upper(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat(' ', 64) as a limit 0;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(64) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ("1.1"), ("2.1");
+select a, hex(a) from t1;
+a hex(a)
+1.1 312E31
+2.1 322E31
+update t1 set a= a + 0.1;
+select a, hex(a) from t1;
+a hex(a)
+1.2000000000000002 312E32303030303030303030303030303032
+2.2 322E32
+drop table t1;
+create table t1 (a tinyint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+303031 001
+303130 010
+313030 100
+drop table t1;
+create table t1 (a tinyint(4) zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303031 0001
+30303130 0010
+30313030 0100
+drop table t1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E3435
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(12) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(6) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303031 00001
+3030303130 00010
+3030313030 00100
+3031303030 01000
+3130303030 10000
+drop table t1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(9) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303030303031 00000001
+3030303030303130 00000010
+3030303030313030 00000100
+3030303031303030 00001000
+3030303130303030 00010000
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(11) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303030303030303031 0000000001
+30303030303030303130 0000000010
+30303030303030313030 0000000100
+30303030303031303030 0000001000
+30303030303130303030 0000010000
+drop table t1;
+create table t1 (a bigint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(20) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303030303030303030303030303030303031 00000000000000000001
+3030303030303030303030303030303030303130 00000000000000000010
+3030303030303030303030303030303030313030 00000000000000000100
+3030303030303030303030303030303031303030 00000000000000001000
+3030303030303030303030303030303130303030 00000000000000010000
+drop table t1;
+create table t1 (a float);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E343536
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(12) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+303030303030303030312E31 0000000001.1
+303030303030303031302E31 0000000010.1
+303030303030303130302E31 0000000100.1
+303030303030313030302E31 0000001000.1
+303030303031303030302E31 0000010000.1
+drop table t1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E343536
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(22) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303030303030303030303030303030303030312E31 00000000000000000001.1
+30303030303030303030303030303030303031302E31 00000000000000000010.1
+30303030303030303030303030303030303130302E31 00000000000000000100.1
+30303030303030303030303030303030313030302E31 00000000000000001000.1
+30303030303030303030303030303031303030302E31 00000000000000010000.1
+drop table t1;
+create table t1 (a year(2));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a year);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+32303031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bit(64));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0000000000000001
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+select hex(concat(a)) from t1;
+hex(concat(a))
+303030302D30302D30302030303A30303A3030
+323030312D30322D30332030343A30353A3036
+313938302D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+select concat(a) from t1;
+concat(a)
+0000-00-00 00:00:00
+2001-02-03 04:05:06
+1980-02-03 04:05:06
+2001-02-03 04:05:06
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+select hex(concat(a)) from t1;
+hex(concat(a))
+323030312D30322D3033
+323030312D30322D3033
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+select hex(concat(a)) from t1;
+hex(concat(a))
+30303A30303A3031
+30313A30323A3033
+select concat(a) from t1;
+concat(a)
+00:00:01
+01:02:03
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(8) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+select hex(concat(a)) from t1;
+hex(concat(a))
+323030312D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(19) CHARACTER SET cp1251 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(4) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(3) YES NULL
+select hex(a) from v1;
+hex(a)
+303031
+303130
+313030
+drop table t1;
+drop view v1;
+create table t1 (a tinyint(30) zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(30) YES NULL
+select hex(a) from v1;
+hex(a)
+303030303030303030303030303030303030303030303030303030303031
+303030303030303030303030303030303030303030303030303030303130
+303030303030303030303030303030303030303030303030303030313030
+drop table t1;
+drop view v1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E3435
+drop table t1;
+drop view v1;
+create table t1 (a smallint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(6) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(5) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303031
+3030303130
+3030313030
+3031303030
+3130303030
+drop table t1;
+drop view v1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(9) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(8) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303030303031
+3030303030303130
+3030303030313030
+3030303031303030
+3030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(11) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(10) YES NULL
+select hex(a) from v1;
+hex(a)
+30303030303030303031
+30303030303030303130
+30303030303030313030
+30303030303031303030
+30303030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a bigint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(20) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(20) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303030303030303030303030303030303031
+3030303030303030303030303030303030303130
+3030303030303030303030303030303030313030
+3030303030303030303030303030303031303030
+3030303030303030303030303030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a float);
+insert into t1 values (123.456);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E343536
+drop table t1;
+drop view v1;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+303030303030303030312E31
+303030303030303031302E31
+303030303030303130302E31
+303030303030313030302E31
+303030303031303030302E31
+drop table t1;
+drop view v1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select concat(a) from t1;
+concat(a)
+123.456
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(22) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E343536
+drop table t1;
+drop view v1;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(22) YES NULL
+select hex(a) from v1;
+hex(a)
+30303030303030303030303030303030303030312E31
+30303030303030303030303030303030303031302E31
+30303030303030303030303030303030303130302E31
+30303030303030303030303030303030313030302E31
+30303030303030303030303030303031303030302E31
+drop table t1;
+drop view v1;
+create table t1 (a year(2));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(2) YES NULL
+select hex(a) from v1;
+hex(a)
+3031
+drop table t1;
+drop view v1;
+create table t1 (a year);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(4) YES NULL
+select hex(a) from v1;
+hex(a)
+32303031
+drop table t1;
+drop view v1;
+create table t1 (a bit(64));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(64) YES NULL
+select hex(a) from v1;
+hex(a)
+0000000000000001
+drop table t1;
+drop view v1;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(19) NO
+select hex(a) from v1;
+hex(a)
+303030302D30302D30302030303A30303A3030
+323030312D30322D30332030343A30353A3036
+313938302D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+drop table t1;
+drop view v1;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(10) YES NULL
+select hex(a) from v1;
+hex(a)
+323030312D30322D3033
+323030312D30322D3033
+drop table t1;
+drop view v1;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(8) YES NULL
+select hex(a) from v1;
+hex(a)
+30303A30303A3031
+30313A30323A3033
+drop table t1;
+drop view v1;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(19) YES NULL
+select hex(a) from v1;
+hex(a)
+323030312D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+drop table t1;
+drop view v1;
+create function f1 (par1 int) returns int
+begin
+return concat(par1);
+end|
+set @a= f1(1);
+select hex(@a);
+hex(@a)
+1
+select hex(concat(f1(1)));
+hex(concat(f1(1)))
+31
+create table t1 as select f1(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(1)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(11) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 decimal(18,2)) returns decimal(18,2)
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` decimal(18,2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(20) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 float) returns float
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` float DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(12) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 date) returns date
+begin
+return concat(par1);
+end|
+set @a= f1(cast('2001-01-02' as date));
+select hex(@a);
+hex(@a)
+323030312D30312D3032
+select hex(concat(f1(cast('2001-01-02' as date))));
+hex(concat(f1(cast('2001-01-02' as date))))
+323030312D30312D3032
+create table t1 as select f1(cast('2001-01-02' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(10) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+#
+# End of WL#2649 Number-to-string conversions
+#
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index 763acd0fea0..4944db677a6 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -409,3 +409,2570 @@ select hex(cast(_ascii 0x7f as char(1) character set latin1));
hex(cast(_ascii 0x7f as char(1) character set latin1))
7F
End of 5.0 tests
+#
+# Start of 5.5 tests
+#
+#
+# Start of WL#2649 Number-to-string conversions
+#
+select hex(concat(1));
+hex(concat(1))
+31
+create table t1 as select concat(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+31
+drop table t1;
+select hex(concat(18446744073709551615));
+hex(concat(18446744073709551615))
+3138343436373434303733373039353531363135
+create table t1 as select concat(18446744073709551615) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+3138343436373434303733373039353531363135
+drop table t1;
+select hex(concat(1.1));
+hex(concat(1.1))
+312E31
+create table t1 as select concat(1.1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+312E31
+drop table t1;
+select hex(concat('a', 1+2)), charset(concat(1+2));
+hex(concat('a', 1+2)) charset(concat(1+2))
+6133 latin1
+create table t1 as select concat(1+2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1-2));
+hex(concat(1-2))
+2D31
+create table t1 as select concat(1-2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1*2));
+hex(concat(1*2))
+32
+create table t1 as select concat(1*2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1/2));
+hex(concat(1/2))
+302E35303030
+create table t1 as select concat(1/2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(7) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 div 2));
+hex(concat(1 div 2))
+30
+create table t1 as select concat(1 div 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 % 2));
+hex(concat(1 % 2))
+31
+create table t1 as select concat(1 % 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-1));
+hex(concat(-1))
+2D31
+create table t1 as select concat(-1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-(1+2)));
+hex(concat(-(1+2)))
+2D33
+create table t1 as select concat(-(1+2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1|2));
+hex(concat(1|2))
+33
+create table t1 as select concat(1|2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1&2));
+hex(concat(1&2))
+30
+create table t1 as select concat(1&2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_count(12)));
+hex(concat(bit_count(12)))
+32
+create table t1 as select concat(bit_count(12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2<<1));
+hex(concat(2<<1))
+34
+create table t1 as select concat(2<<1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2>>1));
+hex(concat(2>>1))
+31
+create table t1 as select concat(2>>1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(~0));
+hex(concat(~0))
+3138343436373434303733373039353531363135
+create table t1 as select concat(~0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(3^2));
+hex(concat(3^2))
+31
+create table t1 as select concat(3^2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(abs(-2)));
+hex(concat(abs(-2)))
+32
+create table t1 as select concat(abs(-2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(exp(2)),1));
+hex(left(concat(exp(2)),1))
+37
+create table t1 as select concat(exp(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log(2)),1));
+hex(left(concat(log(2)),1))
+30
+create table t1 as select concat(log(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log2(2)),1));
+hex(left(concat(log2(2)),1))
+31
+create table t1 as select concat(log2(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log10(2)),1));
+hex(left(concat(log10(2)),1))
+30
+create table t1 as select concat(log10(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sqrt(2)),1));
+hex(left(concat(sqrt(2)),1))
+31
+create table t1 as select concat(sqrt(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(pow(2,2)),1));
+hex(left(concat(pow(2,2)),1))
+34
+create table t1 as select concat(pow(2,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(acos(0.5)),1));
+hex(left(concat(acos(0.5)),1))
+31
+create table t1 as select concat(acos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(asin(0.5)),1));
+hex(left(concat(asin(0.5)),1))
+30
+create table t1 as select concat(asin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(atan(0.5)),1));
+hex(left(concat(atan(0.5)),1))
+30
+create table t1 as select concat(atan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(cos(0.5)),1));
+hex(left(concat(cos(0.5)),1))
+30
+create table t1 as select concat(cos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sin(0.5)),1));
+hex(left(concat(sin(0.5)),1))
+30
+create table t1 as select concat(sin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(tan(0.5)),1));
+hex(left(concat(tan(0.5)),1))
+30
+create table t1 as select concat(tan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(degrees(0)));
+hex(concat(degrees(0)))
+30
+create table t1 as select concat(degrees(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(radians(0)));
+hex(concat(radians(0)))
+30
+create table t1 as select concat(radians(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ceiling(0.5)));
+hex(concat(ceiling(0.5)))
+31
+create table t1 as select concat(ceiling(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(floor(0.5)));
+hex(concat(floor(0.5)))
+30
+create table t1 as select concat(floor(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(round(0.5)));
+hex(concat(round(0.5)))
+31
+create table t1 as select concat(round(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sign(0.5)));
+hex(concat(sign(0.5)))
+31
+create table t1 as select concat(sign(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(rand()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(length('a')));
+hex(concat(length('a')))
+31
+create table t1 as select concat(length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(char_length('a')));
+hex(concat(char_length('a')))
+31
+create table t1 as select concat(char_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_length('a')));
+hex(concat(bit_length('a')))
+38
+create table t1 as select concat(bit_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coercibility('a')));
+hex(concat(coercibility('a')))
+34
+create table t1 as select concat(coercibility('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(locate('a','a')));
+hex(concat(locate('a','a')))
+31
+create table t1 as select concat(locate('a','a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(11) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(field('c','a','b','c')));
+hex(concat(field('c','a','b','c')))
+33
+create table t1 as select concat(field('c','a','b','c')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ascii(61)));
+hex(concat(ascii(61)))
+3534
+create table t1 as select concat(ascii(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ord(61)));
+hex(concat(ord(61)))
+3534
+create table t1 as select concat(ord(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(find_in_set('b','a,b,c,d')));
+hex(concat(find_in_set('b','a,b,c,d')))
+32
+create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select md5('a'), hex(md5('a'));
+md5('a') hex(md5('a'))
+0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631
+create table t1 as select md5('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(32) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select old_password('a'), hex(old_password('a'));
+old_password('a') hex(old_password('a'))
+60671c896665c3fa 36303637316338393636363563336661
+create table t1 as select old_password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(16) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select password('a'), hex(password('a'));
+password('a') hex(password('a'))
+*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445
+create table t1 as select password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(41) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha('a'), hex(sha('a'));
+sha('a') hex(sha('a'))
+86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
+create table t1 as select sha('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(40) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha1('a'), hex(sha1('a'));
+sha1('a') hex(sha1('a'))
+86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
+create table t1 as select sha1('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(40) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('-1' as signed)));
+hex(concat(cast('-1' as signed)))
+2D31
+create table t1 as select concat(cast('-1' as signed)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('1' as unsigned)));
+hex(concat(cast('1' as unsigned)))
+31
+create table t1 as select concat(cast('1' as unsigned)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast(1/2 as decimal(5,5))));
+hex(concat(cast(1/2 as decimal(5,5))))
+302E3530303030
+create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(7) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as date)));
+hex(concat(cast('2001-01-02 03:04:05' as date)))
+323030312D30312D3032
+create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as time)));
+hex(concat(cast('2001-01-02 03:04:05' as time)))
+30333A30343A3035
+create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+03:04:05
+drop table t1;
+select hex(concat(cast('2001-01-02' as datetime)));
+hex(concat(cast('2001-01-02' as datetime)))
+323030312D30312D30322030303A30303A3030
+create table t1 as select concat(cast('2001-01-02' as datetime)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02 00:00:00
+drop table t1;
+select hex(concat(least(1,2)));
+hex(concat(least(1,2)))
+31
+create table t1 as select concat(least(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(greatest(1,2)));
+hex(concat(greatest(1,2)))
+32
+create table t1 as select concat(greatest(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(case when 11 then 22 else 33 end));
+hex(concat(case when 11 then 22 else 33 end))
+3232
+create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coalesce(1,2)));
+hex(concat(coalesce(1,2)))
+31
+create table t1 as select concat(coalesce(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat_ws(1,2,3));
+hex(concat_ws(1,2,3))
+323133
+create table t1 as select concat_ws(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(group_concat(1,2,3));
+hex(group_concat(1,2,3))
+313233
+create table t1 as select group_concat(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` text
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select 1 as c1 union select 'a';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1 order by c1;
+hex(c1)
+31
+61
+drop table t1;
+create table t1 as select concat(last_insert_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(benchmark(0,0)));
+hex(concat(benchmark(0,0)))
+30
+create table t1 as select concat(benchmark(0,0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sleep(0)));
+hex(concat(sleep(0)))
+30
+create table t1 as select concat(sleep(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(is_free_lock('xxxx')));
+hex(concat(is_free_lock('xxxx')))
+31
+create table t1 as select concat(is_free_lock('xxxx')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(is_used_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(release_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(crc32('')));
+hex(concat(crc32('')))
+30
+create table t1 as select concat(crc32('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(uncompressed_length('')));
+hex(concat(uncompressed_length('')))
+30
+create table t1 as select concat(uncompressed_length('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(connection_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_aton('127.1.1.1')));
+hex(concat(inet_aton('127.1.1.1')))
+32313330373732323235
+create table t1 as select concat(inet_aton('127.1.1.1')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_ntoa(2130772225)));
+hex(concat(inet_ntoa(2130772225)))
+3132372E312E312E31
+create table t1 as select concat(inet_ntoa(2130772225)) as c1;
+select * from t1;
+c1
+127.1.1.1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(31) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(row_count()));
+hex(concat(row_count()))
+2D31
+create table t1 as select concat(row_count()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(found_rows()));
+hex(concat(found_rows()))
+30
+create table t1 as select concat(found_rows()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid_short()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
+coercibility(uuid()) coercibility(cast('a' as char character set latin1))
+4 2
+select charset(concat(uuid(), cast('a' as char character set latin1)));
+charset(concat(uuid(), cast('a' as char character set latin1)))
+latin1
+create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(37) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1));
+hex(concat(@a1:=1))
+31
+create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2;
+select hex(c1) from t1;
+hex(c1)
+32
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT '',
+ `c2` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1;
+select hex(concat(@a2));
+hex(concat(@a2))
+31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) DEFAULT NULL,
+ `c2` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=sqrt(1)));
+hex(concat(@a1:=sqrt(1)))
+31
+create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=sqrt(1);
+select hex(concat(@a2));
+hex(concat(@a2))
+31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1.1));
+hex(concat(@a1:=1.1))
+312E31
+create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2;
+select hex(c1) from t1;
+hex(c1)
+312E31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) NOT NULL DEFAULT '',
+ `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1.1;
+select hex(concat(@a2));
+hex(concat(@a2))
+312E31
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+312E31
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(83) DEFAULT NULL,
+ `c2` decimal(65,30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@@ft_max_word_len));
+hex(concat(@@ft_max_word_len))
+3834
+create table t1 as select concat(@@ft_max_word_len) as c1;
+select hex(c1) from t1;
+hex(c1)
+3834
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS TRUE));
+hex(concat('a'='a' IS TRUE))
+31
+create table t1 as select concat('a'='a' IS TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS NOT TRUE));
+hex(concat('a'='a' IS NOT TRUE))
+30
+create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NOT 'a'='a'));
+hex(concat(NOT 'a'='a'))
+30
+create table t1 as select concat(NOT 'a'='a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NULL));
+hex(concat('a' IS NULL))
+30
+create table t1 as select concat('a' IS NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NOT NULL));
+hex(concat('a' IS NOT NULL))
+31
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' rlike 'a'));
+hex(concat('a' rlike 'a'))
+31
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(strcmp('a','b')));
+hex(concat(strcmp('a','b')))
+2D31
+create table t1 as select concat(strcmp('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' like 'a'));
+hex(concat('a' like 'a'))
+31
+create table t1 as select concat('a' like 'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' between 'b' and 'c'));
+hex(concat('a' between 'b' and 'c'))
+30
+create table t1 as select concat('a' between 'b' and 'c') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' in ('a','b')));
+hex(concat('a' in ('a','b')))
+31
+create table t1 as select concat('a' in ('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
+hex(concat(interval(23, 1, 15, 17, 30, 44, 200)))
+33
+create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(10), fulltext key(a));
+insert into t1 values ('a');
+select hex(concat(match (a) against ('a'))) from t1;
+hex(concat(match (a) against ('a')))
+30
+create table t2 as select concat(match (a) against ('a')) as a from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+select hex(ifnull(1,'a'));
+hex(ifnull(1,'a'))
+31
+create table t1 as select ifnull(1,'a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1,1)));
+hex(concat(ifnull(1,1)))
+31
+create table t1 as select concat(ifnull(1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1.1,1.1)));
+hex(concat(ifnull(1.1,1.1)))
+312E31
+create table t1 as select concat(ifnull(1.1,1.1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,'b',1));
+hex(if(1,'b',1))
+62
+create table t1 as select if(1,'b',1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,1,'b'));
+hex(if(1,1,'b'))
+31
+create table t1 as select if(1,1,'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(if(1,1,1)));
+hex(concat(if(1,1,1)))
+31
+create table t1 as select concat(if(1,1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(nullif(1,2)));
+hex(concat(nullif(1,2)))
+31
+create table t1 as select concat(nullif(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))))
+31
+create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+32
+create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))))
+32
+create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+30
+create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))));
+hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))))
+31
+create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))));
+hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))))
+30
+create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsSimple(GeomFromText('POINT(1 1)'))));
+hex(concat(IsSimple(GeomFromText('POINT(1 1)'))))
+30
+create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
+hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))))
+30
+create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
+hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))))
+31
+create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1;
+drop table t1;
+select hex(concat(x(GeomFromText('Point(1 2)'))));
+hex(concat(x(GeomFromText('Point(1 2)'))))
+31
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(y(GeomFromText('Point(1 2)'))));
+hex(concat(y(GeomFromText('Point(1 2)'))))
+32
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))));
+hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))))
+31
+create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))));
+hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))))
+31
+create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GeometryType(GeomFromText('Point(1 2)'))));
+hex(concat(GeometryType(GeomFromText('Point(1 2)'))))
+504F494E54
+create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(AsText(GeomFromText('Point(1 2)'))));
+hex(concat(AsText(GeomFromText('Point(1 2)'))))
+504F494E542831203229
+create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_add(200902, 2)));
+hex(concat(period_add(200902, 2)))
+323030393034
+create table t1 as select concat(period_add(200902, 2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_diff(200902, 200802)));
+hex(concat(period_diff(200902, 200802)))
+3132
+create table t1 as select concat(period_add(200902, 200802)) as c1;
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(to_days(20090224)));
+hex(concat(to_days(20090224)))
+373333383237
+create table t1 as select concat(to_days(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofmonth(20090224)));
+hex(concat(dayofmonth(20090224)))
+3234
+create table t1 as select concat(dayofmonth(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofyear(20090224)));
+hex(concat(dayofyear(20090224)))
+3535
+create table t1 as select concat(dayofyear(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(hour('10:11:12')));
+hex(concat(hour('10:11:12')))
+3130
+create table t1 as select concat(hour('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(minute('10:11:12')));
+hex(concat(minute('10:11:12')))
+3131
+create table t1 as select concat(minute('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(second('10:11:12')));
+hex(concat(second('10:11:12')))
+3132
+create table t1 as select concat(second('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(quarter(20090224)));
+hex(concat(quarter(20090224)))
+31
+create table t1 as select concat(quarter(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(week(20090224)));
+hex(concat(week(20090224)))
+38
+create table t1 as select concat(week(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(yearweek(20090224)));
+hex(concat(yearweek(20090224)))
+323030393038
+create table t1 as select concat(yearweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(year(20090224)));
+hex(concat(year(20090224)))
+32303039
+create table t1 as select concat(year(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(weekday(20090224)));
+hex(concat(weekday(20090224)))
+31
+create table t1 as select concat(weekday(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofweek(20090224)));
+hex(concat(dayofweek(20090224)))
+33
+create table t1 as select concat(dayofweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(unix_timestamp(20090224)));
+hex(concat(unix_timestamp(20090224)))
+31323335343232383030
+create table t1 as select concat(unix_timestamp(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(time_to_sec('10:11:12')));
+hex(concat(time_to_sec('10:11:12')))
+3336363732
+create table t1 as select concat(time_to_sec('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(extract(year from 20090702)));
+hex(concat(extract(year from 20090702)))
+32303039
+create table t1 as select concat(extract(year from 20090702)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(microsecond('12:00:00.123456')));
+hex(concat(microsecond('12:00:00.123456')))
+313233343536
+create table t1 as select concat(microsecond('12:00:00.123456')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(month(20090224)));
+hex(concat(month(20090224)))
+32
+create table t1 as select concat(month(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(last_day('2003-02-05')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2003-02-28 323030332D30322D3238
+drop table t1;
+create table t1 as select concat(from_days(730669)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2000-07-03 323030302D30372D3033
+drop table t1;
+create table t1 as select concat(curdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_date()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(curtime()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(8) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat('a',20) as c1 limit 0;
+set timestamp=1216359724;
+insert into t1 values (current_date);
+insert into t1 values (current_time);
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2008-07-18 323030382D30372D3138
+08:42:04 30383A34323A3034
+drop table t1;
+create table t1 as select concat(utc_time()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(8) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sec_to_time(2378)));
+hex(concat(sec_to_time(2378)))
+30303A33393A3338
+create table t1 as select concat(sec_to_time(2378)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')));
+hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')))
+32343A30303A3030
+create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(maketime(10,11,12)));
+hex(concat(maketime(10,11,12)))
+31303A31313A3132
+create table t1 as select concat(maketime(10,11,12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(get_format(DATE,'USA'));
+hex(get_format(DATE,'USA'))
+256D2E25642E2559
+create table t1 as select get_format(DATE,'USA') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(17) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(from_unixtime(1111885200)),4));
+hex(left(concat(from_unixtime(1111885200)),4))
+32303035
+create table t1 as select concat(from_unixtime(1111885200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')));
+hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')))
+323030332D31322D33312032303A30303A3030
+create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)));
+hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)))
+323030342D30312D30322031323A30303A3030
+create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2004-01-02 12:00:00
+drop table t1;
+select hex(concat(makedate(2009,1)));
+hex(concat(makedate(2009,1)))
+323030392D30312D3031
+create table t1 as select concat(makedate(2009,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2009-01-01
+drop table t1;
+create table t1 as select concat(now()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_timestamp()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(sysdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(addtime('00:00:00','11:22:33')));
+hex(concat(addtime('00:00:00','11:22:33')))
+31313A32323A3333
+create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(subtime('23:59:59','11:22:33')));
+hex(concat(subtime('23:59:59','11:22:33')))
+31323A33373A3236
+create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(elt(1,2,3));
+hex(elt(1,2,3))
+32
+create table t1 as select elt(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(export_set(1,2,3,4,2));
+hex(export_set(1,2,3,4,2))
+323433
+create table t1 as select export_set(1,2,3,4,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(127) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(insert(1133,3,0,22));
+hex(insert(1133,3,0,22))
+313132323333
+create table t1 as select insert(1133,3,0,22) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lcase(123));
+hex(lcase(123))
+313233
+create table t1 as select lcase(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(123,1));
+hex(left(123,1))
+31
+create table t1 as select left(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lower(123));
+hex(lower(123))
+313233
+create table t1 as select lower(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lpad(1,2,0));
+hex(lpad(1,2,0))
+3031
+create table t1 as select lpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ltrim(1));
+hex(ltrim(1))
+31
+create table t1 as select ltrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(mid(1,1,1));
+hex(mid(1,1,1))
+31
+create table t1 as select mid(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(repeat(1,2));
+hex(repeat(1,2))
+3131
+create table t1 as select repeat(1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(replace(1,1,2));
+hex(replace(1,1,2))
+32
+create table t1 as select replace(1,1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(reverse(12));
+hex(reverse(12))
+3231
+create table t1 as select reverse(12) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(right(123,1));
+hex(right(123,1))
+33
+create table t1 as select right(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rpad(1,2,0));
+hex(rpad(1,2,0))
+3130
+create table t1 as select rpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rtrim(1));
+hex(rtrim(1))
+31
+create table t1 as select rtrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(soundex(1));
+hex(soundex(1))
+
+create table t1 as select soundex(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(substring(1,1,1));
+hex(substring(1,1,1))
+31
+create table t1 as select substring(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(trim(1));
+hex(trim(1))
+31
+create table t1 as select trim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ucase(1));
+hex(ucase(1))
+31
+create table t1 as select ucase(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(upper(1));
+hex(upper(1))
+31
+create table t1 as select upper(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat(' ', 64) as a limit 0;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(64) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ("1.1"), ("2.1");
+select a, hex(a) from t1;
+a hex(a)
+1.1 312E31
+2.1 322E31
+update t1 set a= a + 0.1;
+select a, hex(a) from t1;
+a hex(a)
+1.2000000000000002 312E32303030303030303030303030303032
+2.2 322E32
+drop table t1;
+create table t1 (a tinyint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+303031 001
+303130 010
+313030 100
+drop table t1;
+create table t1 (a tinyint(4) zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303031 0001
+30303130 0010
+30313030 0100
+drop table t1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E3435
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303031 00001
+3030303130 00010
+3030313030 00100
+3031303030 01000
+3130303030 10000
+drop table t1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303030303031 00000001
+3030303030303130 00000010
+3030303030313030 00000100
+3030303031303030 00001000
+3030303130303030 00010000
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303030303030303031 0000000001
+30303030303030303130 0000000010
+30303030303030313030 0000000100
+30303030303031303030 0000001000
+30303030303130303030 0000010000
+drop table t1;
+create table t1 (a bigint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+31
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+3030303030303030303030303030303030303031 00000000000000000001
+3030303030303030303030303030303030303130 00000000000000000010
+3030303030303030303030303030303030313030 00000000000000000100
+3030303030303030303030303030303031303030 00000000000000001000
+3030303030303030303030303030303130303030 00000000000000010000
+drop table t1;
+create table t1 (a float);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E343536
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+303030303030303030312E31 0000000001.1
+303030303030303031302E31 0000000010.1
+303030303030303130302E31 0000000100.1
+303030303030313030302E31 0000001000.1
+303030303031303030302E31 0000010000.1
+drop table t1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3132332E343536
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(22) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+30303030303030303030303030303030303030312E31 00000000000000000001.1
+30303030303030303030303030303030303031302E31 00000000000000000010.1
+30303030303030303030303030303030303130302E31 00000000000000000100.1
+30303030303030303030303030303030313030302E31 00000000000000001000.1
+30303030303030303030303030303031303030302E31 00000000000000010000.1
+drop table t1;
+create table t1 (a year(2));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+3031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a year);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+32303031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bit(64));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0000000000000001
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+select hex(concat(a)) from t1;
+hex(concat(a))
+303030302D30302D30302030303A30303A3030
+323030312D30322D30332030343A30353A3036
+313938302D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+select concat(a) from t1;
+concat(a)
+0000-00-00 00:00:00
+2001-02-03 04:05:06
+1980-02-03 04:05:06
+2001-02-03 04:05:06
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(19) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+select hex(concat(a)) from t1;
+hex(concat(a))
+323030312D30322D3033
+323030312D30322D3033
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+select hex(concat(a)) from t1;
+hex(concat(a))
+30303A30303A3031
+30313A30323A3033
+select concat(a) from t1;
+concat(a)
+00:00:01
+01:02:03
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(8) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+select hex(concat(a)) from t1;
+hex(concat(a))
+323030312D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(19) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(4) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(3) YES NULL
+select hex(a) from v1;
+hex(a)
+303031
+303130
+313030
+drop table t1;
+drop view v1;
+create table t1 (a tinyint(30) zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(30) YES NULL
+select hex(a) from v1;
+hex(a)
+303030303030303030303030303030303030303030303030303030303031
+303030303030303030303030303030303030303030303030303030303130
+303030303030303030303030303030303030303030303030303030313030
+drop table t1;
+drop view v1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E3435
+drop table t1;
+drop view v1;
+create table t1 (a smallint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(6) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(5) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303031
+3030303130
+3030313030
+3031303030
+3130303030
+drop table t1;
+drop view v1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(9) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(8) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303030303031
+3030303030303130
+3030303030313030
+3030303031303030
+3030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(11) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(10) YES NULL
+select hex(a) from v1;
+hex(a)
+30303030303030303031
+30303030303030303130
+30303030303030313030
+30303030303031303030
+30303030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a bigint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(20) YES NULL
+select hex(a) from v1;
+hex(a)
+31
+drop table t1;
+drop view v1;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(20) YES NULL
+select hex(a) from v1;
+hex(a)
+3030303030303030303030303030303030303031
+3030303030303030303030303030303030303130
+3030303030303030303030303030303030313030
+3030303030303030303030303030303031303030
+3030303030303030303030303030303130303030
+drop table t1;
+drop view v1;
+create table t1 (a float);
+insert into t1 values (123.456);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E343536
+drop table t1;
+drop view v1;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+303030303030303030312E31
+303030303030303031302E31
+303030303030303130302E31
+303030303030313030302E31
+303030303031303030302E31
+drop table t1;
+drop view v1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select concat(a) from t1;
+concat(a)
+123.456
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(22) YES NULL
+select hex(a) from v1;
+hex(a)
+3132332E343536
+drop table t1;
+drop view v1;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(22) YES NULL
+select hex(a) from v1;
+hex(a)
+30303030303030303030303030303030303030312E31
+30303030303030303030303030303030303031302E31
+30303030303030303030303030303030303130302E31
+30303030303030303030303030303030313030302E31
+30303030303030303030303030303031303030302E31
+drop table t1;
+drop view v1;
+create table t1 (a year(2));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(2) YES NULL
+select hex(a) from v1;
+hex(a)
+3031
+drop table t1;
+drop view v1;
+create table t1 (a year);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(4) YES NULL
+select hex(a) from v1;
+hex(a)
+32303031
+drop table t1;
+drop view v1;
+create table t1 (a bit(64));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(64) YES NULL
+select hex(a) from v1;
+hex(a)
+0000000000000001
+drop table t1;
+drop view v1;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(19) NO
+select hex(a) from v1;
+hex(a)
+303030302D30302D30302030303A30303A3030
+323030312D30322D30332030343A30353A3036
+313938302D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+drop table t1;
+drop view v1;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(10) YES NULL
+select hex(a) from v1;
+hex(a)
+323030312D30322D3033
+323030312D30322D3033
+drop table t1;
+drop view v1;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(8) YES NULL
+select hex(a) from v1;
+hex(a)
+30303A30303A3031
+30313A30323A3033
+drop table t1;
+drop view v1;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(19) YES NULL
+select hex(a) from v1;
+hex(a)
+323030312D30322D30332030343A30353A3036
+323030312D30322D30332030343A30353A3036
+drop table t1;
+drop view v1;
+create function f1 (par1 int) returns int
+begin
+return concat(par1);
+end|
+set @a= f1(1);
+select hex(@a);
+hex(@a)
+1
+select hex(concat(f1(1)));
+hex(concat(f1(1)))
+31
+create table t1 as select f1(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(1)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(11) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 decimal(18,2)) returns decimal(18,2)
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` decimal(18,2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(20) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 float) returns float
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` float DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(12) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 date) returns date
+begin
+return concat(par1);
+end|
+set @a= f1(cast('2001-01-02' as date));
+select hex(@a);
+hex(@a)
+323030312D30312D3032
+select hex(concat(f1(cast('2001-01-02' as date))));
+hex(concat(f1(cast('2001-01-02' as date))))
+323030312D30312D3032
+create table t1 as select f1(cast('2001-01-02' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(10) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+#
+# End of WL#2649 Number-to-string conversions
+#
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
index 3373e31539f..433078a2a07 100644
--- a/mysql-test/r/ctype_ldml.result
+++ b/mysql-test/r/ctype_ldml.result
@@ -53,6 +53,33 @@ select * from t1 where c1='b';
c1
a
drop table t1;
+show collation like 'utf8mb4_test_ci';
+Collation Charset Id Default Compiled Sortlen
+utf8mb4_test_ci utf8mb4 326 8
+create table t1 (c1 char(1) character set utf8mb4 collate utf8mb4_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+c1
+a
+drop table t1;
+show collation like 'utf16_test_ci';
+Collation Charset Id Default Compiled Sortlen
+utf16_test_ci utf16 327 8
+create table t1 (c1 char(1) character set utf16 collate utf16_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+c1
+a
+drop table t1;
+show collation like 'utf32_test_ci';
+Collation Charset Id Default Compiled Sortlen
+utf32_test_ci utf32 391 8
+create table t1 (c1 char(1) character set utf32 collate utf32_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+c1
+a
+drop table t1;
CREATE TABLE t1 (
col1 varchar(100) character set utf8 collate utf8_test_ci
);
@@ -373,16 +400,22 @@ select "foo" = "foo " collate latin1_test;
The following tests check that two-byte collation IDs work
select * from information_schema.collations where id>256 order by id;
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
+utf8mb4_test_ci utf8mb4 326 8
+utf16_test_ci utf16 327 8
utf8_phone_ci utf8 352 8
utf8_test_ci utf8 353 8
ucs2_test_ci ucs2 358 8
ucs2_vn_ci ucs2 359 8
+utf32_test_ci utf32 391 8
utf8_maxuserid_ci utf8 2047 8
show collation like '%test%';
Collation Charset Id Default Compiled Sortlen
latin1_test latin1 99 Yes 1
utf8_test_ci utf8 353 8
ucs2_test_ci ucs2 358 8
+utf8mb4_test_ci utf8mb4 326 8
+utf16_test_ci utf16 327 8
+utf32_test_ci utf32 391 8
show collation like 'ucs2_vn_ci';
Collation Charset Id Default Compiled Sortlen
ucs2_vn_ci ucs2 359 8
diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result
index 89e05bf4484..4730b4df668 100644
--- a/mysql-test/r/ctype_many.result
+++ b/mysql-test/r/ctype_many.result
@@ -1683,3 +1683,59 @@ ARMENIAN CAPIT DA 2
ARMENIAN CAPIT ECH 2
ARMENIAN CAPIT ZA 2
DROP TABLE t1;
+#
+# WL#1213 Implement 4-byte UTF8, UTF16 and UTF32
+# Testing that only utf8mb4 is superset for utf8
+# No other Unicode character set pairs have superset/subset relations
+#
+CREATE TABLE t1 (
+utf8 CHAR CHARACTER SET utf8,
+utf8mb4 CHAR CHARACTER SET utf8mb4,
+ucs2 CHAR CHARACTER SET ucs2,
+utf16 CHAR CHARACTER SET utf16,
+utf32 CHAR CHARACTER SET utf32
+);
+INSERT INTO t1 VALUES ('','','','','');
+SELECT CHARSET(CONCAT(utf8, utf8mb4)) FROM t1;
+CHARSET(CONCAT(utf8, utf8mb4))
+utf8mb4
+SELECT CHARSET(CONCAT(utf8, ucs2)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf8, utf16)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf8, utf32)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf8mb4, utf8)) FROM t1;
+CHARSET(CONCAT(utf8mb4, utf8))
+utf8mb4
+SELECT CHARSET(CONCAT(utf8mb4, ucs2)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf8mb4, utf16)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf8mb4, utf32)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(ucs2, utf8)) FROM t1;
+ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(ucs2, utf8mb4)) FROM t1;
+ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(ucs2, utf16)) FROM t1;
+ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(ucs2, utf32)) FROM t1;
+ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf16, utf8)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf16, ucs2)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf16, utf8mb4)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf16, utf32)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf32, utf8)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf32, ucs2)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf32, utf8mb4)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat'
+SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1;
+ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index abb21b7cee7..533dfa4db34 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -982,12 +982,12 @@ ALTER TABLE t2 ADD a int NOT NULL AFTER status;
DROP TABLE t1,t2;
select password(name) from bug20536;
password(name)
-????????????????????
-????????????????????
+*286C12C0F32248BD65B30EE65F3ECFB2AA3F7849
+*947A5674312754578F132655C74A11533B105FF6
select old_password(name) from bug20536;
old_password(name)
-????????
-????????
+10e155cb44e2adb5
+14e500b131773991
select quote(name) from bug20536;
quote(name)
????????
@@ -1231,3 +1231,2573 @@ HEX(DAYNAME(19700101))
0427043504420432043504400433
SET character_set_connection=latin1;
End of 5.0 tests
+#
+# Start of 5.5 tests
+#
+SET NAMES latin1;
+SET collation_connection=ucs2_general_ci;
+#
+# Start of WL#2649 Number-to-string conversions
+#
+select hex(concat(1));
+hex(concat(1))
+0031
+create table t1 as select concat(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+0031
+drop table t1;
+select hex(concat(18446744073709551615));
+hex(concat(18446744073709551615))
+00310038003400340036003700340034003000370033003700300039003500350031003600310035
+create table t1 as select concat(18446744073709551615) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+00310038003400340036003700340034003000370033003700300039003500350031003600310035
+drop table t1;
+select hex(concat(1.1));
+hex(concat(1.1))
+0031002E0031
+create table t1 as select concat(1.1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1;
+hex(c1)
+0031002E0031
+drop table t1;
+select hex(concat('a', 1+2)), charset(concat(1+2));
+hex(concat('a', 1+2)) charset(concat(1+2))
+00610033 ucs2
+create table t1 as select concat(1+2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1-2));
+hex(concat(1-2))
+002D0031
+create table t1 as select concat(1-2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1*2));
+hex(concat(1*2))
+0032
+create table t1 as select concat(1*2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1/2));
+hex(concat(1/2))
+0030002E0035003000300030
+create table t1 as select concat(1/2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(7) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 div 2));
+hex(concat(1 div 2))
+0030
+create table t1 as select concat(1 div 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1 % 2));
+hex(concat(1 % 2))
+0031
+create table t1 as select concat(1 % 2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-1));
+hex(concat(-1))
+002D0031
+create table t1 as select concat(-1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(-(1+2)));
+hex(concat(-(1+2)))
+002D0033
+create table t1 as select concat(-(1+2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1|2));
+hex(concat(1|2))
+0033
+create table t1 as select concat(1|2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(1&2));
+hex(concat(1&2))
+0030
+create table t1 as select concat(1&2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_count(12)));
+hex(concat(bit_count(12)))
+0032
+create table t1 as select concat(bit_count(12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2<<1));
+hex(concat(2<<1))
+0034
+create table t1 as select concat(2<<1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(2>>1));
+hex(concat(2>>1))
+0031
+create table t1 as select concat(2>>1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(~0));
+hex(concat(~0))
+00310038003400340036003700340034003000370033003700300039003500350031003600310035
+create table t1 as select concat(~0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(3^2));
+hex(concat(3^2))
+0031
+create table t1 as select concat(3^2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(abs(-2)));
+hex(concat(abs(-2)))
+0032
+create table t1 as select concat(abs(-2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(exp(2)),1));
+hex(left(concat(exp(2)),1))
+0037
+create table t1 as select concat(exp(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log(2)),1));
+hex(left(concat(log(2)),1))
+0030
+create table t1 as select concat(log(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log2(2)),1));
+hex(left(concat(log2(2)),1))
+0031
+create table t1 as select concat(log2(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(log10(2)),1));
+hex(left(concat(log10(2)),1))
+0030
+create table t1 as select concat(log10(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sqrt(2)),1));
+hex(left(concat(sqrt(2)),1))
+0031
+create table t1 as select concat(sqrt(2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(pow(2,2)),1));
+hex(left(concat(pow(2,2)),1))
+0034
+create table t1 as select concat(pow(2,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(acos(0.5)),1));
+hex(left(concat(acos(0.5)),1))
+0031
+create table t1 as select concat(acos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(asin(0.5)),1));
+hex(left(concat(asin(0.5)),1))
+0030
+create table t1 as select concat(asin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(atan(0.5)),1));
+hex(left(concat(atan(0.5)),1))
+0030
+create table t1 as select concat(atan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(cos(0.5)),1));
+hex(left(concat(cos(0.5)),1))
+0030
+create table t1 as select concat(cos(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(sin(0.5)),1));
+hex(left(concat(sin(0.5)),1))
+0030
+create table t1 as select concat(sin(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(tan(0.5)),1));
+hex(left(concat(tan(0.5)),1))
+0030
+create table t1 as select concat(tan(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(degrees(0)));
+hex(concat(degrees(0)))
+0030
+create table t1 as select concat(degrees(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(radians(0)));
+hex(concat(radians(0)))
+0030
+create table t1 as select concat(radians(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ceiling(0.5)));
+hex(concat(ceiling(0.5)))
+0031
+create table t1 as select concat(ceiling(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(floor(0.5)));
+hex(concat(floor(0.5)))
+0030
+create table t1 as select concat(floor(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(round(0.5)));
+hex(concat(round(0.5)))
+0031
+create table t1 as select concat(round(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sign(0.5)));
+hex(concat(sign(0.5)))
+0031
+create table t1 as select concat(sign(0.5)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(rand()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(length('a')));
+hex(concat(length('a')))
+0032
+create table t1 as select concat(length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(char_length('a')));
+hex(concat(char_length('a')))
+0031
+create table t1 as select concat(char_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(bit_length('a')));
+hex(concat(bit_length('a')))
+00310036
+create table t1 as select concat(bit_length('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coercibility('a')));
+hex(concat(coercibility('a')))
+0034
+create table t1 as select concat(coercibility('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(locate('a','a')));
+hex(concat(locate('a','a')))
+0031
+create table t1 as select concat(locate('a','a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(11) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(field('c','a','b','c')));
+hex(concat(field('c','a','b','c')))
+0033
+create table t1 as select concat(field('c','a','b','c')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ascii(61)));
+hex(concat(ascii(61)))
+00350034
+create table t1 as select concat(ascii(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ord(61)));
+hex(concat(ord(61)))
+00350034
+create table t1 as select concat(ord(61)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(find_in_set('b','a,b,c,d')));
+hex(concat(find_in_set('b','a,b,c,d')))
+0032
+create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select md5('a'), hex(md5('a'));
+md5('a') hex(md5('a'))
+760f753576f2955b0074758acb4d5fa6 00370036003000660037003500330035003700360066003200390035003500620030003000370034003700350038006100630062003400640035006600610036
+create table t1 as select md5('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(32) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select old_password('a'), hex(old_password('a'));
+old_password('a') hex(old_password('a'))
+0705298948d1f92f 0030003700300035003200390038003900340038006400310066003900320066
+create table t1 as select old_password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(16) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select password('a'), hex(password('a'));
+password('a') hex(password('a'))
+*9A48A662559C49521B25C43077059DD109FBD84A 002A0039004100340038004100360036003200350035003900430034003900350032003100420032003500430034003300300037003700300035003900440044003100300039004600420044003800340041
+create table t1 as select password('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(41) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha('a'), hex(sha('a'));
+sha('a') hex(sha('a'))
+3106600e0327ca77371f2526df794ed84322585c 0033003100300036003600300030006500300033003200370063006100370037003300370031006600320035003200360064006600370039003400650064003800340033003200320035003800350063
+create table t1 as select sha('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(40) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select sha1('a'), hex(sha1('a'));
+sha1('a') hex(sha1('a'))
+3106600e0327ca77371f2526df794ed84322585c 0033003100300036003600300030006500300033003200370063006100370037003300370031006600320035003200360064006600370039003400650064003800340033003200320035003800350063
+create table t1 as select sha1('a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(40) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('-1' as signed)));
+hex(concat(cast('-1' as signed)))
+002D0031
+create table t1 as select concat(cast('-1' as signed)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('1' as unsigned)));
+hex(concat(cast('1' as unsigned)))
+0031
+create table t1 as select concat(cast('1' as unsigned)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast(1/2 as decimal(5,5))));
+hex(concat(cast(1/2 as decimal(5,5))))
+0030002E00350030003000300030
+create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(7) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as date)));
+hex(concat(cast('2001-01-02 03:04:05' as date)))
+0032003000300031002D00300031002D00300032
+create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02
+drop table t1;
+select hex(concat(cast('2001-01-02 03:04:05' as time)));
+hex(concat(cast('2001-01-02 03:04:05' as time)))
+00300033003A00300034003A00300035
+create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+03:04:05
+drop table t1;
+select hex(concat(cast('2001-01-02' as datetime)));
+hex(concat(cast('2001-01-02' as datetime)))
+0032003000300031002D00300031002D00300032002000300030003A00300030003A00300030
+create table t1 as select concat(cast('2001-01-02' as datetime)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2001-01-02 00:00:00
+drop table t1;
+select hex(concat(least(1,2)));
+hex(concat(least(1,2)))
+0031
+create table t1 as select concat(least(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(greatest(1,2)));
+hex(concat(greatest(1,2)))
+0032
+create table t1 as select concat(greatest(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(case when 11 then 22 else 33 end));
+hex(concat(case when 11 then 22 else 33 end))
+00320032
+create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(coalesce(1,2)));
+hex(concat(coalesce(1,2)))
+0031
+create table t1 as select concat(coalesce(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat_ws(1,2,3));
+hex(concat_ws(1,2,3))
+003200310033
+create table t1 as select concat_ws(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(group_concat(1,2,3));
+hex(group_concat(1,2,3))
+003100320033
+create table t1 as select group_concat(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(512) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select 1 as c1 union select 'a';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(c1) from t1 order by c1;
+hex(c1)
+0031
+0061
+drop table t1;
+create table t1 as select concat(last_insert_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(benchmark(0,0)));
+hex(concat(benchmark(0,0)))
+0030
+create table t1 as select concat(benchmark(0,0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sleep(0)));
+hex(concat(sleep(0)))
+0030
+create table t1 as select concat(sleep(0)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(is_free_lock('xxxx')));
+hex(concat(is_free_lock('xxxx')))
+0031
+create table t1 as select concat(is_free_lock('xxxx')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(is_used_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(release_lock('a')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(crc32('')));
+hex(concat(crc32('')))
+0030
+create table t1 as select concat(crc32('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(uncompressed_length('')));
+hex(concat(uncompressed_length('')))
+0030
+create table t1 as select concat(uncompressed_length('')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(connection_id()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_aton('127.1.1.1')));
+hex(concat(inet_aton('127.1.1.1')))
+0032003100330030003700370032003200320035
+create table t1 as select concat(inet_aton('127.1.1.1')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(inet_ntoa(2130772225)));
+hex(concat(inet_ntoa(2130772225)))
+003100320037002E0031002E0031002E0031
+create table t1 as select concat(inet_ntoa(2130772225)) as c1;
+select * from t1;
+c1
+127.1.1.1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(31) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(row_count()));
+hex(concat(row_count()))
+002D0031
+create table t1 as select concat(row_count()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(found_rows()));
+hex(concat(found_rows()))
+0030
+create table t1 as select concat(found_rows()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid_short()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(uuid()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
+coercibility(uuid()) coercibility(cast('a' as char character set latin1))
+4 2
+select charset(concat(uuid(), cast('a' as char character set latin1)));
+charset(concat(uuid(), cast('a' as char character set latin1)))
+latin1
+create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(37) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1));
+hex(concat(@a1:=1))
+0031
+create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2;
+select hex(c1) from t1;
+hex(c1)
+0032
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '',
+ `c2` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1;
+select hex(concat(@a2));
+hex(concat(@a2))
+0031
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+0031
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) CHARACTER SET ucs2 DEFAULT NULL,
+ `c2` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=sqrt(1)));
+hex(concat(@a1:=sqrt(1)))
+0031
+create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2;
+select hex(c1) from t1;
+hex(c1)
+0031
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=sqrt(1);
+select hex(concat(@a2));
+hex(concat(@a2))
+0031
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+0031
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL,
+ `c2` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@a1:=1.1));
+hex(concat(@a1:=1.1))
+0031002E0031
+create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2;
+select hex(c1) from t1;
+hex(c1)
+0031002E0031
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '',
+ `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @a2=1.1;
+select hex(concat(@a2));
+hex(concat(@a2))
+0031002E0031
+create table t1 as select concat(@a2) as c1, @a2 as c2;
+select hex(c1) from t1;
+hex(c1)
+0031002E0031
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(83) CHARACTER SET ucs2 DEFAULT NULL,
+ `c2` decimal(65,30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(@@ft_max_word_len));
+hex(concat(@@ft_max_word_len))
+00380034
+create table t1 as select concat(@@ft_max_word_len) as c1;
+select hex(c1) from t1;
+hex(c1)
+00380034
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS TRUE));
+hex(concat('a'='a' IS TRUE))
+0031
+create table t1 as select concat('a'='a' IS TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a'='a' IS NOT TRUE));
+hex(concat('a'='a' IS NOT TRUE))
+0030
+create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NOT 'a'='a'));
+hex(concat(NOT 'a'='a'))
+0030
+create table t1 as select concat(NOT 'a'='a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NULL));
+hex(concat('a' IS NULL))
+0030
+create table t1 as select concat('a' IS NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' IS NOT NULL));
+hex(concat('a' IS NOT NULL))
+0031
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' rlike 'a'));
+hex(concat('a' rlike 'a'))
+0031
+create table t1 as select concat('a' IS NOT NULL) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(strcmp('a','b')));
+hex(concat(strcmp('a','b')))
+002D0031
+create table t1 as select concat(strcmp('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' like 'a'));
+hex(concat('a' like 'a'))
+0031
+create table t1 as select concat('a' like 'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' between 'b' and 'c'));
+hex(concat('a' between 'b' and 'c'))
+0030
+create table t1 as select concat('a' between 'b' and 'c') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat('a' in ('a','b')));
+hex(concat('a' in ('a','b')))
+0031
+create table t1 as select concat('a' in ('a','b')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
+hex(concat(interval(23, 1, 15, 17, 30, 44, 200)))
+0033
+create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(10), fulltext key(a));
+insert into t1 values ('a');
+select hex(concat(match (a) against ('a'))) from t1;
+hex(concat(match (a) against ('a')))
+0030
+create table t2 as select concat(match (a) against ('a')) as a from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+select hex(ifnull(1,'a'));
+hex(ifnull(1,'a'))
+0031
+create table t1 as select ifnull(1,'a') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1,1)));
+hex(concat(ifnull(1,1)))
+0031
+create table t1 as select concat(ifnull(1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(ifnull(1.1,1.1)));
+hex(concat(ifnull(1.1,1.1)))
+0031002E0031
+create table t1 as select concat(ifnull(1.1,1.1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,'b',1));
+hex(if(1,'b',1))
+0062
+create table t1 as select if(1,'b',1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(if(1,1,'b'));
+hex(if(1,1,'b'))
+0031
+create table t1 as select if(1,1,'b') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(if(1,1,1)));
+hex(concat(if(1,1,1)))
+0031
+create table t1 as select concat(if(1,1,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(nullif(1,2)));
+hex(concat(nullif(1,2)))
+0031
+create table t1 as select concat(nullif(1,2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))))
+0031
+create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+0032
+create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))));
+hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))))
+0032
+create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
+hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
+0030
+create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))));
+hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))))
+0031
+create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))));
+hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))))
+0030
+create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsSimple(GeomFromText('POINT(1 1)'))));
+hex(concat(IsSimple(GeomFromText('POINT(1 1)'))))
+0030
+create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
+hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))))
+0030
+create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
+hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))))
+0031
+create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1;
+drop table t1;
+select hex(concat(x(GeomFromText('Point(1 2)'))));
+hex(concat(x(GeomFromText('Point(1 2)'))))
+0031
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(y(GeomFromText('Point(1 2)'))));
+hex(concat(y(GeomFromText('Point(1 2)'))))
+0032
+create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))));
+hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))))
+0031
+create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))));
+hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))))
+0031
+create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(GeometryType(GeomFromText('Point(1 2)'))));
+hex(concat(GeometryType(GeomFromText('Point(1 2)'))))
+0050004F0049004E0054
+create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(AsText(GeomFromText('Point(1 2)'))));
+hex(concat(AsText(GeomFromText('Point(1 2)'))))
+0050004F0049004E005400280031002000320029
+create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` longtext CHARACTER SET ucs2
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_add(200902, 2)));
+hex(concat(period_add(200902, 2)))
+003200300030003900300034
+create table t1 as select concat(period_add(200902, 2)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(period_diff(200902, 200802)));
+hex(concat(period_diff(200902, 200802)))
+00310032
+create table t1 as select concat(period_add(200902, 200802)) as c1;
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(to_days(20090224)));
+hex(concat(to_days(20090224)))
+003700330033003800320037
+create table t1 as select concat(to_days(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofmonth(20090224)));
+hex(concat(dayofmonth(20090224)))
+00320034
+create table t1 as select concat(dayofmonth(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofyear(20090224)));
+hex(concat(dayofyear(20090224)))
+00350035
+create table t1 as select concat(dayofyear(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(hour('10:11:12')));
+hex(concat(hour('10:11:12')))
+00310030
+create table t1 as select concat(hour('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(minute('10:11:12')));
+hex(concat(minute('10:11:12')))
+00310031
+create table t1 as select concat(minute('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(second('10:11:12')));
+hex(concat(second('10:11:12')))
+00310032
+create table t1 as select concat(second('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(quarter(20090224)));
+hex(concat(quarter(20090224)))
+0031
+create table t1 as select concat(quarter(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(week(20090224)));
+hex(concat(week(20090224)))
+0038
+create table t1 as select concat(week(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(yearweek(20090224)));
+hex(concat(yearweek(20090224)))
+003200300030003900300038
+create table t1 as select concat(yearweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(year(20090224)));
+hex(concat(year(20090224)))
+0032003000300039
+create table t1 as select concat(year(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(weekday(20090224)));
+hex(concat(weekday(20090224)))
+0031
+create table t1 as select concat(weekday(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(dayofweek(20090224)));
+hex(concat(dayofweek(20090224)))
+0033
+create table t1 as select concat(dayofweek(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(unix_timestamp(20090224)));
+hex(concat(unix_timestamp(20090224)))
+0031003200330035003400320032003800300030
+create table t1 as select concat(unix_timestamp(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(time_to_sec('10:11:12')));
+hex(concat(time_to_sec('10:11:12')))
+00330036003600370032
+create table t1 as select concat(time_to_sec('10:11:12')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(extract(year from 20090702)));
+hex(concat(extract(year from 20090702)))
+0032003000300039
+create table t1 as select concat(extract(year from 20090702)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(microsecond('12:00:00.123456')));
+hex(concat(microsecond('12:00:00.123456')))
+003100320033003400350036
+create table t1 as select concat(microsecond('12:00:00.123456')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(month(20090224)));
+hex(concat(month(20090224)))
+0032
+create table t1 as select concat(month(20090224)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(last_day('2003-02-05')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2003-02-28 0032003000300033002D00300032002D00320038
+drop table t1;
+create table t1 as select concat(from_days(730669)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2000-07-03 0032003000300030002D00300037002D00300033
+drop table t1;
+create table t1 as select concat(curdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_date()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(curtime()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(8) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat('a',20) as c1 limit 0;
+set timestamp=1216359724;
+insert into t1 values (current_date);
+insert into t1 values (current_time);
+select c1, hex(c1) from t1;
+c1 hex(c1)
+2008-07-18 0032003000300038002D00300037002D00310038
+08:42:04 00300038003A00340032003A00300034
+drop table t1;
+create table t1 as select concat(utc_time()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(8) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(sec_to_time(2378)));
+hex(concat(sec_to_time(2378)))
+00300030003A00330039003A00330038
+create table t1 as select concat(sec_to_time(2378)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')));
+hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')))
+00320034003A00300030003A00300030
+create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(maketime(10,11,12)));
+hex(concat(maketime(10,11,12)))
+00310030003A00310031003A00310032
+create table t1 as select concat(maketime(10,11,12)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(get_format(DATE,'USA'));
+hex(get_format(DATE,'USA'))
+0025006D002E00250064002E00250059
+create table t1 as select get_format(DATE,'USA') as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(17) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(concat(from_unixtime(1111885200)),4));
+hex(left(concat(from_unixtime(1111885200)),4))
+0032003000300035
+create table t1 as select concat(from_unixtime(1111885200)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')));
+hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')))
+0032003000300033002D00310032002D00330031002000320030003A00300030003A00300030
+create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)));
+hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)))
+0032003000300034002D00300031002D00300032002000310032003A00300030003A00300030
+create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2004-01-02 12:00:00
+drop table t1;
+select hex(concat(makedate(2009,1)));
+hex(concat(makedate(2009,1)))
+0032003000300039002D00300031002D00300031
+create table t1 as select concat(makedate(2009,1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+c1
+2009-01-01
+drop table t1;
+create table t1 as select concat(now()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(utc_timestamp()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(sysdate()) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(addtime('00:00:00','11:22:33')));
+hex(concat(addtime('00:00:00','11:22:33')))
+00310031003A00320032003A00330033
+create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(concat(subtime('23:59:59','11:22:33')));
+hex(concat(subtime('23:59:59','11:22:33')))
+00310032003A00330037003A00320036
+create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(elt(1,2,3));
+hex(elt(1,2,3))
+0032
+create table t1 as select elt(1,2,3) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(export_set(1,2,3,4,2));
+hex(export_set(1,2,3,4,2))
+003200340033
+create table t1 as select export_set(1,2,3,4,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(127) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(insert(1133,3,0,22));
+hex(insert(1133,3,0,22))
+003100310032003200330033
+create table t1 as select insert(1133,3,0,22) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lcase(123));
+hex(lcase(123))
+003100320033
+create table t1 as select lcase(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(left(123,1));
+hex(left(123,1))
+0031
+create table t1 as select left(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lower(123));
+hex(lower(123))
+003100320033
+create table t1 as select lower(123) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(lpad(1,2,0));
+hex(lpad(1,2,0))
+00300031
+create table t1 as select lpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ltrim(1));
+hex(ltrim(1))
+0031
+create table t1 as select ltrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(mid(1,1,1));
+hex(mid(1,1,1))
+0031
+create table t1 as select mid(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(repeat(1,2));
+hex(repeat(1,2))
+00310031
+create table t1 as select repeat(1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(replace(1,1,2));
+hex(replace(1,1,2))
+0032
+create table t1 as select replace(1,1,2) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(reverse(12));
+hex(reverse(12))
+00320031
+create table t1 as select reverse(12) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(right(123,1));
+hex(right(123,1))
+0033
+create table t1 as select right(123,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rpad(1,2,0));
+hex(rpad(1,2,0))
+00310030
+create table t1 as select rpad(1,2,0) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(rtrim(1));
+hex(rtrim(1))
+0031
+create table t1 as select rtrim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(soundex(1));
+hex(soundex(1))
+
+create table t1 as select soundex(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(substring(1,1,1));
+hex(substring(1,1,1))
+0031
+create table t1 as select substring(1,1,1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(trim(1));
+hex(trim(1))
+0031
+create table t1 as select trim(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(ucase(1));
+hex(ucase(1))
+0031
+create table t1 as select ucase(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select hex(upper(1));
+hex(upper(1))
+0031
+create table t1 as select upper(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select repeat(' ', 64) as a limit 0;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(64) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ("1.1"), ("2.1");
+select a, hex(a) from t1;
+a hex(a)
+1.1 0031002E0031
+2.1 0032002E0031
+update t1 set a= a + 0.1;
+select a, hex(a) from t1;
+a hex(a)
+1.2000000000000002 0031002E0032003000300030003000300030003000300030003000300030003000300032
+2.2 0032002E0032
+drop table t1;
+create table t1 (a tinyint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+003000300031 001
+003000310030 010
+003100300030 100
+drop table t1;
+create table t1 (a tinyint(4) zerofill);
+insert into t1 values (1), (10), (100);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+0030003000300031 0001
+0030003000310030 0010
+0030003100300030 0100
+drop table t1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+select hex(concat(a)) from t1;
+hex(concat(a))
+003100320033002E00340035
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(12) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(6) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+00300030003000300031 00001
+00300030003000310030 00010
+00300030003100300030 00100
+00300031003000300030 01000
+00310030003000300030 10000
+drop table t1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(9) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+00300030003000300030003000300031 00000001
+00300030003000300030003000310030 00000010
+00300030003000300030003100300030 00000100
+00300030003000300031003000300030 00001000
+00300030003000310030003000300030 00010000
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(11) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+0030003000300030003000300030003000300031 0000000001
+0030003000300030003000300030003000310030 0000000010
+0030003000300030003000300030003100300030 0000000100
+0030003000300030003000300031003000300030 0000001000
+0030003000300030003000310030003000300030 0000010000
+drop table t1;
+create table t1 (a bigint);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(20) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+00300030003000300030003000300030003000300030003000300030003000300030003000300031 00000000000000000001
+00300030003000300030003000300030003000300030003000300030003000300030003000310030 00000000000000000010
+00300030003000300030003000300030003000300030003000300030003000300030003100300030 00000000000000000100
+00300030003000300030003000300030003000300030003000300030003000300031003000300030 00000000000000001000
+00300030003000300030003000300030003000300030003000300030003000310030003000300030 00000000000000010000
+drop table t1;
+create table t1 (a float);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+003100320033002E003400350036
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(12) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+0030003000300030003000300030003000300031002E0031 0000000001.1
+0030003000300030003000300030003000310030002E0031 0000000010.1
+0030003000300030003000300030003100300030002E0031 0000000100.1
+0030003000300030003000300031003000300030002E0031 0000001000.1
+0030003000300030003000310030003000300030002E0031 0000010000.1
+drop table t1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select hex(concat(a)) from t1;
+hex(concat(a))
+003100320033002E003400350036
+select concat(a) from t1;
+concat(a)
+123.456
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(22) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+select hex(concat(a)), a from t1;
+hex(concat(a)) a
+00300030003000300030003000300030003000300030003000300030003000300030003000300031002E0031 00000000000000000001.1
+00300030003000300030003000300030003000300030003000300030003000300030003000310030002E0031 00000000000000000010.1
+00300030003000300030003000300030003000300030003000300030003000300030003100300030002E0031 00000000000000000100.1
+00300030003000300030003000300030003000300030003000300030003000300031003000300030002E0031 00000000000000001000.1
+00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1
+drop table t1;
+create table t1 (a year(2));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+00300031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a year);
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0032003000300031
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a bit(64));
+insert into t1 values (1);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0000000000000001
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varbinary(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+select hex(concat(a)) from t1;
+hex(concat(a))
+0030003000300030002D00300030002D00300030002000300030003A00300030003A00300030
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+0031003900380030002D00300032002D00300033002000300034003A00300035003A00300036
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+select concat(a) from t1;
+concat(a)
+0000-00-00 00:00:00
+2001-02-03 04:05:06
+1980-02-03 04:05:06
+2001-02-03 04:05:06
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0032003000300031002D00300032002D00300033
+0032003000300031002D00300032002D00300033
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+select hex(concat(a)) from t1;
+hex(concat(a))
+00300030003A00300030003A00300031
+00300031003A00300032003A00300033
+select concat(a) from t1;
+concat(a)
+00:00:01
+01:02:03
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(8) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+select hex(concat(a)) from t1;
+hex(concat(a))
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+create table t2 as select concat(a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `concat(a)` varchar(19) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1 (a tinyint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(4) YES NULL
+select hex(a) from v1;
+hex(a)
+0031
+drop table t1;
+drop view v1;
+create table t1 (a tinyint zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(3) YES NULL
+select hex(a) from v1;
+hex(a)
+003000300031
+003000310030
+003100300030
+drop table t1;
+drop view v1;
+create table t1 (a tinyint(30) zerofill);
+insert into t1 values (1), (10), (100);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(30) YES NULL
+select hex(a) from v1;
+hex(a)
+003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300031
+003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000310030
+003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003100300030
+drop table t1;
+drop view v1;
+create table t1 (a decimal(10,2));
+insert into t1 values (123.45);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+003100320033002E00340035
+drop table t1;
+drop view v1;
+create table t1 (a smallint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(6) YES NULL
+select hex(a) from v1;
+hex(a)
+0031
+drop table t1;
+drop view v1;
+create table t1 (a smallint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(5) YES NULL
+select hex(a) from v1;
+hex(a)
+00300030003000300031
+00300030003000310030
+00300030003100300030
+00300031003000300030
+00310030003000300030
+drop table t1;
+drop view v1;
+create table t1 (a mediumint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(9) YES NULL
+select hex(a) from v1;
+hex(a)
+0031
+drop table t1;
+drop view v1;
+create table t1 (a mediumint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(8) YES NULL
+select hex(a) from v1;
+hex(a)
+00300030003000300030003000300031
+00300030003000300030003000310030
+00300030003000300030003100300030
+00300030003000300031003000300030
+00300030003000310030003000300030
+drop table t1;
+drop view v1;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(11) YES NULL
+select hex(a) from v1;
+hex(a)
+0031
+drop table t1;
+drop view v1;
+create table t1 (a int zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(10) YES NULL
+select hex(a) from v1;
+hex(a)
+0030003000300030003000300030003000300031
+0030003000300030003000300030003000310030
+0030003000300030003000300030003100300030
+0030003000300030003000300031003000300030
+0030003000300030003000310030003000300030
+drop table t1;
+drop view v1;
+create table t1 (a bigint);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(20) YES NULL
+select hex(a) from v1;
+hex(a)
+0031
+drop table t1;
+drop view v1;
+create table t1 (a bigint zerofill);
+insert into t1 values (1), (10), (100), (1000), (10000);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(20) YES NULL
+select hex(a) from v1;
+hex(a)
+00300030003000300030003000300030003000300030003000300030003000300030003000300031
+00300030003000300030003000300030003000300030003000300030003000300030003000310030
+00300030003000300030003000300030003000300030003000300030003000300030003100300030
+00300030003000300030003000300030003000300030003000300030003000300031003000300030
+00300030003000300030003000300030003000300030003000300030003000310030003000300030
+drop table t1;
+drop view v1;
+create table t1 (a float);
+insert into t1 values (123.456);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+003100320033002E003400350036
+drop table t1;
+drop view v1;
+create table t1 (a float zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(12) YES NULL
+select hex(a) from v1;
+hex(a)
+0030003000300030003000300030003000300031002E0031
+0030003000300030003000300030003000310030002E0031
+0030003000300030003000300030003100300030002E0031
+0030003000300030003000300031003000300030002E0031
+0030003000300030003000310030003000300030002E0031
+drop table t1;
+drop view v1;
+create table t1 (a double);
+insert into t1 values (123.456);
+select concat(a) from t1;
+concat(a)
+123.456
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(22) YES NULL
+select hex(a) from v1;
+hex(a)
+003100320033002E003400350036
+drop table t1;
+drop view v1;
+create table t1 (a double zerofill);
+insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(22) YES NULL
+select hex(a) from v1;
+hex(a)
+00300030003000300030003000300030003000300030003000300030003000300030003000300031002E0031
+00300030003000300030003000300030003000300030003000300030003000300030003000310030002E0031
+00300030003000300030003000300030003000300030003000300030003000300030003100300030002E0031
+00300030003000300030003000300030003000300030003000300030003000300031003000300030002E0031
+00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031
+drop table t1;
+drop view v1;
+create table t1 (a year(2));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(2) YES NULL
+select hex(a) from v1;
+hex(a)
+00300031
+drop table t1;
+drop view v1;
+create table t1 (a year);
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(4) YES NULL
+select hex(a) from v1;
+hex(a)
+0032003000300031
+drop table t1;
+drop view v1;
+create table t1 (a bit(64));
+insert into t1 values (1);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varbinary(64) YES NULL
+select hex(a) from v1;
+hex(a)
+0000000000000001
+drop table t1;
+drop view v1;
+create table t1 (a timestamp);
+insert into t1 values (0);
+insert into t1 values (20010203040506);
+insert into t1 values (19800203040506);
+insert into t1 values ('2001-02-03 04:05:06');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(19) NO
+select hex(a) from v1;
+hex(a)
+0030003000300030002D00300030002D00300030002000300030003A00300030003A00300030
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+0031003900380030002D00300032002D00300033002000300034003A00300035003A00300036
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+drop table t1;
+drop view v1;
+create table t1 (a date);
+insert into t1 values ('2001-02-03');
+insert into t1 values (20010203);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(10) YES NULL
+select hex(a) from v1;
+hex(a)
+0032003000300031002D00300032002D00300033
+0032003000300031002D00300032002D00300033
+drop table t1;
+drop view v1;
+create table t1 (a time);
+insert into t1 values (1);
+insert into t1 values ('01:02:03');
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(8) YES NULL
+select hex(a) from v1;
+hex(a)
+00300030003A00300030003A00300031
+00300031003A00300032003A00300033
+drop table t1;
+drop view v1;
+create table t1 (a datetime);
+insert into t1 values ('2001-02-03 04:05:06');
+insert into t1 values (20010203040506);
+create view v1(a) as select concat(a) from t1;
+show columns from v1;
+Field Type Null Key Default Extra
+a varchar(19) YES NULL
+select hex(a) from v1;
+hex(a)
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036
+drop table t1;
+drop view v1;
+create function f1 (par1 int) returns int
+begin
+return concat(par1);
+end|
+set @a= f1(1);
+select hex(@a);
+hex(@a)
+1
+select hex(concat(f1(1)));
+hex(concat(f1(1)))
+31
+create table t1 as select f1(1) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(1)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(1)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(11) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 decimal(18,2)) returns decimal(18,2)
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` decimal(18,2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(20) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 float) returns float
+begin
+return concat(par1);
+end|
+set @a= f1(123.45);
+select hex(@a);
+hex(@a)
+7B
+select hex(concat(f1(123.45)));
+hex(concat(f1(123.45)))
+3132332E3435
+create table t1 as select f1(123.45) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` float DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(123.45)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(12) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(123.45)) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(12) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+create function f1 (par1 date) returns date
+begin
+return concat(par1);
+end|
+set @a= f1(cast('2001-01-02' as date));
+select hex(@a);
+hex(@a)
+323030312D30312D3032
+select hex(concat(f1(cast('2001-01-02' as date))));
+hex(concat(f1(cast('2001-01-02' as date))))
+323030312D30312D3032
+create table t1 as select f1(cast('2001-01-02' as date)) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1;
+show columns from v1;
+Field Type Null Key Default Extra
+c1 varchar(10) YES NULL
+drop table t1;
+drop view v1;
+drop function f1;
+#
+# End of WL#2649 Number-to-string conversions
+#
+SET NAMES latin1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
new file mode 100644
index 00000000000..3c2fe316d71
--- /dev/null
+++ b/mysql-test/r/ctype_utf16.result
@@ -0,0 +1,1038 @@
+DROP TABLE IF EXISTS t1;
+#
+# Start of 5.5 tests
+#
+SET NAMES latin1;
+SET character_set_connection=utf16;
+select hex('a'), hex('a ');
+hex('a') hex('a ')
+0061 00610020
+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
+select hex(_utf16 0x44);
+hex(_utf16 0x44)
+00000044
+select hex(_utf16 0x3344);
+hex(_utf16 0x3344)
+3344
+select hex(_utf16 0x113344);
+hex(_utf16 0x113344)
+000000113344
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+0420
+2004
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+0420
+2004
+DELETE FROM t1;
+INSERT INTO t1 VALUES (X'042000200020',X'042000200020'), (X'200400200020', X'200400200020');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+042000200020
+200400200020
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+0420
+2004
+DROP TABLE t1;
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'0421'));
+hex(LPAD(_utf16 X'0420',10,_utf16 X'0421'))
+0421042104210421042104210421042104210420
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422'))
+0421042204210422042104220421042204210420
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423'))
+0421042204230421042204230421042204230420
+SELECT hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'))
+0420042104220423042404250426042704280429
+SELECT hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'))
+042104210421042104210421042104210421D800DC00
+SELECT hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'))
+D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC000421
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'0421'));
+hex(RPAD(_utf16 X'0420',10,_utf16 X'0421'))
+0420042104210421042104210421042104210421
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422'))
+0420042104220421042204210422042104220421
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423'))
+0420042104220423042104220423042104220423
+SELECT hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'))
+0420042104220423042404250426042704280429
+SELECT hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'))
+D800DC00042104210421042104210421042104210421
+SELECT hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'))
+0421D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00
+CREATE TABLE t1 SELECT
+LPAD(_utf16 X'0420',10,_utf16 X'0421') l,
+RPAD(_utf16 X'0420',10,_utf16 X'0421') r;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `l` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT '',
+ `r` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(l), hex(r) from t1;
+hex(l) hex(r)
+0421042104210421042104210421042104210420 0420042104210421042104210421042104210421
+DROP TABLE t1;
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+lpad(f1, 12, "-o-/")
+-o-/-o103000
+-o-/22720000
+-o-/-3401200
+-o-/-o-78000
+drop table t1;
+SET NAMES latin1;
+SET character_set_connection=utf16;
+select @@collation_connection;
+@@collation_connection
+utf16_general_ci
+create table t1 as select repeat(' ',10) as a union select null;
+alter table t1 add key(a);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf16 DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 43 NULL 1 Using where; Using index
+explain select * from t1 where a like concat('abc','%');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 43 NULL 1 Using where; Using index
+select * from t1 where a like "abc%";
+a
+abc
+abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
+select * from t1 where a like "ABC%";
+a
+abc
+abcd
+select * from t1 where a like "test%";
+a
+test
+select * from t1 where a like "te_t";
+a
+test
+select * from t1 where a like "%a%";
+a
+a
+abc
+abcd
+select * from t1 where a like "%abcd%";
+a
+abcd
+select * from t1 where a like "%abc\d%";
+a
+abcd
+drop table t1;
+select 'AA' like 'AA';
+'AA' like 'AA'
+1
+select 'AA' like 'A%A';
+'AA' like 'A%A'
+1
+select 'AA' like 'A%%A';
+'AA' like 'A%%A'
+1
+select 'AA' like 'AA%';
+'AA' like 'AA%'
+1
+select 'AA' like '%AA%';
+'AA' like '%AA%'
+1
+select 'AA' like '%A';
+'AA' like '%A'
+1
+select 'AA' like '%AA';
+'AA' like '%AA'
+1
+select 'AA' like 'A%A%';
+'AA' like 'A%A%'
+1
+select 'AA' like '_%_%';
+'AA' like '_%_%'
+1
+select 'AA' like '%A%A';
+'AA' like '%A%A'
+1
+select 'AAA'like 'A%A%A';
+'AAA'like 'A%A%A'
+1
+select 'AZ' like 'AZ';
+'AZ' like 'AZ'
+1
+select 'AZ' like 'A%Z';
+'AZ' like 'A%Z'
+1
+select 'AZ' like 'A%%Z';
+'AZ' like 'A%%Z'
+1
+select 'AZ' like 'AZ%';
+'AZ' like 'AZ%'
+1
+select 'AZ' like '%AZ%';
+'AZ' like '%AZ%'
+1
+select 'AZ' like '%Z';
+'AZ' like '%Z'
+1
+select 'AZ' like '%AZ';
+'AZ' like '%AZ'
+1
+select 'AZ' like 'A%Z%';
+'AZ' like 'A%Z%'
+1
+select 'AZ' like '_%_%';
+'AZ' like '_%_%'
+1
+select 'AZ' like '%A%Z';
+'AZ' like '%A%Z'
+1
+select 'AZ' like 'A_';
+'AZ' like 'A_'
+1
+select 'AZ' like '_Z';
+'AZ' like '_Z'
+1
+select 'AMZ'like 'A%M%Z';
+'AMZ'like 'A%M%Z'
+1
+SET NAMES utf8;
+SET character_set_connection=utf16;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
+INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
+INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ');
+SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапРолдж
+фывапрОлдж
+фывапроЛдж
+фывапролДж
+фывапролдЖ
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапРолдж
+фывапрОлдж
+фывапроЛдж
+фывапролДж
+фывапролдЖ
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапРолдж
+фывапрОлдж
+фывапроЛдж
+фывапролДж
+фывапролдЖ
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf16_bin ORDER BY BINARY a;
+a
+фЫва
+фЫвапролдж
+DROP TABLE t1;
+CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
+ENGINE=MyISAM CHARACTER SET utf16;
+INSERT INTO t1 (word) VALUES ("cat");
+SELECT * FROM t1 WHERE word LIKE "c%";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "ca_";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "cat";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630025';
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630061005F';
+word
+cat
+DROP TABLE t1;
+select insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066);
+insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066)
+abc
+select insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066);
+insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066)
+defc
+SET NAMES latin1;
+CREATE TABLE t1 (
+word VARCHAR(64),
+bar INT(11) default 0,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf16
+COLLATE utf16_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+SELECT * FROM t1 ORDER BY word;
+word bar
+a 0
+aar 0
+aardvar 0
+aardvara 0
+aardvark 0
+aardvarz 0
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 258 NULL 6 Using index
+SELECT word FROM t1 ORDER by word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word VARCHAR(64) ,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf16
+COLLATE utf16_general_ci;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY WORD;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 258 NULL 6 Using index
+SELECT * FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word TEXT,
+bar INT(11) AUTO_INCREMENT,
+PRIMARY KEY (bar))
+ENGINE=MyISAM
+CHARSET utf16
+COLLATE utf16_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a" );
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+SELECT * FROM t1 ORDER BY word;
+word bar
+a 2
+aar 1
+aardvar 3
+aardvara 5
+aardvark 4
+aardvarz 6
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+SELECT word FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+SELECT hex(cast(0xAA as char character set utf16));
+hex(cast(0xAA as char character set utf16))
+000000AA
+SELECT hex(convert(0xAA using utf16));
+hex(convert(0xAA using utf16))
+000000AA
+CREATE TABLE t1 (a char(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a text character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a mediumtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a longtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+create table t1(a char(1)) default charset utf16;
+insert into t1 values ('a'),('b'),('c');
+alter table t1 modify a char(5);
+select a, hex(a) from t1;
+a hex(a)
+a 0061
+b 0062
+c 0063
+drop table t1;
+set @ivar= 1234;
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using utf16);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+?
+1234
+set names utf8;
+create table t1 (a enum('x','y','z') character set utf16);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('x','y','z') CHARACTER SET utf16 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 utf16;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf16 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 utf16);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` set('x','y','z','ä','ö','ü') CHARACTER SET utf16 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 utf16;
+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 NAMES latin1;
+SET collation_connection='utf16_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)
+utf16_general_ci 00610009
+utf16_general_ci 0061
+utf16_general_ci 00610020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf16_general_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+SET NAMES latin1;
+SET collation_connection='utf16_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)
+utf16_bin 00610009
+utf16_bin 0061
+utf16_bin 00610020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf16_bin
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+select hex(substr(_utf16 0x00e400e50068,1));
+hex(substr(_utf16 0x00e400e50068,1))
+00E400E50068
+select hex(substr(_utf16 0x00e400e50068,2));
+hex(substr(_utf16 0x00e400e50068,2))
+00E50068
+select hex(substr(_utf16 0x00e400e50068,3));
+hex(substr(_utf16 0x00e400e50068,3))
+0068
+select hex(substr(_utf16 0x00e400e50068,-1));
+hex(substr(_utf16 0x00e400e50068,-1))
+0068
+select hex(substr(_utf16 0x00e400e50068,-2));
+hex(substr(_utf16 0x00e400e50068,-2))
+00E50068
+select hex(substr(_utf16 0x00e400e50068,-3));
+hex(substr(_utf16 0x00e400e50068,-3))
+00E400E50068
+select hex(substr(_utf16 0x00e400e5D800DC00,1));
+hex(substr(_utf16 0x00e400e5D800DC00,1))
+00E400E5D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,2));
+hex(substr(_utf16 0x00e400e5D800DC00,2))
+00E5D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,3));
+hex(substr(_utf16 0x00e400e5D800DC00,3))
+D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,-1));
+hex(substr(_utf16 0x00e400e5D800DC00,-1))
+D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,-2));
+hex(substr(_utf16 0x00e400e5D800DC00,-2))
+00E5D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,-3));
+hex(substr(_utf16 0x00e400e5D800DC00,-3))
+00E400E5D800DC00
+SET NAMES latin1;
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+create table t1 (
+a char(10) character set utf16 not null,
+index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+explain select hex(a) from t1 order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 40 NULL 3 Using index
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+drop table t1;
+CREATE TABLE t1 (
+status enum('active','passive') character set utf16 collate utf16_general_ci
+NOT NULL default 'passive'
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `status` enum('active','passive') CHARACTER SET utf16 NOT NULL DEFAULT 'passive'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD a int NOT NULL AFTER status;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `status` enum('active','passive') CHARACTER SET utf16 NOT NULL DEFAULT 'passive',
+ `a` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+End of 4.1 tests
+CREATE TABLE t1 (a varchar(64) character set utf16, b decimal(10,3));
+INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
+update t1 set b=a;
+SELECT *, hex(a) FROM t1;
+a b hex(a)
+1.1 1.100 0031002E0031
+2.1 2.100 0032002E0031
+DROP TABLE t1;
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+set names latin1;
+set character_set_connection=utf16;
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb')
+ H000 H4142 I51231
+select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
+hex(soundex('')) hex(soundex('he')) hex(soundex('hello all folks')) hex(soundex('#3556 in bugdb'))
+ 0048003000300030 00480034003100340032 004900350031003200330031
+select 'mood' sounds like 'mud';
+'mood' sounds like 'mud'
+1
+select hex(soundex(_utf16 0x041004110412));
+hex(soundex(_utf16 0x041004110412))
+0410003000300030
+select hex(soundex(_utf16 0x00BF00C0));
+hex(soundex(_utf16 0x00BF00C0))
+00C0003000300030
+set names latin1;
+create table t1(a blob, b text charset utf16);
+select data_type, character_octet_length, character_maximum_length
+from information_schema.columns where table_name='t1';
+data_type character_octet_length character_maximum_length
+blob 65535 65535
+text 65535 32767
+drop table t1;
+set names latin1;
+set collation_connection=utf16_general_ci;
+select position('bb' in 'abba');
+position('bb' in 'abba')
+2
+create table t1 (a varchar(10) character set utf16) engine=heap;
+insert into t1 values ('a'),('A'),('b'),('B');
+select * from t1 where a='a' order by binary a;
+a
+A
+a
+select hex(min(binary a)),count(*) from t1 group by a;
+hex(min(binary a)) count(*)
+0041 2
+0042 2
+drop table t1;
+select char_length('abcd'), octet_length('abcd');
+char_length('abcd') octet_length('abcd')
+4 8
+select char_length(_utf16 0xD800DC00), octet_length(_utf16 0xD800DC00);
+char_length(_utf16 0xD800DC00) octet_length(_utf16 0xD800DC00)
+1 4
+select char_length(_utf16 0xD87FDFFF), octet_length(_utf16 0xD87FDFFF);
+char_length(_utf16 0xD87FDFFF) octet_length(_utf16 0xD87FDFFF)
+1 4
+select left('abcd',2);
+left('abcd',2)
+ab
+select hex(left(_utf16 0xD800DC00D87FDFFF, 1));
+hex(left(_utf16 0xD800DC00D87FDFFF, 1))
+D800DC00
+select hex(right(_utf16 0xD800DC00D87FDFFF, 1));
+hex(right(_utf16 0xD800DC00D87FDFFF, 1))
+D87FDFFF
+create table t1 (a varchar(10) character set utf16);
+insert into t1 values (_utf16 0xD800);
+ERROR HY000: Invalid utf16 character string: 'D800'
+insert into t1 values (_utf16 0xDC00);
+ERROR HY000: Invalid utf16 character string: 'DC00'
+insert into t1 values (_utf16 0xD800D800);
+ERROR HY000: Invalid utf16 character string: 'D800D8'
+insert into t1 values (_utf16 0xD800E800);
+ERROR HY000: Invalid utf16 character string: 'D800E8'
+insert into t1 values (_utf16 0xD8000800);
+ERROR HY000: Invalid utf16 character string: 'D80008'
+insert into t1 values (_utf16 0xD800DC00);
+insert into t1 values (_utf16 0xD800DCFF);
+insert into t1 values (_utf16 0xDBFFDC00);
+insert into t1 values (_utf16 0xDBFFDCFF);
+select hex(a) from t1;
+hex(a)
+D800DC00
+D800DCFF
+DBFFDC00
+DBFFDCFF
+drop table t1;
+create table t1 (s1 varchar(50) character set ucs2);
+insert into t1 values (0xdf84);
+alter table t1 modify column s1 varchar(50) character set utf16;
+Warnings:
+Warning 1366 Incorrect string value: '\xDF\x84' for column 's1' at row 1
+select hex(s1) from t1;
+hex(s1)
+003F
+drop table t1;
+create table t1 (s1 varchar(5) character set ucs2, s2 varchar(5) character set utf16);
+insert into t1 (s1) values (0xdf84);
+update t1 set s2 = s1;
+Warnings:
+Warning 1366 Incorrect string value: '\xDF\x84' for column 's2' at row 1
+select hex(s2) from t1;
+hex(s2)
+003F
+drop table t1;
+create table t1 (a char(10)) character set utf16;
+insert into t1 values ('a ');
+select hex(a) from t1;
+hex(a)
+0061
+drop table t1;
+select upper('abcd'), lower('ABCD');
+upper('abcd') lower('ABCD')
+ABCD abcd
+create table t1 (a varchar(10) character set utf16);
+insert into t1 values (123456);
+select a, hex(a) from t1;
+a hex(a)
+123456 003100320033003400350036
+drop table t1;
+select hex(soundex('a'));
+hex(soundex('a'))
+0041003000300030
+create table t1 (a enum ('a','b','c')) character set utf16;
+insert into t1 values ('1');
+select * from t1;
+a
+a
+drop table t1;
+set names latin1;
+select hex(conv(convert('123' using utf16), -10, 16));
+hex(conv(convert('123' using utf16), -10, 16))
+3742
+select hex(conv(convert('123' using utf16), 10, 16));
+hex(conv(convert('123' using utf16), 10, 16))
+3742
+set names latin1;
+set character_set_connection=utf16;
+select 1.1 + '1.2';
+1.1 + '1.2'
+2.3
+select 1.1 + '1.2xxx';
+1.1 + '1.2xxx'
+2.3
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+select left('aaa','1');
+left('aaa','1')
+a
+create table t1 (a int);
+insert into t1 values ('-1234.1e2');
+insert into t1 values ('-1234.1e2xxxx');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+insert into t1 values ('-1234.1e2 ');
+select * from t1;
+a
+-123410
+-123410
+-123410
+drop table t1;
+create table t1 (a int);
+insert into t1 values ('1 ');
+insert into t1 values ('1 x');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1;
+a
+1
+1
+drop table t1;
+create table t1 (a varchar(17000) character set utf16);
+Warnings:
+Note 1246 Converting column 'a' from VARCHAR to TEXT
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` mediumtext CHARACTER SET utf16
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(250) character set utf16 primary key);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(250) CHARACTER SET utf16 NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(334) character set utf16 primary key);
+ERROR 42000: Specified key was too long; max key length is 1000 bytes
+create table t1 (a char(1) character set utf16);
+insert into t1 values (0xD800DC00),(0xD800DCFF),(0xDB7FDC00),(0xDB7FDCFF);
+insert into t1 values (0x00C0), (0x00FF),(0xE000), (0xFFFF);
+select hex(a), hex(@a:=convert(a using utf8mb4)), hex(convert(@a using utf16)) from t1;
+hex(a) hex(@a:=convert(a using utf8mb4)) hex(convert(@a using utf16))
+D800DC00 F0908080 D800DC00
+D800DCFF F09083BF D800DCFF
+DB7FDC00 F3AFB080 DB7FDC00
+DB7FDCFF F3AFB3BF DB7FDCFF
+00C0 C380 00C0
+00FF C3BF 00FF
+E000 EE8080 E000
+FFFF EFBFBF FFFF
+drop table t1;
+set collation_connection=utf16_general_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) CHARACTER SET utf16 DEFAULT NULL,
+ `s2` varchar(64) CHARACTER SET utf16 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+set names latin1;
+SET collation_connection=utf16_general_ci;
+CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0;
+SET timestamp=1216359724;
+INSERT INTO t1 VALUES (current_date);
+INSERT INTO t1 VALUES (current_time);
+INSERT INTO t1 VALUES (current_timestamp);
+SELECT s1, hex(s1) FROM t1;
+s1 hex(s1)
+2008-07-18 0032003000300038002D00300037002D00310038
+08:42:04 00300038003A00340032003A00300034
+2008-07-18 08:42:04 0032003000300038002D00300037002D00310038002000300038003A00340032003A00300034
+DROP TABLE t1;
+SET timestamp=0;
+SET NAMES latin1;
+SET collation_connection=utf16_general_ci;
+CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(2) CHARACTER SET utf16 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE');
+SELECT * FROM t1 ORDER BY s1;
+s1
+ab
+ab
+AE
+AE
+SET max_sort_length=4;
+SELECT * FROM t1 ORDER BY s1;
+s1
+ab
+ab
+AE
+AE
+DROP TABLE t1;
+SET max_sort_length=DEFAULT;
+SET NAMES latin1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result
new file mode 100644
index 00000000000..d83ef2af09e
--- /dev/null
+++ b/mysql-test/r/ctype_utf16_uca.result
@@ -0,0 +1,2373 @@
+DROP TABLE IF EXISTS t1;
+#
+# Start of 5.5 tests
+#
+set names utf8;
+set collation_connection=utf16_unicode_ci;
+select hex('a'), hex('a ');
+hex('a') hex('a ')
+0061 00610020
+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'
+1 0 0
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0'
+1 0 0
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a '
+1 0 0
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0'
+1 0 0
+select 'a a' > 'a', 'a \0' < 'a';
+'a a' > 'a' 'a \0' < 'a'
+1 0
+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
+select 'c' like '\_' as want0;
+want0
+0
+CREATE TABLE t (
+c char(20) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARACTER SET utf16 COLLATE utf16_unicode_ci;
+INSERT INTO t VALUES ('a'),('ab'),('aba');
+ALTER TABLE t ADD INDEX (c);
+SELECT c FROM t WHERE c LIKE 'a%';
+c
+a
+ab
+aba
+DROP TABLE t;
+create table t1 (c1 char(10) character set utf16 collate utf16_bin);
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+insert into t1 values (0x00e0),(0x00c0);
+insert into t1 values (0x00e1),(0x00c1);
+insert into t1 values (0x00e2),(0x00c2);
+insert into t1 values (0x00e3),(0x00c3);
+insert into t1 values (0x00e4),(0x00c4);
+insert into t1 values (0x00e5),(0x00c5);
+insert into t1 values (0x00e6),(0x00c6);
+insert into t1 values (0x00e7),(0x00c7);
+insert into t1 values (0x00e8),(0x00c8);
+insert into t1 values (0x00e9),(0x00c9);
+insert into t1 values (0x00ea),(0x00ca);
+insert into t1 values (0x00eb),(0x00cb);
+insert into t1 values (0x00ec),(0x00cc);
+insert into t1 values (0x00ed),(0x00cd);
+insert into t1 values (0x00ee),(0x00ce);
+insert into t1 values (0x00ef),(0x00cf);
+insert into t1 values (0x00f0),(0x00d0);
+insert into t1 values (0x00f1),(0x00d1);
+insert into t1 values (0x00f2),(0x00d2);
+insert into t1 values (0x00f3),(0x00d3);
+insert into t1 values (0x00f4),(0x00d4);
+insert into t1 values (0x00f5),(0x00d5);
+insert into t1 values (0x00f6),(0x00d6);
+insert into t1 values (0x00f7),(0x00d7);
+insert into t1 values (0x00f8),(0x00d8);
+insert into t1 values (0x00f9),(0x00d9);
+insert into t1 values (0x00fa),(0x00da);
+insert into t1 values (0x00fb),(0x00db);
+insert into t1 values (0x00fc),(0x00dc);
+insert into t1 values (0x00fd),(0x00dd);
+insert into t1 values (0x00fe),(0x00de);
+insert into t1 values (0x00ff),(0x00df);
+insert into t1 values (0x0100),(0x0101),(0x0102),(0x0103);
+insert into t1 values (0x0104),(0x0105),(0x0106),(0x0107);
+insert into t1 values (0x0108),(0x0109),(0x010a),(0x010b);
+insert into t1 values (0x010c),(0x010d),(0x010e),(0x010f);
+insert into t1 values (0x0110),(0x0111),(0x0112),(0x0113);
+insert into t1 values (0x0114),(0x0115),(0x0116),(0x0117);
+insert into t1 values (0x0118),(0x0119),(0x011a),(0x011b);
+insert into t1 values (0x011c),(0x011d),(0x011e),(0x011f);
+insert into t1 values (0x0120),(0x0121),(0x0122),(0x0123);
+insert into t1 values (0x0124),(0x0125),(0x0126),(0x0127);
+insert into t1 values (0x0128),(0x0129),(0x012a),(0x012b);
+insert into t1 values (0x012c),(0x012d),(0x012e),(0x012f);
+insert into t1 values (0x0130),(0x0131),(0x0132),(0x0133);
+insert into t1 values (0x0134),(0x0135),(0x0136),(0x0137);
+insert into t1 values (0x0138),(0x0139),(0x013a),(0x013b);
+insert into t1 values (0x013c),(0x013d),(0x013e),(0x013f);
+insert into t1 values (0x0140),(0x0141),(0x0142),(0x0143);
+insert into t1 values (0x0144),(0x0145),(0x0146),(0x0147);
+insert into t1 values (0x0148),(0x0149),(0x014a),(0x014b);
+insert into t1 values (0x014c),(0x014d),(0x014e),(0x014f);
+insert into t1 values (0x0150),(0x0151),(0x0152),(0x0153);
+insert into t1 values (0x0154),(0x0155),(0x0156),(0x0157);
+insert into t1 values (0x0158),(0x0159),(0x015a),(0x015b);
+insert into t1 values (0x015c),(0x015d),(0x015e),(0x015f);
+insert into t1 values (0x0160),(0x0161),(0x0162),(0x0163);
+insert into t1 values (0x0164),(0x0165),(0x0166),(0x0167);
+insert into t1 values (0x0168),(0x0169),(0x016a),(0x016b);
+insert into t1 values (0x016c),(0x016d),(0x016e),(0x016f);
+insert into t1 values (0x0170),(0x0171),(0x0172),(0x0173);
+insert into t1 values (0x0174),(0x0175),(0x0176),(0x0177);
+insert into t1 values (0x0178),(0x0179),(0x017a),(0x017b);
+insert into t1 values (0x017c),(0x017d),(0x017e),(0x017f);
+insert into t1 values (0x0180),(0x0181),(0x0182),(0x0183);
+insert into t1 values (0x0184),(0x0185),(0x0186),(0x0187);
+insert into t1 values (0x0188),(0x0189),(0x018a),(0x018b);
+insert into t1 values (0x018c),(0x018d),(0x018e),(0x018f);
+insert into t1 values (0x0190),(0x0191),(0x0192),(0x0193);
+insert into t1 values (0x0194),(0x0195),(0x0196),(0x0197);
+insert into t1 values (0x0198),(0x0199),(0x019a),(0x019b);
+insert into t1 values (0x019c),(0x019d),(0x019e),(0x019f);
+insert into t1 values (0x01a0),(0x01a1),(0x01a2),(0x01a3);
+insert into t1 values (0x01a4),(0x01a5),(0x01a6),(0x01a7);
+insert into t1 values (0x01a8),(0x01a9),(0x01aa),(0x01ab);
+insert into t1 values (0x01ac),(0x01ad),(0x01ae),(0x01af);
+insert into t1 values (0x01b0),(0x01b1),(0x01b2),(0x01b3);
+insert into t1 values (0x01b4),(0x01b5),(0x01b6),(0x01b7);
+insert into t1 values (0x01b8),(0x01b9),(0x01ba),(0x01bb);
+insert into t1 values (0x01bc),(0x01bd),(0x01be),(0x01bf);
+insert into t1 values (0x01c0),(0x01c1),(0x01c2),(0x01c3);
+insert into t1 values (0x01c4),(0x01c5),(0x01c6),(0x01c7);
+insert into t1 values (0x01c8),(0x01c9),(0x01ca),(0x01cb);
+insert into t1 values (0x01cc),(0x01cd),(0x01ce),(0x01cf);
+insert into t1 values (0x01d0),(0x01d1),(0x01d2),(0x01d3);
+insert into t1 values (0x01d4),(0x01d5),(0x01d6),(0x01d7);
+insert into t1 values (0x01d8),(0x01d9),(0x01da),(0x01db);
+insert into t1 values (0x01dc),(0x01dd),(0x01de),(0x01df);
+insert into t1 values (0x01e0),(0x01e1),(0x01e2),(0x01e3);
+insert into t1 values (0x01e4),(0x01e5),(0x01e6),(0x01e7);
+insert into t1 values (0x01e8),(0x01e9),(0x01ea),(0x01eb);
+insert into t1 values (0x01ec),(0x01ed),(0x01ee),(0x01ef);
+insert into t1 values (0x01f0),(0x01f1),(0x01f2),(0x01f3);
+insert into t1 values (0x01f4),(0x01f5),(0x01f6),(0x01f7);
+insert into t1 values (0x01f8),(0x01f9),(0x01fa),(0x01fb);
+insert into t1 values (0x01fc),(0x01fd),(0x01fe),(0x01ff);
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_icelandic_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÂÃàâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Áá
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Ðð
+Đđ
+Ƌƌ
+EeÈÊËèêëĒēĔĕĖėĘęĚě
+Éé
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÎÏìîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Íí
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÔÕòôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÛÜùûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Úú
+Vv
+WwŴŵ
+Xx
+YyÿŶŷŸ
+Ýý
+Ƴƴ
+ZzŹźŻżŽž
+Þþ
+ÄÆäæ
+ÖØöø
+Åå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_latvian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġǦǧǴǵ
+Ģģ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Yy
+JjĴĵǰ
+KkǨǩ
+Ķķ
+Ƙƙ
+LlĹ弾
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Ļļ
+Łł
+Mm
+NnÑñŃńŇňǸǹ
+NJNjnJnjNJNjnj
+Ņņ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŘř
+RRRrrRrr
+Ŗŗ
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_romanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ăă
+Ââ
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÏìíïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Îî
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŤť
+Ţţ
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovenian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_polish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂăǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ąą
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĈĉĊċČč
+CHChcHch
+Ćć
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĚě
+Ęę
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ńń
+Ŋŋ
+OoÒÔÕÖòôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŜŝŞşŠšſ
+SSSssSssß
+Śś
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŽž
+Źź
+Żż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_estonian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdz
+DŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔòóôŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+Zz
+Žž
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Õõ
+Ää
+Öö
+Üü
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ŹźŻż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_swedish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Åå
+ÄÆäæ
+ÖØöø
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_turkish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcĆćĈĉĊċČč
+CHChcHch
+Çç
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĠġĢģǦǧǴǵ
+Ğğ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+Iı
+IJIj
+ƕǶ
+Ħħ
+iÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+iJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Öö
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Üü
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_czech_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗ
+RRRrrRrr
+Řř
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_danish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+aA
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŰűŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+ÄÆäæ
+ÖØöøŐő
+AAAaaaÅå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_lithuanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CCHChcchÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IYiyÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovak_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ää
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÕÖòóõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ôô
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish2_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+cH
+CHChch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+lL
+LLLlll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IJijÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJij
+IJij
+Ĵĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJlj
+LJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnj
+NJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+ÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+UVuv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĊċČč
+CHChcHch
+Ĉĉ
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĞğĠġĢģǦǧǴǵ
+Ĝĝ
+Ǥǥ
+Ƣƣ
+Hh
+Ĥĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Jjǰ
+Ĵĵ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŞşŠšſ
+SSSssSssß
+Ŝŝ
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Ŭŭ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ÖöŐő
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+ÜüŰű
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+drop table t1;
+SET NAMES utf8;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_general_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_general_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+SET NAMES utf8;
+SET @test_character_set='utf16';
+SET @test_collation='utf16_swedish_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
+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) utf16_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) utf16_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;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
+drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) COLLATE utf16_swedish_ci DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf16 COLLATE=utf16_swedish_ci
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
+SET collation_connection='utf16_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)
+utf16_unicode_ci 00610009
+utf16_unicode_ci 0061
+utf16_unicode_ci 00610020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf16_unicode_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+End of 4.1 tests
+CREATE TABLE t1 (id int, a varchar(30) character set utf16);
+INSERT INTO t1 VALUES (1, 0x01310069), (2, 0x01310131);
+INSERT INTO t1 VALUES (3, 0x00690069), (4, 0x01300049);
+INSERT INTO t1 VALUES (5, 0x01300130), (6, 0x00490049);
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a la l ll u lu
+ıi 4 ıi 4 II 4
+ıı 4 ıı 4 II 4
+ii 4 ii 4 II 4
+İI 4 ii 4 İI 4
+İİ 4 ii 4 İİ 4
+II 4 ii 4 II 4
+ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf16 collate utf16_turkish_ci;
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a la l ll u lu
+ıi 4 ıi 4 Iİ 4
+ıı 4 ıı 4 II 4
+ii 4 ii 4 İİ 4
+İI 4 iı 4 İI 4
+İİ 4 ii 4 İİ 4
+II 4 ıı 4 II 4
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 text character set utf16 collate utf16_polish_ci NOT NULL
+) ENGINE=MyISAM;
+insert into t1 values (''),('a');
+SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
+COUNT(*) c1
+1
+1 a
+DROP TABLE IF EXISTS t1;
+set collation_connection=utf16_unicode_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) CHARACTER SET utf16 COLLATE utf16_unicode_ci DEFAULT NULL,
+ `s2` varchar(64) CHARACTER SET utf16 COLLATE utf16_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result
new file mode 100644
index 00000000000..f0f10be9743
--- /dev/null
+++ b/mysql-test/r/ctype_utf32.result
@@ -0,0 +1,1052 @@
+DROP TABLE IF EXISTS t1;
+#
+# Start of 5.5 tests
+#
+SET NAMES latin1;
+SET character_set_connection=utf32;
+select hex('a'), hex('a ');
+hex('a') hex('a ')
+00000061 0000006100000020
+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
+select hex(_utf32 0x44);
+hex(_utf32 0x44)
+00000044
+select hex(_utf32 0x3344);
+hex(_utf32 0x3344)
+00003344
+select hex(_utf32 0x103344);
+hex(_utf32 0x103344)
+00103344
+select hex(_utf32 X'44');
+hex(_utf32 X'44')
+00000044
+select hex(_utf32 X'3344');
+hex(_utf32 X'3344')
+00003344
+select hex(_utf32 X'103344');
+hex(_utf32 X'103344')
+00103344
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+00000420
+00002004
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+00000420
+00002004
+DELETE FROM t1;
+INSERT INTO t1 VALUES
+(X'000004200000002000000020',X'000004200000002000000020'),
+(X'000020040000002000000020',X'000020040000002000000020');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+000004200000002000000020
+000020040000002000000020
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+00000420
+00002004
+DROP TABLE t1;
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0421'));
+hex(LPAD(_utf32 X'0420',10,_utf32 X'0421'))
+00000421000004210000042100000421000004210000042100000421000004210000042100000420
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'))
+00000421000004220000042100000422000004210000042200000421000004220000042100000420
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'))
+00000421000004220000042300000421000004220000042300000421000004220000042300000420
+SELECT hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'))
+00000420000004210000042200000423000004240000042500000426000004270000042800000429
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0421'));
+hex(RPAD(_utf32 X'0420',10,_utf32 X'0421'))
+00000420000004210000042100000421000004210000042100000421000004210000042100000421
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'))
+00000420000004210000042200000421000004220000042100000422000004210000042200000421
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'))
+00000420000004210000042200000423000004210000042200000423000004210000042200000423
+SELECT hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'))
+00000420000004210000042200000423000004240000042500000426000004270000042800000429
+CREATE TABLE t1 SELECT
+LPAD(_utf32 X'0420',10,_utf32 X'0421') l,
+RPAD(_utf32 X'0420',10,_utf32 X'0421') r;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `l` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT '',
+ `r` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(l), hex(r) from t1;
+hex(l) hex(r)
+00000421000004210000042100000421000004210000042100000421000004210000042100000420 00000420000004210000042100000421000004210000042100000421000004210000042100000421
+DROP TABLE t1;
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+lpad(f1, 12, "-o-/")
+-o-/-o103000
+-o-/22720000
+-o-/-3401200
+-o-/-o-78000
+drop table t1;
+SET NAMES latin1;
+SET character_set_connection=utf32;
+select @@collation_connection;
+@@collation_connection
+utf32_general_ci
+create table t1 as select repeat(' ',10) as a union select null;
+alter table t1 add key(a);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf32 DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 43 NULL 1 Using where; Using index
+explain select * from t1 where a like concat('abc','%');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 43 NULL 1 Using where; Using index
+select * from t1 where a like "abc%";
+a
+abc
+abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
+select * from t1 where a like "ABC%";
+a
+abc
+abcd
+select * from t1 where a like "test%";
+a
+test
+select * from t1 where a like "te_t";
+a
+test
+select * from t1 where a like "%a%";
+a
+a
+abc
+abcd
+select * from t1 where a like "%abcd%";
+a
+abcd
+select * from t1 where a like "%abc\d%";
+a
+abcd
+drop table t1;
+select 'AA' like 'AA';
+'AA' like 'AA'
+1
+select 'AA' like 'A%A';
+'AA' like 'A%A'
+1
+select 'AA' like 'A%%A';
+'AA' like 'A%%A'
+1
+select 'AA' like 'AA%';
+'AA' like 'AA%'
+1
+select 'AA' like '%AA%';
+'AA' like '%AA%'
+1
+select 'AA' like '%A';
+'AA' like '%A'
+1
+select 'AA' like '%AA';
+'AA' like '%AA'
+1
+select 'AA' like 'A%A%';
+'AA' like 'A%A%'
+1
+select 'AA' like '_%_%';
+'AA' like '_%_%'
+1
+select 'AA' like '%A%A';
+'AA' like '%A%A'
+1
+select 'AAA'like 'A%A%A';
+'AAA'like 'A%A%A'
+1
+select 'AZ' like 'AZ';
+'AZ' like 'AZ'
+1
+select 'AZ' like 'A%Z';
+'AZ' like 'A%Z'
+1
+select 'AZ' like 'A%%Z';
+'AZ' like 'A%%Z'
+1
+select 'AZ' like 'AZ%';
+'AZ' like 'AZ%'
+1
+select 'AZ' like '%AZ%';
+'AZ' like '%AZ%'
+1
+select 'AZ' like '%Z';
+'AZ' like '%Z'
+1
+select 'AZ' like '%AZ';
+'AZ' like '%AZ'
+1
+select 'AZ' like 'A%Z%';
+'AZ' like 'A%Z%'
+1
+select 'AZ' like '_%_%';
+'AZ' like '_%_%'
+1
+select 'AZ' like '%A%Z';
+'AZ' like '%A%Z'
+1
+select 'AZ' like 'A_';
+'AZ' like 'A_'
+1
+select 'AZ' like '_Z';
+'AZ' like '_Z'
+1
+select 'AMZ'like 'A%M%Z';
+'AMZ'like 'A%M%Z'
+1
+SET NAMES utf8;
+SET character_set_connection=utf32;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
+INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
+INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ');
+SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапРолдж
+фывапрОлдж
+фывапроЛдж
+фывапролДж
+фывапролдЖ
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапРолдж
+фывапрОлдж
+фывапроЛдж
+фывапролДж
+фывапролдЖ
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапРолдж
+фывапрОлдж
+фывапроЛдж
+фывапролДж
+фывапролдЖ
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf32_bin ORDER BY BINARY a;
+a
+фЫва
+фЫвапролдж
+DROP TABLE t1;
+CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
+ENGINE=MyISAM CHARACTER SET utf32;
+INSERT INTO t1 (word) VALUES ("cat");
+SELECT * FROM t1 WHERE word LIKE "c%";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "ca_";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "cat";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf32 x'0000006300000025';
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf32 x'00000063000000610000005F';
+word
+cat
+DROP TABLE t1;
+select insert(_utf32 0x000000610000006200000063,10,2,_utf32 0x000000640000006500000066);
+insert(_utf32 0x000000610000006200000063,10,2,_utf32 0x000000640000006500000066)
+abc
+select insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066);
+insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066)
+defc
+SET NAMES latin1;
+CREATE TABLE t1 (
+word VARCHAR(64),
+bar INT(11) default 0,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf32
+COLLATE utf32_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+SELECT * FROM t1 ORDER BY word;
+word bar
+a 0
+aar 0
+aardvar 0
+aardvara 0
+aardvark 0
+aardvarz 0
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 258 NULL 6 Using index
+SELECT word FROM t1 ORDER by word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word VARCHAR(64) ,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf32
+COLLATE utf32_general_ci;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY WORD;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 258 NULL 6 Using index
+SELECT * FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word TEXT,
+bar INT(11) AUTO_INCREMENT,
+PRIMARY KEY (bar))
+ENGINE=MyISAM
+CHARSET utf32
+COLLATE utf32_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a" );
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+SELECT * FROM t1 ORDER BY word;
+word bar
+a 2
+aar 1
+aardvar 3
+aardvara 5
+aardvark 4
+aardvarz 6
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+SELECT word FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+SELECT hex(cast(0xAA as char character set utf32));
+hex(cast(0xAA as char character set utf32))
+000000AA
+SELECT hex(convert(0xAA using utf32));
+hex(convert(0xAA using utf32))
+000000AA
+CREATE TABLE t1 (a char(10) character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(10) character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a text character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a mediumtext character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a longtext character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+create table t1(a char(1)) default charset utf32;
+insert into t1 values ('a'),('b'),('c');
+alter table t1 modify a char(5);
+select a, hex(a) from t1;
+a hex(a)
+a 00000061
+b 00000062
+c 00000063
+drop table t1;
+set @ivar= 1234;
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using utf32);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+?
+1234
+set names utf8;
+create table t1 (a enum('x','y','z') character set utf32);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('x','y','z') CHARACTER SET utf32 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 00000078
+y 00000079
+z 0000007A
+alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set utf32;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf32 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 00000078
+y 00000079
+z 0000007A
+d 00000064
+e 00000065
+ä 000000E4
+ö 000000F6
+ü 000000FC
+drop table t1;
+create table t1 (a set ('x','y','z','ä','ö','ü') character set utf32);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` set('x','y','z','ä','ö','ü') CHARACTER SET utf32 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 00000078
+y 00000079
+x,y 000000780000002C00000079
+z 0000007A
+x,y,z,ä,ö,ü 000000780000002C000000790000002C0000007A0000002C000000E40000002C000000F60000002C000000FC
+drop table t1;
+create table t1(a enum('a','b','c')) default character set utf32;
+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 NAMES latin1;
+SET collation_connection='utf32_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)
+utf32_general_ci 0000006100000009
+utf32_general_ci 00000061
+utf32_general_ci 0000006100000020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf32_general_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+SET NAMES latin1;
+SET collation_connection='utf32_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)
+utf32_bin 0000006100000009
+utf32_bin 00000061
+utf32_bin 0000006100000020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf32_bin
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+select hex(substr(_utf32 0x000000e4000000e500000068,1));
+hex(substr(_utf32 0x000000e4000000e500000068,1))
+000000E4000000E500000068
+select hex(substr(_utf32 0x000000e4000000e500000068,2));
+hex(substr(_utf32 0x000000e4000000e500000068,2))
+000000E500000068
+select hex(substr(_utf32 0x000000e4000000e500000068,3));
+hex(substr(_utf32 0x000000e4000000e500000068,3))
+00000068
+select hex(substr(_utf32 0x000000e4000000e500000068,-1));
+hex(substr(_utf32 0x000000e4000000e500000068,-1))
+00000068
+select hex(substr(_utf32 0x000000e4000000e500000068,-2));
+hex(substr(_utf32 0x000000e4000000e500000068,-2))
+000000E500000068
+select hex(substr(_utf32 0x000000e4000000e500000068,-3));
+hex(substr(_utf32 0x000000e4000000e500000068,-3))
+000000E4000000E500000068
+CREATE TABLE t1 (
+a varchar(250) NOT NULL default '',
+KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE utf32_general_ci;
+insert into t1 values (0x803d);
+insert into t1 values (0x005b);
+select hex(a) from t1;
+hex(a)
+0000005B
+0000803D
+drop table t1;
+create table t1 (utext varchar(20) character set utf32);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+create table t1 (
+a char(10) character set utf32 not null,
+index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x0000201f, 10));
+insert into t1 values (repeat(0x00002020, 10));
+insert into t1 values (repeat(0x00002021, 10));
+explain select hex(a) from t1 order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 40 NULL 3 Using index
+select hex(a) from t1 order by a;
+hex(a)
+0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F
+00002020000020200000202000002020000020200000202000002020000020200000202000002020
+00002021000020210000202100002021000020210000202100002021000020210000202100002021
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+hex(a)
+0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F
+00002020000020200000202000002020000020200000202000002020000020200000202000002020
+00002021000020210000202100002021000020210000202100002021000020210000202100002021
+drop table t1;
+CREATE TABLE t1 (
+status enum('active','passive') character set utf32 collate utf32_general_ci
+NOT NULL default 'passive'
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `status` enum('active','passive') CHARACTER SET utf32 NOT NULL DEFAULT 'passive'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD a int NOT NULL AFTER status;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `status` enum('active','passive') CHARACTER SET utf32 NOT NULL DEFAULT 'passive',
+ `a` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+End of 4.1 tests
+CREATE TABLE t1 (a varchar(64) character set utf32, b decimal(10,3));
+INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
+update t1 set b=a;
+SELECT *, hex(a) FROM t1;
+a b hex(a)
+1.1 1.100 000000310000002E00000031
+2.1 2.100 000000320000002E00000031
+DROP TABLE t1;
+create table t1 (utext varchar(20) character set utf32);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+set names latin1;
+set character_set_connection=utf32;
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb')
+ H000 H4142 I51231
+select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
+hex(soundex('')) hex(soundex('he')) hex(soundex('hello all folks')) hex(soundex('#3556 in bugdb'))
+ 00000048000000300000003000000030 0000004800000034000000310000003400000032 000000490000003500000031000000320000003300000031
+select 'mood' sounds like 'mud';
+'mood' sounds like 'mud'
+1
+select hex(soundex(_utf32 0x000004100000041100000412));
+hex(soundex(_utf32 0x000004100000041100000412))
+00000410000000300000003000000030
+select hex(soundex(_utf32 0x000000BF000000C0));
+hex(soundex(_utf32 0x000000BF000000C0))
+000000C0000000300000003000000030
+set names latin1;
+create table t1(a blob, b text charset utf32);
+select data_type, character_octet_length, character_maximum_length
+from information_schema.columns where table_name='t1';
+data_type character_octet_length character_maximum_length
+blob 65535 65535
+text 65535 16383
+drop table t1;
+set names latin1;
+set collation_connection=utf32_general_ci;
+select position('bb' in 'abba');
+position('bb' in 'abba')
+2
+create table t1 (a varchar(10) character set utf32) engine=heap;
+insert into t1 values ('a'),('A'),('b'),('B');
+select * from t1 where a='a' order by binary a;
+a
+A
+a
+select hex(min(binary a)),count(*) from t1 group by a;
+hex(min(binary a)) count(*)
+00000041 2
+00000042 2
+drop table t1;
+select char_length('abcd'), octet_length('abcd');
+char_length('abcd') octet_length('abcd')
+4 16
+select left('abcd',2);
+left('abcd',2)
+ab
+create table t1 (a varchar(10) character set utf32);
+insert into t1 values (_utf32 0x0010FFFF);
+insert into t1 values (_utf32 0x00110000);
+ERROR HY000: Invalid utf32 character string: '001100'
+insert into t1 values (_utf32 0x00110101);
+ERROR HY000: Invalid utf32 character string: '001101'
+insert into t1 values (_utf32 0x01000101);
+ERROR HY000: Invalid utf32 character string: '010001'
+insert into t1 values (_utf32 0x11000101);
+ERROR HY000: Invalid utf32 character string: '110001'
+select hex(a) from t1;
+hex(a)
+0010FFFF
+drop table t1;
+create table t1 (utf32 varchar(2) character set utf32);
+Wrong character with pad
+insert into t1 values (0x110000);
+Warnings:
+Warning 1366 Incorrect string value: '\x11\x00\x00' for column 'utf32' at row 1
+Wrong chsaracter without pad
+insert into t1 values (0x00110000);
+Warnings:
+Warning 1366 Incorrect string value: '\x00\x11\x00\x00' for column 'utf32' at row 1
+Wrong character with pad followed by another wrong character
+insert into t1 values (0x11000000110000);
+Warnings:
+Warning 1366 Incorrect string value: '\x11\x00\x00\x00\x11\x00...' for column 'utf32' at row 1
+Good character with pad followed by bad character
+insert into t1 values (0x10000000110000);
+Warnings:
+Warning 1366 Incorrect string value: '\x00\x11\x00\x00' for column 'utf32' at row 1
+Good character without pad followed by bad character
+insert into t1 values (0x0010000000110000);
+Warnings:
+Warning 1366 Incorrect string value: '\x00\x11\x00\x00' for column 'utf32' at row 1
+Wrong character with the second byte higher than 0x10
+insert into t1 values (0x00800037);
+Warnings:
+Warning 1366 Incorrect string value: '\x00\x80\x007' for column 'utf32' at row 1
+Wrong character with pad with the second byte higher than 0x10
+insert into t1 values (0x00800037);
+Warnings:
+Warning 1366 Incorrect string value: '\x00\x80\x007' for column 'utf32' at row 1
+drop table t1;
+select _utf32'a' collate utf32_general_ci = 0xfffd;
+_utf32'a' collate utf32_general_ci = 0xfffd
+0
+select hex(concat(_utf32 0x0410 collate utf32_general_ci, 0x61));
+hex(concat(_utf32 0x0410 collate utf32_general_ci, 0x61))
+0000041000000061
+create table t1 (s1 varchar(5) character set utf32);
+insert into t1 values (0xfffd);
+select case when s1 = 0xfffd then 1 else 0 end from t1;
+case when s1 = 0xfffd then 1 else 0 end
+1
+select hex(s1) from t1 where s1 = 0xfffd;
+hex(s1)
+0000FFFD
+drop table t1;
+create table t1 (a char(10)) character set utf32;
+insert into t1 values ('a ');
+select hex(a) from t1;
+hex(a)
+00000061
+drop table t1;
+select upper('abcd'), lower('ABCD');
+upper('abcd') lower('ABCD')
+ABCD abcd
+create table t1 (a varchar(10) character set utf32);
+insert into t1 values (123456);
+select a, hex(a) from t1;
+a hex(a)
+123456 000000310000003200000033000000340000003500000036
+drop table t1;
+select hex(soundex('a'));
+hex(soundex('a'))
+00000041000000300000003000000030
+create table t1 (a enum ('a','b','c')) character set utf32;
+insert into t1 values ('1');
+select * from t1;
+a
+a
+drop table t1;
+set names latin1;
+select hex(conv(convert('123' using utf32), -10, 16));
+hex(conv(convert('123' using utf32), -10, 16))
+3742
+select hex(conv(convert('123' using utf32), 10, 16));
+hex(conv(convert('123' using utf32), 10, 16))
+3742
+set names latin1;
+set character_set_connection=utf32;
+select 1.1 + '1.2';
+1.1 + '1.2'
+2.3
+select 1.1 + '1.2xxx';
+1.1 + '1.2xxx'
+2.3
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+select left('aaa','1');
+left('aaa','1')
+a
+create table t1 (a int);
+insert into t1 values ('-1234.1e2');
+insert into t1 values ('-1234.1e2xxxx');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+insert into t1 values ('-1234.1e2 ');
+select * from t1;
+a
+-123410
+-123410
+-123410
+drop table t1;
+create table t1 (a int);
+insert into t1 values ('1 ');
+insert into t1 values ('1 x');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1;
+a
+1
+1
+drop table t1;
+create table t1 (a varchar(17000) character set utf32);
+Warnings:
+Note 1246 Converting column 'a' from VARCHAR to TEXT
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` mediumtext CHARACTER SET utf32
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(250) character set utf32 primary key);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(250) CHARACTER SET utf32 NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(334) character set utf32 primary key);
+ERROR 42000: Specified key was too long; max key length is 1000 bytes
+create table t1 (a varchar(333) character set utf32, key(a));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 1000 bytes
+insert into t1 values (repeat('a',333)), (repeat('b',333));
+flush tables;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+SET collation_connection=utf32_general_ci;
+CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0;
+SET timestamp=1216359724;
+INSERT INTO t1 VALUES (current_date);
+INSERT INTO t1 VALUES (current_time);
+INSERT INTO t1 VALUES (current_timestamp);
+SELECT s1, hex(s1) FROM t1;
+s1 hex(s1)
+2008-07-18 000000320000003000000030000000380000002D00000030000000370000002D0000003100000038
+08:42:04 00000030000000380000003A00000034000000320000003A0000003000000034
+2008-07-18 08:42:04 000000320000003000000030000000380000002D00000030000000370000002D00000031000000380000002000000030000000380000003A00000034000000320000003A0000003000000034
+DROP TABLE t1;
+SET timestamp=0;
+SET NAMES latin1;
+set collation_connection=utf32_general_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) CHARACTER SET utf32 DEFAULT NULL,
+ `s2` varchar(64) CHARACTER SET utf32 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+set names latin1;
+select hex(char(0x01 using utf32));
+hex(char(0x01 using utf32))
+00000001
+select hex(char(0x0102 using utf32));
+hex(char(0x0102 using utf32))
+00000102
+select hex(char(0x010203 using utf32));
+hex(char(0x010203 using utf32))
+00010203
+select hex(char(0x01020304 using utf32));
+hex(char(0x01020304 using utf32))
+
+Warnings:
+Warning 1300 Invalid utf32 character string: '010203'
+create table t1 (s1 varchar(1) character set utf32, s2 text character set utf32);
+create index i on t1 (s1);
+insert into t1 values (char(256 using utf32), char(256 using utf32));
+select hex(s1), hex(s2) from t1;
+hex(s1) hex(s2)
+00000100 00000100
+drop table t1;
+SET collation_connection=utf32_general_ci;
+CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(2) CHARACTER SET utf32 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE');
+SELECT * FROM t1 ORDER BY s1;
+s1
+ab
+ab
+AE
+AE
+SET max_sort_length=4;
+SELECT * FROM t1 ORDER BY s1;
+s1
+ab
+ab
+AE
+AE
+DROP TABLE t1;
+SET max_sort_length=DEFAULT;
+SET NAMES latin1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result
new file mode 100644
index 00000000000..5006009fc9c
--- /dev/null
+++ b/mysql-test/r/ctype_utf32_uca.result
@@ -0,0 +1,2373 @@
+DROP TABLE IF EXISTS t1;
+#
+# Start of 5.5 tests
+#
+set names utf8;
+set collation_connection=utf32_unicode_ci;
+select hex('a'), hex('a ');
+hex('a') hex('a ')
+00000061 0000006100000020
+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'
+1 0 0
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0'
+1 0 0
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a '
+1 0 0
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0'
+1 0 0
+select 'a a' > 'a', 'a \0' < 'a';
+'a a' > 'a' 'a \0' < 'a'
+1 0
+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
+select 'c' like '\_' as want0;
+want0
+0
+CREATE TABLE t (
+c char(20) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARACTER SET utf32 COLLATE=utf32_unicode_ci;
+INSERT INTO t VALUES ('a'),('ab'),('aba');
+ALTER TABLE t ADD INDEX (c);
+SELECT c FROM t WHERE c LIKE 'a%';
+c
+a
+ab
+aba
+DROP TABLE t;
+create table t1 (c1 char(10) character set utf32 collate utf32_bin);
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
+insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
+insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
+insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
+insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
+insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
+insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
+insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
+insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
+insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
+insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
+insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
+insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
+insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
+insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
+insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
+insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
+insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
+insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
+insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
+insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
+insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
+insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
+insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
+insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
+insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
+insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
+insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
+insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
+insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
+insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
+insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
+insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
+insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
+insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
+insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
+insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
+insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
+insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
+insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
+insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
+insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
+insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
+insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
+insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
+insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
+insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
+insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
+insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
+insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
+insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
+insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
+insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
+insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
+insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
+insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
+insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
+insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
+insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
+insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
+insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
+insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
+insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
+insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
+insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
+insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
+insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
+insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
+insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
+insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
+insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
+insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
+insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
+insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
+insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
+insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
+insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
+insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
+insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
+insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
+insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
+insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
+insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
+insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
+insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
+insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
+insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
+insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
+insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
+insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
+insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
+insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
+insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
+insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
+insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
+insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_unicode_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_icelandic_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÂÃàâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Áá
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Ðð
+Đđ
+Ƌƌ
+EeÈÊËèêëĒēĔĕĖėĘęĚě
+Éé
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÎÏìîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Íí
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÔÕòôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÛÜùûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Úú
+Vv
+WwŴŵ
+Xx
+YyÿŶŷŸ
+Ýý
+Ƴƴ
+ZzŹźŻżŽž
+Þþ
+ÄÆäæ
+ÖØöø
+Åå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_latvian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġǦǧǴǵ
+Ģģ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Yy
+JjĴĵǰ
+KkǨǩ
+Ķķ
+Ƙƙ
+LlĹ弾
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Ļļ
+Łł
+Mm
+NnÑñŃńŇňǸǹ
+NJNjnJnjNJNjnj
+Ņņ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŘř
+RRRrrRrr
+Ŗŗ
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_romanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ăă
+Ââ
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÏìíïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Îî
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŤť
+Ţţ
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovenian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_polish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂăǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ąą
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĈĉĊċČč
+CHChcHch
+Ćć
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĚě
+Ęę
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ńń
+Ŋŋ
+OoÒÔÕÖòôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŜŝŞşŠšſ
+SSSssSssß
+Śś
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŽž
+Źź
+Żż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_estonian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdz
+DŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔòóôŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+Zz
+Žž
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Õõ
+Ää
+Öö
+Üü
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ŹźŻż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_swedish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Åå
+ÄÆäæ
+ÖØöø
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_turkish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcĆćĈĉĊċČč
+CHChcHch
+Çç
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĠġĢģǦǧǴǵ
+Ğğ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+Iı
+IJIj
+ƕǶ
+Ħħ
+iÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+iJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Öö
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Üü
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_czech_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗ
+RRRrrRrr
+Řř
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_danish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+aA
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŰűŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+ÄÆäæ
+ÖØöøŐő
+AAAaaaÅå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_lithuanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CCHChcchÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IYiyÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovak_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ää
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÕÖòóõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ôô
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish2_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+cH
+CHChch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+lL
+LLLlll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_roman_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IJijÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJij
+IJij
+Ĵĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJlj
+LJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnj
+NJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+ÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+UVuv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_esperanto_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĊċČč
+CHChcHch
+Ĉĉ
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĞğĠġĢģǦǧǴǵ
+Ĝĝ
+Ǥǥ
+Ƣƣ
+Hh
+Ĥĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Jjǰ
+Ĵĵ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŞşŠšſ
+SSSssSssß
+Ŝŝ
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Ŭŭ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_hungarian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ÖöŐő
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+ÜüŰű
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+drop table t1;
+SET NAMES utf8;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_general_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025
+COLLATE utf32_general_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025
+COLLATE utf32_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32) COLLATE utf32_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
+SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32)
+COLLATE utf32_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+SET NAMES utf8;
+SET @test_character_set='utf32';
+SET @test_collation='utf32_swedish_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
+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) utf32_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) utf32_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;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
+drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) COLLATE utf32_swedish_ci DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_swedish_ci
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
+SET collation_connection='utf32_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)
+utf32_unicode_ci 0000006100000009
+utf32_unicode_ci 00000061
+utf32_unicode_ci 0000006100000020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf32_unicode_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+End of 4.1 tests
+CREATE TABLE t1 (id int, a varchar(30) character set utf32);
+INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131);
+INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049);
+INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049);
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a la l ll u lu
+ıi 8 ıi 8 II 8
+ıı 8 ıı 8 II 8
+ii 8 ii 8 II 8
+İI 8 ii 8 İI 8
+İİ 8 ii 8 İİ 8
+II 8 ii 8 II 8
+ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf32 collate utf32_turkish_ci;
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a la l ll u lu
+ıi 8 ıi 8 Iİ 8
+ıı 8 ıı 8 II 8
+ii 8 ii 8 İİ 8
+İI 8 iı 8 İI 8
+İİ 8 ii 8 İİ 8
+II 8 ıı 8 II 8
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 text character set utf32 collate utf32_polish_ci NOT NULL
+) ENGINE=MyISAM;
+insert into t1 values (''),('a');
+SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
+COUNT(*) c1
+1
+1 a
+DROP TABLE IF EXISTS t1;
+set collation_connection=utf32_unicode_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) CHARACTER SET utf32 COLLATE utf32_unicode_ci DEFAULT NULL,
+ `s2` varchar(64) CHARACTER SET utf32 COLLATE utf32_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 55c32c6a1d4..03040d1676c 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1899,6 +1899,20 @@ CONVERT(a, CHAR) CONVERT(b, CHAR)
DROP TABLE t1;
End of 5.0 tests
Start of 5.4 tests
+SET NAMES utf8mb3;
+SHOW VARIABLES LIKE 'character_set_results%';
+Variable_name Value
+character_set_results utf8
+CREATE TABLE t1 (a CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SELECT _utf8mb3'test';
+test
+test
CREATE TABLE t1 (
clipid INT NOT NULL,
Tape TINYTEXT,
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
new file mode 100644
index 00000000000..f20c88829e9
--- /dev/null
+++ b/mysql-test/r/ctype_utf8mb4.result
@@ -0,0 +1,2238 @@
+drop table if exists t1,t2;
+#
+# Start of 5.5 tests
+#
+set names utf8mb4;
+select left(_utf8mb4 0xD0B0D0B1D0B2,1);
+left(_utf8mb4 0xD0B0D0B1D0B2,1)
+select right(_utf8mb4 0xD0B0D0B2D0B2,1);
+right(_utf8mb4 0xD0B0D0B2D0B2,1)
+select locate('he','hello');
+locate('he','hello')
+1
+select locate('he','hello',2);
+locate('he','hello',2)
+0
+select locate('lo','hello',2);
+locate('lo','hello',2)
+4
+select locate('HE','hello');
+locate('HE','hello')
+1
+select locate('HE','hello',2);
+locate('HE','hello',2)
+0
+select locate('LO','hello',2);
+locate('LO','hello',2)
+4
+select locate('HE','hello' collate utf8mb4_bin);
+locate('HE','hello' collate utf8mb4_bin)
+0
+select locate('HE','hello' collate utf8mb4_bin,2);
+locate('HE','hello' collate utf8mb4_bin,2)
+0
+select locate('LO','hello' collate utf8mb4_bin,2);
+locate('LO','hello' collate utf8mb4_bin,2)
+0
+select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2);
+locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2)
+2
+select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2);
+locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2)
+2
+select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2);
+locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2)
+2
+select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin);
+locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin)
+0
+select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin);
+locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin)
+0
+select length(_utf8mb4 0xD0B1), bit_length(_utf8mb4 0xD0B1), char_length(_utf8mb4 0xD0B1);
+length(_utf8mb4 0xD0B1) bit_length(_utf8mb4 0xD0B1) char_length(_utf8mb4 0xD0B1)
+2 16 1
+select 'a' like 'a';
+'a' like 'a'
+1
+select 'A' like 'a';
+'A' like 'a'
+1
+select 'A' like 'a' collate utf8mb4_bin;
+'A' like 'a' collate utf8mb4_bin
+0
+select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%');
+_utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%')
+1
+select convert(_latin1'Gnter Andr' using utf8mb4) like CONVERT(_latin1'GNTER%' USING utf8mb4);
+convert(_latin1'G?nter Andr?' using utf8mb4) like CONVERT(_latin1'G?NTER%' USING utf8mb4)
+1
+select CONVERT(_koi8r'' USING utf8mb4) LIKE CONVERT(_koi8r'' USING utf8mb4);
+CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
+1
+select CONVERT(_koi8r'' USING utf8mb4) LIKE CONVERT(_koi8r'' USING utf8mb4);
+CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
+1
+SELECT 'a' = 'a ';
+'a' = 'a '
+1
+SELECT 'a\0' < 'a';
+'a\0' < 'a'
+1
+SELECT 'a\0' < 'a ';
+'a\0' < 'a '
+1
+SELECT 'a\t' < 'a';
+'a\t' < 'a'
+1
+SELECT 'a\t' < 'a ';
+'a\t' < 'a '
+1
+SELECT 'a' = 'a ' collate utf8mb4_bin;
+'a' = 'a ' collate utf8mb4_bin
+1
+SELECT 'a\0' < 'a' collate utf8mb4_bin;
+'a\0' < 'a' collate utf8mb4_bin
+1
+SELECT 'a\0' < 'a ' collate utf8mb4_bin;
+'a\0' < 'a ' collate utf8mb4_bin
+1
+SELECT 'a\t' < 'a' collate utf8mb4_bin;
+'a\t' < 'a' collate utf8mb4_bin
+1
+SELECT 'a\t' < 'a ' collate utf8mb4_bin;
+'a\t' < 'a ' collate utf8mb4_bin
+1
+CREATE TABLE t1 (a char(10) character set utf8mb4 not null);
+INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
+SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
+hex(a) STRCMP(a,'a') STRCMP(a,'a ')
+61 0 0
+6100 -1 -1
+6109 -1 -1
+61 0 0
+DROP TABLE t1;
+select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
+insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
+this is a test
+select insert("aa",100,1,"b"),insert("aa",1,3,"b");
+insert("aa",100,1,"b") insert("aa",1,3,"b")
+aa b
+select char_length(left(@a:='тест',5)), length(@a), @a;
+char_length(left(@a:='тест',5)) length(@a) @a
+4 8 тест
+create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+date_format("2004-01-19 10:10:10", "%Y-%m-%d")
+2004-01-19
+drop table t1;
+set names utf8mb4;
+set LC_TIME_NAMES='fr_FR';
+create table t1 (s1 char(20) character set latin1);
+insert into t1 values (date_format('2004-02-02','%M'));
+select hex(s1) from t1;
+hex(s1)
+66E97672696572
+drop table t1;
+create table t1 (s1 char(20) character set koi8r);
+set LC_TIME_NAMES='ru_RU';
+insert into t1 values (date_format('2004-02-02','%M'));
+insert into t1 values (date_format('2004-02-02','%b'));
+insert into t1 values (date_format('2004-02-02','%W'));
+insert into t1 values (date_format('2004-02-02','%a'));
+select hex(s1), s1 from t1;
+hex(s1) s1
+E6C5D7D2C1CCD1 Февраля
+E6C5D7 Фев
+F0CFCEC5C4C5CCD8CEC9CB Понедельник
+F0CEC4 Пнд
+drop table t1;
+set LC_TIME_NAMES='en_US';
+set names koi8r;
+create table t1 (s1 char(1) character set utf8mb4);
+insert into t1 values (_koi8r'');
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
+s1 hex(s1) char_length(s1) octet_length(s1)
+ D0B0 1 2
+drop table t1;
+create table t1 (s1 tinytext character set utf8mb4);
+insert into t1 select repeat('a',300);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('',300);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('a',300);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('a',300);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('',300);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+select hex(s1) from t1;
+hex(s1)
+616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
+D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F
+61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F
+D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61
+D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F
+select length(s1),char_length(s1) from t1;
+length(s1) char_length(s1)
+255 255
+254 127
+255 170
+255 170
+254 127
+drop table t1;
+create table t1 (s1 text character set utf8mb4);
+insert into t1 select repeat('a',66000);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('',66000);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('a',66000);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('a',66000);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+insert into t1 select repeat('',66000);
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+select length(s1),char_length(s1) from t1;
+length(s1) char_length(s1)
+65535 65535
+65534 32767
+65535 43690
+65535 43690
+65534 32767
+drop table t1;
+create table t1 (s1 char(10) character set utf8mb4);
+insert into t1 values (0x41FF);
+Warnings:
+Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
+select hex(s1) from t1;
+hex(s1)
+41
+drop table t1;
+create table t1 (s1 varchar(10) character set utf8mb4);
+insert into t1 values (0x41FF);
+Warnings:
+Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
+select hex(s1) from t1;
+hex(s1)
+41
+drop table t1;
+create table t1 (s1 text character set utf8mb4);
+insert into t1 values (0x41FF);
+Warnings:
+Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
+select hex(s1) from t1;
+hex(s1)
+41
+drop table t1;
+create table t1 (a text character set utf8mb4, primary key(a(371)));
+ERROR 42000: Specified key was too long; max key length is 1000 bytes
+CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES ( 'test' );
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a;
+a a
+test test
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test';
+a a
+test test
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test';
+a a
+test test
+DROP TABLE t1;
+create table t1 (a char(255) character set utf8mb4);
+insert into t1 values('b'),('b');
+select * from t1 where a = 'b';
+a
+b
+b
+select * from t1 where a = 'b' and a = 'b';
+a
+b
+b
+select * from t1 where a = 'b' and a != 'b';
+a
+drop table t1;
+set collation_connection=utf8mb4_general_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
+ `s2` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+set names utf8mb4;
+set names utf8mb4;
+select 'вася' rlike '[[:<:]]вася[[:>:]]';
+'вася' rlike '[[:<:]]вася[[:>:]]'
+1
+select 'вася ' rlike '[[:<:]]вася[[:>:]]';
+'вася ' rlike '[[:<:]]вася[[:>:]]'
+1
+select ' вася' rlike '[[:<:]]вася[[:>:]]';
+' вася' rlike '[[:<:]]вася[[:>:]]'
+1
+select ' вася ' rlike '[[:<:]]вася[[:>:]]';
+' вася ' rlike '[[:<:]]вася[[:>:]]'
+1
+select 'васяz' rlike '[[:<:]]вася[[:>:]]';
+'васяz' rlike '[[:<:]]вася[[:>:]]'
+0
+select 'zвася' rlike '[[:<:]]вася[[:>:]]';
+'zвася' rlike '[[:<:]]вася[[:>:]]'
+0
+select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
+'zвасяz' rlike '[[:<:]]вася[[:>:]]'
+0
+CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci);
+ALTER TABLE t1 ADD COLUMN b CHAR(20);
+DROP TABLE t1;
+set names utf8mb4;
+create table t1 (a enum('aaaa','проба') character set utf8mb4);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('aaaa','проба') CHARACTER SET utf8mb4 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('проба');
+select * from t1;
+a
+проба
+create table t2 select ifnull(a,a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t2;
+ifnull(a,a)
+проба
+drop table t1;
+drop table t2;
+create table t1 (c varchar(30) character set utf8mb4, unique(c(10)));
+insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
+insert into t1 values ('aaaaaaaaaa');
+insert into t1 values ('aaaaaaaaaaa');
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
+insert into t1 values ('aaaaaaaaaaaa');
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
+insert into t1 values (repeat('b',20));
+select c c1 from t1 where c='1';
+c1
+1
+select c c2 from t1 where c='2';
+c2
+2
+select c c3 from t1 where c='3';
+c3
+3
+select c cx from t1 where c='x';
+cx
+x
+select c cy from t1 where c='y';
+cy
+y
+select c cz from t1 where c='z';
+cz
+z
+select c ca10 from t1 where c='aaaaaaaaaa';
+ca10
+aaaaaaaaaa
+select c cb20 from t1 where c=repeat('b',20);
+cb20
+bbbbbbbbbbbbbbbbbbbb
+drop table t1;
+create table t1 (c varchar(30) character set utf8mb4, unique(c(10))) engine=innodb;
+insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
+insert into t1 values ('aaaaaaaaaa');
+insert into t1 values ('aaaaaaaaaaa');
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
+insert into t1 values ('aaaaaaaaaaaa');
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
+insert into t1 values (repeat('b',20));
+select c c1 from t1 where c='1';
+c1
+1
+select c c2 from t1 where c='2';
+c2
+2
+select c c3 from t1 where c='3';
+c3
+3
+select c cx from t1 where c='x';
+cx
+x
+select c cy from t1 where c='y';
+cy
+y
+select c cz from t1 where c='z';
+cz
+z
+select c ca10 from t1 where c='aaaaaaaaaa';
+ca10
+aaaaaaaaaa
+select c cb20 from t1 where c=repeat('b',20);
+cb20
+bbbbbbbbbbbbbbbbbbbb
+drop table t1;
+create table t1 (c char(3) character set utf8mb4, unique (c(2)));
+insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
+insert into t1 values ('a');
+insert into t1 values ('aa');
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'aa' for key 'c'
+insert into t1 values ('b');
+insert into t1 values ('bb');
+insert into t1 values ('bbb');
+ERROR 23000: Duplicate entry 'bb' for key 'c'
+insert into t1 values ('а');
+insert into t1 values ('аа');
+insert into t1 values ('ааа');
+ERROR 23000: Duplicate entry 'аа' for key 'c'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'бб' for key 'c'
+insert into t1 values ('ꪪ');
+insert into t1 values ('ꪪꪪ');
+insert into t1 values ('ꪪꪪꪪ');
+ERROR 23000: Duplicate entry 'ꪪꪪ' for key 'c'
+drop table t1;
+create table t1 (c char(3) character set utf8mb4, unique (c(2))) engine=innodb;
+insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
+insert into t1 values ('a');
+insert into t1 values ('aa');
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'aa' for key 'c'
+insert into t1 values ('b');
+insert into t1 values ('bb');
+insert into t1 values ('bbb');
+ERROR 23000: Duplicate entry 'bb' for key 'c'
+insert into t1 values ('а');
+insert into t1 values ('аа');
+insert into t1 values ('ааа');
+ERROR 23000: Duplicate entry 'аа' for key 'c'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'бб' for key 'c'
+insert into t1 values ('ꪪ');
+insert into t1 values ('ꪪꪪ');
+insert into t1 values ('ꪪꪪꪪ');
+ERROR 23000: Duplicate entry 'ꪪꪪ' for key 'c'
+drop table t1;
+create table t1 (
+c char(10) character set utf8mb4,
+unique key a using hash (c(1))
+) engine=heap;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) CHARACTER SET utf8mb4 DEFAULT NULL,
+ UNIQUE KEY `a` (`c`(1)) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+insert into t1 values ('aa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+select c as c_all from t1 order by c;
+c_all
+a
+b
+c
+d
+e
+f
+select c as c_a from t1 where c='a';
+c_a
+a
+select c as c_a from t1 where c='б';
+c_a
+drop table t1;
+create table t1 (
+c char(10) character set utf8mb4,
+unique key a using btree (c(1))
+) engine=heap;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) CHARACTER SET utf8mb4 DEFAULT NULL,
+ UNIQUE KEY `a` (`c`(1)) USING BTREE
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+insert into t1 values ('aa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+select c as c_all from t1 order by c;
+c_all
+a
+b
+c
+d
+e
+f
+select c as c_a from t1 where c='a';
+c_a
+a
+select c as c_a from t1 where c='б';
+c_a
+drop table t1;
+create table t1 (
+c char(10) character set utf8mb4,
+unique key a (c(1))
+) engine=innodb;
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+insert into t1 values ('aa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+select c as c_all from t1 order by c;
+c_all
+a
+b
+c
+d
+e
+f
+select c as c_a from t1 where c='a';
+c_a
+a
+select c as c_a from t1 where c='б';
+c_a
+drop table t1;
+create table t1 (c varchar(30) character set utf8mb4 collate utf8mb4_bin, unique(c(10)));
+insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
+insert into t1 values ('aaaaaaaaaa');
+insert into t1 values ('aaaaaaaaaaa');
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
+insert into t1 values ('aaaaaaaaaaaa');
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
+insert into t1 values (repeat('b',20));
+select c c1 from t1 where c='1';
+c1
+1
+select c c2 from t1 where c='2';
+c2
+2
+select c c3 from t1 where c='3';
+c3
+3
+select c cx from t1 where c='x';
+cx
+x
+select c cy from t1 where c='y';
+cy
+y
+select c cz from t1 where c='z';
+cz
+z
+select c ca10 from t1 where c='aaaaaaaaaa';
+ca10
+aaaaaaaaaa
+select c cb20 from t1 where c=repeat('b',20);
+cb20
+bbbbbbbbbbbbbbbbbbbb
+drop table t1;
+create table t1 (c char(3) character set utf8mb4 collate utf8mb4_bin, unique (c(2)));
+insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
+insert into t1 values ('a');
+insert into t1 values ('aa');
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'aa' for key 'c'
+insert into t1 values ('b');
+insert into t1 values ('bb');
+insert into t1 values ('bbb');
+ERROR 23000: Duplicate entry 'bb' for key 'c'
+insert into t1 values ('а');
+insert into t1 values ('аа');
+insert into t1 values ('ааа');
+ERROR 23000: Duplicate entry 'аа' for key 'c'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'бб' for key 'c'
+insert into t1 values ('ꪪ');
+insert into t1 values ('ꪪꪪ');
+insert into t1 values ('ꪪꪪꪪ');
+ERROR 23000: Duplicate entry 'ꪪꪪ' for key 'c'
+drop table t1;
+create table t1 (
+c char(10) character set utf8mb4 collate utf8mb4_bin,
+unique key a using hash (c(1))
+) engine=heap;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
+ UNIQUE KEY `a` (`c`(1)) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+insert into t1 values ('aa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+select c as c_all from t1 order by c;
+c_all
+a
+b
+c
+d
+e
+f
+select c as c_a from t1 where c='a';
+c_a
+a
+select c as c_a from t1 where c='б';
+c_a
+drop table t1;
+create table t1 (
+c char(10) character set utf8mb4 collate utf8mb4_bin,
+unique key a using btree (c(1))
+) engine=heap;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
+ UNIQUE KEY `a` (`c`(1)) USING BTREE
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+insert into t1 values ('aa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+select c as c_all from t1 order by c;
+c_all
+a
+b
+c
+d
+e
+f
+select c as c_a from t1 where c='a';
+c_a
+a
+select c as c_a from t1 where c='б';
+c_a
+drop table t1;
+create table t1 (
+c char(10) character set utf8mb4 collate utf8mb4_bin,
+unique key a (c(1))
+) engine=innodb;
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+insert into t1 values ('aa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('aaa');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+insert into t1 values ('б');
+insert into t1 values ('бб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+insert into t1 values ('ббб');
+ERROR 23000: Duplicate entry 'б' for key 'a'
+select c as c_all from t1 order by c;
+c_all
+a
+b
+c
+d
+e
+f
+select c as c_a from t1 where c='a';
+c_a
+a
+select c as c_a from t1 where c='б';
+c_a
+drop table t1;
+create table t1 (
+str varchar(255) character set utf8mb4 not null,
+key str (str(2))
+) engine=myisam;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+str
+str
+drop table t1;
+create table t1 (
+str varchar(255) character set utf8mb4 not null,
+key str (str(2))
+) engine=innodb;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+str
+str
+drop table t1;
+create table t1 (
+str varchar(255) character set utf8mb4 not null,
+key str using btree (str(2))
+) engine=heap;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+str
+str
+drop table t1;
+create table t1 (
+str varchar(255) character set utf8mb4 not null,
+key str using hash (str(2))
+) engine=heap;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+str
+str
+drop table t1;
+create table t1 (
+str varchar(255) character set utf8mb4 not null,
+key str (str(2))
+) engine=innodb;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+str
+str
+drop table t1;
+CREATE TABLE t1 (a varchar(32) BINARY) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES ('test');
+SELECT a FROM t1 WHERE a LIKE '%te';
+a
+DROP TABLE t1;
+SET NAMES utf8mb4;
+CREATE TABLE t1 (
+subject varchar(255) character set utf8mb4 collate utf8mb4_unicode_ci,
+p varchar(15) character set utf8mb4
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057');
+INSERT INTO t1 VALUES ('aaa','bbb');
+SELECT length(subject) FROM t1;
+length(subject)
+432
+3
+SELECT length(subject) FROM t1 ORDER BY 1;
+length(subject)
+3
+432
+DROP TABLE t1;
+CREATE TABLE t1 (
+id int unsigned NOT NULL auto_increment,
+list_id smallint unsigned NOT NULL,
+term TEXT NOT NULL,
+PRIMARY KEY(id),
+INDEX(list_id, term(4))
+) ENGINE=MYISAM CHARSET=utf8mb4;
+INSERT INTO t1 SET list_id = 1, term = "letterc";
+INSERT INTO t1 SET list_id = 1, term = "letterb";
+INSERT INTO t1 SET list_id = 1, term = "lettera";
+INSERT INTO t1 SET list_id = 1, term = "letterd";
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc");
+id
+1
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb");
+id
+2
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera");
+id
+3
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
+id
+4
+DROP TABLE t1;
+SET NAMES latin1;
+CREATE TABLE t1 (
+id int unsigned NOT NULL auto_increment,
+list_id smallint unsigned NOT NULL,
+term text NOT NULL,
+PRIMARY KEY(id),
+INDEX(list_id, term(19))
+) ENGINE=MyISAM CHARSET=utf8mb4;
+INSERT INTO t1 set list_id = 1, term = "testtest";
+INSERT INTO t1 set list_id = 1, term = "testetest";
+INSERT INTO t1 set list_id = 1, term = "testtest";
+SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest");
+id term
+1 testtest
+2 testetest
+3 testtest
+SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest");
+id term
+1 testtest
+2 testetest
+3 testtest
+SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest");
+id term
+1 testtest
+2 testetest
+3 testtest
+DROP TABLE t1;
+set names utf8mb4;
+create table t1 (
+a int primary key,
+b varchar(6),
+index b3(b(3))
+) engine=innodb character set=utf8mb4;
+insert into t1 values(1,'foo'),(2,'foobar');
+select * from t1 where b like 'foob%';
+a b
+2 foobar
+alter table t1 engine=innodb;
+select * from t1 where b like 'foob%';
+a b
+2 foobar
+drop table t1;
+create table t1 (
+a enum('петя','вася','анюта') character set utf8mb4 not null default 'анюта',
+b set('петя','вася','анюта') character set utf8mb4 not null default 'анюта'
+);
+create table t2 select concat(a,_utf8mb4'') as a, concat(b,_utf8mb4'')as b from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
+ `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t2;
+drop table t1;
+select 'c' like '\_' as want0;
+want0
+0
+SELECT SUBSTR('вася',-2);
+SUBSTR('вася',-2)
+ся
+create table t1 (id integer, a varchar(100) character set utf8mb4 collate utf8mb4_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;
+select soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB);
+soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)
+阅000
+select hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB));
+hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB))
+E99885303030
+select soundex(_utf8mb4 0xD091D092D093);
+soundex(_utf8mb4 0xD091D092D093)
+Б000
+select hex(soundex(_utf8mb4 0xD091D092D093));
+hex(soundex(_utf8mb4 0xD091D092D093))
+D091303030
+SET collation_connection='utf8mb4_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)
+utf8mb4_general_ci 6109
+utf8mb4_general_ci 61
+utf8mb4_general_ci 6120
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf8mb4_general_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+drop table if exists t1;
+create table t1 as select repeat(' ', 64) as s1;
+select collation(s1) from t1;
+collation(s1)
+utf8mb4_general_ci
+delete from t1;
+insert into t1 values ('a'),('ae'),(_latin1 0xE4);
+insert into t1 values ('o'),('oe'),(_latin1 0xF6);
+insert into t1 values ('s'),('ss'),(_latin1 0xDF);
+insert into t1 values ('u'),('ue'),(_latin1 0xFC);
+select s1, hex(s1) from t1 order by s1, binary s1;
+s1 hex(s1)
+a 61
+ä C3A4
+ae 6165
+o 6F
+ö C3B6
+oe 6F65
+s 73
+ß C39F
+ss 7373
+u 75
+ü C3BC
+ue 7565
+select group_concat(s1 order by binary s1) from t1 group by s1;
+group_concat(s1 order by binary s1)
+a,ä
+ae
+o,ö
+oe
+s,ß
+ss
+u,ü
+ue
+drop table t1;
+SET collation_connection='utf8mb4_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)
+utf8mb4_bin 6109
+utf8mb4_bin 61
+utf8mb4_bin 6120
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf8mb4_bin
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+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')
+utf8mb4
+SELECT user, CONCAT('<', user, '>') AS c FROM t1;
+user c
+one <one>
+two <two>
+DROP TABLE t1;
+create table t1 (f1 varchar(1) not null) default charset utf8mb4;
+insert into t1 values (''), ('');
+select concat(concat(_latin1'->',f1),_latin1'<-') from t1;
+concat(concat(_latin1'->',f1),_latin1'<-')
+-><-
+-><-
+drop table t1;
+select convert(_koi8r'' using utf8mb4) < convert(_koi8r'' using utf8mb4);
+convert(_koi8r'?' using utf8mb4) < convert(_koi8r'?' using utf8mb4)
+1
+set names latin1;
+create table t1 (a varchar(10)) character set utf8mb4;
+insert into t1 values ('test');
+select ifnull(a,'') from t1;
+ifnull(a,'')
+test
+drop table t1;
+select repeat(_utf8mb4'+',3) as h union select NULL;
+h
++++
+NULL
+select ifnull(NULL, _utf8mb4'string');
+ifnull(NULL, _utf8mb4'string')
+string
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_lithuanian_ci);
+insert into t1 values ('I'),('K'),('Y');
+select * from t1 where s1 < 'K' and s1 = 'Y';
+s1
+I
+Y
+select * from t1 where 'K' > s1 and s1 = 'Y';
+s1
+I
+Y
+drop table t1;
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_czech_ci);
+insert into t1 values ('c'),('d'),('h'),('ch'),('CH'),('cH'),('Ch'),('i');
+select * from t1 where s1 > 'd' and s1 = 'CH';
+s1
+ch
+CH
+Ch
+select * from t1 where 'd' < s1 and s1 = 'CH';
+s1
+ch
+CH
+Ch
+select * from t1 where s1 = 'cH' and s1 <> 'ch';
+s1
+cH
+select * from t1 where 'cH' = s1 and s1 <> 'ch';
+s1
+cH
+drop table t1;
+create table t1 (a varchar(255)) default character set utf8mb4;
+insert into t1 values (1.0);
+drop table t1;
+create table t1 (
+id int not null,
+city varchar(20) not null,
+key (city(7),id)
+) character set=utf8mb4;
+insert into t1 values (1,'Durban North');
+insert into t1 values (2,'Durban');
+select * from t1 where city = 'Durban';
+id city
+2 Durban
+select * from t1 where city = 'Durban ';
+id city
+2 Durban
+drop table t1;
+create table t1 (x set('A', 'B') default 0) character set utf8mb4;
+ERROR 42000: Invalid default value for 'x'
+create table t1 (x enum('A', 'B') default 0) character set utf8mb4;
+ERROR 42000: Invalid default value for 'x'
+SET NAMES UTF8;
+CREATE TABLE t1 (
+`id` int(20) NOT NULL auto_increment,
+`country` varchar(100) NOT NULL default '',
+`shortcode` varchar(100) NOT NULL default '',
+`operator` varchar(100) NOT NULL default '',
+`momid` varchar(30) NOT NULL default '',
+`keyword` varchar(160) NOT NULL default '',
+`content` varchar(160) NOT NULL default '',
+`second_token` varchar(160) default NULL,
+`gateway_id` int(11) NOT NULL default '0',
+`created` datetime NOT NULL default '0000-00-00 00:00:00',
+`msisdn` varchar(15) NOT NULL default '',
+PRIMARY KEY (`id`),
+UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`),
+KEY `IX_mobile_originated_message_keyword` (`keyword`),
+KEY `IX_mobile_originated_message_created` (`created`),
+KEY `IX_mobile_originated_message_support` (`msisdn`,`momid`,`keyword`,`gateway_id`,`created`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+INSERT INTO t1 VALUES
+(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'),
+(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890');
+CREATE TABLE t2 (
+`msisdn` varchar(15) NOT NULL default '',
+`operator_id` int(11) NOT NULL default '0',
+`created` datetime NOT NULL default '0000-00-00 00:00:00',
+UNIQUE KEY `PK_user` (`msisdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
+SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
+content msisdn
+ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890
+11 g 1234567890
+DROP TABLE t1,t2;
+create table t1 (a char(20) character set utf8mb4);
+insert into t1 values ('123456'),('андрей');
+alter table t1 modify a char(2) character set utf8mb4;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+select char_length(a), length(a), a from t1 order by a;
+char_length(a) length(a) a
+2 2 12
+2 4 ан
+drop table t1;
+set names utf8mb4;
+select 'andre%' like 'andreñ%' escape 'ñ';
+'andre%' like 'andreñ%' escape 'ñ'
+1
+set names utf8mb4;
+select 'a\\' like 'a\\';
+'a\\' like 'a\\'
+1
+select 'aa\\' like 'a%\\';
+'aa\\' like 'a%\\'
+1
+create table t1 (a char(10), key(a)) character set utf8mb4;
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+select * from t1 where a like "abc%";
+a
+abc
+abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
+select * from t1 where a like "ABC%";
+a
+abc
+abcd
+select * from t1 where a like "test%";
+a
+test
+select * from t1 where a like "te_t";
+a
+test
+select * from t1 where a like "%a%";
+a
+a
+abc
+abcd
+select * from t1 where a like "%abcd%";
+a
+abcd
+select * from t1 where a like "%abc\d%";
+a
+abcd
+drop table t1;
+CREATE TABLE t1 (
+a varchar(255) NOT NULL default '',
+KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 1000 bytes
+insert into t1 values (_utf8mb4 0xe880bd);
+insert into t1 values (_utf8mb4 0x5b);
+select hex(a) from t1;
+hex(a)
+E880BD
+5B
+drop table t1;
+set names 'latin1';
+create table t1 (a varchar(255)) default charset=utf8mb4;
+select * from t1 where find_in_set('-1', a);
+a
+drop table t1;
+create table t1 (a int);
+insert into t1 values (48),(49),(50);
+set names utf8mb4;
+select distinct char(a) from t1;
+char(a)
+0
+1
+2
+drop table t1;
+CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8mb4);
+INSERT INTO t1 VALUES(REPEAT('a', 100));
+CREATE TEMPORARY TABLE t2 SELECT COALESCE(t) AS bug FROM t1;
+SELECT LENGTH(bug) FROM t2;
+LENGTH(bug)
+100
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (item varchar(255)) default character set utf8mb4;
+INSERT INTO t1 VALUES (N'\\');
+INSERT INTO t1 VALUES (_utf8mb4'\\');
+INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
+INSERT INTO t1 VALUES (_utf8mb4'Cote d\'Ivoire');
+SELECT item FROM t1 ORDER BY item;
+item
+Cote d'Ivoire
+Cote d'Ivoire
+\
+\
+DROP TABLE t1;
+SET NAMES utf8mb4;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 1000 bytes
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t1 VALUES('uu');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uU');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uu');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('UuABC');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+alter table t1 add b int;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',2);
+delete from t1 where b=1;
+INSERT INTO t1 VALUES('UUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',4);
+delete from t1 where b=3;
+INSERT INTO t1 VALUES('uUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%';
+before_delete_general_ci
+ペテルグル
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%';
+after_delete_general_ci
+ペテルグル
+drop table t1;
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_unicode_ci);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%';
+before_delete_unicode_ci
+ペテルグル
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%';
+after_delete_unicode_ci
+ペテルグル
+drop table t1;
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_bin);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_bin from t1 where s1 like 'ペテ%';
+before_delete_bin
+ペテルグル
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_bin from t1 where s1 like 'ペテ%';
+after_delete_bin
+ペテルグル
+drop table t1;
+set names utf8mb4;
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8mb4 collate utf8mb4_general_ci;
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+gci1
+さしすせそかきくけこあいうえお
+select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+gci2
+あいうえおかきくけこさしすせそ
+drop table t1;
+set names utf8mb4;
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8mb4 collate utf8mb4_unicode_ci;
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+uci1
+さしすせそかきくけこあいうえお
+select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+uci2
+あいうえおかきくけこさしすせそ
+drop table t1;
+set names utf8mb4;
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8mb4 collate utf8mb4_bin;
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+bin1
+さしすせそかきくけこあいうえお
+select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+bin2
+あいうえおかきくけこさしすせそ
+drop table t1;
+SET NAMES utf8mb4;
+CREATE TABLE t1 (id int PRIMARY KEY,
+a varchar(16) collate utf8mb4_unicode_ci NOT NULL default '',
+b int,
+f varchar(128) default 'XXX',
+INDEX (a(4))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1(id, a, b) VALUES
+(1, 'cccc', 50), (2, 'cccc', 70), (3, 'cccc', 30),
+(4, 'cccc', 30), (5, 'cccc', 20), (6, 'bbbbbb', 40),
+(7, 'dddd', 30), (8, 'aaaa', 10), (9, 'aaaa', 50),
+(10, 'eeeee', 40), (11, 'bbbbbb', 60);
+SELECT id, a, b FROM t1;
+id a b
+1 cccc 50
+2 cccc 70
+3 cccc 30
+4 cccc 30
+5 cccc 20
+6 bbbbbb 40
+7 dddd 30
+8 aaaa 10
+9 aaaa 50
+10 eeeee 40
+11 bbbbbb 60
+SELECT id, a, b FROM t1 WHERE a BETWEEN 'aaaa' AND 'bbbbbb';
+id a b
+8 aaaa 10
+9 aaaa 50
+6 bbbbbb 40
+11 bbbbbb 60
+SELECT id, a FROM t1 WHERE a='bbbbbb';
+id a
+6 bbbbbb
+11 bbbbbb
+SELECT id, a FROM t1 WHERE a='bbbbbb' ORDER BY b;
+id a
+6 bbbbbb
+11 bbbbbb
+DROP TABLE t1;
+SET NAMES utf8mb4;
+CREATE TABLE t1 (
+a CHAR(13) DEFAULT '',
+INDEX(a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES
+('Käli Käli 2-4'), ('Käli Käli 2-4'),
+('Käli Käli 2+4'), ('Käli Käli 2+4'),
+('Käli Käli 2-6'), ('Käli Käli 2-6');
+INSERT INTO t1 SELECT * FROM t1;
+CREATE TABLE t2 (
+a CHAR(13) DEFAULT '',
+INDEX(a)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+INSERT INTO t2 VALUES
+('Kali Kali 2-4'), ('Kali Kali 2-4'),
+('Kali Kali 2+4'), ('Kali Kali 2+4'),
+('Kali Kali 2-6'), ('Kali Kali 2-6');
+INSERT INTO t2 SELECT * FROM t2;
+SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4';
+a
+Käli Käli 2+4
+Käli Käli 2+4
+Käli Käli 2+4
+Käli Käli 2+4
+SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4';
+a
+Kali Kali 2+4
+Kali Kali 2+4
+Kali Kali 2+4
+Kali Kali 2+4
+EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 53 NULL 4 Using where; Using index
+EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 53 const 4 Using where; Using index
+EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range a a 14 NULL 4 Using where; Using index
+EXPLAIN SELECT a FROM t2 WHERE a = 'Kali Kali 2+4';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref a a 14 const 4 Using where; Using index
+DROP TABLE t1,t2;
+CREATE TABLE t1 (
+a char(255) DEFAULT '',
+KEY(a(10))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+a
+Käli Käli 2-4
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+a
+Käli Käli 2-4
+Käli Käli 2-4
+DROP TABLE t1;
+CREATE TABLE t1 (
+a char(255) DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+a
+Käli Käli 2-4
+Käli Käli 2-4
+ALTER TABLE t1 ADD KEY (a(10));
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+a
+Käli Käli 2-4
+Käli Käli 2-4
+DROP TABLE t1;
+SET NAMES latin2;
+CREATE TABLE t1 (
+id int(11) NOT NULL default '0',
+tid int(11) NOT NULL default '0',
+val text NOT NULL,
+INDEX idx(tid, val(10))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+INSERT INTO t1 VALUES
+(40988,72,'VOLN ADSL'),(41009,72,'VOLN ADSL'),
+(41032,72,'VOLN ADSL'),(41038,72,'VOLN ADSL'),
+(41063,72,'VOLN ADSL'),(41537,72,'VOLN ADSL Office'),
+(42141,72,'VOLN ADSL'),(42565,72,'VOLN ADSL Combi'),
+(42749,72,'VOLN ADSL'),(44205,72,'VOLN ADSL');
+SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNY ADSL';
+id tid val
+40988 72 VOLN ADSL
+41009 72 VOLN ADSL
+41032 72 VOLN ADSL
+41038 72 VOLN ADSL
+41063 72 VOLN ADSL
+42141 72 VOLN ADSL
+42749 72 VOLN ADSL
+44205 72 VOLN ADSL
+SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL';
+id tid val
+40988 72 VOLN ADSL
+41009 72 VOLN ADSL
+41032 72 VOLN ADSL
+41038 72 VOLN ADSL
+41063 72 VOLN ADSL
+42141 72 VOLN ADSL
+42749 72 VOLN ADSL
+44205 72 VOLN ADSL
+SELECT * FROM t1 WHERE tid=72 and val LIKE '%VOLN ADSL';
+id tid val
+40988 72 VOLN ADSL
+41009 72 VOLN ADSL
+41032 72 VOLN ADSL
+41038 72 VOLN ADSL
+41063 72 VOLN ADSL
+42141 72 VOLN ADSL
+42749 72 VOLN ADSL
+44205 72 VOLN ADSL
+ALTER TABLE t1 DROP KEY idx;
+ALTER TABLE t1 ADD KEY idx (tid,val(11));
+SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL';
+id tid val
+40988 72 VOLN ADSL
+41009 72 VOLN ADSL
+41032 72 VOLN ADSL
+41038 72 VOLN ADSL
+41063 72 VOLN ADSL
+42141 72 VOLN ADSL
+42749 72 VOLN ADSL
+44205 72 VOLN ADSL
+DROP TABLE t1;
+create table t1(a char(200) collate utf8mb4_unicode_ci NOT NULL default '')
+default charset=utf8mb4 collate=utf8mb4_unicode_ci;
+insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65'));
+explain select distinct a from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary
+select distinct a from t1;
+a
+e
+explain select a from t1 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort
+select a from t1 group by a;
+a
+e
+drop table t1;
+create table t1(a char(10)) default charset utf8mb4;
+insert into t1 values ('123'), ('456');
+explain
+select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where; Using join buffer
+select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+substr(Z.a,-1) a
+3 123
+6 456
+drop table t1;
+SET CHARACTER SET utf8mb4;
+SHOW VARIABLES LIKE 'character\_set\_%';
+Variable_name Value
+character_set_client utf8mb4
+character_set_connection latin1
+character_set_database latin1
+character_set_filesystem binary
+character_set_results utf8mb4
+character_set_server latin1
+character_set_system utf8
+CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
+USE crashtest;
+CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4;
+INSERT INTO crashtest VALUES ('35'), ('36'), ('37');
+SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
+crash
+35
+36
+37
+INSERT INTO crashtest VALUES ('-1000');
+EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE crashtest ALL NULL NULL NULL NULL 4 Using filesort
+SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
+crash
+-1000
+35
+36
+37
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FFFFFC'
+DROP TABLE crashtest;
+DROP DATABASE crashtest;
+USE test;
+SET CHARACTER SET default;
+CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8mb4;
+INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
+SELECT id FROM t1;
+id
+xxx
+aa
+yyy
+aa
+SELECT DISTINCT id FROM t1;
+id
+xxx
+aa
+yyy
+SELECT DISTINCT id FROM t1 ORDER BY id;
+id
+aa
+xxx
+yyy
+DROP TABLE t1;
+create table t1 (
+a varchar(26) not null
+) default character set utf8mb4;
+insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz');
+select * from t1;
+a
+abcdefghijklmnopqrstuvwxyz
+alter table t1 change a a varchar(20) character set utf8mb4 not null;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1;
+a
+abcdefghijklmnopqrst
+alter table t1 change a a char(15) character set utf8mb4 not null;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1;
+a
+abcdefghijklmno
+alter table t1 change a a char(10) character set utf8mb4 not null;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1;
+a
+abcdefghij
+alter table t1 change a a varchar(5) character set utf8mb4 not null;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1;
+a
+abcde
+drop table t1;
+create table t1 (
+a varchar(4000) not null
+) default character set utf8mb4;
+insert into t1 values (repeat('a',4000));
+alter table t1 change a a varchar(3000) character set utf8mb4 not null;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select length(a) from t1;
+length(a)
+3000
+drop table t1;
+set names utf8mb4;
+select hex(char(1 using utf8mb4));
+hex(char(1 using utf8mb4))
+01
+select char(0xd1,0x8f using utf8mb4);
+char(0xd1,0x8f using utf8mb4)
+select char(0xd18f using utf8mb4);
+char(0xd18f using utf8mb4)
+select char(53647 using utf8mb4);
+char(53647 using utf8mb4)
+select char(0xff,0x8f using utf8mb4);
+char(0xff,0x8f using utf8mb4)
+
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+select convert(char(0xff,0x8f) using utf8mb4);
+convert(char(0xff,0x8f) using utf8mb4)
+
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+set sql_mode=traditional;
+select char(0xff,0x8f using utf8mb4);
+char(0xff,0x8f using utf8mb4)
+NULL
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+select char(195 using utf8mb4);
+char(195 using utf8mb4)
+NULL
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'C3'
+select char(196 using utf8mb4);
+char(196 using utf8mb4)
+NULL
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'C4'
+select char(2557 using utf8mb4);
+char(2557 using utf8mb4)
+NULL
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FD'
+select convert(char(0xff,0x8f) using utf8mb4);
+convert(char(0xff,0x8f) using utf8mb4)
+NULL
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+select hex(convert(char(2557 using latin1) using utf8mb4));
+hex(convert(char(2557 using latin1) using utf8mb4))
+09C3BD
+select hex(char(195));
+hex(char(195))
+C3
+select hex(char(196));
+hex(char(196))
+C4
+select hex(char(2557));
+hex(char(2557))
+09FD
+set names utf8mb4;
+create table t1 (a char(1)) default character set utf8mb4;
+create table t2 (a char(1)) default character set utf8mb4;
+insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
+insert into t1 values('i'),('i'),(0xE38184),(0xE38184);
+select * from t1 union distinct select * from t2;
+a
+a
+あ
+i
+い
+drop table t1,t2;
+set names utf8mb4;
+create table t1 (a char(10), b varchar(10));
+insert into t1 values ('bar','kostja');
+insert into t1 values ('kostja','bar');
+prepare my_stmt from "select * from t1 where a=?";
+set @a:='bar';
+execute my_stmt using @a;
+a b
+bar kostja
+set @a:='kostja';
+execute my_stmt using @a;
+a b
+kostja bar
+set @a:=null;
+execute my_stmt using @a;
+a b
+drop table if exists t1;
+drop table if exists t1;
+drop view if exists v1, v2;
+set names utf8mb4;
+create table t1(col1 varchar(12) character set utf8mb4 collate utf8mb4_unicode_ci);
+insert into t1 values('t1_val');
+create view v1 as select 'v1_val' as col1;
+select coercibility(col1), collation(col1) from v1;
+coercibility(col1) collation(col1)
+4 utf8mb4_general_ci
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1)from v2;
+coercibility(col1) collation(col1)
+2 utf8mb4_unicode_ci
+2 utf8mb4_unicode_ci
+drop view v1, v2;
+create view v1 as select 'v1_val' collate utf8mb4_swedish_ci as col1;
+select coercibility(col1), collation(col1) from v1;
+coercibility(col1) collation(col1)
+0 utf8mb4_swedish_ci
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1) from v2;
+coercibility(col1) collation(col1)
+0 utf8mb4_swedish_ci
+0 utf8mb4_swedish_ci
+drop view v1, v2;
+drop table t1;
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, N'x', N'y')) from t1;
+concat(a, if(b>10, N'x', N'y'))
+ay
+select concat(a, if(b>10, N'æ', N'ß')) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1;
+concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y'))
+ay
+select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1;
+concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79))
+ay
+select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
+concat(a, if(b>10, 'x' 'x', 'y' 'y'))
+ayy
+select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
+CREATE TABLE t1 (
+colA int(11) NOT NULL,
+colB varchar(255) character set utf8mb4 NOT NULL,
+PRIMARY KEY (colA)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 (colA, colB) VALUES (1, 'foo'), (2, 'foo bar');
+CREATE TABLE t2 (
+colA int(11) NOT NULL,
+colB varchar(255) character set utf8mb4 NOT NULL,
+KEY bad (colA,colB(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar');
+SELECT * FROM t1 JOIN t2 ON t1.colA=t2.colA AND t1.colB=t2.colB
+WHERE t1.colA < 3;
+colA colB colA colB
+1 foo 1 foo
+2 foo bar 2 foo bar
+DROP TABLE t1, t2;
+SELECT 'н1234567890' UNION SELECT _binary '1';
+н1234567890
+н1234567890
+1
+SELECT 'н1234567890' UNION SELECT 1;
+н1234567890
+н1234567890
+1
+SELECT '1' UNION SELECT 'н1234567890';
+1
+1
+н1234567890
+SELECT 1 UNION SELECT 'н1234567890';
+1
+1
+н1234567890
+CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8mb4;
+CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT);
+INSERT INTO t1 (c) VALUES ('н1234567890');
+INSERT INTO t2 (b, i) VALUES ('1', 1);
+SELECT c FROM t1 UNION SELECT b FROM t2;
+c
+н1234567890
+1
+SELECT c FROM t1 UNION SELECT i FROM t2;
+c
+н1234567890
+1
+SELECT b FROM t2 UNION SELECT c FROM t1;
+b
+1
+н1234567890
+SELECT i FROM t2 UNION SELECT c FROM t1;
+i
+1
+н1234567890
+DROP TABLE t1, t2;
+set sql_mode=traditional;
+select hex(char(0xFF using utf8mb4));
+hex(char(0xFF using utf8mb4))
+NULL
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF'
+select hex(convert(0xFF using utf8mb4));
+hex(convert(0xFF using utf8mb4))
+NULL
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF'
+select hex(_utf8mb4 0x616263FF);
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+select hex(_utf8mb4 X'616263FF');
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+select hex(_utf8mb4 B'001111111111');
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+select (_utf8mb4 X'616263FF');
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+set sql_mode=default;
+select hex(char(0xFF using utf8mb4));
+hex(char(0xFF using utf8mb4))
+
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF'
+select hex(convert(0xFF using utf8mb4));
+hex(convert(0xFF using utf8mb4))
+
+Warnings:
+Warning 1300 Invalid utf8mb4 character string: 'FF'
+select hex(_utf8mb4 0x616263FF);
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+select hex(_utf8mb4 X'616263FF');
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+select hex(_utf8mb4 B'001111111111');
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+select (_utf8mb4 X'616263FF');
+ERROR HY000: Invalid utf8mb4 character string: 'FF'
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
+INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70000 1092
+70001 1085
+70002 1065
+ALTER TABLE t1 ADD UNIQUE (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+DROP INDEX b ON t1;
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+ALTER TABLE t1 ADD INDEX (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+DROP TABLE t1;
+#
+# Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+predicted_order int NOT NULL,
+utf8mb4_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
+SELECT predicted_order, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_sinhala_ci;
+predicted_order hex(utf8mb4_encoding)
+1 E0B7B4
+2 E0B685
+3 E0B686
+4 E0B687
+5 E0B688
+6 E0B689
+7 E0B68A
+8 E0B68B
+9 E0B68C
+10 E0B68D
+11 E0B68E
+12 E0B68F
+13 E0B690
+14 E0B691
+15 E0B692
+16 E0B693
+17 E0B694
+18 E0B695
+19 E0B696
+20 E0B682
+21 E0B683
+22 E0B69A
+23 E0B69AE0B78F
+24 E0B69AE0B790
+25 E0B69AE0B791
+26 E0B69AE0B792
+27 E0B69AE0B793
+28 E0B69AE0B794
+29 E0B69AE0B796
+30 E0B69AE0B798
+31 E0B69AE0B7B2
+32 E0B69AE0B79F
+33 E0B69AE0B7B3
+34 E0B69AE0B799
+35 E0B69AE0B79A
+36 E0B69AE0B79B
+37 E0B69AE0B79C
+38 E0B69AE0B79D
+39 E0B69AE0B79E
+40 E0B69AE0B78A
+41 E0B69B
+42 E0B69C
+43 E0B69D
+44 E0B69E
+45 E0B69F
+46 E0B6A0
+47 E0B6A1
+48 E0B6A2
+49 E0B6A3
+50 E0B6A5
+51 E0B6A4
+52 E0B6A6
+53 E0B6A7
+54 E0B6A8
+55 E0B6A9
+56 E0B6AA
+57 E0B6AB
+58 E0B6AC
+59 E0B6AD
+60 E0B6AE
+61 E0B6AF
+62 E0B6B0
+63 E0B6B1
+64 E0B6B3
+65 E0B6B4
+66 E0B6B5
+67 E0B6B6
+68 E0B6B7
+69 E0B6B8
+70 E0B6B9
+71 E0B6BA
+72 E0B6BB
+73 E0B6BBE0B78AE2808D
+74 E0B6BD
+75 E0B780
+76 E0B781
+77 E0B782
+78 E0B783
+79 E0B784
+80 E0B785
+81 E0B786
+82 E0B78F
+83 E0B790
+84 E0B791
+85 E0B792
+86 E0B793
+87 E0B794
+88 E0B796
+89 E0B798
+90 E0B7B2
+91 E0B79F
+92 E0B7B3
+93 E0B799
+94 E0B79A
+95 E0B79B
+96 E0B79C
+97 E0B79D
+98 E0B79E
+99 E0B78A
+100 E0B78AE2808DE0B6BA
+101 E0B78AE2808DE0B6BB
+DROP TABLE t1;
+#
+# Bug#32914 Character sets: illegal characters in utf8mb4 and utf32 columns
+#
+create table t1 (utf8mb4 char(1) character set utf8mb4);
+Testing [F0][90..BF][80..BF][80..BF]
+insert into t1 values (0xF0908080);
+insert into t1 values (0xF0BFBFBF);
+insert into t1 values (0xF08F8080);
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x8F\x80\x80' for column 'utf8mb4' at row 1
+select hex(utf8mb4) from t1;
+hex(utf8mb4)
+F0908080
+F0BFBFBF
+
+delete from t1;
+Testing [F2..F3][80..BF][80..BF][80..BF]
+insert into t1 values (0xF2808080);
+insert into t1 values (0xF2BFBFBF);
+select hex(utf8mb4) from t1;
+hex(utf8mb4)
+F2808080
+F2BFBFBF
+delete from t1;
+Testing [F4][80..8F][80..BF][80..BF]
+insert into t1 values (0xF4808080);
+insert into t1 values (0xF48F8080);
+insert into t1 values (0xF4908080);
+Warnings:
+Warning 1366 Incorrect string value: '\xF4\x90\x80\x80' for column 'utf8mb4' at row 1
+select hex(utf8mb4) from t1;
+hex(utf8mb4)
+F4808080
+F48F8080
+
+drop table t1;
+#
+# Check strnxfrm() with odd length
+#
+set max_sort_length=5;
+select @@max_sort_length;
+@@max_sort_length
+5
+create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci);
+insert into t1 values ('a'),('b'),('c');
+select * from t1 order by a;
+a
+a
+b
+c
+alter table t1 modify a varchar(128) character set utf8mb4 collate utf8mb4_bin;
+select * from t1 order by a;
+a
+a
+b
+c
+drop table t1;
+set max_sort_length=default;
+#
+# Bug#26180: Can't add columns to tables created with utf8mb4 text indexes
+#
+CREATE TABLE t1 (
+clipid INT NOT NULL,
+Tape TINYTEXT,
+PRIMARY KEY (clipid),
+KEY tape(Tape(255))
+) CHARACTER SET=utf8mb4;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 1000 bytes
+ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `clipid` int(11) NOT NULL,
+ `mos` tinyint(4) DEFAULT '0',
+ `Tape` tinytext,
+ PRIMARY KEY (`clipid`),
+ KEY `tape` (`Tape`(250))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4
+DROP TABLE t1;
+#
+# Testing 4-byte values.
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+u_decimal int NOT NULL,
+utf8mb4_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES (119040, x'f09d8480'),
+# G CLEF
+(119070, x'f09d849e'),
+# HALF NOTE
+(119134, x'f09d859e'),
+# MUSICAL SYMBOL CROIX
+(119247, x'f09d878f'),
+# MATHEMATICAL BOLD ITALIC CAPITAL DELTA
+(120607, x'f09d9c9f'),
+# SANS-SERIF BOLD ITALIC CAPITAL PI
+(120735, x'f09d9e9f'),
+# <Plane 16 Private Use, Last> (last 4 byte character)
+(1114111, x'f48fbfbf'),
+# VARIATION SELECTOR-256
+(917999, x'f3a087af');
+INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480');
+INSERT INTO t1 VALUES (65131, x'efb9abf09d849ef09d859ef09d859ef09d8480f09d859fefb9abefb9abf09d85a0efb9ab');
+INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0');
+Warnings:
+Warning 1265 Data truncated for column 'utf8mb4_encoding' at row 1
+SELECT u_decimal, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_general_ci, BINARY utf8mb4_encoding;
+u_decimal hex(utf8mb4_encoding)
+65131 EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB
+119040 F09D8480
+119070 F09D849E
+119134 F09D859E
+119247 F09D878F
+120607 F09D9C9F
+120735 F09D9E9F
+917999 F3A087AF
+1114111 F48FBFBF
+119070 F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
+119070 F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
+INSERT INTO t1 VALUES (1114111, x'f5808080');
+Warnings:
+Warning 1366 Incorrect string value: '\xF5\x80\x80\x80' for column 'utf8mb4_encoding' at row 1
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t2 (
+u_decimal int NOT NULL,
+utf8mb3_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8mb3;
+INSERT INTO t2 VALUES (42856, x'ea9da8');
+INSERT INTO t2 VALUES (65131, x'efb9ab');
+INSERT INTO t2 VALUES (1114111, x'f48fbfbf');
+Warnings:
+Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBF' for column 'utf8mb3_encoding' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `u_decimal` int(11) NOT NULL,
+ `utf8mb4_encoding` varchar(10) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `u_decimal` int(11) NOT NULL,
+ `utf8mb3_encoding` varchar(10) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Testing that mixing utf8 and utf8mb4 collations returns utf8mb4
+#
+SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b'));
+CHARSET(CONCAT(_utf8mb4'a',_utf8'b'))
+utf8mb4
+CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL);
+INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf');
+SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0;
+CONCAT(utf8mb4, _utf8 x'ea9da8')
+CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL);
+INSERT INTO t2 VALUES (x'ea9da8');
+SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
+HEX(CONCAT(utf8mb4, utf8mb3))
+EA9DA8EA9DA8
+F48FBFBFEA9DA8
+SELECT CHARSET(CONCAT(utf8mb4, utf8mb3)) FROM t1, t2 LIMIT 1;
+CHARSET(CONCAT(utf8mb4, utf8mb3))
+utf8mb4
+CREATE TEMPORARY TABLE t3 AS SELECT *, concat(utf8mb4,utf8mb3) FROM t1, t2;
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TEMPORARY TABLE `t3` (
+ `utf8mb4` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
+ `utf8mb3` varchar(10) CHARACTER SET utf8 NOT NULL,
+ `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TEMPORARY TABLE t3;
+SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
+utf8mb4 utf8mb3
+􏿿 Ꝩ
+SELECT * FROM t1, t2 WHERE t1.utf8mb4 = t2.utf8mb3;
+utf8mb4 utf8mb3
+Ꝩ Ꝩ
+SELECT * FROM t1, t2 WHERE t1.utf8mb4 < t2.utf8mb3;
+utf8mb4 utf8mb3
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Check that mixing utf8mb4 with an invalid utf8 constant returns error
+#
+CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4);
+INSERT INTO t1 VALUES (x'f48fbfbf');
+SELECT CONCAT(utf8mb4, _utf8 '') FROM t1;
+ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
+SELECT CONCAT('a', _utf8 '') FROM t1;
+ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8_general_ci,COERCIBLE) for operation 'concat'
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
+#
+# End of tests
+#
diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result
index 5b0d82407a2..9afffe4c3bc 100644
--- a/mysql-test/r/default.result
+++ b/mysql-test/r/default.result
@@ -180,7 +180,6 @@ insert into bug20691 values (2, 3, 5, '0007-01-01', 11, 13, 17, '0019-01-01 00:0
insert into bug20691 values (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 4);
Warnings:
Warning 1364 Field 'a' doesn't have a default value
-Warning 1364 Field 'b' doesn't have a default value
Warning 1364 Field 'c' doesn't have a default value
Warning 1364 Field 'd' doesn't have a default value
Warning 1364 Field 'e' doesn't have a default value
@@ -193,7 +192,7 @@ a b c d e f g h i x
two large 00:00:05 0007-01-01 11 13 17 0019-01-01 00:00:00 23 1
small 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 2
two large 00:00:05 0007-01-01 11 13 17 0019-01-01 00:00:00 23 3
- 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 4
+ small 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 4
drop table bug20691;
create table t1 (id int not null);
insert into t1 values(default);
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index d6eb1fbabe9..733614b765a 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -278,6 +278,18 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
DROP TABLE t1;
DROP FUNCTION f1;
+#
+# Bug #49552 : sql_buffer_result cause crash + not found records
+# in multitable delete/subquery
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SET SESSION SQL_BUFFER_RESULT=1;
+DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
+SET SESSION SQL_BUFFER_RESULT=DEFAULT;
+SELECT * FROM t1;
+a
+DROP TABLE t1;
End of 5.0 tests
DROP DATABASE IF EXISTS db1;
DROP DATABASE IF EXISTS db2;
@@ -478,16 +490,4 @@ END |
DELETE IGNORE FROM t1;
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
DROP TABLE t1;
-#
-# Bug #49552 : sql_buffer_result cause crash + not found records
-# in multitable delete/subquery
-#
-CREATE TABLE t1(a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-SET SESSION SQL_BUFFER_RESULT=1;
-DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
-SET SESSION SQL_BUFFER_RESULT=DEFAULT;
-SELECT * FROM t1;
-a
-DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 68560f27a66..1d9fa20f673 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -611,6 +611,26 @@ WHERE t3.a=t1.a AND MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE)
count(*)
0
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a VARCHAR(4), FULLTEXT(a));
+INSERT INTO t1 VALUES
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('awrd'),('cwrd'),
+('awrd');
+SELECT COUNT(*) FROM t1 WHERE MATCH(a) AGAINST("+awrd bwrd* +cwrd*" IN BOOLEAN MODE);
+COUNT(*)
+0
+DROP TABLE t1;
#
# Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
# fulltext search and row op
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index ebec186591d..2d2ca10f54b 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -625,7 +625,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
select f2,group_concat(f1) from t1 group by f2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 f2 f2 253 255 255 Y 0 0 8
-def group_concat(f1) 253 400 1 Y 128 0 63
+def group_concat(f1) 253 400 1 Y 0 0 8
f2 group_concat(f1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
@@ -737,7 +737,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
select f2,group_concat(f1) from t1 group by f2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 f2 f2 253 255 255 Y 0 0 8
-def group_concat(f1) 252 1024 1 Y 128 0 63
+def group_concat(f1) 252 1024 1 Y 0 0 8
f2 group_concat(f1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
@@ -986,6 +986,23 @@ GROUP BY t1.a
1
1
DROP TABLE t1, t2;
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (),();
+EXPLAIN EXTENDED SELECT 1 FROM
+(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Distinct
+2 DERIVED td ALL NULL NULL NULL NULL 2 100.00 Distinct; Using join buffer
+Warnings:
+Note 1003 select 1 AS `1` from `test`.`t1`
+SELECT 1 FROM
+(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
+1
+1
+1
+DROP TABLE t1;
End of 5.0 tests
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a VARCHAR(6), b INT);
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 3d43cbbfd76..72cf1473594 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -761,7 +761,7 @@ latin2 latin2_general_ci 2
drop table t1;
select charset(null), collation(null), coercibility(null);
charset(null) collation(null) coercibility(null)
-binary binary 5
+binary binary 6
CREATE TABLE t1 (a int, b int);
CREATE TABLE t2 (a int, b int);
INSERT INTO t1 VALUES (1,1),(2,2);
@@ -777,7 +777,7 @@ a b a b
1 1 NULL NULL
2 2 2 2
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
-where coercibility(t2.a) = 2 order by t1.a,t2.a;
+where coercibility(t2.a) = 5 order by t1.a,t2.a;
a b a b
1 1 NULL NULL
2 2 2 2
@@ -1230,13 +1230,13 @@ create table t1 (i int);
insert into t1 values (1000000000),(1);
select lpad(i, 7, ' ') as t from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def t 253 7 7 Y 128 31 63
+def t 253 7 7 Y 0 31 8
t
1000000
1
select rpad(i, 7, ' ') as t from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def t 253 7 7 Y 128 31 63
+def t 253 7 7 Y 0 31 8
t
1000000
1
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index e6063047ba4..36340de7de1 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1704,3 +1704,91 @@ COUNT(i)
1
DROP TABLE t1;
SET @@sql_mode = @old_sql_mode;
+#
+# Bug #45640: optimizer bug produces wrong results
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (4, 40), (1, 10), (2, 20), (2, 20), (3, 30);
+# should return 4 ordered records:
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
+aa COUNT(DISTINCT b)
+1 1
+2 1
+3 1
+4 1
+SELECT (SELECT (SELECT t1.a)) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
+aa COUNT(DISTINCT b)
+1 1
+2 1
+3 1
+4 1
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
+aa COUNT(DISTINCT b)
+1 1
+2 1
+3 1
+4 1
+# should return the same result in a reverse order:
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
+aa COUNT(DISTINCT b)
+4 1
+3 1
+2 1
+1 1
+# execution plan should not use temporary table:
+EXPLAIN EXTENDED
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using filesort
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select `test`.`t1`.`a` AS `a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by ((select `test`.`t1`.`a` AS `a`) + 0)
+EXPLAIN EXTENDED
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using filesort
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select `test`.`t1`.`a` AS `a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by -((select `test`.`t1`.`a` AS `a`))
+# should return only one record
+SELECT (SELECT tt.a FROM t1 tt LIMIT 1) aa, COUNT(DISTINCT b) FROM t1
+GROUP BY aa;
+aa COUNT(DISTINCT b)
+4 4
+CREATE TABLE t2 SELECT DISTINCT a FROM t1;
+# originally reported queries (1st two columns of next two query
+# results should be same):
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
+FROM t1 GROUP BY aa, b;
+aa b COUNT(DISTINCT b)
+1 10 1
+2 20 1
+3 30 1
+4 40 1
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
+FROM t1 GROUP BY aa, b;
+aa b COUNT( b)
+1 10 1
+2 20 2
+3 30 1
+4 40 1
+# ORDER BY for sure:
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
+FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
+aa b COUNT(DISTINCT b)
+4 40 1
+3 30 1
+2 20 1
+1 10 1
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
+FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
+aa b COUNT( b)
+4 40 1
+3 30 1
+2 20 2
+1 10 1
+DROP TABLE t1, t2;
+#
+# End of 5.1 tests
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index 94069d0559c..2f38e7b983b 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -2524,6 +2524,19 @@ SELECT a, MAX(b) FROM t WHERE b GROUP BY a;
a MAX(b)
2 1
DROP TABLE t;
+CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, KEY (b));
+INSERT INTO t1 VALUES(1,1),(2,1);
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT 1 AS c, b FROM t1 WHERE b IN (1,2) GROUP BY c, b;
+c b
+1 1
+SELECT a FROM t1 WHERE b=1;
+a
+1
+2
+DROP TABLE t1;
End of 5.1 tests
#
# WL#3220 (Loose index scan for COUNT DISTINCT)
diff --git a/mysql-test/r/have_utf16.require b/mysql-test/r/have_utf16.require
new file mode 100644
index 00000000000..a1b5469cad7
--- /dev/null
+++ b/mysql-test/r/have_utf16.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+utf16_general_ci utf16 54 Yes Yes 1
diff --git a/mysql-test/r/have_utf32.require b/mysql-test/r/have_utf32.require
new file mode 100644
index 00000000000..710ddb8090c
--- /dev/null
+++ b/mysql-test/r/have_utf32.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+utf32_general_ci utf32 60 Yes Yes 1
diff --git a/mysql-test/r/have_utf8mb4.require b/mysql-test/r/have_utf8mb4.require
new file mode 100644
index 00000000000..1669b332d0d
--- /dev/null
+++ b/mysql-test/r/have_utf8mb4.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+utf8mb4_general_ci utf8mb4 45 Yes Yes 1
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index f0b934ebd3a..28e798f5475 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -430,4 +430,24 @@ SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
b COUNT(DISTINCT a)
NULL 1
DROP TABLE t1;
+#
+# Bug#50995 Having clause on subquery result produces incorrect results.
+#
+CREATE TABLE t1
+(
+id1 INT,
+id2 INT NOT NULL,
+INDEX id1(id2)
+);
+INSERT INTO t1 SET id1=1, id2=1;
+INSERT INTO t1 SET id1=2, id2=1;
+INSERT INTO t1 SET id1=3, id2=1;
+SELECT t1.id1,
+(SELECT 0 FROM DUAL
+WHERE t1.id1=t1.id1) AS amount FROM t1
+WHERE t1.id2 = 1
+HAVING amount > 0
+ORDER BY t1.id1;
+id1 amount
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 085e5440712..96b75312516 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -2276,6 +2276,28 @@ END|
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1,t2;
+#
+# Bug #49324: more valgrind errors in test_if_skip_sort_order
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
+#should not cause valgrind warnings
+SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
+1
+DROP TABLE t1;
+#
+# Bug#50843: Filesort used instead of clustered index led to
+# performance degradation.
+#
+create table t1(f1 int not null primary key, f2 int) engine=innodb;
+create table t2(f1 int not null, key (f1)) engine=innodb;
+insert into t1 values (1,1),(2,2),(3,3);
+insert into t2 values (1),(2),(3);
+explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 3
+1 SIMPLE t2 ref f1 f1 4 test.t1.f1 1 Using index
+drop table t1,t2;
+#
End of 5.1 tests
#
# Test for bug #39932 "create table fails if column for FK is in different
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index d443e20df76..d1234ecbd56 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -1128,3 +1128,31 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1, t2;
+CREATE TABLE t1(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+CREATE TABLE t2(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+INSERT INTO t1 VALUES ('1',null),(null,null);
+INSERT INTO t2 VALUES ('1',null),(null,null);
+CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
+ENGINE=MERGE UNION=(t1,t2);
+SELECT t1.a FROM mm1,t1;
+a
+NULL
+1
+NULL
+1
+NULL
+1
+NULL
+1
+DROP TABLE t1, t2, mm1;
+#
+# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
+#
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
+INSERT INTO t1 VALUES (0,0), (1,1);
+SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
+a b a b
+0 0 0 0
+1 1 1 1
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 58dd97ee9f3..5a200bb4783 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -126,7 +126,7 @@ renamed
1
select * from v3 where renamed=1 group by renamed;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def v3 v3 renamed renamed 8 12 0 Y 32896 0 63
+def v3 v3 renamed renamed 8 11 0 Y 32896 0 63
renamed
drop table t1;
drop view v1,v2,v3;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 2513e94137f..aae7ee6d6e0 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -634,4 +634,15 @@ select count(*) from t3 /* must be 1 */;
count(*)
1
drop table t1, t2, t3;
+#
+# Bug#49534: multitable IGNORE update with sql_safe_updates error
+# causes debug assertion
+#
+CREATE TABLE t1( a INT, KEY( a ) );
+INSERT INTO t1 VALUES (1), (2), (3);
+SET SESSION sql_safe_updates = 1;
+# Must not cause failed assertion
+UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
+ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
+DROP TABLE t1;
end of tests
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 37a53cecfb2..df53b1d1480 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1870,6 +1870,19 @@ CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 467455460
DROP TABLE t1;
+#
+# BUG#48438 - crash with error in unioned query against merge table and view...
+#
+SET GLOBAL table_open_cache=3;
+CREATE TABLE t1(a INT);
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+1
+SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+TABLE_ROWS DATA_LENGTH
+0 0
+DROP TABLE t1;
+SET GLOBAL table_open_cache=DEFAULT;
End of 5.0 tests
create table t1 (a int not null, key `a` (a) key_block_size=1024);
show create table t1;
@@ -2315,4 +2328,17 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+#
+# BUG#49628 - corrupt table after legal SQL, LONGTEXT column
+#
+CREATE TABLE t1(a INT, b LONGTEXT, UNIQUE(a));
+REPLACE INTO t1 VALUES
+(1, REPEAT('a', 129015)),(1, NULL),
+(2, NULL),(3, NULL),(4, NULL),(5, NULL),(6, NULL),(7, NULL),
+(1, REPEAT('b', 129016)),(1, NULL),
+(1, REPEAT('c', 129015)),(1, REPEAT('d', 129015));
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result
index 711402c764f..64f8aa63a30 100644
--- a/mysql-test/r/mysqld--help-notwin.result
+++ b/mysql-test/r/mysqld--help-notwin.result
@@ -1,8 +1,8 @@
The following options may be given as the first argument:
---print-defaults Print the program argument list and exit
---no-defaults Don't read default options from any options file
---defaults-file=# Only read default options from the given file #
---defaults-extra-file=# Read this file after the global files are read
+--print-defaults Print the program argument list and exit.
+--no-defaults Don't read default options from any option file.
+--defaults-file=# Only read default options from the given file #.
+--defaults-extra-file=# Read this file after the global files are read.
--abort-slave-event-count=#
Option used by mysql-test for debugging and testing of
@@ -60,7 +60,7 @@ The following options may be given as the first argument:
NDBCLUSTER table
--binlog-ignore-db=name
Tells the master that updates to the given database
- should not be logged tothe binary log.
+ should not be logged to the binary log.
--binlog-row-event-max-size=#
The maximum size of a row-based binary log event in
bytes. Rows will be grouped into events smaller than this
@@ -90,7 +90,7 @@ The following options may be given as the first argument:
NEVER, AUTO, ALWAYS
--connect-timeout=# The number of seconds the mysqld server is waiting for a
connect packet before responding with 'Bad handshake'
- --console Write error output on screen; Don't remove the console
+ --console Write error output on screen; don't remove the console
window on windows.
--core-file Write core on errors.
-h, --datadir=name Path to the database root directory
@@ -132,7 +132,7 @@ The following options may be given as the first argument:
Enable the event scheduler. Possible values are ON, OFF,
and DISABLED (keep the event scheduler completely
deactivated, it cannot be activated run-time)
- -T, --exit-info[=#] Used for debugging; Use at your own risk!
+ -T, --exit-info[=#] Used for debugging. Use at your own risk.
--expire-logs-days=#
If non-zero, binary logs will be purged after
expire_logs_days days; possible purges happen at startup
@@ -157,7 +157,7 @@ The following options may be given as the first argument:
Number of best matches to use for query expansion
--ft-stopword-file=name
Use stopwords from this file instead of built-in list
- --gdb Set up signals usable for debugging
+ --gdb Set up signals usable for debugging.
--general-log Log connections and queries to a table or log file.
Defaults logging to a file hostname.log or a table
mysql.general_logif --log-output=TABLE is used
@@ -254,7 +254,7 @@ The following options may be given as the first argument:
log if it is open.
--log-tc=name Path to transaction coordinator log (used for
transactions that affect more than one storage engine,
- when binary log is disabled)
+ when binary log is disabled).
--log-tc-size=# Size of transaction coordinator log.
-W, --log-warnings[=#]
Log some not critical warnings to the log file
@@ -372,10 +372,11 @@ The following options may be given as the first argument:
--old-passwords Use old password encryption method (needed for 4.0 and
older clients)
--old-style-user-limits
- Enable old-style user limits (before 5.0.3 user resources
- were counted per each user+host vs. per account)
- --one-thread (deprecated): Only use one thread (for debugging under
- Linux). Use thread-handling=no-threads instead
+ Enable old-style user limits (before 5.0.3, user
+ resources were counted per each user+host vs. per
+ account).
+ --one-thread (Deprecated): Only use one thread (for debugging under
+ Linux). Use thread-handling=no-threads instead.
--open-files-limit=#
If this is not 0, then mysqld will use this value to
reserve file descriptors to use with setrlimit(). If this
@@ -448,7 +449,7 @@ The following options may be given as the first argument:
(3306), whatever comes first
--port-open-timeout=#
Maximum time in seconds to wait for the port to become
- free. (Default: no wait)
+ free. (Default: No wait).
--preload-buffer-size=#
The size of the buffer that is allocated when preloading
indexes
@@ -483,8 +484,7 @@ The following options may be given as the first argument:
the SUPER privilege
--read-rnd-buffer-size=#
When reading rows in sorted order after a sort, the rows
- are read through this buffer to avoid a disk seeks. If
- not set, then it's set to the value of record_buffer
+ are read through this buffer to avoid a disk seeks
--relay-log=name The location and name to use for relay logs
--relay-log-index=name
The location and name to use for the file that keeps a
@@ -591,14 +591,15 @@ The following options may be given as the first argument:
--server-id=# Uniquely identifies the server instance in the community
of replication partners
--show-slave-auth-info
- Show user and password in SHOW SLAVE HOSTS on this master
+ Show user and password in SHOW SLAVE HOSTS on this
+ master.
--skip-grant-tables Start without grant tables. This gives all users FULL
- ACCESS to all tables!
+ ACCESS to all tables.
--skip-host-cache Don't cache host names.
--skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
'localhost'.
--skip-networking Don't allow connection with TCP/IP
- --skip-new Don't use new, possible wrong routines.
+ --skip-new Don't use new, possibly wrong routines.
--skip-show-database
Don't allow 'SHOW DATABASE' commands
--skip-slave-start If set, slave is not autostarted.
@@ -713,11 +714,8 @@ The following options may be given as the first argument:
Prohibit update of a VIEW, which does not contain a key
of the underlying table and the query uses a LIMIT clause
(usually get from GUI tools)
- -s, --use-symbolic-links
- Enable symbolic link support. Deprecated option; use
- --symbolic-links instead.
-u, --user=name Run mysqld daemon as user.
- -v, --verbose Used with --help option for detailed help
+ -v, --verbose Used with --help option for detailed help.
-V, --version Output version information and exit.
--wait-timeout=# The number of seconds the server waits for activity on a
connection before closing it
@@ -939,7 +937,6 @@ transaction-alloc-block-size 8192
transaction-isolation REPEATABLE-READ
transaction-prealloc-size 4096
updatable-views-with-limit YES
-use-symbolic-links FALSE
verbose TRUE
wait-timeout 28800
diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result
index 9804cfce78b..e51e0ed76b5 100644
--- a/mysql-test/r/mysqld--help-win.result
+++ b/mysql-test/r/mysqld--help-win.result
@@ -1,8 +1,8 @@
The following options may be given as the first argument:
---print-defaults Print the program argument list and exit
---no-defaults Don't read default options from any options file
---defaults-file=# Only read default options from the given file #
---defaults-extra-file=# Read this file after the global files are read
+--print-defaults Print the program argument list and exit.
+--no-defaults Don't read default options from any option file.
+--defaults-file=# Only read default options from the given file #.
+--defaults-extra-file=# Read this file after the global files are read.
--abort-slave-event-count=#
Option used by mysql-test for debugging and testing of
@@ -60,7 +60,7 @@ The following options may be given as the first argument:
NDBCLUSTER table
--binlog-ignore-db=name
Tells the master that updates to the given database
- should not be logged tothe binary log.
+ should not be logged to the binary log.
--binlog-row-event-max-size=#
The maximum size of a row-based binary log event in
bytes. Rows will be grouped into events smaller than this
@@ -90,7 +90,7 @@ The following options may be given as the first argument:
NEVER, AUTO, ALWAYS
--connect-timeout=# The number of seconds the mysqld server is waiting for a
connect packet before responding with 'Bad handshake'
- --console Write error output on screen; Don't remove the console
+ --console Write error output on screen; don't remove the console
window on windows.
--core-file Write core on errors.
-h, --datadir=name Path to the database root directory
@@ -132,7 +132,7 @@ The following options may be given as the first argument:
Enable the event scheduler. Possible values are ON, OFF,
and DISABLED (keep the event scheduler completely
deactivated, it cannot be activated run-time)
- -T, --exit-info[=#] Used for debugging; Use at your own risk!
+ -T, --exit-info[=#] Used for debugging. Use at your own risk.
--expire-logs-days=#
If non-zero, binary logs will be purged after
expire_logs_days days; possible purges happen at startup
@@ -157,7 +157,7 @@ The following options may be given as the first argument:
Number of best matches to use for query expansion
--ft-stopword-file=name
Use stopwords from this file instead of built-in list
- --gdb Set up signals usable for debugging
+ --gdb Set up signals usable for debugging.
--general-log Log connections and queries to a table or log file.
Defaults logging to a file hostname.log or a table
mysql.general_logif --log-output=TABLE is used
@@ -253,7 +253,7 @@ The following options may be given as the first argument:
log if it is open.
--log-tc=name Path to transaction coordinator log (used for
transactions that affect more than one storage engine,
- when binary log is disabled)
+ when binary log is disabled).
--log-tc-size=# Size of transaction coordinator log.
-W, --log-warnings[=#]
Log some not critical warnings to the log file
@@ -372,10 +372,11 @@ The following options may be given as the first argument:
--old-passwords Use old password encryption method (needed for 4.0 and
older clients)
--old-style-user-limits
- Enable old-style user limits (before 5.0.3 user resources
- were counted per each user+host vs. per account)
- --one-thread (deprecated): Only use one thread (for debugging under
- Linux). Use thread-handling=no-threads instead
+ Enable old-style user limits (before 5.0.3, user
+ resources were counted per each user+host vs. per
+ account).
+ --one-thread (Deprecated): Only use one thread (for debugging under
+ Linux). Use thread-handling=no-threads instead.
--open-files-limit=#
If this is not 0, then mysqld will use this value to
reserve file descriptors to use with setrlimit(). If this
@@ -448,7 +449,7 @@ The following options may be given as the first argument:
(3306), whatever comes first
--port-open-timeout=#
Maximum time in seconds to wait for the port to become
- free. (Default: no wait)
+ free. (Default: No wait).
--preload-buffer-size=#
The size of the buffer that is allocated when preloading
indexes
@@ -483,8 +484,7 @@ The following options may be given as the first argument:
the SUPER privilege
--read-rnd-buffer-size=#
When reading rows in sorted order after a sort, the rows
- are read through this buffer to avoid a disk seeks. If
- not set, then it's set to the value of record_buffer
+ are read through this buffer to avoid a disk seeks
--relay-log=name The location and name to use for relay logs
--relay-log-index=name
The location and name to use for the file that keeps a
@@ -594,14 +594,15 @@ The following options may be given as the first argument:
--shared-memory-base-name=name
Base name of shared memory
--show-slave-auth-info
- Show user and password in SHOW SLAVE HOSTS on this master
+ Show user and password in SHOW SLAVE HOSTS on this
+ master.
--skip-grant-tables Start without grant tables. This gives all users FULL
- ACCESS to all tables!
+ ACCESS to all tables.
--skip-host-cache Don't cache host names.
--skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
'localhost'.
--skip-networking Don't allow connection with TCP/IP
- --skip-new Don't use new, possible wrong routines.
+ --skip-new Don't use new, possibly wrong routines.
--skip-show-database
Don't allow 'SHOW DATABASE' commands
--skip-slave-start If set, slave is not autostarted.
@@ -717,11 +718,8 @@ The following options may be given as the first argument:
Prohibit update of a VIEW, which does not contain a key
of the underlying table and the query uses a LIMIT clause
(usually get from GUI tools)
- -s, --use-symbolic-links
- Enable symbolic link support. Deprecated option; use
- --symbolic-links instead.
-u, --user=name Run mysqld daemon as user.
- -v, --verbose Used with --help option for detailed help
+ -v, --verbose Used with --help option for detailed help.
-V, --version Output version information and exit.
--wait-timeout=# The number of seconds the server waits for activity on a
connection before closing it
@@ -945,7 +943,6 @@ transaction-alloc-block-size 8192
transaction-isolation REPEATABLE-READ
transaction-prealloc-size 4096
updatable-views-with-limit YES
-use-symbolic-links FALSE
verbose TRUE
wait-timeout 28800
diff --git a/mysql-test/r/no_binlog.result b/mysql-test/r/no_binlog.result
new file mode 100644
index 00000000000..6ae267664fd
--- /dev/null
+++ b/mysql-test/r/no_binlog.result
@@ -0,0 +1,2 @@
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
diff --git a/mysql-test/r/partition_debug_sync.result b/mysql-test/r/partition_debug_sync.result
new file mode 100644
index 00000000000..5ab1044934b
--- /dev/null
+++ b/mysql-test/r/partition_debug_sync.result
@@ -0,0 +1,65 @@
+DROP TABLE IF EXISTS t1, t2;
+SET DEBUG_SYNC= 'RESET';
+#
+# Bug#42438: Crash ha_partition::change_table_ptr
+# Test when remove partitioning is done while drop table is waiting
+# for the table.
+# After MDL was introduced, there is no longer any race, so test is done
+# by adding a small sleep to verify that the delete waits.
+# Con 1
+SET DEBUG_SYNC= 'RESET';
+CREATE TABLE t1
+(a INTEGER,
+b INTEGER NOT NULL,
+KEY (b))
+ENGINE = MYISAM
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (2),
+PARTITION p1 VALUES LESS THAN (20),
+PARTITION p2 VALUES LESS THAN (100),
+PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
+SET SESSION debug= "+d,sleep_before_create_table_no_lock";
+SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter';
+SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL partitioning_removed';
+ALTER TABLE t1 REMOVE PARTITIONING;
+# Con default
+SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
+SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed';
+DROP TABLE IF EXISTS t1;
+# Con 1
+SET SESSION debug= "-d,sleep_before_create_table_no_lock";
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+#
+# Bug#42438: Crash ha_partition::change_table_ptr
+# Test when remove partitioning is failing due to drop table is already
+# in progress.
+# After MDL was introduced, there is no longer any race, so test is done
+# by adding a small sleep to verify that the alter waits.
+CREATE TABLE t2
+(a INTEGER,
+b INTEGER NOT NULL,
+KEY (b))
+ENGINE = MYISAM
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (2),
+PARTITION p1 VALUES LESS THAN (20),
+PARTITION p2 VALUES LESS THAN (100),
+PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
+SET DEBUG_SYNC= 'open_tables_acquire_upgradable_mdl SIGNAL removing_partitions WAIT_FOR waiting_for_alter';
+SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
+ALTER TABLE t2 REMOVE PARTITIONING;
+# Con default
+SET SESSION debug= "+d,sleep_before_part2_delete_table";
+SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
+SET DEBUG_SYNC= 'rm_table_part2_before_delete_table SIGNAL waiting_for_alter';
+SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done';
+DROP TABLE IF EXISTS t2;
+SET SESSION debug= "-d,sleep_before_part2_delete_table";
+# Con 1
+ERROR 42S02: Table 'test.t2' doesn't exist
+SET DEBUG_SYNC= 'RESET';
+# Con default
+SET DEBUG_SYNC= 'RESET';
+End of 5.1 tests
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 4f9444c1542..1eaa2e0d256 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1788,11 +1788,11 @@ t5 CREATE TABLE `t5` (
`const06` varchar(10) NOT NULL DEFAULT '',
`param06` longtext,
`const07` date DEFAULT NULL,
- `param07` longblob,
+ `param07` longtext,
`const08` varchar(19) NOT NULL DEFAULT '',
`param08` longtext,
`const09` datetime DEFAULT NULL,
- `param09` longblob,
+ `param09` longtext,
`const10` int(10) NOT NULL DEFAULT '0',
`param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL,
@@ -1818,11 +1818,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
def test t5 t5 const08 const08 253 19 19 N 1 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
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
@@ -1929,10 +1929,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -1976,10 +1976,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2026,10 +2026,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2066,10 +2066,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2114,10 +2114,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2158,10 +2158,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2204,10 +2204,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2242,10 +2242,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 772a7462342..06e232fd9b0 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1771,11 +1771,11 @@ t5 CREATE TABLE `t5` (
`const06` varchar(10) NOT NULL DEFAULT '',
`param06` longtext,
`const07` date DEFAULT NULL,
- `param07` longblob,
+ `param07` longtext,
`const08` varchar(19) NOT NULL DEFAULT '',
`param08` longtext,
`const09` datetime DEFAULT NULL,
- `param09` longblob,
+ `param09` longtext,
`const10` int(10) NOT NULL DEFAULT '0',
`param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL,
@@ -1801,11 +1801,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
def test t5 t5 const08 const08 253 19 19 N 1 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
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
@@ -1912,10 +1912,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -1959,10 +1959,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2009,10 +2009,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2049,10 +2049,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2097,10 +2097,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2141,10 +2141,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2187,10 +2187,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2225,10 +2225,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 84bf7a6fa00..1458f7d4514 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1772,11 +1772,11 @@ t5 CREATE TABLE `t5` (
`const06` varchar(10) NOT NULL DEFAULT '',
`param06` longtext,
`const07` date DEFAULT NULL,
- `param07` longblob,
+ `param07` longtext,
`const08` varchar(19) NOT NULL DEFAULT '',
`param08` longtext,
`const09` datetime DEFAULT NULL,
- `param09` longblob,
+ `param09` longtext,
`const10` int(10) NOT NULL DEFAULT '0',
`param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL,
@@ -1802,11 +1802,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
def test t5 t5 const08 const08 253 19 19 N 1 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
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
@@ -1913,10 +1913,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -1960,10 +1960,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2010,10 +2010,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2050,10 +2050,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2098,10 +2098,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2142,10 +2142,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2188,10 +2188,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2226,10 +2226,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 61d2822fd5b..ad750cccd52 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1708,11 +1708,11 @@ t5 CREATE TABLE `t5` (
`const06` varchar(10) NOT NULL DEFAULT '',
`param06` longtext,
`const07` date DEFAULT NULL,
- `param07` longblob,
+ `param07` longtext,
`const08` varchar(19) NOT NULL DEFAULT '',
`param08` longtext,
`const09` datetime DEFAULT NULL,
- `param09` longblob,
+ `param09` longtext,
`const10` int(10) NOT NULL DEFAULT '0',
`param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL,
@@ -1738,11 +1738,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
def test t5 t5 const08 const08 253 19 19 N 1 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
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
@@ -1849,10 +1849,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -1896,10 +1896,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -1946,10 +1946,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -1986,10 +1986,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2034,10 +2034,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2078,10 +2078,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2124,10 +2124,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2162,10 +2162,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -4730,11 +4730,11 @@ t5 CREATE TABLE `t5` (
`const06` varchar(10) NOT NULL DEFAULT '',
`param06` longtext,
`const07` date DEFAULT NULL,
- `param07` longblob,
+ `param07` longtext,
`const08` varchar(19) NOT NULL DEFAULT '',
`param08` longtext,
`const09` datetime DEFAULT NULL,
- `param09` longblob,
+ `param09` longtext,
`const10` int(10) NOT NULL DEFAULT '0',
`param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL,
@@ -4760,11 +4760,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
def test t5 t5 const08 const08 253 19 19 N 1 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
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
@@ -4871,10 +4871,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -4918,10 +4918,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -4968,10 +4968,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -5008,10 +5008,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -5056,10 +5056,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -5100,10 +5100,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -5146,10 +5146,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -5184,10 +5184,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
diff --git a/mysql-test/r/sp-bugs.result b/mysql-test/r/sp-bugs.result
index 14c5311bbe5..2374b433fba 100644
--- a/mysql-test/r/sp-bugs.result
+++ b/mysql-test/r/sp-bugs.result
@@ -44,4 +44,33 @@ SELECT f2 ();
f2 ()
NULL
DROP SCHEMA testdb;
+USE test;
+#
+# Bug#50423: Crash on second call of a procedure dropping a trigger
+#
+DROP TABLE IF EXISTS t1;
+DROP TRIGGER IF EXISTS tr1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
+CREATE PROCEDURE p1 () DROP TRIGGER tr1;
+CALL p1 ();
+CALL p1 ();
+ERROR HY000: Trigger does not exist
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Bug#50423: Crash on second call of a procedure dropping a trigger
+#
+DROP TABLE IF EXISTS t1;
+DROP TRIGGER IF EXISTS tr1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
+CREATE PROCEDURE p1 () DROP TRIGGER tr1;
+CALL p1 ();
+CALL p1 ();
+ERROR HY000: Trigger does not exist
+DROP TABLE t1;
+DROP PROCEDURE p1;
End of 5.1 tests
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 931e66dba73..e4170cc3a49 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -270,6 +270,17 @@ SELECT RELEASE_LOCK('Bug44521');
RELEASE_LOCK('Bug44521')
1
DROP PROCEDURE p;
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1);
+CREATE FUNCTION f1 (inp TEXT) RETURNS INT NO SQL RETURN sleep(60);
+CREATE VIEW v1 AS SELECT f1('a') FROM t1;
+SELECT * FROM v1;;
+SELECT * FROM v1;
+ERROR 70100: Query execution was interrupted
+ERROR 70100: Query execution was interrupted
+DROP VIEW v1;
+DROP TABLE t1;
+DROP FUNCTION f1;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index cd7af9651b9..640cc4f1452 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4886,4 +4886,16 @@ FROM t1,t1 a
);
1
DROP TABLE t1;
+#
+# Bug #45989 take 2 : memory leak after explain encounters an
+# error in the query
+#
+CREATE TABLE t1(a LONGTEXT);
+INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet));
+INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet));
+EXPLAIN EXTENDED SELECT DISTINCT 1 FROM t1,
+(SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) AS d1
+WHERE t1.a = d1.a;
+ERROR 42S22: Unknown column 'd1.a' in 'where clause'
+DROP TABLE t1;
End of 5.1 tests.
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index e8c8c6c65a4..f2f21b90e06 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -785,4 +785,19 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+#
+# Bug#50591 bit(31) causes Duplicate entry '1-NULL' for key 'group_key'
+#
+CREATE TABLE t1(a INT, b BIT(7) NOT NULL);
+INSERT INTO t1 VALUES (NULL, 0),(NULL, 0);
+SELECT SUM(a) FROM t1 GROUP BY b, a;
+SUM(a)
+NULL
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b BIT(7) NOT NULL, c BIT(8) NOT NULL);
+INSERT INTO t1 VALUES (NULL, 0, 0),(NULL, 0, 0);
+SELECT SUM(a) FROM t1 GROUP BY c, b, a;
+SUM(a)
+NULL
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index 054fda90c02..b5d16316c92 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -449,11 +449,11 @@ f4 datetime YES NULL
create table t5 as select coalesce(f1,f3) as f4 from t1;
desc t5;
Field Type Null Key Default Extra
-f4 varbinary(20) YES NULL
+f4 varchar(20) YES NULL
create table t6 as select coalesce(f2,f3) as f4 from t1;
desc t6;
Field Type Null Key Default Extra
-f4 varbinary(20) YES NULL
+f4 varchar(20) YES NULL
create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1;
desc t7;
Field Type Null Key Default Extra
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index 17398f93e18..ac3d52b9ead 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -271,7 +271,7 @@ drop table t2;
create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
show full columns from t2;
Field Type Collation Null Key Default Extra Privileges Comment
-auto bigint(12) unsigned NULL NO PRI 0 #
+auto int(6) unsigned NULL NO PRI 0 #
t1 int(1) NULL NO 0 #
t2 varchar(1) latin1_swedish_ci NO #
t3 varchar(256) latin1_swedish_ci NO #
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 71f7547386f..2d0914474a4 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` varbinary(2) NOT NULL DEFAULT ''
+ `a` varchar(2) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT 12 as a UNION select 12.2 as a;
@@ -655,7 +655,7 @@ f
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f` varbinary(12) DEFAULT NULL
+ `f` varchar(12) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT y from t2 UNION select da from t2;
@@ -666,7 +666,7 @@ y
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `y` varbinary(10) DEFAULT NULL
+ `y` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT y from t2 UNION select dt from t2;
@@ -677,7 +677,7 @@ y
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `y` varbinary(19) DEFAULT NULL
+ `y` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT da from t2 UNION select dt from t2;
@@ -699,7 +699,7 @@ testc
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `dt` varbinary(19) DEFAULT NULL
+ `dt` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT dt from t2 UNION select sv from t2;
@@ -710,7 +710,7 @@ testv
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `dt` varbinary(19) DEFAULT NULL
+ `dt` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT sc from t2 UNION select sv from t2;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 0e79446ba81..52f88a00d22 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3956,6 +3956,36 @@ CREATE VIEW v1 AS SELECT a FROM t1;
ALTER TABLE v1;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug#48449: hang on show create view after upgrading when
+# view contains function of view
+#
+DROP VIEW IF EXISTS v1,v2;
+DROP TABLE IF EXISTS t1,t2;
+DROP FUNCTION IF EXISTS f1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SELECT a FROM v2 INTO @a;
+RETURN @a;
+END//
+# Trigger pre-locking when opening v2.
+CREATE VIEW v1 AS SELECT f1() FROM t1;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `f1`() AS `f1()` from `t1` latin1 latin1_swedish_ci
+Warnings:
+Note 1599 View `test`.`v2` has no creation context
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;
+DROP FUNCTION f1;
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES ();
+CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE
+ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' )));
+DROP VIEW v1;
+DROP TABLE t1;
# -----------------------------------------------------------------
# -- End of 5.1 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 0c74d8ed91b..1412df20012 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -1237,3 +1237,14 @@ SELECT a FROM v2;
a
DROP USER mysqluser1;
DROP DATABASE mysqltest1;
+USE test;
+#
+# Bug#47734: Assertion failed: ! is_set() when locking a view with non-existing definer
+#
+DROP VIEW IF EXISTS v1;
+CREATE DEFINER=`unknown`@`unknown` SQL SECURITY DEFINER VIEW v1 AS SELECT 1;
+Warnings:
+Note 1449 The user specified as a definer ('unknown'@'unknown') does not exist
+LOCK TABLES v1 READ;
+ERROR HY000: The user specified as a definer ('unknown'@'unknown') does not exist
+DROP VIEW v1;
diff --git a/mysql-test/std_data/Index.xml b/mysql-test/std_data/Index.xml
index e4964a33419..27358fefd54 100644
--- a/mysql-test/std_data/Index.xml
+++ b/mysql-test/std_data/Index.xml
@@ -33,6 +33,36 @@
</collation>
</charset>
+
+ <charset name="utf8mb4">
+ <collation name="utf8mb4_test_ci" id="326">
+ <rules>
+ <reset>a</reset>
+ <s>b</s>
+ </rules>
+ </collation>
+ </charset>
+
+ <charset name="utf16">
+ <collation name="utf16_test_ci" id="327">
+ <rules>
+ <reset>a</reset>
+ <s>b</s>
+ </rules>
+ </collation>
+ </charset>
+
+
+ <charset name="utf32">
+ <collation name="utf32_test_ci" id="391">
+ <rules>
+ <reset>a</reset>
+ <s>b</s>
+ </rules>
+ </collation>
+ </charset>
+
+
<charset name="ucs2">
<collation name="ucs2_test_ci" id="358">
<rules>
diff --git a/mysql-test/std_data/bug48449.frm b/mysql-test/std_data/bug48449.frm
new file mode 100644
index 00000000000..b6a717427aa
--- /dev/null
+++ b/mysql-test/std_data/bug48449.frm
@@ -0,0 +1,12 @@
+TYPE=VIEW
+query=select `test`.`t2`.`a` AS `a` from `test`.`t2`
+md5=5e6eaf216e7b016fcedfd4e1113517af
+updatable=1
+algorithm=0
+definer_user=root
+definer_host=localhost
+suid=2
+with_check_option=0
+timestamp=2010-01-01 15:00:00
+create-version=1
+source=select * from t2
diff --git a/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt
index ad2c6a647b5..f8e46a44854 100644
--- a/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt
@@ -1 +1 @@
--O max_binlog_size=4096
+--max_binlog_size=4096
diff --git a/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
index ad2c6a647b5..f8e46a44854 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
@@ -1 +1 @@
--O max_binlog_size=4096
+--max_binlog_size=4096
diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
index fcb2d641cf0..cab660e391c 100644
--- a/mysql-test/suite/ndb/r/ps_7ndb.result
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result
@@ -1771,11 +1771,11 @@ t5 CREATE TABLE `t5` (
`const06` varchar(10) NOT NULL DEFAULT '',
`param06` longtext,
`const07` date DEFAULT NULL,
- `param07` longblob,
+ `param07` longtext,
`const08` varchar(19) NOT NULL DEFAULT '',
`param08` longtext,
`const09` datetime DEFAULT NULL,
- `param09` longblob,
+ `param09` longtext,
`const10` int(10) NOT NULL DEFAULT '0',
`param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL,
@@ -1801,11 +1801,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
def test t5 t5 const08 const08 253 19 19 N 1 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
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
@@ -1912,10 +1912,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -1959,10 +1959,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2009,10 +2009,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2049,10 +2049,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2097,10 +2097,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2141,10 +2141,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
@@ -2187,10 +2187,10 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 30 63
def @arg12 246 83 6 Y 32896 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 251 16777216 10 Y 0 31 8
+def @arg14 251 16777216 19 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 8 Y 0 31 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
@@ -2225,10 +2225,10 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 30 63
def @arg12 246 83 0 Y 32896 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 251 16777216 0 Y 0 31 8
+def @arg14 251 16777216 0 Y 0 31 8
+def @arg15 251 16777216 19 Y 0 31 8
+def @arg16 251 16777216 0 Y 0 31 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
index fd6a2c5d7c4..a4479f0c544 100644
--- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
@@ -46,3 +46,46 @@ include/stop_slave.inc
SET GLOBAL long_query_time= @old_long_query_time;
SET GLOBAL log_output= @old_log_output;
include/start_slave.inc
+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;
+SET @old_log_output= @@log_output;
+SET GLOBAL log_output= 'TABLE';
+SET GLOBAL long_query_time= 2;
+SET @old_long_query_time= @@long_query_time;
+SET SESSION long_query_time= 2;
+TRUNCATE mysql.slow_log;
+include/stop_slave.inc
+SET @old_log_output= @@log_output;
+SET GLOBAL log_output= 'TABLE';
+SET @old_long_query_time= @@long_query_time;
+SET GLOBAL long_query_time= 2;
+TRUNCATE mysql.slow_log;
+include/start_slave.inc
+CREATE TABLE t1 (a int, b int);
+********************************************************************
+**** INSERT one row that exceeds long_query_time
+**** Outcome: query ends up in both master and slave slow log
+********************************************************************
+INSERT INTO t1 values(1, sleep(3));
+### Assertion is good. Both Master and Slave exhibit the
+### same number of queries in slow log: 1
+TRUNCATE mysql.slow_log;
+TRUNCATE mysql.slow_log;
+********************************************************************
+**** Now do inserts again, but first add an index to the table.
+**** Outcome: Note that the slave contains the same one entry (as
+**** the master does) whereas before the patch it did not.
+********************************************************************
+ALTER TABLE t1 ADD INDEX id1(a);
+INSERT INTO t1 values(1, sleep(3));
+### Assertion is good. Both Master and Slave exhibit the
+### same number of queries in slow log: 1
+SET @@global.log_output= @old_log_output;
+SET @@global.long_query_time= @old_long_query_time;
+DROP TABLE t1;
+SET @@global.log_output= @old_log_output;
+SET @@global.long_query_time= @old_long_query_time;
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
index 95bca94fd3a..ad7fd508afe 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
@@ -1 +1 @@
--O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.1/data/relay-log
+--max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.1/data/relay-log
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
index e2aa63225a3..c8d2f85bcb7 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
@@ -1 +1 @@
--O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.2/data/relay-log
+--max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.2/data/relay-log
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
index d3ee2766314..63e65834e5b 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
@@ -4,6 +4,7 @@
# if the path of the load data file is a symbolic link.
#
--source include/master-slave.inc
+--source include/not_windows.inc
--source include/have_binlog_format_statement.inc
create table t1(a int not null auto_increment, b int, primary key(a) );
diff --git a/mysql-test/suite/rpl/t/rpl_packet-master.opt b/mysql-test/suite/rpl/t/rpl_packet-master.opt
index 42d4f94c999..412bc079caa 100644
--- a/mysql-test/suite/rpl/t/rpl_packet-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_packet-master.opt
@@ -1 +1 @@
--O max_allowed_packet=1024 -O net_buffer_length=1024
+--max_allowed_packet=1024 --net_buffer_length=1024
diff --git a/mysql-test/suite/rpl/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
index 42d4f94c999..412bc079caa 100644
--- a/mysql-test/suite/rpl/t/rpl_packet-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
@@ -1 +1 @@
--O max_allowed_packet=1024 -O net_buffer_length=1024
+--max_allowed_packet=1024 --net_buffer_length=1024
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
index e5b24dd9413..5cdfe28dd79 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
@@ -1,2 +1,2 @@
--O max_relay_log_size=16384
+--max_relay_log_size=16384
--log-warnings
diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
index c310d6a8a4f..6b97969d4c8 100644
--- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
@@ -191,3 +191,119 @@ source include/start_slave.inc;
disconnect extra;
disconnect extra2;
+
+#
+# BUG#50620: Adding an index to a table prevents slave from logging into slow log
+#
+
+-- source include/master-slave-reset.inc
+
+-- connection master
+SET @old_log_output= @@log_output;
+SET GLOBAL log_output= 'TABLE';
+SET GLOBAL long_query_time= 2;
+SET @old_long_query_time= @@long_query_time;
+SET SESSION long_query_time= 2;
+TRUNCATE mysql.slow_log;
+-- connection slave
+
+-- source include/stop_slave.inc
+SET @old_log_output= @@log_output;
+SET GLOBAL log_output= 'TABLE';
+SET @old_long_query_time= @@long_query_time;
+SET GLOBAL long_query_time= 2;
+TRUNCATE mysql.slow_log;
+-- source include/start_slave.inc
+
+let $slow_query= INSERT INTO t1 values(1, sleep(3));
+
+-- connection master
+CREATE TABLE t1 (a int, b int);
+
+-- echo ********************************************************************
+-- echo **** INSERT one row that exceeds long_query_time
+-- echo **** Outcome: query ends up in both master and slave slow log
+-- echo ********************************************************************
+
+-- disable_warnings
+-- eval $slow_query
+-- enable_warnings
+
+let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+-- sync_slave_with_master
+let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+
+if (`SELECT $master_slow_query != $slave_slow_query`)
+{
+ -- connection master
+ -- echo ***********************************************
+ -- echo ** DUMPING MASTER SLOW LOG CONTENTS
+ -- echo ***********************************************
+ SELECT * FROM mysql.slow_log;
+
+ -- connection slave
+ -- echo ***********************************************
+ -- echo ** DUMPING SLAVE SLOW LOG CONTENTS
+ -- echo ***********************************************
+ SELECT * FROM mysql.slow_log;
+
+ -- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
+}
+
+if (`SELECT $master_slow_query = $slave_slow_query`)
+{
+ -- echo ### Assertion is good. Both Master and Slave exhibit the
+ -- echo ### same number of queries in slow log: $master_slow_query
+}
+
+TRUNCATE mysql.slow_log;
+-- connection master
+TRUNCATE mysql.slow_log;
+
+-- echo ********************************************************************
+-- echo **** Now do inserts again, but first add an index to the table.
+-- echo **** Outcome: Note that the slave contains the same one entry (as
+-- echo **** the master does) whereas before the patch it did not.
+-- echo ********************************************************************
+
+ALTER TABLE t1 ADD INDEX id1(a);
+
+-- disable_warnings
+-- eval $slow_query
+-- enable_warnings
+
+let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+-- sync_slave_with_master
+let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+
+if (`SELECT $master_slow_query != $slave_slow_query`)
+{
+ -- connection master
+ -- echo ***********************************************
+ -- echo ** DUMPING MASTER SLOW LOG CONTENTS
+ -- echo ***********************************************
+ SELECT * FROM mysql.slow_log;
+
+ -- connection slave
+ -- echo ***********************************************
+ -- echo ** DUMPING SLAVE SLOW LOG CONTENTS
+ -- echo ***********************************************
+ SELECT * FROM mysql.slow_log;
+
+ -- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
+}
+
+if (`SELECT $master_slow_query = $slave_slow_query`)
+{
+ -- echo ### Assertion is good. Both Master and Slave exhibit the
+ -- echo ### same number of queries in slow log: $master_slow_query
+}
+
+-- connection master
+SET @@global.log_output= @old_log_output;
+SET @@global.long_query_time= @old_long_query_time;
+DROP TABLE t1;
+
+-- sync_slave_with_master
+SET @@global.log_output= @old_log_output;
+SET @@global.long_query_time= @old_long_query_time;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
index cf4319f2b40..2211d2dbb2d 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
@@ -1,3 +1,3 @@
--O max_relay_log_size=16384
+--max_relay_log_size=16384
--loose-innodb
--log-warnings
diff --git a/mysql-test/suite/sys_vars/r/character_set_client_basic.result b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
index 78993015a24..ed3612627e6 100644
--- a/mysql-test/suite/sys_vars/r/character_set_client_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
@@ -162,8 +162,16 @@ SET @@character_set_client = utf8;
SELECT @@character_set_client;
@@character_set_client
utf8
+SET @@character_set_client = utf8mb4;
+SELECT @@character_set_client;
+@@character_set_client
+utf8mb4
SET @@character_set_client = ucs2;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
+SET @@character_set_client = utf16;
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'utf16'
+SET @@character_set_client = utf32;
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'utf32'
SET @@character_set_client = cp866;
SELECT @@character_set_client;
@@character_set_client
@@ -422,7 +430,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-36
+39
'#--------------------FN_DYNVARS_010_10-------------------------#'
SET @@character_set_client = abc;
ERROR 42000: Unknown character set: 'abc'
diff --git a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
index dd1052d27ef..feb9073e175 100644
--- a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
@@ -424,7 +424,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-36
+39
'#--------------------FN_DYNVARS_011_10-------------------------#'
SET @@character_set_connection = abc;
ERROR 42000: Unknown character set: 'abc'
diff --git a/mysql-test/suite/sys_vars/r/character_set_database_basic.result b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
index 9aa449816f5..669af6a610c 100644
--- a/mysql-test/suite/sys_vars/r/character_set_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
@@ -424,7 +424,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-36
+39
'#--------------------FN_DYNVARS_012_10-------------------------#'
SET @@character_set_database = "grek";
ERROR 42000: Unknown character set: 'grek'
diff --git a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
index e33df353c74..e8d41d99437 100644
--- a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
@@ -402,7 +402,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-36
+39
'#--------------------FN_DYNVARS_008_10-------------------------#'
SET @@character_set_filesystem = abc;
ERROR 42000: Unknown character set: 'abc'
diff --git a/mysql-test/suite/sys_vars/r/character_set_results_basic.result b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
index 0b59f60cd45..6b50f128af8 100644
--- a/mysql-test/suite/sys_vars/r/character_set_results_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
Binary files differ
diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_func.result b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
index d5485e2e6d7..eb7efe4a004 100644
--- a/mysql-test/suite/sys_vars/r/slow_query_log_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
@@ -20,5 +20,21 @@ sleep(2)
SELECT count(*) > 0 FROM mysql.slow_log;
count(*) > 0
1
+'Bug#47905 stored procedures not logged correctly to slow query log'
+TRUNCATE mysql.slow_log;
+CREATE PROCEDURE p_test()
+BEGIN
+select sleep(2);
+select 1;
+END//
+CALL p_test();
+sleep(2)
+0
+1
+1
+SELECT count(*) > 0 FROM mysql.slow_log;
+count(*) > 0
+1
+DROP PROCEDURE p_test;
SET @@global.log_output = @global_log_output;
SET @global.slow_query_log = @global_slow_query_log;
diff --git a/mysql-test/suite/sys_vars/t/character_set_client_basic.test b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
index 26912e89509..7b3d36fb16f 100644
--- a/mysql-test/suite/sys_vars/t/character_set_client_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
@@ -27,6 +27,9 @@
--source include/have_sjis.inc
--source include/have_utf8.inc
--source include/have_ucs2.inc
+--source include/have_utf8mb4.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
--source include/load_sysvars.inc
###################################################
@@ -163,9 +166,15 @@ SET @@character_set_client = armscii8;
SELECT @@character_set_client;
SET @@character_set_client = utf8;
SELECT @@character_set_client;
+SET @@character_set_client = utf8mb4;
+SELECT @@character_set_client;
--error ER_WRONG_VALUE_FOR_VAR
SET @@character_set_client = ucs2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_client = utf16;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_client = utf32;
SET @@character_set_client = cp866;
SELECT @@character_set_client;
diff --git a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
index 1a51843e0e8..e402dbb0ff5 100644
--- a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
@@ -27,6 +27,9 @@
--source include/have_sjis.inc
--source include/have_utf8.inc
--source include/have_ucs2.inc
+--source include/have_utf8mb4.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
--source include/load_sysvars.inc
###################################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_database_basic.test b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
index 07b4b31b25c..4e650dc6139 100644
--- a/mysql-test/suite/sys_vars/t/character_set_database_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
@@ -27,6 +27,9 @@
--source include/have_sjis.inc
--source include/have_utf8.inc
--source include/have_ucs2.inc
+--source include/have_utf8mb4.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
--source include/load_sysvars.inc
###################################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
index 928d02ee46b..6bb2de35429 100644
--- a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
@@ -27,6 +27,9 @@
--source include/have_sjis.inc
--source include/have_utf8.inc
--source include/have_ucs2.inc
+--source include/have_utf8mb4.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
--source include/load_sysvars.inc
diff --git a/mysql-test/suite/sys_vars/t/character_set_results_basic.test b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
index 98635c00287..1bede9e493c 100644
--- a/mysql-test/suite/sys_vars/t/character_set_results_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
@@ -27,6 +27,9 @@
--source include/have_sjis.inc
--source include/have_utf8.inc
--source include/have_ucs2.inc
+--source include/have_utf8mb4.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
--source include/load_sysvars.inc
################################################
diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_func.test b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
index d2653f89de4..250d5210c46 100644
--- a/mysql-test/suite/sys_vars/t/slow_query_log_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
@@ -31,6 +31,27 @@ SELECT sleep(2);
SELECT count(*) > 0 FROM mysql.slow_log;
+
+#==========================================================================
+--echo 'Bug#47905 stored procedures not logged correctly to slow query log'
+#==========================================================================
+# assumes logging to table turned on with long_query_time=1 as above
+
+TRUNCATE mysql.slow_log;
+
+DELIMITER //;
+CREATE PROCEDURE p_test()
+BEGIN
+ select sleep(2);
+ select 1;
+END//
+DELIMITER ;//
+
+CALL p_test();
+SELECT count(*) > 0 FROM mysql.slow_log;
+DROP PROCEDURE p_test;
+
+
#restore
SET @@global.log_output = @global_log_output;
SET @global.slow_query_log = @global_slow_query_log;
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 5de34ec6db8..12dd4635b47 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1658,3 +1658,14 @@ INSERT INTO t1 (col1, col2) VALUES (1, "value");
REPAIR TABLE t1;
DROP TABLE t1;
remove_file $MYSQLD_DATADIR/test/t1.ARM;
+
+--echo #
+--echo # BUG#48757 - missing .ARZ file causes server crash
+--echo #
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+FLUSH TABLE t1;
+--remove_file $MYSQLD_DATADIR/test/t1.ARZ
+--error ER_FILE_NOT_FOUND
+SELECT * FROM t1;
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 5a589816dcd..e19bba971f9 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -327,3 +327,38 @@ drop table t1;
create table t1 select -9223372036854775809 bi;
describe t1;
drop table t1;
+
+--echo #
+--echo # Bug #45360: wrong results
+--echo #
+
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY,
+ a BIGINT(20) UNSIGNED,
+ b VARCHAR(20));
+
+INSERT INTO t1 (a) VALUES
+ (0),
+ (CAST(0x7FFFFFFFFFFFFFFF AS UNSIGNED)),
+ (CAST(0x8000000000000000 AS UNSIGNED)),
+ (CAST(0xFFFFFFFFFFFFFFFF AS UNSIGNED));
+
+UPDATE t1 SET b = a;
+
+let $n = `SELECT MAX(id) FROM t1`;
+while($n) {
+ let $x = `SELECT a FROM t1 WHERE id = $n`;
+ dec $n;
+ let $hex = `SELECT HEX($x)`;
+ echo # $hex;
+
+ --disable_result_log
+ eval EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = $x AND TRIM(a) = b;
+ --enable_result_log
+ SHOW WARNINGS;
+}
+
+DROP TABLE t1;
+
+--echo # End of 5.1 tests
+
+
diff --git a/mysql-test/t/bug39022.test b/mysql-test/t/bug39022.test
new file mode 100644
index 00000000000..268b207e0e5
--- /dev/null
+++ b/mysql-test/t/bug39022.test
@@ -0,0 +1,63 @@
+-- source include/have_log_bin.inc
+-- source include/have_innodb.inc
+-- source include/not_binlog_format_row.inc
+
+--echo #
+--echo # Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
+--echo #
+
+CREATE TABLE t1(a TINYINT NOT NULL,b TINYINT,PRIMARY KEY(b)) ENGINE=innodb;
+CREATE TABLE t2(d TINYINT NOT NULL,UNIQUE KEY(d)) ENGINE=innodb;
+INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
+(11,5),(11,6),(7,7),(7,8),(4,9),(6,10),(3,11),(11,12),
+(12,13),(7,14);
+INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
+(11),(12),(13),(14);
+
+connect (thread1, localhost, root,,);
+connect (thread2, localhost, root,,);
+
+connection thread1;
+--echo # in thread1
+START TRANSACTION;
+
+connection thread2;
+--echo # in thread2
+REPLACE INTO t2 VALUES (-17);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+
+connection thread1;
+--echo # in thread1
+REPLACE INTO t1(a,b) VALUES (67,20);
+
+connection thread2;
+--echo # in thread2
+COMMIT;
+START TRANSACTION;
+REPLACE INTO t1(a,b) VALUES (65,-50);
+REPLACE INTO t2 VALUES (-91);
+send;
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); #waits
+
+connection thread1;
+--echo # in thread1
+
+--echo # should not crash
+--error ER_LOCK_DEADLOCK
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); #crashes
+
+connection thread2;
+--echo # in thread2
+REAP;
+
+disconnect thread2;
+--source include/wait_until_disconnected.inc
+
+connection thread1;
+--echo # in thread1;
+disconnect thread1;
+--source include/wait_until_disconnected.inc
+
+connection default;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/cache_innodb-master.opt b/mysql-test/t/cache_innodb-master.opt
index 5f0ebff98f6..6672b4ddce1 100644
--- a/mysql-test/t/cache_innodb-master.opt
+++ b/mysql-test/t/cache_innodb-master.opt
@@ -1 +1 @@
---set-variable=query_cache_size=1M
+--query_cache_size=1M
diff --git a/mysql-test/t/count_distinct2-master.opt b/mysql-test/t/count_distinct2-master.opt
index d81cc55090d..2fa4c2b903d 100644
--- a/mysql-test/t/count_distinct2-master.opt
+++ b/mysql-test/t/count_distinct2-master.opt
@@ -1 +1 @@
---set-variable=max_heap_table_size=16384
+--max_heap_table_size=16384
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index ea949f463c9..609a49c7634 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1807,17 +1807,17 @@ unlock tables;
drop table t1;
#
-# Bug#41441 repair csv table crashes debug server
-#
-# Note: The test should be removed after Bug#33717 is fixed
+# Bug#33717 INSERT...(default) fails for enum. Crashes CSV tables, loads spaces for MyISAM
+#
+CREATE TABLE t1 (e enum('foo','bar') NOT NULL) ENGINE = CSV;
+INSERT INTO t1 VALUES();
+INSERT INTO t1 VALUES(default);
+INSERT INTO t1 VALUES(0);
+INSERT INTO t1 VALUES(3);
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+DROP TABLE t1;
-create table t1(a enum ('a') not null) engine=csv;
-insert into t1 values (2);
---error ER_CRASHED_ON_USAGE
-select * from t1 limit 1;
-repair table t1;
-select * from t1 limit 1;
-drop table t1;
#
# Bug #40814 CSV engine does not parse \X characters when they occur in unquoted fields
diff --git a/mysql-test/t/ctype_binary.test b/mysql-test/t/ctype_binary.test
new file mode 100644
index 00000000000..8b57854de83
--- /dev/null
+++ b/mysql-test/t/ctype_binary.test
@@ -0,0 +1,12 @@
+
+set names binary;
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--source include/ctype_numconv.inc
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test
index b6a1cfc3f98..4dfb0be3892 100644
--- a/mysql-test/t/ctype_cp1251.test
+++ b/mysql-test/t/ctype_cp1251.test
@@ -58,3 +58,13 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
# End of 4.1 tests
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--source include/ctype_numconv.inc
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index b12436f77ba..1733ee299d1 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -127,3 +127,14 @@ DROP TABLE `abcdef`;
select hex(cast(_ascii 0x7f as char(1) character set latin1));
--echo End of 5.0 tests
+
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--source include/ctype_numconv.inc
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
index 99d9cd5a866..d2f06a84a8c 100644
--- a/mysql-test/t/ctype_ldml.test
+++ b/mysql-test/t/ctype_ldml.test
@@ -1,4 +1,7 @@
--source include/have_ucs2.inc
+--source include/have_utf8mb4.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
--disable_warnings
drop table if exists t1;
@@ -40,6 +43,24 @@ insert into t1 values ('a');
select * from t1 where c1='b';
drop table t1;
+show collation like 'utf8mb4_test_ci';
+create table t1 (c1 char(1) character set utf8mb4 collate utf8mb4_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+drop table t1;
+
+show collation like 'utf16_test_ci';
+create table t1 (c1 char(1) character set utf16 collate utf16_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+drop table t1;
+
+show collation like 'utf32_test_ci';
+create table t1 (c1 char(1) character set utf32 collate utf32_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+drop table t1;
+
#
# Bug#41084 full-text index added to custom UCA collation not working
diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test
index 0903c3dd7fa..67726c53585 100644
--- a/mysql-test/t/ctype_many.test
+++ b/mysql-test/t/ctype_many.test
@@ -1,4 +1,7 @@
-- source include/have_ucs2.inc
+-- source include/have_utf8mb4.inc
+-- source include/have_utf16.inc
+-- source include/have_utf32.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
@@ -211,3 +214,73 @@ SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f;
DROP TABLE t1;
# End of 4.1 tests
+
+
+--echo #
+--echo # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32
+--echo # Testing that only utf8mb4 is superset for utf8
+--echo # No other Unicode character set pairs have superset/subset relations
+--echo #
+
+CREATE TABLE t1 (
+ utf8 CHAR CHARACTER SET utf8,
+ utf8mb4 CHAR CHARACTER SET utf8mb4,
+ ucs2 CHAR CHARACTER SET ucs2,
+ utf16 CHAR CHARACTER SET utf16,
+ utf32 CHAR CHARACTER SET utf32
+);
+INSERT INTO t1 VALUES ('','','','','');
+
+# utf8mb4 is superset only for utf8
+SELECT CHARSET(CONCAT(utf8, utf8mb4)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf8, ucs2)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf8, utf16)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf8, utf32)) FROM t1;
+
+
+# utf8mb4 is superset only for utf8
+SELECT CHARSET(CONCAT(utf8mb4, utf8)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf8mb4, ucs2)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf8mb4, utf16)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf8mb4, utf32)) FROM t1;
+
+
+# ucs2 is not a superset for the other Unicode character sets
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(ucs2, utf8)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(ucs2, utf8mb4)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(ucs2, utf16)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(ucs2, utf32)) FROM t1;
+
+
+# utf16 is not a superset for the other Unicode character sets
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf16, utf8)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf16, ucs2)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf16, utf8mb4)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf16, utf32)) FROM t1;
+
+
+# utf32 is not a superset for the other Unicode character sets
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf32, utf8)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf32, ucs2)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf32, utf8mb4)) FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 310576b9478..8d4b478e68d 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -733,3 +733,17 @@ SELECT HEX(DAYNAME(19700101));
SET character_set_connection=latin1;
--echo End of 5.0 tests
+
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+SET NAMES latin1;
+SET collation_connection=ucs2_general_ci;
+--source include/ctype_numconv.inc
+SET NAMES latin1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test
new file mode 100644
index 00000000000..b997bde6e7c
--- /dev/null
+++ b/mysql-test/t/ctype_utf16.test
@@ -0,0 +1,733 @@
+-- source include/have_utf16.inc
+-- source include/have_utf8mb4.inc
+
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+SET NAMES latin1;
+SET character_set_connection=utf16;
+select hex('a'), hex('a ');
+-- source include/endspace.inc
+
+
+# Check that incomplete utf16 characters in HEX notation
+# are left-padded with zeros
+#
+select hex(_utf16 0x44);
+select hex(_utf16 0x3344);
+select hex(_utf16 0x113344);
+
+
+# Check that 0x20 is only trimmed when it is
+# a part of real SPACE character, not just a part
+# of a multibyte sequence.
+# Note, CYRILLIC LETTER ER is used as an example, which
+# is stored as 0x0420 in utf16, thus contains 0x20 in the
+# low byte. The second character is THREE-PER-M, U+2004,
+# which contains 0x20 in the high byte.
+
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DELETE FROM t1;
+
+#
+# Check that real spaces are correctly trimmed.
+#
+INSERT INTO t1 VALUES (X'042000200020',X'042000200020'), (X'200400200020', X'200400200020');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DROP TABLE t1;
+
+
+#
+# Check LPAD/RPAD
+#
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'0421'));
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+SELECT hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+SELECT hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+SELECT hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'0421'));
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+SELECT hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+SELECT hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+SELECT hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+
+CREATE TABLE t1 SELECT
+LPAD(_utf16 X'0420',10,_utf16 X'0421') l,
+RPAD(_utf16 X'0420',10,_utf16 X'0421') r;
+SHOW CREATE TABLE t1;
+select hex(l), hex(r) from t1;
+DROP TABLE t1;
+
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+drop table t1;
+
+######################################################
+#
+# Test of like
+#
+
+SET NAMES latin1;
+SET character_set_connection=utf16;
+--source include/ctype_like.inc
+
+SET NAMES utf8;
+SET character_set_connection=utf16;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
+INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
+INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ');
+SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf16_bin ORDER BY BINARY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
+ENGINE=MyISAM CHARACTER SET utf16;
+INSERT INTO t1 (word) VALUES ("cat");
+SELECT * FROM t1 WHERE word LIKE "c%";
+SELECT * FROM t1 WHERE word LIKE "ca_";
+SELECT * FROM t1 WHERE word LIKE "cat";
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630025'; # "c%"
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630061005F'; # "ca_"
+DROP TABLE t1;
+
+
+#
+# Check that INSERT() works fine.
+# This invokes charpos() function.
+select insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066);
+select insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066);
+
+########################################################
+#
+# Bug 1264
+#
+# Description:
+#
+# When using a ucs2 table in MySQL,
+# either with ucs2_general_ci or ucs2_bin collation,
+# words are returned in an incorrect order when using ORDER BY
+# on an _indexed_ CHAR or VARCHAR column. They are sorted with
+# the longest word *first* instead of last. I.E. The word "aardvark"
+# is in the results before the word "a".
+#
+# If there is no index for the column, the problem does not occur.
+#
+# Interestingly, if there is no second column, the words are returned
+# in the correct order.
+#
+# According to EXPLAIN, it looks like when the output includes columns that
+# are not part of the index sorted on, it does a filesort, which fails.
+# Using a straight index yields correct results.
+
+SET NAMES latin1;
+
+#
+# Two fields, index
+#
+
+CREATE TABLE t1 (
+ word VARCHAR(64),
+ bar INT(11) default 0,
+ PRIMARY KEY (word))
+ ENGINE=MyISAM
+ CHARSET utf16
+ COLLATE utf16_general_ci ;
+
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+SELECT * FROM t1 ORDER BY word;
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+SELECT word FROM t1 ORDER by word;
+DROP TABLE t1;
+
+
+#
+# One field, index
+#
+
+CREATE TABLE t1 (
+ word VARCHAR(64) ,
+ PRIMARY KEY (word))
+ ENGINE=MyISAM
+ CHARSET utf16
+ COLLATE utf16_general_ci;
+
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY WORD;
+SELECT * FROM t1 ORDER BY word;
+DROP TABLE t1;
+
+
+#
+# Two fields, no index
+#
+
+CREATE TABLE t1 (
+ word TEXT,
+ bar INT(11) AUTO_INCREMENT,
+ PRIMARY KEY (bar))
+ ENGINE=MyISAM
+ CHARSET utf16
+ COLLATE utf16_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a" );
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+SELECT * FROM t1 ORDER BY word;
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+SELECT word FROM t1 ORDER BY word;
+DROP TABLE t1;
+
+#
+# END OF Bug 1264 test
+#
+########################################################
+
+
+#
+# Check alignment for from-binary-conversion with CAST and CONVERT
+#
+SELECT hex(cast(0xAA as char character set utf16));
+SELECT hex(convert(0xAA using utf16));
+
+#
+# Check alignment for string types
+#
+CREATE TABLE t1 (a char(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a varchar(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a text character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a mediumtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a longtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+##
+## Bug #5024 Server crashes with queries on fields
+## with certain charset/collation settings
+##
+##
+#create table t1 (s1 char character set utf16 collate utf16_czech_ci);
+#insert into t1 values ('0'),('1'),('2'),('a'),('b'),('c');
+#select s1 from t1 where s1 > 'a' order by s1;
+#drop table t1;
+#
+
+#
+# Bug #5081 : UCS2 fields are filled with '0x2020'
+# after extending field length
+#
+create table t1(a char(1)) default charset utf16;
+insert into t1 values ('a'),('b'),('c');
+alter table t1 modify a char(5);
+select a, hex(a) from t1;
+drop table t1;
+
+#
+# Check prepare statement from an UTF16 string
+#
+set @ivar= 1234;
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using utf16);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+
+#
+# Check that utf16 works with ENUM and SET type
+#
+set names utf8;
+create table t1 (a enum('x','y','z') character set utf16);
+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 utf16;
+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 utf16);
+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 utf16;
+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 NAMES latin1;
+SET collation_connection='utf16_general_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+SET NAMES latin1;
+SET collation_connection='utf16_bin';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+
+#
+# Bug#10344 Some string functions fail for UCS2
+#
+select hex(substr(_utf16 0x00e400e50068,1));
+select hex(substr(_utf16 0x00e400e50068,2));
+select hex(substr(_utf16 0x00e400e50068,3));
+select hex(substr(_utf16 0x00e400e50068,-1));
+select hex(substr(_utf16 0x00e400e50068,-2));
+select hex(substr(_utf16 0x00e400e50068,-3));
+select hex(substr(_utf16 0x00e400e5D800DC00,1));
+select hex(substr(_utf16 0x00e400e5D800DC00,2));
+select hex(substr(_utf16 0x00e400e5D800DC00,3));
+select hex(substr(_utf16 0x00e400e5D800DC00,-1));
+select hex(substr(_utf16 0x00e400e5D800DC00,-2));
+select hex(substr(_utf16 0x00e400e5D800DC00,-3));
+
+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;
+
+###
+### Bug #14583 Bug on query using a LIKE on indexed field with ucs2_bin collation
+###
+##--disable_warnings
+##create table t1(f1 varchar(5) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL) engine=InnoDB;
+##--enable_warnings
+##insert into t1 values('a');
+##create index t1f1 on t1(f1);
+##select f1 from t1 where f1 like 'a%';
+##drop table t1;
+
+#
+# Bug#9442 Set parameter make query fail if column character set is UCS2
+#
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+execute stmt using @param1;
+select utext from t1 where utext like '%%';
+drop table t1;
+deallocate prepare stmt;
+
+#
+# Bug#22052 Trailing spaces are not removed from UNICODE fields in an index
+#
+create table t1 (
+ a char(10) character set utf16 not null,
+ index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+# make sure "index read" is used
+explain select hex(a) from t1 order by a;
+select hex(a) from t1 order by a;
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+drop table t1;
+
+##
+## Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation
+## over a 'ucs2' field uses a temporary table
+##
+##CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
+##INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
+##SELECT id, MIN(s) FROM t1 GROUP BY id;
+##DROP TABLE t1;
+
+###
+### Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
+###
+##
+##--disable_warnings
+##drop table if exists bug20536;
+##--enable_warnings
+##
+##set names latin1;
+##create table bug20536 (id bigint not null auto_increment primary key, name
+##varchar(255) character set ucs2 not null);
+##insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431'), (2, "'test\\_2'");
+##select md5(name) from bug20536;
+##select sha1(name) from bug20536;
+##select make_set(3, name, upper(name)) from bug20536;
+##select export_set(5, name, upper(name)) from bug20536;
+##select export_set(5, name, upper(name), ",", 5) from bug20536;
+
+#
+# Bug #20108: corrupted default enum value for a ucs2 field
+#
+
+CREATE TABLE t1 (
+ status enum('active','passive') character set utf16 collate utf16_general_ci
+ NOT NULL default 'passive'
+);
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD a int NOT NULL AFTER status;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+##CREATE TABLE t2 (
+## status enum('active','passive') collate ucs2_turkish_ci
+## NOT NULL default 'passive'
+##);
+##SHOW CREATE TABLE t2;
+##ALTER TABLE t2 ADD a int NOT NULL AFTER status;
+##DROP TABLE t2;
+
+
+--echo End of 4.1 tests
+
+#
+# Conversion from an UTF16 string to a decimal column
+#
+CREATE TABLE t1 (a varchar(64) character set utf16, b decimal(10,3));
+INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
+update t1 set b=a;
+SELECT *, hex(a) FROM t1;
+DROP TABLE t1;
+
+#
+# Bug#9442 Set parameter make query fail if column character set is UCS2
+#
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+execute stmt using @param1;
+select utext from t1 where utext like '%%';
+drop table t1;
+deallocate prepare stmt;
+
+#
+# Bug#22638 SOUNDEX broken for international characters
+#
+set names latin1;
+set character_set_connection=utf16;
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
+select 'mood' sounds like 'mud';
+# Cyrillic A, BE, VE
+select hex(soundex(_utf16 0x041004110412));
+# Make sure that "U+00BF INVERTED QUESTION MARK" is not considered as letter
+select hex(soundex(_utf16 0x00BF00C0));
+set names latin1;
+
+#
+# Bug #14290: character_maximum_length for text fields
+#
+create table t1(a blob, b text charset utf16);
+select data_type, character_octet_length, character_maximum_length
+ from information_schema.columns where table_name='t1';
+drop table t1;
+
+
+set names latin1;
+set collation_connection=utf16_general_ci;
+#
+# Testing cs->coll->instr()
+#
+select position('bb' in 'abba');
+
+#
+# Testing cs->coll->hash_sort()
+#
+create table t1 (a varchar(10) character set utf16) engine=heap;
+insert into t1 values ('a'),('A'),('b'),('B');
+select * from t1 where a='a' order by binary a;
+select hex(min(binary a)),count(*) from t1 group by a;
+drop table t1;
+
+#
+# Testing cs->cset->numchars()
+#
+select char_length('abcd'), octet_length('abcd');
+select char_length(_utf16 0xD800DC00), octet_length(_utf16 0xD800DC00);
+select char_length(_utf16 0xD87FDFFF), octet_length(_utf16 0xD87FDFFF);
+
+#
+# Testing cs->cset->charpos()
+#
+select left('abcd',2);
+select hex(left(_utf16 0xD800DC00D87FDFFF, 1));
+select hex(right(_utf16 0xD800DC00D87FDFFF, 1));
+
+#
+# Testing cs->cset->well_formed_length()
+#
+create table t1 (a varchar(10) character set utf16);
+# Bad sequences
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf16 0xD800);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf16 0xDC00);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf16 0xD800D800);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf16 0xD800E800);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf16 0xD8000800);
+# Good sequences
+insert into t1 values (_utf16 0xD800DC00);
+insert into t1 values (_utf16 0xD800DCFF);
+insert into t1 values (_utf16 0xDBFFDC00);
+insert into t1 values (_utf16 0xDBFFDCFF);
+select hex(a) from t1;
+drop table t1;
+
+#
+# Bug#32393 Character sets: illegal characters in utf16 columns
+#
+# Tests that cs->cset->wc_mb() doesn't accept surrogate parts
+#
+# via alter
+#
+create table t1 (s1 varchar(50) character set ucs2);
+insert into t1 values (0xdf84);
+alter table t1 modify column s1 varchar(50) character set utf16;
+select hex(s1) from t1;
+drop table t1;
+#
+# via update
+#
+create table t1 (s1 varchar(5) character set ucs2, s2 varchar(5) character set utf16);
+insert into t1 (s1) values (0xdf84);
+update t1 set s2 = s1;
+select hex(s2) from t1;
+drop table t1;
+
+
+
+#
+# Testing cs->cset->lengthsp()
+#
+create table t1 (a char(10)) character set utf16;
+insert into t1 values ('a ');
+select hex(a) from t1;
+drop table t1;
+
+#
+# Testing cs->cset->caseup() and cs->cset->casedn()
+#
+select upper('abcd'), lower('ABCD');
+
+#
+# TODO: str_to_datetime() is broken and doesn't work with ucs2 and utf16
+# Testing cs->cset->snprintf()
+#
+#create table t1 (a date);
+#insert into t1 values ('2007-09-16');
+#select * from t1;
+#drop table t1;
+
+#
+# Testing cs->cset->l10tostr
+# !!! Not used in the code
+
+#
+# Testing cs->cset->ll10tostr
+#
+create table t1 (a varchar(10) character set utf16);
+insert into t1 values (123456);
+select a, hex(a) from t1;
+drop table t1;
+
+
+# Testing cs->cset->fill
+# SOUNDEX fills strings with DIGIT ZERO up to four characters
+select hex(soundex('a'));
+
+#
+# Testing cs->cset->strntol
+# !!! Not used in the code
+
+#
+# Testing cs->cset->strntoul
+#
+create table t1 (a enum ('a','b','c')) character set utf16;
+insert into t1 values ('1');
+select * from t1;
+drop table t1;
+
+#
+# Testing cs->cset->strntoll and cs->cset->strntoull
+#
+set names latin1;
+select hex(conv(convert('123' using utf16), -10, 16));
+select hex(conv(convert('123' using utf16), 10, 16));
+
+#
+# Testing cs->cset->strntod
+#
+set names latin1;
+set character_set_connection=utf16;
+select 1.1 + '1.2';
+select 1.1 + '1.2xxx';
+
+# Testing strntoll10_utf16
+# Testing cs->cset->strtoll10
+select left('aaa','1');
+
+#
+# Testing cs->cset->strntoull10rnd
+#
+create table t1 (a int);
+insert into t1 values ('-1234.1e2');
+insert into t1 values ('-1234.1e2xxxx');
+insert into t1 values ('-1234.1e2 ');
+select * from t1;
+drop table t1;
+
+#
+# Testing cs->cset->scan
+#
+create table t1 (a int);
+insert into t1 values ('1 ');
+insert into t1 values ('1 x');
+select * from t1;
+drop table t1;
+
+#
+# Testing auto-conversion to TEXT
+#
+create table t1 (a varchar(17000) character set utf16);
+show create table t1;
+drop table t1;
+
+#
+# Testing that maximim possible key length is 1000 bytes
+#
+create table t1 (a varchar(250) character set utf16 primary key);
+show create table t1;
+drop table t1;
+--error ER_TOO_LONG_KEY
+create table t1 (a varchar(334) character set utf16 primary key);
+
+#
+# Conversion to utf8
+#
+create table t1 (a char(1) character set utf16);
+insert into t1 values (0xD800DC00),(0xD800DCFF),(0xDB7FDC00),(0xDB7FDCFF);
+insert into t1 values (0x00C0), (0x00FF),(0xE000), (0xFFFF);
+select hex(a), hex(@a:=convert(a using utf8mb4)), hex(convert(@a using utf16)) from t1;
+drop table t1;
+
+#
+# Test basic regex functionality
+#
+set collation_connection=utf16_general_ci;
+--source include/ctype_regex.inc
+set names latin1;
+
+#
+# Test how character set works with date/time
+#
+SET collation_connection=utf16_general_ci;
+--source include/ctype_datetime.inc
+SET NAMES latin1;
+
+#
+# Bug#33073 Character sets: ordering fails with utf32
+#
+SET collation_connection=utf16_general_ci;
+CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE');
+SELECT * FROM t1 ORDER BY s1;
+SET max_sort_length=4;
+SELECT * FROM t1 ORDER BY s1;
+DROP TABLE t1;
+SET max_sort_length=DEFAULT;
+SET NAMES latin1;
+
+
+#
+## TODO: add tests for all engines
+#
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf16_uca.test b/mysql-test/t/ctype_utf16_uca.test
new file mode 100644
index 00000000000..5314777c6f4
--- /dev/null
+++ b/mysql-test/t/ctype_utf16_uca.test
@@ -0,0 +1,290 @@
+-- source include/have_utf16.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+set names utf8;
+set collation_connection=utf16_unicode_ci;
+select hex('a'), hex('a ');
+-- source include/endspace.inc
+
+#
+# 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 (
+ c char(20) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARACTER SET utf16 COLLATE utf16_unicode_ci;
+INSERT INTO t VALUES ('a'),('ab'),('aba');
+ALTER TABLE t ADD INDEX (c);
+SELECT c FROM t WHERE c LIKE 'a%';
+DROP TABLE t;
+
+
+create table t1 (c1 char(10) character set utf16 collate utf16_bin);
+
+#
+# Basic Latin
+#
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+
+#
+# Latin1 suppliment
+#
+insert into t1 values (0x00e0),(0x00c0);
+insert into t1 values (0x00e1),(0x00c1);
+insert into t1 values (0x00e2),(0x00c2);
+insert into t1 values (0x00e3),(0x00c3);
+insert into t1 values (0x00e4),(0x00c4);
+insert into t1 values (0x00e5),(0x00c5);
+insert into t1 values (0x00e6),(0x00c6);
+insert into t1 values (0x00e7),(0x00c7);
+insert into t1 values (0x00e8),(0x00c8);
+insert into t1 values (0x00e9),(0x00c9);
+insert into t1 values (0x00ea),(0x00ca);
+insert into t1 values (0x00eb),(0x00cb);
+insert into t1 values (0x00ec),(0x00cc);
+insert into t1 values (0x00ed),(0x00cd);
+insert into t1 values (0x00ee),(0x00ce);
+insert into t1 values (0x00ef),(0x00cf);
+
+insert into t1 values (0x00f0),(0x00d0);
+insert into t1 values (0x00f1),(0x00d1);
+insert into t1 values (0x00f2),(0x00d2);
+insert into t1 values (0x00f3),(0x00d3);
+insert into t1 values (0x00f4),(0x00d4);
+insert into t1 values (0x00f5),(0x00d5);
+insert into t1 values (0x00f6),(0x00d6);
+insert into t1 values (0x00f7),(0x00d7);
+insert into t1 values (0x00f8),(0x00d8);
+insert into t1 values (0x00f9),(0x00d9);
+insert into t1 values (0x00fa),(0x00da);
+insert into t1 values (0x00fb),(0x00db);
+insert into t1 values (0x00fc),(0x00dc);
+insert into t1 values (0x00fd),(0x00dd);
+insert into t1 values (0x00fe),(0x00de);
+insert into t1 values (0x00ff),(0x00df);
+
+#
+# Latin extended-A, 0100-017F
+#
+insert into t1 values (0x0100),(0x0101),(0x0102),(0x0103);
+insert into t1 values (0x0104),(0x0105),(0x0106),(0x0107);
+insert into t1 values (0x0108),(0x0109),(0x010a),(0x010b);
+insert into t1 values (0x010c),(0x010d),(0x010e),(0x010f);
+insert into t1 values (0x0110),(0x0111),(0x0112),(0x0113);
+insert into t1 values (0x0114),(0x0115),(0x0116),(0x0117);
+insert into t1 values (0x0118),(0x0119),(0x011a),(0x011b);
+insert into t1 values (0x011c),(0x011d),(0x011e),(0x011f);
+insert into t1 values (0x0120),(0x0121),(0x0122),(0x0123);
+insert into t1 values (0x0124),(0x0125),(0x0126),(0x0127);
+insert into t1 values (0x0128),(0x0129),(0x012a),(0x012b);
+insert into t1 values (0x012c),(0x012d),(0x012e),(0x012f);
+insert into t1 values (0x0130),(0x0131),(0x0132),(0x0133);
+insert into t1 values (0x0134),(0x0135),(0x0136),(0x0137);
+insert into t1 values (0x0138),(0x0139),(0x013a),(0x013b);
+insert into t1 values (0x013c),(0x013d),(0x013e),(0x013f);
+insert into t1 values (0x0140),(0x0141),(0x0142),(0x0143);
+insert into t1 values (0x0144),(0x0145),(0x0146),(0x0147);
+insert into t1 values (0x0148),(0x0149),(0x014a),(0x014b);
+insert into t1 values (0x014c),(0x014d),(0x014e),(0x014f);
+insert into t1 values (0x0150),(0x0151),(0x0152),(0x0153);
+insert into t1 values (0x0154),(0x0155),(0x0156),(0x0157);
+insert into t1 values (0x0158),(0x0159),(0x015a),(0x015b);
+insert into t1 values (0x015c),(0x015d),(0x015e),(0x015f);
+insert into t1 values (0x0160),(0x0161),(0x0162),(0x0163);
+insert into t1 values (0x0164),(0x0165),(0x0166),(0x0167);
+insert into t1 values (0x0168),(0x0169),(0x016a),(0x016b);
+insert into t1 values (0x016c),(0x016d),(0x016e),(0x016f);
+insert into t1 values (0x0170),(0x0171),(0x0172),(0x0173);
+insert into t1 values (0x0174),(0x0175),(0x0176),(0x0177);
+insert into t1 values (0x0178),(0x0179),(0x017a),(0x017b);
+insert into t1 values (0x017c),(0x017d),(0x017e),(0x017f);
+
+#
+# Latin extended-B, 0180-024F
+#
+insert into t1 values (0x0180),(0x0181),(0x0182),(0x0183);
+insert into t1 values (0x0184),(0x0185),(0x0186),(0x0187);
+insert into t1 values (0x0188),(0x0189),(0x018a),(0x018b);
+insert into t1 values (0x018c),(0x018d),(0x018e),(0x018f);
+insert into t1 values (0x0190),(0x0191),(0x0192),(0x0193);
+insert into t1 values (0x0194),(0x0195),(0x0196),(0x0197);
+insert into t1 values (0x0198),(0x0199),(0x019a),(0x019b);
+insert into t1 values (0x019c),(0x019d),(0x019e),(0x019f);
+insert into t1 values (0x01a0),(0x01a1),(0x01a2),(0x01a3);
+insert into t1 values (0x01a4),(0x01a5),(0x01a6),(0x01a7);
+insert into t1 values (0x01a8),(0x01a9),(0x01aa),(0x01ab);
+insert into t1 values (0x01ac),(0x01ad),(0x01ae),(0x01af);
+insert into t1 values (0x01b0),(0x01b1),(0x01b2),(0x01b3);
+insert into t1 values (0x01b4),(0x01b5),(0x01b6),(0x01b7);
+insert into t1 values (0x01b8),(0x01b9),(0x01ba),(0x01bb);
+insert into t1 values (0x01bc),(0x01bd),(0x01be),(0x01bf);
+insert into t1 values (0x01c0),(0x01c1),(0x01c2),(0x01c3);
+insert into t1 values (0x01c4),(0x01c5),(0x01c6),(0x01c7);
+insert into t1 values (0x01c8),(0x01c9),(0x01ca),(0x01cb);
+insert into t1 values (0x01cc),(0x01cd),(0x01ce),(0x01cf);
+insert into t1 values (0x01d0),(0x01d1),(0x01d2),(0x01d3);
+insert into t1 values (0x01d4),(0x01d5),(0x01d6),(0x01d7);
+insert into t1 values (0x01d8),(0x01d9),(0x01da),(0x01db);
+insert into t1 values (0x01dc),(0x01dd),(0x01de),(0x01df);
+insert into t1 values (0x01e0),(0x01e1),(0x01e2),(0x01e3);
+insert into t1 values (0x01e4),(0x01e5),(0x01e6),(0x01e7);
+insert into t1 values (0x01e8),(0x01e9),(0x01ea),(0x01eb);
+insert into t1 values (0x01ec),(0x01ed),(0x01ee),(0x01ef);
+insert into t1 values (0x01f0),(0x01f1),(0x01f2),(0x01f3);
+insert into t1 values (0x01f4),(0x01f5),(0x01f6),(0x01f7);
+insert into t1 values (0x01f8),(0x01f9),(0x01fa),(0x01fb);
+insert into t1 values (0x01fc),(0x01fd),(0x01fe),(0x01ff);
+
+
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_icelandic_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_latvian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_romanian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovenian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_polish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_estonian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_swedish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_turkish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_czech_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_danish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_lithuanian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovak_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish2_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci;
+
+drop table t1;
+
+#
+# Bug#5324
+#
+SET NAMES utf8;
+
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+#Check one row
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_general_ci;
+INSERT INTO t1 VALUES (0x039C03C903B4);
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_general_ci ORDER BY c;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+#Check one row
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+INSERT INTO t1 VALUES (0x039C03C903B4);
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+#Check one row row
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+INSERT INTO t1 VALUES (0x039C03C903B4);
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+DROP TABLE t1;
+
+
+SET NAMES utf8;
+SET @test_character_set='utf16';
+SET @test_collation='utf16_swedish_ci';
+-- source include/ctype_common.inc
+
+
+SET collation_connection='utf16_unicode_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+
+--echo End of 4.1 tests
+
+#
+# Check UPPER/LOWER changing length
+#
+# Result shorter than argument
+CREATE TABLE t1 (id int, a varchar(30) character set utf16);
+INSERT INTO t1 VALUES (1, 0x01310069), (2, 0x01310131);
+INSERT INTO t1 VALUES (3, 0x00690069), (4, 0x01300049);
+INSERT INTO t1 VALUES (5, 0x01300130), (6, 0x00490049);
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf16 collate utf16_turkish_ci;
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+DROP TABLE t1;
+
+#
+# Bug #27079 Crash while grouping empty ucs2 strings
+#
+CREATE TABLE t1 (
+ c1 text character set utf16 collate utf16_polish_ci NOT NULL
+) ENGINE=MyISAM;
+insert into t1 values (''),('a');
+SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
+DROP TABLE IF EXISTS t1;
+
+
+#
+# Test basic regex functionality
+#
+set collation_connection=utf16_unicode_ci;
+--source include/ctype_regex.inc
+
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test
new file mode 100644
index 00000000000..f1e17532b88
--- /dev/null
+++ b/mysql-test/t/ctype_utf32.test
@@ -0,0 +1,784 @@
+-- source include/have_utf32.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+SET NAMES latin1;
+SET character_set_connection=utf32;
+select hex('a'), hex('a ');
+-- source include/endspace.inc
+
+#
+# Check that incomplete utf32 characters in HEX notation
+# are left-padded with zeros
+#
+select hex(_utf32 0x44);
+select hex(_utf32 0x3344);
+select hex(_utf32 0x103344);
+
+select hex(_utf32 X'44');
+select hex(_utf32 X'3344');
+select hex(_utf32 X'103344');
+
+
+#
+# Check that 0x20 is only trimmed when it is
+# a part of real SPACE character, not just a part
+# of a multibyte sequence.
+# Note, CYRILLIC LETTER ER is used as an example, which
+# is stored as 0x0420 in UCS2, thus contains 0x20 in the
+# low byte. The second character is THREE-PER-M, U+2004,
+# which contains 0x20 in the high byte.
+#
+
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DELETE FROM t1;
+
+#
+# Check that real spaces are correctly trimmed.
+#
+
+INSERT INTO t1 VALUES
+ (X'000004200000002000000020',X'000004200000002000000020'),
+ (X'000020040000002000000020',X'000020040000002000000020');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DROP TABLE t1;
+
+#
+# Check LPAD/RPAD
+#
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0421'));
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+SELECT hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0421'));
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+SELECT hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+
+CREATE TABLE t1 SELECT
+LPAD(_utf32 X'0420',10,_utf32 X'0421') l,
+RPAD(_utf32 X'0420',10,_utf32 X'0421') r;
+SHOW CREATE TABLE t1;
+select hex(l), hex(r) from t1;
+DROP TABLE t1;
+
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+drop table t1;
+
+######################################################
+#
+# Test of like
+#
+
+SET NAMES latin1;
+SET character_set_connection=utf32;
+--source include/ctype_like.inc
+
+SET NAMES utf8;
+SET character_set_connection=utf32;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
+INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
+INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ');
+SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf32_bin ORDER BY BINARY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
+ENGINE=MyISAM CHARACTER SET utf32;
+INSERT INTO t1 (word) VALUES ("cat");
+SELECT * FROM t1 WHERE word LIKE "c%";
+SELECT * FROM t1 WHERE word LIKE "ca_";
+SELECT * FROM t1 WHERE word LIKE "cat";
+SELECT * FROM t1 WHERE word LIKE _utf32 x'0000006300000025'; # "c%"
+SELECT * FROM t1 WHERE word LIKE _utf32 x'00000063000000610000005F'; # "ca_"
+DROP TABLE t1;
+
+
+#
+# Check that INSERT() works fine.
+# This invokes charpos() function.
+select insert(_utf32 0x000000610000006200000063,10,2,_utf32 0x000000640000006500000066);
+select insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066);
+
+#######################################################
+
+#
+# Bug 1264
+#
+# Description:
+#
+# When using a ucs2 table in MySQL,
+# either with ucs2_general_ci or ucs2_bin collation,
+# words are returned in an incorrect order when using ORDER BY
+# on an _indexed_ CHAR or VARCHAR column. They are sorted with
+# the longest word *first* instead of last. I.E. The word "aardvark"
+# is in the results before the word "a".
+#
+# If there is no index for the column, the problem does not occur.
+#
+# Interestingly, if there is no second column, the words are returned
+# in the correct order.
+#
+# According to EXPLAIN, it looks like when the output includes columns that
+# are not part of the index sorted on, it does a filesort, which fails.
+# Using a straight index yields correct results.
+
+SET NAMES latin1;
+
+#
+# Two fields, index
+#
+
+CREATE TABLE t1 (
+ word VARCHAR(64),
+ bar INT(11) default 0,
+ PRIMARY KEY (word))
+ ENGINE=MyISAM
+ CHARSET utf32
+ COLLATE utf32_general_ci ;
+
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+SELECT * FROM t1 ORDER BY word;
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+SELECT word FROM t1 ORDER by word;
+DROP TABLE t1;
+
+
+#
+# One field, index
+#
+
+CREATE TABLE t1 (
+ word VARCHAR(64) ,
+ PRIMARY KEY (word))
+ ENGINE=MyISAM
+ CHARSET utf32
+ COLLATE utf32_general_ci;
+
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY WORD;
+SELECT * FROM t1 ORDER BY word;
+DROP TABLE t1;
+
+
+#
+# Two fields, no index
+#
+
+CREATE TABLE t1 (
+ word TEXT,
+ bar INT(11) AUTO_INCREMENT,
+ PRIMARY KEY (bar))
+ ENGINE=MyISAM
+ CHARSET utf32
+ COLLATE utf32_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a" );
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+SELECT * FROM t1 ORDER BY word;
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+SELECT word FROM t1 ORDER BY word;
+DROP TABLE t1;
+
+#
+# END OF Bug 1264 test
+#
+########################################################
+
+
+#
+# Check alignment for from-binary-conversion with CAST and CONVERT
+#
+SELECT hex(cast(0xAA as char character set utf32));
+SELECT hex(convert(0xAA using utf32));
+
+#
+# Check alignment for string types
+#
+CREATE TABLE t1 (a char(10) character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a varchar(10) character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a text character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a mediumtext character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a longtext character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+##
+## Bug #5024 Server crashes with queries on fields
+## with certain charset/collation settings
+##
+#
+#create table t1 (s1 char character set `ucs2` collate `ucs2_czech_ci`);
+#insert into t1 values ('0'),('1'),('2'),('a'),('b'),('c');
+#select s1 from t1 where s1 > 'a' order by s1;
+#drop table t1;
+
+#
+# Bug #5081 : UCS2 fields are filled with '0x2020'
+# after extending field length
+#
+create table t1(a char(1)) default charset utf32;
+insert into t1 values ('a'),('b'),('c');
+alter table t1 modify a char(5);
+select a, hex(a) from t1;
+drop table t1;
+
+#
+# Check prepare statement from an UTF32 string
+#
+set @ivar= 1234;
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using utf32);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+
+#
+# Check that utf32 works with ENUM and SET type
+#
+set names utf8;
+create table t1 (a enum('x','y','z') character set utf32);
+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 utf32;
+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 utf32);
+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 utf32;
+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 NAMES latin1;
+SET collation_connection='utf32_general_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+SET NAMES latin1;
+SET collation_connection='utf32_bin';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+
+#
+# Bug#10344 Some string functions fail for UCS2
+#
+select hex(substr(_utf32 0x000000e4000000e500000068,1));
+select hex(substr(_utf32 0x000000e4000000e500000068,2));
+select hex(substr(_utf32 0x000000e4000000e500000068,3));
+select hex(substr(_utf32 0x000000e4000000e500000068,-1));
+select hex(substr(_utf32 0x000000e4000000e500000068,-2));
+select hex(substr(_utf32 0x000000e4000000e500000068,-3));
+
+#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;
+
+#
+##
+## Bug#18691 Converting number to UNICODE string returns invalid result
+##
+#SELECT CONVERT(103, CHAR(50) UNICODE);
+#SELECT CONVERT(103.0, CHAR(50) UNICODE);
+#SELECT CONVERT(-103, CHAR(50) UNICODE);
+#SELECT CONVERT(-103.0, CHAR(50) UNICODE);
+
+#
+# Bug#9557 MyISAM utf8 table crash
+#
+CREATE TABLE t1 (
+ a varchar(250) NOT NULL default '',
+ KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE utf32_general_ci;
+insert into t1 values (0x803d);
+insert into t1 values (0x005b);
+select hex(a) from t1;
+drop table t1;
+
+##
+## Bug #14583 Bug on query using a LIKE on indexed field with ucs2_bin collation
+##
+#--disable_warnings
+#create table t1(f1 varchar(5) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL) engine=InnoDB;
+#--enable_warnings
+#insert into t1 values('a');
+#create index t1f1 on t1(f1);
+#select f1 from t1 where f1 like 'a%';
+#drop table t1;
+
+#
+# Bug#9442 Set parameter make query fail if column character set is UCS2
+#
+create table t1 (utext varchar(20) character set utf32);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+execute stmt using @param1;
+select utext from t1 where utext like '%%';
+drop table t1;
+deallocate prepare stmt;
+
+#
+# Bug#22052 Trailing spaces are not removed from UNICODE fields in an index
+#
+create table t1 (
+ a char(10) character set utf32 not null,
+ index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x0000201f, 10));
+insert into t1 values (repeat(0x00002020, 10));
+insert into t1 values (repeat(0x00002021, 10));
+# make sure "index read" is used
+explain select hex(a) from t1 order by a;
+select hex(a) from t1 order by a;
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+drop table t1;
+
+#
+# Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation
+# over a 'ucs2' field uses a temporary table
+#
+#CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
+#INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
+#SELECT id, MIN(s) FROM t1 GROUP BY id;
+#DROP TABLE t1;
+
+##
+## Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
+##
+#
+#--disable_warnings
+#drop table if exists bug20536;
+#--enable_warnings
+#
+#set names latin1;
+#create table bug20536 (id bigint not null auto_increment primary key, name
+#varchar(255) character set ucs2 not null);
+#insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431'), (2, "'test\\_2'");
+#select md5(name) from bug20536;
+#select sha1(name) from bug20536;
+#select make_set(3, name, upper(name)) from bug20536;
+#select export_set(5, name, upper(name)) from bug20536;
+#select export_set(5, name, upper(name), ",", 5) from bug20536;
+
+#
+# Bug #20108: corrupted default enum value for a ucs2 field
+#
+
+CREATE TABLE t1 (
+ status enum('active','passive') character set utf32 collate utf32_general_ci
+ NOT NULL default 'passive'
+);
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD a int NOT NULL AFTER status;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+#CREATE TABLE t2 (
+# status enum('active','passive') collate ucs2_turkish_ci
+# NOT NULL default 'passive'
+#);
+#SHOW CREATE TABLE t2;
+#ALTER TABLE t2 ADD a int NOT NULL AFTER status;
+#DROP TABLE t2;
+
+
+## Some broken functions: add these tests just to document current behavior.
+#
+## PASSWORD and OLD_PASSWORD don't work with UCS2 strings, but to fix it would
+## not be backwards compatible in all cases, so it's best to leave it alone
+#select password(name) from bug20536;
+#select old_password(name) from bug20536;
+#
+## Disable test case as encrypt relies on 'crypt' function.
+## "decrypt" is noramlly tested in func_crypt.test which have a
+## "have_crypt.inc" test
+#--disable_parsing
+## ENCRYPT relies on OS function crypt() which takes a NUL-terminated string; it
+## doesn't return good results for strings with embedded 0 bytes. It won't be
+## fixed unless we choose to re-implement the crypt() function ourselves to take
+## an extra size_t string_length argument.
+#select encrypt(name, 'SALT') from bug20536;
+#--enable_parsing
+#
+## QUOTE doesn't work with UCS2 data. It would require a total rewrite
+## of Item_func_quote::val_str(), which isn't worthwhile until UCS2 is
+## supported fully as a client character set.
+#select quote(name) from bug20536;
+#
+#drop table bug20536;
+#
+--echo End of 4.1 tests
+
+
+#
+# Conversion from an UTF32 string to a decimal column
+#
+CREATE TABLE t1 (a varchar(64) character set utf32, b decimal(10,3));
+INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
+update t1 set b=a;
+SELECT *, hex(a) FROM t1;
+DROP TABLE t1;
+
+#
+# Bug#9442 Set parameter make query fail if column character set is UCS2
+#
+create table t1 (utext varchar(20) character set utf32);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+execute stmt using @param1;
+select utext from t1 where utext like '%%';
+drop table t1;
+deallocate prepare stmt;
+
+#
+# Bug#22638 SOUNDEX broken for international characters
+#
+set names latin1;
+set character_set_connection=utf32;
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
+select 'mood' sounds like 'mud';
+# Cyrillic A, BE, VE
+select hex(soundex(_utf32 0x000004100000041100000412));
+# Make sure that "U+00BF INVERTED QUESTION MARK" is not considered as letter
+select hex(soundex(_utf32 0x000000BF000000C0));
+set names latin1;
+
+#
+# Bug #14290: character_maximum_length for text fields
+#
+create table t1(a blob, b text charset utf32);
+select data_type, character_octet_length, character_maximum_length
+ from information_schema.columns where table_name='t1';
+drop table t1;
+
+
+set names latin1;
+set collation_connection=utf32_general_ci;
+#
+# Testing cs->coll->instr()
+#
+select position('bb' in 'abba');
+
+#
+# Testing cs->coll->hash_sort()
+#
+create table t1 (a varchar(10) character set utf32) engine=heap;
+insert into t1 values ('a'),('A'),('b'),('B');
+select * from t1 where a='a' order by binary a;
+select hex(min(binary a)),count(*) from t1 group by a;
+drop table t1;
+
+#
+# Testing cs->cset->numchars()
+#
+select char_length('abcd'), octet_length('abcd');
+
+#
+# Testing cs->cset->charpos()
+#
+select left('abcd',2);
+
+#
+# Testing cs->cset->well_formed_length()
+#
+create table t1 (a varchar(10) character set utf32);
+insert into t1 values (_utf32 0x0010FFFF);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf32 0x00110000);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf32 0x00110101);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf32 0x01000101);
+--error ER_INVALID_CHARACTER_STRING
+insert into t1 values (_utf32 0x11000101);
+select hex(a) from t1;
+drop table t1;
+
+#
+# Bug#32914 Character sets: illegal characters in utf8 and utf32 columns
+#
+create table t1 (utf32 varchar(2) character set utf32);
+--echo Wrong character with pad
+insert into t1 values (0x110000);
+--echo Wrong chsaracter without pad
+insert into t1 values (0x00110000);
+--echo Wrong character with pad followed by another wrong character
+insert into t1 values (0x11000000110000);
+--echo Good character with pad followed by bad character
+insert into t1 values (0x10000000110000);
+--echo Good character without pad followed by bad character
+insert into t1 values (0x0010000000110000);
+--echo Wrong character with the second byte higher than 0x10
+insert into t1 values (0x00800037);
+--echo Wrong character with pad with the second byte higher than 0x10
+insert into t1 values (0x00800037);
+drop table t1;
+
+#
+# Bug#32394 Character sets: crash if comparison with 0xfffd
+#
+select _utf32'a' collate utf32_general_ci = 0xfffd;
+select hex(concat(_utf32 0x0410 collate utf32_general_ci, 0x61));
+create table t1 (s1 varchar(5) character set utf32);
+insert into t1 values (0xfffd);
+select case when s1 = 0xfffd then 1 else 0 end from t1;
+select hex(s1) from t1 where s1 = 0xfffd;
+drop table t1;
+
+#
+# Testing cs->cset->lengthsp()
+#
+create table t1 (a char(10)) character set utf32;
+insert into t1 values ('a ');
+select hex(a) from t1;
+drop table t1;
+
+#
+# Testing cs->cset->caseup() and cs->cset->casedn()
+#
+select upper('abcd'), lower('ABCD');
+
+#
+# TODO: str_to_datetime() is broken and doesn't work with ucs2 and utf32
+# Testing cs->cset->snprintf()
+#
+#create table t1 (a date);
+#insert into t1 values ('2007-09-16');
+#select * from t1;
+#drop table t1;
+
+#
+# Testing cs->cset->l10tostr
+# !!! Not used in the code
+
+#
+# Testing cs->cset->ll10tostr
+#
+create table t1 (a varchar(10) character set utf32);
+insert into t1 values (123456);
+select a, hex(a) from t1;
+drop table t1;
+
+#
+# Testing cs->cset->fill
+# SOUNDEX fills strings with DIGIT ZERO up to four characters
+select hex(soundex('a'));
+
+#
+# Testing cs->cset->strntol
+# !!! Not used in the code
+
+#
+# Testing cs->cset->strntoul
+#
+create table t1 (a enum ('a','b','c')) character set utf32;
+insert into t1 values ('1');
+select * from t1;
+drop table t1;
+
+#
+# Testing cs->cset->strntoll and cs->cset->strntoull
+#
+set names latin1;
+select hex(conv(convert('123' using utf32), -10, 16));
+select hex(conv(convert('123' using utf32), 10, 16));
+
+#
+# Testing cs->cset->strntod
+#
+set names latin1;
+set character_set_connection=utf32;
+select 1.1 + '1.2';
+select 1.1 + '1.2xxx';
+
+# Testing strntoll10_utf32
+# Testing cs->cset->strtoll10
+select left('aaa','1');
+
+#
+# Testing cs->cset->strntoull10rnd
+#
+create table t1 (a int);
+insert into t1 values ('-1234.1e2');
+insert into t1 values ('-1234.1e2xxxx');
+insert into t1 values ('-1234.1e2 ');
+select * from t1;
+drop table t1;
+
+#
+# Testing cs->cset->scan
+#
+create table t1 (a int);
+insert into t1 values ('1 ');
+insert into t1 values ('1 x');
+select * from t1;
+drop table t1;
+
+#
+# Testing auto-conversion to TEXT
+#
+create table t1 (a varchar(17000) character set utf32);
+show create table t1;
+drop table t1;
+
+#
+# Testing that maximim possible key length is 1332 bytes
+#
+create table t1 (a varchar(250) character set utf32 primary key);
+show create table t1;
+drop table t1;
+--error ER_TOO_LONG_KEY
+create table t1 (a varchar(334) character set utf32 primary key);
+
+#
+# Testing mi_check with long key values
+#
+create table t1 (a varchar(333) character set utf32, key(a));
+insert into t1 values (repeat('a',333)), (repeat('b',333));
+flush tables;
+check table t1;
+drop table t1;
+
+#
+# Test how character set works with date/time
+#
+SET collation_connection=utf32_general_ci;
+--source include/ctype_datetime.inc
+SET NAMES latin1;
+
+#
+# Test basic regex functionality
+#
+set collation_connection=utf32_general_ci;
+--source include/ctype_regex.inc
+set names latin1;
+
+
+# TODO: add tests for all engines
+
+#
+# Bug #36418 Character sets: crash if char(256 using utf32)
+#
+select hex(char(0x01 using utf32));
+select hex(char(0x0102 using utf32));
+select hex(char(0x010203 using utf32));
+select hex(char(0x01020304 using utf32));
+create table t1 (s1 varchar(1) character set utf32, s2 text character set utf32);
+create index i on t1 (s1);
+insert into t1 values (char(256 using utf32), char(256 using utf32));
+select hex(s1), hex(s2) from t1;
+drop table t1;
+
+
+#
+# Bug#33073 Character sets: ordering fails with utf32
+#
+SET collation_connection=utf32_general_ci;
+CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE');
+SELECT * FROM t1 ORDER BY s1;
+SET max_sort_length=4;
+SELECT * FROM t1 ORDER BY s1;
+DROP TABLE t1;
+SET max_sort_length=DEFAULT;
+SET NAMES latin1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test
new file mode 100644
index 00000000000..9386cc9e65e
--- /dev/null
+++ b/mysql-test/t/ctype_utf32_uca.test
@@ -0,0 +1,291 @@
+-- source include/have_ucs2.inc
+-- source include/have_utf32.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+set names utf8;
+set collation_connection=utf32_unicode_ci;
+select hex('a'), hex('a ');
+-- source include/endspace.inc
+
+#
+# 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 (
+ c char(20) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARACTER SET utf32 COLLATE=utf32_unicode_ci;
+INSERT INTO t VALUES ('a'),('ab'),('aba');
+ALTER TABLE t ADD INDEX (c);
+SELECT c FROM t WHERE c LIKE 'a%';
+DROP TABLE t;
+
+
+create table t1 (c1 char(10) character set utf32 collate utf32_bin);
+
+#
+# Basic Latin
+#
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+
+#
+# Latin1 suppliment
+#
+insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
+insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
+insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
+insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
+insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
+insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
+insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
+insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
+insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
+insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
+insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
+insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
+insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
+insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
+insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
+insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
+
+insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
+insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
+insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
+insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
+insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
+insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
+insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
+insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
+insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
+insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
+insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
+insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
+insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
+insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
+insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
+insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
+
+#
+# Latin extended-A, 0100-017F
+#
+insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
+insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
+insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
+insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
+insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
+insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
+insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
+insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
+insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
+insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
+insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
+insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
+insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
+insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
+insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
+insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
+insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
+insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
+insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
+insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
+insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
+insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
+insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
+insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
+insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
+insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
+insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
+insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
+insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
+insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
+insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
+insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
+
+#
+# Latin extended-B, 0180-024F
+#
+insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
+insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
+insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
+insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
+insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
+insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
+insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
+insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
+insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
+insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
+insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
+insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
+insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
+insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
+insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
+insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
+insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
+insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
+insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
+insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
+insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
+insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
+insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
+insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
+insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
+insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
+insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
+insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
+insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
+insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
+insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
+insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
+
+
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_unicode_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_icelandic_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_latvian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_romanian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovenian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_polish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_estonian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_swedish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_turkish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_czech_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_danish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_lithuanian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovak_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish2_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_roman_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_esperanto_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_hungarian_ci;
+
+drop table t1;
+
+#
+# Bug#5324
+#
+SET NAMES utf8;
+#test1
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+#Check one row
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_general_ci;
+INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025
+COLLATE utf32_general_ci ORDER BY c;
+DROP TABLE t1;
+#test2
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+#Check one row
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_unicode_ci;
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4);
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025
+COLLATE utf32_unicode_ci ORDER BY c;
+DROP TABLE t1;
+#test 3
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+#Check one row row
+SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32) COLLATE utf32_unicode_ci;
+INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32)
+COLLATE utf32_unicode_ci ORDER BY c;
+DROP TABLE t1;
+
+
+SET NAMES utf8;
+SET @test_character_set='utf32';
+SET @test_collation='utf32_swedish_ci';
+-- source include/ctype_common.inc
+
+
+SET collation_connection='utf32_unicode_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+
+--echo End of 4.1 tests
+
+#
+# Check UPPER/LOWER changing length
+#
+# Result shorter than argument
+CREATE TABLE t1 (id int, a varchar(30) character set utf32);
+INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131);
+INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049);
+INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049);
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf32 collate utf32_turkish_ci;
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+DROP TABLE t1;
+
+#
+# Bug #27079 Crash while grouping empty ucs2 strings
+#
+CREATE TABLE t1 (
+ c1 text character set utf32 collate utf32_polish_ci NOT NULL
+) ENGINE=MyISAM;
+insert into t1 values (''),('a');
+SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
+DROP TABLE IF EXISTS t1;
+
+
+#
+# Test basic regex functionality
+#
+set collation_connection=utf32_unicode_ci;
+--source include/ctype_regex.inc
+
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 1a560554d3d..201e96b0b09 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1440,6 +1440,17 @@ DROP TABLE t1;
--echo Start of 5.4 tests
+
+#
+# WL#1213: utf8mb3 is an alias for utf8
+#
+SET NAMES utf8mb3;
+SHOW VARIABLES LIKE 'character_set_results%';
+CREATE TABLE t1 (a CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+SELECT _utf8mb3'test';
+
#
# Bug#26180: Can't add columns to tables created with utf8 text indexes
#
diff --git a/mysql-test/t/ctype_utf8mb4.test b/mysql-test/t/ctype_utf8mb4.test
new file mode 100644
index 00000000000..218ce012412
--- /dev/null
+++ b/mysql-test/t/ctype_utf8mb4.test
@@ -0,0 +1,1671 @@
+--source include/have_utf8mb4.inc
+
+#
+# Tests with the utf8mb4 character set
+#
+
+--source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+set names utf8mb4;
+
+select left(_utf8mb4 0xD0B0D0B1D0B2,1);
+select right(_utf8mb4 0xD0B0D0B2D0B2,1);
+
+select locate('he','hello');
+select locate('he','hello',2);
+select locate('lo','hello',2);
+select locate('HE','hello');
+select locate('HE','hello',2);
+select locate('LO','hello',2);
+select locate('HE','hello' collate utf8mb4_bin);
+select locate('HE','hello' collate utf8mb4_bin,2);
+select locate('LO','hello' collate utf8mb4_bin,2);
+
+select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2);
+select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2);
+select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2);
+select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin);
+select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin);
+
+select length(_utf8mb4 0xD0B1), bit_length(_utf8mb4 0xD0B1), char_length(_utf8mb4 0xD0B1);
+
+select 'a' like 'a';
+select 'A' like 'a';
+select 'A' like 'a' collate utf8mb4_bin;
+select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%');
+
+# Bug #6040: can't retrieve records with umlaut
+# characters in case insensitive manner.
+# Case insensitive search LIKE comparison
+# was broken for multibyte characters:
+select convert(_latin1'Gnter Andr' using utf8mb4) like CONVERT(_latin1'GNTER%' USING utf8mb4);
+select CONVERT(_koi8r'' USING utf8mb4) LIKE CONVERT(_koi8r'' USING utf8mb4);
+select CONVERT(_koi8r'' USING utf8mb4) LIKE CONVERT(_koi8r'' USING utf8mb4);
+
+#
+# Check the following:
+# "a" == "a "
+# "a\0" < "a"
+# "a\0" < "a "
+
+SELECT 'a' = 'a ';
+SELECT 'a\0' < 'a';
+SELECT 'a\0' < 'a ';
+SELECT 'a\t' < 'a';
+SELECT 'a\t' < 'a ';
+
+#
+# The same for binary collation
+#
+SELECT 'a' = 'a ' collate utf8mb4_bin;
+SELECT 'a\0' < 'a' collate utf8mb4_bin;
+SELECT 'a\0' < 'a ' collate utf8mb4_bin;
+SELECT 'a\t' < 'a' collate utf8mb4_bin;
+SELECT 'a\t' < 'a ' collate utf8mb4_bin;
+
+CREATE TABLE t1 (a char(10) character set utf8mb4 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;
+
+#
+# Fix this, it should return 1:
+#
+#select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD091,_utf8mb4 '%');
+#
+
+#
+# Bug 2367: INSERT() behaviour is different for different charsets.
+#
+select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
+select insert("aa",100,1,"b"),insert("aa",1,3,"b");
+
+#
+# LELF() didn't work well with utf8mb4 in some cases too.
+#
+select char_length(left(@a:='тест',5)), length(@a), @a;
+
+
+#
+# CREATE ... SELECT
+#
+create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
+show create table t1;
+select * from t1;
+drop table t1;
+
+#
+# Bug#22646 LC_TIME_NAMES: Assignment to non-UTF8 target fails
+#
+set names utf8mb4;
+set LC_TIME_NAMES='fr_FR';
+create table t1 (s1 char(20) character set latin1);
+insert into t1 values (date_format('2004-02-02','%M'));
+select hex(s1) from t1;
+drop table t1;
+create table t1 (s1 char(20) character set koi8r);
+set LC_TIME_NAMES='ru_RU';
+insert into t1 values (date_format('2004-02-02','%M'));
+insert into t1 values (date_format('2004-02-02','%b'));
+insert into t1 values (date_format('2004-02-02','%W'));
+insert into t1 values (date_format('2004-02-02','%a'));
+select hex(s1), s1 from t1;
+drop table t1;
+set LC_TIME_NAMES='en_US';
+
+
+#
+# Bug #2366 Wrong utf8mb4 behaviour when data is truncated
+#
+set names koi8r;
+create table t1 (s1 char(1) character set utf8mb4);
+insert into t1 values (_koi8r'');
+select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
+drop table t1;
+
+create table t1 (s1 tinytext character set utf8mb4);
+insert into t1 select repeat('a',300);
+insert into t1 select repeat('',300);
+insert into t1 select repeat('a',300);
+insert into t1 select repeat('a',300);
+insert into t1 select repeat('',300);
+select hex(s1) from t1;
+select length(s1),char_length(s1) from t1;
+drop table t1;
+
+create table t1 (s1 text character set utf8mb4);
+insert into t1 select repeat('a',66000);
+insert into t1 select repeat('',66000);
+insert into t1 select repeat('a',66000);
+insert into t1 select repeat('a',66000);
+insert into t1 select repeat('',66000);
+select length(s1),char_length(s1) from t1;
+drop table t1;
+
+#
+# Bug #2368 Multibyte charsets do not check that incoming data is well-formed
+#
+create table t1 (s1 char(10) character set utf8mb4);
+insert into t1 values (0x41FF);
+select hex(s1) from t1;
+drop table t1;
+
+create table t1 (s1 varchar(10) character set utf8mb4);
+insert into t1 values (0x41FF);
+select hex(s1) from t1;
+drop table t1;
+
+create table t1 (s1 text character set utf8mb4);
+insert into t1 values (0x41FF);
+select hex(s1) from t1;
+drop table t1;
+
+#
+# Bug 2699
+# UTF8 breaks primary keys for cols > 333 characters
+#
+--error 1071
+create table t1 (a text character set utf8mb4, primary key(a(371)));
+
+
+#
+# Bug 2959
+# UTF8 charset breaks joins with mixed column/string constant
+#
+CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES ( 'test' );
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a;
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test';
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test';
+DROP TABLE t1;
+
+create table t1 (a char(255) character set utf8mb4);
+insert into t1 values('b'),('b');
+select * from t1 where a = 'b';
+select * from t1 where a = 'b' and a = 'b';
+select * from t1 where a = 'b' and a != 'b';
+drop table t1;
+
+#
+# Testing regexp
+#
+set collation_connection=utf8mb4_general_ci;
+--source include/ctype_regex.inc
+set names utf8mb4;
+
+#
+# Bug #3928 regexp [[:>:]] and UTF-8
+#
+set names utf8mb4;
+
+# This should return TRUE
+select 'вася' rlike '[[:<:]]вася[[:>:]]';
+select 'вася ' rlike '[[:<:]]вася[[:>:]]';
+select ' вася' rlike '[[:<:]]вася[[:>:]]';
+select ' вася ' rlike '[[:<:]]вася[[:>:]]';
+
+# This should return FALSE
+select 'васяz' rlike '[[:<:]]вася[[:>:]]';
+select 'zвася' rlike '[[:<:]]вася[[:>:]]';
+select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
+
+#
+# Bug #4555
+# ALTER TABLE crashes mysqld with enum column collated utf8mb4_unicode_ci
+#
+CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci);
+ALTER TABLE t1 ADD COLUMN b CHAR(20);
+DROP TABLE t1;
+
+# Customer Support Center issue # 3299
+# ENUM and SET multibyte fields computed their length wronly
+# when converted into a char field
+set names utf8mb4;
+create table t1 (a enum('aaaa','проба') character set utf8mb4);
+show create table t1;
+insert into t1 values ('проба');
+select * from t1;
+create table t2 select ifnull(a,a) from t1;
+show create table t2;
+select * from t2;
+drop table t1;
+drop table t2;
+
+#
+# Bug 4521: unique key prefix interacts poorly with utf8mb4
+# MYISAM: keys with prefix compression, case insensitive collation.
+#
+create table t1 (c varchar(30) character set utf8mb4, unique(c(10)));
+insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
+insert into t1 values ('aaaaaaaaaa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaaaaaaaaaa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaaaaaaaaaaa');
+insert into t1 values (repeat('b',20));
+select c c1 from t1 where c='1';
+select c c2 from t1 where c='2';
+select c c3 from t1 where c='3';
+select c cx from t1 where c='x';
+select c cy from t1 where c='y';
+select c cz from t1 where c='z';
+select c ca10 from t1 where c='aaaaaaaaaa';
+select c cb20 from t1 where c=repeat('b',20);
+drop table t1;
+
+#
+# Bug 4521: unique key prefix interacts poorly with utf8mb4
+# InnoDB: keys with prefix compression, case insensitive collation.
+#
+--disable_warnings
+create table t1 (c varchar(30) character set utf8mb4, unique(c(10))) engine=innodb;
+--enable_warnings
+insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
+insert into t1 values ('aaaaaaaaaa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaaaaaaaaaa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaaaaaaaaaaa');
+insert into t1 values (repeat('b',20));
+select c c1 from t1 where c='1';
+select c c2 from t1 where c='2';
+select c c3 from t1 where c='3';
+select c cx from t1 where c='x';
+select c cy from t1 where c='y';
+select c cz from t1 where c='z';
+select c ca10 from t1 where c='aaaaaaaaaa';
+select c cb20 from t1 where c=repeat('b',20);
+drop table t1;
+#
+# Bug 4521: unique key prefix interacts poorly with utf8mb4
+# MYISAM: fixed length keys, case insensitive collation
+#
+create table t1 (c char(3) character set utf8mb4, unique (c(2)));
+insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
+insert into t1 values ('a');
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('b');
+insert into t1 values ('bb');
+--error ER_DUP_ENTRY
+insert into t1 values ('bbb');
+insert into t1 values ('а');
+insert into t1 values ('аа');
+--error ER_DUP_ENTRY
+insert into t1 values ('ааа');
+insert into t1 values ('б');
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+insert into t1 values ('ꪪ');
+insert into t1 values ('ꪪꪪ');
+--error ER_DUP_ENTRY
+insert into t1 values ('ꪪꪪꪪ');
+drop table t1;
+#
+# Bug 4521: unique key prefix interacts poorly with utf8mb4
+# InnoDB: fixed length keys, case insensitive collation
+#
+--disable_warnings
+create table t1 (c char(3) character set utf8mb4, unique (c(2))) engine=innodb;
+--enable_warnings
+insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
+insert into t1 values ('a');
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('b');
+insert into t1 values ('bb');
+--error ER_DUP_ENTRY
+insert into t1 values ('bbb');
+insert into t1 values ('а');
+insert into t1 values ('аа');
+--error ER_DUP_ENTRY
+insert into t1 values ('ааа');
+insert into t1 values ('б');
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+insert into t1 values ('ꪪ');
+insert into t1 values ('ꪪꪪ');
+--error ER_DUP_ENTRY
+insert into t1 values ('ꪪꪪꪪ');
+drop table t1;
+#
+# Bug 4531: unique key prefix interacts poorly with utf8mb4
+# Check HEAP+HASH, case insensitive collation
+#
+create table t1 (
+c char(10) character set utf8mb4,
+unique key a using hash (c(1))
+) engine=heap;
+show create table t1;
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+--error ER_DUP_ENTRY
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('б');
+--error ER_DUP_ENTRY
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+select c as c_all from t1 order by c;
+select c as c_a from t1 where c='a';
+select c as c_a from t1 where c='б';
+drop table t1;
+
+#
+# Bug 4531: unique key prefix interacts poorly with utf8mb4
+# Check HEAP+BTREE, case insensitive collation
+#
+create table t1 (
+c char(10) character set utf8mb4,
+unique key a using btree (c(1))
+) engine=heap;
+show create table t1;
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+--error ER_DUP_ENTRY
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('б');
+--error ER_DUP_ENTRY
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+select c as c_all from t1 order by c;
+select c as c_a from t1 where c='a';
+select c as c_a from t1 where c='б';
+drop table t1;
+
+#
+# Bug 4531: unique key prefix interacts poorly with utf8mb4
+# Check BDB, case insensitive collation
+#
+--disable_warnings
+create table t1 (
+c char(10) character set utf8mb4,
+unique key a (c(1))
+) engine=innodb;
+--enable_warnings
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+--error ER_DUP_ENTRY
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('б');
+--error ER_DUP_ENTRY
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+select c as c_all from t1 order by c;
+select c as c_a from t1 where c='a';
+select c as c_a from t1 where c='б';
+drop table t1;
+
+#
+# Bug 4521: unique key prefix interacts poorly with utf8mb4
+# MYISAM: keys with prefix compression, binary collation.
+#
+create table t1 (c varchar(30) character set utf8mb4 collate utf8mb4_bin, unique(c(10)));
+insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
+insert into t1 values ('aaaaaaaaaa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaaaaaaaaaa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaaaaaaaaaaa');
+insert into t1 values (repeat('b',20));
+select c c1 from t1 where c='1';
+select c c2 from t1 where c='2';
+select c c3 from t1 where c='3';
+select c cx from t1 where c='x';
+select c cy from t1 where c='y';
+select c cz from t1 where c='z';
+select c ca10 from t1 where c='aaaaaaaaaa';
+select c cb20 from t1 where c=repeat('b',20);
+drop table t1;
+
+#
+# Bug 4521: unique key prefix interacts poorly with utf8mb4
+# MYISAM: fixed length keys, binary collation
+#
+create table t1 (c char(3) character set utf8mb4 collate utf8mb4_bin, unique (c(2)));
+insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
+insert into t1 values ('a');
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('b');
+insert into t1 values ('bb');
+--error ER_DUP_ENTRY
+insert into t1 values ('bbb');
+insert into t1 values ('а');
+insert into t1 values ('аа');
+--error ER_DUP_ENTRY
+insert into t1 values ('ааа');
+insert into t1 values ('б');
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+insert into t1 values ('ꪪ');
+insert into t1 values ('ꪪꪪ');
+--error ER_DUP_ENTRY
+insert into t1 values ('ꪪꪪꪪ');
+drop table t1;
+
+#
+# Bug 4531: unique key prefix interacts poorly with utf8mb4
+# Check HEAP+HASH, binary collation
+#
+create table t1 (
+c char(10) character set utf8mb4 collate utf8mb4_bin,
+unique key a using hash (c(1))
+) engine=heap;
+show create table t1;
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+--error ER_DUP_ENTRY
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('б');
+--error ER_DUP_ENTRY
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+select c as c_all from t1 order by c;
+select c as c_a from t1 where c='a';
+select c as c_a from t1 where c='б';
+drop table t1;
+
+#
+# Bug 4531: unique key prefix interacts poorly with utf8mb4
+# Check HEAP+BTREE, binary collation
+#
+create table t1 (
+c char(10) character set utf8mb4 collate utf8mb4_bin,
+unique key a using btree (c(1))
+) engine=heap;
+show create table t1;
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+--error ER_DUP_ENTRY
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('б');
+--error ER_DUP_ENTRY
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+select c as c_all from t1 order by c;
+select c as c_a from t1 where c='a';
+select c as c_a from t1 where c='б';
+drop table t1;
+
+#
+# Bug 4531: unique key prefix interacts poorly with utf8mb4
+# Check BDB, binary collation
+#
+--disable_warnings
+create table t1 (
+c char(10) character set utf8mb4 collate utf8mb4_bin,
+unique key a (c(1))
+) engine=innodb;
+--enable_warnings
+insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
+--error ER_DUP_ENTRY
+insert into t1 values ('aa');
+--error ER_DUP_ENTRY
+insert into t1 values ('aaa');
+insert into t1 values ('б');
+--error ER_DUP_ENTRY
+insert into t1 values ('бб');
+--error ER_DUP_ENTRY
+insert into t1 values ('ббб');
+select c as c_all from t1 order by c;
+select c as c_a from t1 where c='a';
+select c as c_a from t1 where c='б';
+drop table t1;
+
+
+# Bug#4594: column index make = failed for gbk, but like works
+# Check MYISAM
+#
+create table t1 (
+ str varchar(255) character set utf8mb4 not null,
+ key str (str(2))
+) engine=myisam;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+drop table t1;
+
+# Bug#4594: column index make = failed for gbk, but like works
+# Check InnoDB
+#
+--disable_warnings
+create table t1 (
+ str varchar(255) character set utf8mb4 not null,
+ key str (str(2))
+) engine=innodb;
+--enable_warnings
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+drop table t1;
+
+# the same for HEAP+BTREE
+#
+
+create table t1 (
+ str varchar(255) character set utf8mb4 not null,
+ key str using btree (str(2))
+) engine=heap;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+drop table t1;
+
+# the same for HEAP+HASH
+#
+
+create table t1 (
+ str varchar(255) character set utf8mb4 not null,
+ key str using hash (str(2))
+) engine=heap;
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+drop table t1;
+
+# the same for BDB
+#
+
+--disable_warnings
+create table t1 (
+ str varchar(255) character set utf8mb4 not null,
+ key str (str(2))
+) engine=innodb;
+--enable_warnings
+INSERT INTO t1 VALUES ('str');
+INSERT INTO t1 VALUES ('str2');
+select * from t1 where str='str';
+drop table t1;
+
+#
+# Bug #5397: Crash with varchar binary and LIKE
+#
+CREATE TABLE t1 (a varchar(32) BINARY) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES ('test');
+SELECT a FROM t1 WHERE a LIKE '%te';
+DROP TABLE t1;
+
+#
+# Bug #5723: length(<varchar utf8mb4 field>) returns varying results
+#
+--disable_warnings
+SET NAMES utf8mb4;
+--disable_warnings
+CREATE TABLE t1 (
+ subject varchar(255) character set utf8mb4 collate utf8mb4_unicode_ci,
+ p varchar(15) character set utf8mb4
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+--enable_warnings
+INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057');
+INSERT INTO t1 VALUES ('aaa','bbb');
+SELECT length(subject) FROM t1;
+SELECT length(subject) FROM t1 ORDER BY 1;
+DROP TABLE t1;
+
+#
+# Bug #5832 SELECT doesn't return records in some cases
+#
+CREATE TABLE t1 (
+ id int unsigned NOT NULL auto_increment,
+ list_id smallint unsigned NOT NULL,
+ term TEXT NOT NULL,
+ PRIMARY KEY(id),
+ INDEX(list_id, term(4))
+) ENGINE=MYISAM CHARSET=utf8mb4;
+INSERT INTO t1 SET list_id = 1, term = "letterc";
+INSERT INTO t1 SET list_id = 1, term = "letterb";
+INSERT INTO t1 SET list_id = 1, term = "lettera";
+INSERT INTO t1 SET list_id = 1, term = "letterd";
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc");
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb");
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera");
+SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
+DROP TABLE t1;
+
+
+#
+# Bug #6043 erratic searching for diacriticals in indexed MyISAM UTF-8 table
+#
+SET NAMES latin1;
+CREATE TABLE t1 (
+ id int unsigned NOT NULL auto_increment,
+ list_id smallint unsigned NOT NULL,
+ term text NOT NULL,
+ PRIMARY KEY(id),
+ INDEX(list_id, term(19))
+) ENGINE=MyISAM CHARSET=utf8mb4;
+INSERT INTO t1 set list_id = 1, term = "testtest";
+INSERT INTO t1 set list_id = 1, term = "testetest";
+INSERT INTO t1 set list_id = 1, term = "testtest";
+SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest");
+SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest");
+SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest");
+DROP TABLE t1;
+
+#
+# Bug #6019 SELECT tries to use too short prefix index on utf8mb4 data
+#
+set names utf8mb4;
+--disable_warnings
+create table t1 (
+ a int primary key,
+ b varchar(6),
+ index b3(b(3))
+) engine=innodb character set=utf8mb4;
+--enable_warnings
+insert into t1 values(1,'foo'),(2,'foobar');
+select * from t1 where b like 'foob%';
+--disable_warnings
+alter table t1 engine=innodb;
+--enable_warnings
+select * from t1 where b like 'foob%';
+drop table t1;
+
+#
+# Test for calculate_interval_lengths() function
+#
+create table t1 (
+ a enum('петя','вася','анюта') character set utf8mb4 not null default 'анюта',
+ b set('петя','вася','анюта') character set utf8mb4 not null default 'анюта'
+);
+create table t2 select concat(a,_utf8mb4'') as a, concat(b,_utf8mb4'')as b from t1;
+show create table t2;
+drop table t2;
+drop table t1;
+
+#
+# Bug #6787 LIKE not working properly with _ and utf8mb4 data
+#
+select 'c' like '\_' as want0;
+
+#
+# SUBSTR with negative offset didn't work with multi-byte strings
+#
+SELECT SUBSTR('вася',-2);
+
+
+#
+# Bug #7730 Server crash using soundex on an utf8mb4 table
+#
+create table t1 (id integer, a varchar(100) character set utf8mb4 collate utf8mb4_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;
+
+#
+# Bug#22638 SOUNDEX broken for international characters
+#
+select soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB);
+select hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB));
+select soundex(_utf8mb4 0xD091D092D093);
+select hex(soundex(_utf8mb4 0xD091D092D093));
+
+
+SET collation_connection='utf8mb4_general_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+-- source include/ctype_german.inc
+SET collation_connection='utf8mb4_bin';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+
+#
+# Bug #7874 CONCAT() gives wrong results mixing
+# latin1 field and utf8mb4 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#8785
+# the same problem with the above, but with nested CONCATs
+#
+create table t1 (f1 varchar(1) not null) default charset utf8mb4;
+insert into t1 values (''), ('');
+select concat(concat(_latin1'->',f1),_latin1'<-') from t1;
+drop table t1;
+
+#
+# Bug#8385: utf8mb4_general_ci treats Cyrillic letters I and SHORT I as the same
+#
+select convert(_koi8r'' using utf8mb4) < convert(_koi8r'' using utf8mb4);
+
+#
+# Bugs#5980: NULL requires a characterset in a union
+#
+set names latin1;
+create table t1 (a varchar(10)) character set utf8mb4;
+insert into t1 values ('test');
+select ifnull(a,'') from t1;
+drop table t1;
+select repeat(_utf8mb4'+',3) as h union select NULL;
+select ifnull(NULL, _utf8mb4'string');
+
+#
+# Bug#9509 Optimizer: wrong result after AND with comparisons
+#
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_lithuanian_ci);
+insert into t1 values ('I'),('K'),('Y');
+select * from t1 where s1 < 'K' and s1 = 'Y';
+select * from t1 where 'K' > s1 and s1 = 'Y';
+drop table t1;
+
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_czech_ci);
+insert into t1 values ('c'),('d'),('h'),('ch'),('CH'),('cH'),('Ch'),('i');
+select * from t1 where s1 > 'd' and s1 = 'CH';
+select * from t1 where 'd' < s1 and s1 = 'CH';
+select * from t1 where s1 = 'cH' and s1 <> 'ch';
+select * from t1 where 'cH' = s1 and s1 <> 'ch';
+drop table t1;
+
+#
+# Bug#10714: Inserting double value into utf8mb4 column crashes server
+#
+create table t1 (a varchar(255)) default character set utf8mb4;
+insert into t1 values (1.0);
+drop table t1;
+
+#
+# Bug#10253 compound index length and utf8mb4 char set
+# produces invalid query results
+#
+create table t1 (
+ id int not null,
+ city varchar(20) not null,
+ key (city(7),id)
+) character set=utf8mb4;
+insert into t1 values (1,'Durban North');
+insert into t1 values (2,'Durban');
+select * from t1 where city = 'Durban';
+select * from t1 where city = 'Durban ';
+drop table t1;
+
+#
+# Bug #11819 CREATE TABLE with a SET DEFAULT 0 and UTF8 crashes server.
+#
+--error 1067
+create table t1 (x set('A', 'B') default 0) character set utf8mb4;
+--error 1067
+create table t1 (x enum('A', 'B') default 0) character set utf8mb4;
+
+
+#
+# Test for bug #11167: join for utf8mb4 varchar value longer than 255 bytes
+#
+
+SET NAMES UTF8;
+
+CREATE TABLE t1 (
+ `id` int(20) NOT NULL auto_increment,
+ `country` varchar(100) NOT NULL default '',
+ `shortcode` varchar(100) NOT NULL default '',
+ `operator` varchar(100) NOT NULL default '',
+ `momid` varchar(30) NOT NULL default '',
+ `keyword` varchar(160) NOT NULL default '',
+ `content` varchar(160) NOT NULL default '',
+ `second_token` varchar(160) default NULL,
+ `gateway_id` int(11) NOT NULL default '0',
+ `created` datetime NOT NULL default '0000-00-00 00:00:00',
+ `msisdn` varchar(15) NOT NULL default '',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`),
+ KEY `IX_mobile_originated_message_keyword` (`keyword`),
+ KEY `IX_mobile_originated_message_created` (`created`),
+ KEY `IX_mobile_originated_message_support` (`msisdn`,`momid`,`keyword`,`gateway_id`,`created`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO t1 VALUES
+(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'),
+(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890');
+
+--disable_warnings
+CREATE TABLE t2 (
+ `msisdn` varchar(15) NOT NULL default '',
+ `operator_id` int(11) NOT NULL default '0',
+ `created` datetime NOT NULL default '0000-00-00 00:00:00',
+ UNIQUE KEY `PK_user` (`msisdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+--enable_warnings
+
+INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
+
+SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
+
+DROP TABLE t1,t2;
+
+#
+# Bug#11591: CHAR column with utf8mb4 does not work properly
+# (more chars than expected)
+#
+create table t1 (a char(20) character set utf8mb4);
+insert into t1 values ('123456'),('андрей');
+alter table t1 modify a char(2) character set utf8mb4;
+select char_length(a), length(a), a from t1 order by a;
+drop table t1;
+
+#
+# Bugs#12611
+# ESCAPE + LIKE do not work when the escape char is a multibyte one
+#
+set names utf8mb4;
+select 'andre%' like 'andreñ%' escape 'ñ';
+
+#
+# Bugs#11754: SET NAMES utf8mb4 followed by SELECT "A\\" LIKE "A\\" returns 0
+#
+set names utf8mb4;
+select 'a\\' like 'a\\';
+select 'aa\\' like 'a%\\';
+
+create table t1 (a char(10), key(a)) character set utf8mb4;
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+select * from t1 where a like "abc%";
+select * from t1 where a like concat("abc","%");
+select * from t1 where a like "ABC%";
+select * from t1 where a like "test%";
+select * from t1 where a like "te_t";
+select * from t1 where a like "%a%";
+select * from t1 where a like "%abcd%";
+select * from t1 where a like "%abc\d%";
+drop table t1;
+
+
+#
+# Bug#9557 MyISAM utf8mb4 table crash
+#
+CREATE TABLE t1 (
+ a varchar(255) NOT NULL default '',
+ KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
+insert into t1 values (_utf8mb4 0xe880bd);
+insert into t1 values (_utf8mb4 0x5b);
+select hex(a) from t1;
+drop table t1;
+
+#
+# Bug#13751 find_in_set: Illegal mix of collations
+#
+set names 'latin1';
+create table t1 (a varchar(255)) default charset=utf8mb4;
+select * from t1 where find_in_set('-1', a);
+drop table t1;
+
+#
+# Bug#13233: select distinct char(column) fails with utf8mb4
+#
+create table t1 (a int);
+insert into t1 values (48),(49),(50);
+set names utf8mb4;
+select distinct char(a) from t1;
+drop table t1;
+
+#
+# Bug#15581: COALESCE function truncates mutli-byte TINYTEXT values
+#
+CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8mb4);
+INSERT INTO t1 VALUES(REPEAT('a', 100));
+CREATE TEMPORARY TABLE t2 SELECT COALESCE(t) AS bug FROM t1;
+SELECT LENGTH(bug) FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
+
+#
+# Bug#17313: N'xxx' and _utf8mb4'xxx' are not equivalent
+#
+CREATE TABLE t1 (item varchar(255)) default character set utf8mb4;
+INSERT INTO t1 VALUES (N'\\');
+INSERT INTO t1 VALUES (_utf8mb4'\\');
+INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
+INSERT INTO t1 VALUES (_utf8mb4'Cote d\'Ivoire');
+SELECT item FROM t1 ORDER BY item;
+DROP TABLE t1;
+
+#
+# Bug#17705: Corruption of compressed index when index length changes between
+# 254 and 256
+#
+
+SET NAMES utf8mb4;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t1 VALUES('uu');
+check table t1;
+INSERT INTO t1 VALUES('uU');
+check table t1;
+INSERT INTO t1 VALUES('uu');
+check table t1;
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+INSERT INTO t1 VALUES('UuABC');
+check table t1;
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+alter table t1 add b int;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',2);
+delete from t1 where b=1;
+INSERT INTO t1 VALUES('UUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
+check table t1;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',4);
+delete from t1 where b=3;
+INSERT INTO t1 VALUES('uUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
+check table t1;
+drop table t1;
+
+#
+# Bug#20471 LIKE search fails with indexed utf8mb4 char column
+#
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%';
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%';
+drop table t1;
+
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_unicode_ci);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%';
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%';
+drop table t1;
+
+set names utf8mb4;
+create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_bin);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_bin from t1 where s1 like 'ペテ%';
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_bin from t1 where s1 like 'ペテ%';
+drop table t1;
+
+# additional tests from duplicate bug#20744 MySQL return no result
+
+set names utf8mb4;
+--disable_warnings
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8mb4 collate utf8mb4_general_ci;
+--enable_warnings
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+drop table t1;
+
+set names utf8mb4;
+--disable_warnings
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8mb4 collate utf8mb4_unicode_ci;
+--enable_warnings
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+drop table t1;
+
+set names utf8mb4;
+--disable_warnings
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8mb4 collate utf8mb4_bin;
+--enable_warnings
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+drop table t1;
+
+
+
+#
+# Bug#14896: Comparison with a key in a partial index over mb chararacter field
+#
+
+SET NAMES utf8mb4;
+CREATE TABLE t1 (id int PRIMARY KEY,
+ a varchar(16) collate utf8mb4_unicode_ci NOT NULL default '',
+ b int,
+ f varchar(128) default 'XXX',
+ INDEX (a(4))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1(id, a, b) VALUES
+ (1, 'cccc', 50), (2, 'cccc', 70), (3, 'cccc', 30),
+ (4, 'cccc', 30), (5, 'cccc', 20), (6, 'bbbbbb', 40),
+ (7, 'dddd', 30), (8, 'aaaa', 10), (9, 'aaaa', 50),
+ (10, 'eeeee', 40), (11, 'bbbbbb', 60);
+
+SELECT id, a, b FROM t1;
+
+SELECT id, a, b FROM t1 WHERE a BETWEEN 'aaaa' AND 'bbbbbb';
+
+SELECT id, a FROM t1 WHERE a='bbbbbb';
+SELECT id, a FROM t1 WHERE a='bbbbbb' ORDER BY b;
+
+DROP TABLE t1;
+
+#
+# Bug#16674: LIKE predicate for a utf8mb4 character set column
+#
+
+SET NAMES utf8mb4;
+
+CREATE TABLE t1 (
+ a CHAR(13) DEFAULT '',
+ INDEX(a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES
+ ('Käli Käli 2-4'), ('Käli Käli 2-4'),
+ ('Käli Käli 2+4'), ('Käli Käli 2+4'),
+ ('Käli Käli 2-6'), ('Käli Käli 2-6');
+INSERT INTO t1 SELECT * FROM t1;
+
+CREATE TABLE t2 (
+ a CHAR(13) DEFAULT '',
+ INDEX(a)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+INSERT INTO t2 VALUES
+ ('Kali Kali 2-4'), ('Kali Kali 2-4'),
+ ('Kali Kali 2+4'), ('Kali Kali 2+4'),
+ ('Kali Kali 2-6'), ('Kali Kali 2-6');
+INSERT INTO t2 SELECT * FROM t2;
+
+SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4';
+SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4';
+
+EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4';
+EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4';
+EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4';
+EXPLAIN SELECT a FROM t2 WHERE a = 'Kali Kali 2+4';
+
+DROP TABLE t1,t2;
+
+CREATE TABLE t1 (
+ a char(255) DEFAULT '',
+ KEY(a(10))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a char(255) DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+INSERT INTO t1 VALUES ('Käli Käli 2-4');
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+ALTER TABLE t1 ADD KEY (a(10));
+SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
+DROP TABLE t1;
+
+#
+# Bug#18359: LIKE predicate for a 'utf8mb4' text column with a partial index
+# (see bug #16674 as well)
+#
+
+SET NAMES latin2;
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL default '0',
+ tid int(11) NOT NULL default '0',
+ val text NOT NULL,
+ INDEX idx(tid, val(10))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO t1 VALUES
+ (40988,72,'VOLN ADSL'),(41009,72,'VOLN ADSL'),
+ (41032,72,'VOLN ADSL'),(41038,72,'VOLN ADSL'),
+ (41063,72,'VOLN ADSL'),(41537,72,'VOLN ADSL Office'),
+ (42141,72,'VOLN ADSL'),(42565,72,'VOLN ADSL Combi'),
+ (42749,72,'VOLN ADSL'),(44205,72,'VOLN ADSL');
+
+SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNY ADSL';
+SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL';
+SELECT * FROM t1 WHERE tid=72 and val LIKE '%VOLN ADSL';
+
+ALTER TABLE t1 DROP KEY idx;
+ALTER TABLE t1 ADD KEY idx (tid,val(11));
+
+SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL';
+
+DROP TABLE t1;
+
+#
+# Bug 20709: problem with utf8mb4 fields in temporary tables
+#
+
+create table t1(a char(200) collate utf8mb4_unicode_ci NOT NULL default '')
+ default charset=utf8mb4 collate=utf8mb4_unicode_ci;
+insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65'));
+explain select distinct a from t1;
+select distinct a from t1;
+explain select a from t1 group by a;
+select a from t1 group by a;
+drop table t1;
+
+#
+# Bug #20204: "order by" changes the results returned
+#
+
+create table t1(a char(10)) default charset utf8mb4;
+insert into t1 values ('123'), ('456');
+explain
+ select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+drop table t1;
+
+#
+# Bug #34349: Passing invalid parameter to CHAR() in an ORDER BY causes
+# MySQL to hang
+#
+
+SET CHARACTER SET utf8mb4;
+SHOW VARIABLES LIKE 'character\_set\_%';
+CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
+USE crashtest;
+CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4;
+INSERT INTO crashtest VALUES ('35'), ('36'), ('37');
+SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
+INSERT INTO crashtest VALUES ('-1000');
+EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
+SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
+DROP TABLE crashtest;
+DROP DATABASE crashtest;
+USE test;
+SET CHARACTER SET default;
+
+# End of 4.1 tests
+
+#
+# Test for bug #11484: wrong results for a DISTINCT varchar column in uft8.
+#
+
+CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8mb4;
+INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
+
+SELECT id FROM t1;
+SELECT DISTINCT id FROM t1;
+SELECT DISTINCT id FROM t1 ORDER BY id;
+
+DROP TABLE t1;
+
+#
+# Bug#20095 Changing length of VARCHAR field with UTF8
+# collation does not truncate values
+#
+create table t1 (
+ a varchar(26) not null
+) default character set utf8mb4;
+insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz');
+select * from t1;
+# varchar to varchar
+alter table t1 change a a varchar(20) character set utf8mb4 not null;
+select * from t1;
+# varchar to char
+alter table t1 change a a char(15) character set utf8mb4 not null;
+select * from t1;
+# char to char
+alter table t1 change a a char(10) character set utf8mb4 not null;
+select * from t1;
+# char to varchar
+alter table t1 change a a varchar(5) character set utf8mb4 not null;
+select * from t1;
+drop table t1;
+
+#
+# Check that do_varstring2_mb produces a warning
+#
+create table t1 (
+ a varchar(4000) not null
+) default character set utf8mb4;
+insert into t1 values (repeat('a',4000));
+alter table t1 change a a varchar(3000) character set utf8mb4 not null;
+select length(a) from t1;
+drop table t1;
+
+
+#
+# Bug#10504: Character set does not support traditional mode
+# Bug#14146: CHAR(...USING ...) and CONVERT(CHAR(...) USING...)
+# produce different results
+#
+set names utf8mb4;
+# correct value
+select hex(char(1 using utf8mb4));
+select char(0xd1,0x8f using utf8mb4);
+select char(0xd18f using utf8mb4);
+select char(53647 using utf8mb4);
+# incorrect value: return with warning
+select char(0xff,0x8f using utf8mb4);
+select convert(char(0xff,0x8f) using utf8mb4);
+# incorrect value in strict mode: return NULL with "Error" level warning
+set sql_mode=traditional;
+select char(0xff,0x8f using utf8mb4);
+select char(195 using utf8mb4);
+select char(196 using utf8mb4);
+select char(2557 using utf8mb4);
+select convert(char(0xff,0x8f) using utf8mb4);
+
+#
+# Check convert + char + using
+#
+select hex(convert(char(2557 using latin1) using utf8mb4));
+
+#
+# char() without USING returns "binary" by default, any argument is ok
+#
+select hex(char(195));
+select hex(char(196));
+select hex(char(2557));
+
+
+
+#
+# Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters
+#
+set names utf8mb4;
+create table t1 (a char(1)) default character set utf8mb4;
+create table t2 (a char(1)) default character set utf8mb4;
+insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
+insert into t1 values('i'),('i'),(0xE38184),(0xE38184);
+select * from t1 union distinct select * from t2;
+drop table t1,t2;
+
+
+#
+# Bug#12371: executing prepared statement fails (illegal mix of collations)
+#
+set names utf8mb4;
+create table t1 (a char(10), b varchar(10));
+insert into t1 values ('bar','kostja');
+insert into t1 values ('kostja','bar');
+prepare my_stmt from "select * from t1 where a=?";
+set @a:='bar';
+execute my_stmt using @a;
+set @a:='kostja';
+execute my_stmt using @a;
+set @a:=null;
+execute my_stmt using @a;
+drop table if exists t1;
+
+
+#
+# Bug#21505 Create view - illegal mix of collation for operation 'UNION'
+#
+--disable_warnings
+drop table if exists t1;
+drop view if exists v1, v2;
+--enable_warnings
+set names utf8mb4;
+create table t1(col1 varchar(12) character set utf8mb4 collate utf8mb4_unicode_ci);
+insert into t1 values('t1_val');
+create view v1 as select 'v1_val' as col1;
+select coercibility(col1), collation(col1) from v1;
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1)from v2;
+drop view v1, v2;
+create view v1 as select 'v1_val' collate utf8mb4_swedish_ci as col1;
+select coercibility(col1), collation(col1) from v1;
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1) from v2;
+drop view v1, v2;
+drop table t1;
+
+#
+# Check conversion of NCHAR strings to subset (e.g. latin1).
+# Conversion is possible if string repertoire is ASCII.
+# Conversion is not possible if the string have extended characters
+#
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, N'x', N'y')) from t1;
+--error 1267
+select concat(a, if(b>10, N'æ', N'ß')) from t1;
+drop table t1;
+
+# Conversion tests for character set introducers
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1;
+--error 1267
+select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1;
+drop table t1;
+
+# Conversion tests for introducer + HEX string
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1;
+--error 1267
+select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1;
+drop table t1;
+
+# Conversion tests for "text_literal TEXT_STRING_literal" syntax structure
+set names utf8mb4;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
+--error 1267
+select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
+drop table t1;
+
+
+#
+# Bug#19960: Inconsistent results when joining
+# InnoDB tables using partial UTF8 indexes
+#
+--disable_warnings
+CREATE TABLE t1 (
+ colA int(11) NOT NULL,
+ colB varchar(255) character set utf8mb4 NOT NULL,
+ PRIMARY KEY (colA)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+--enable_warnings
+INSERT INTO t1 (colA, colB) VALUES (1, 'foo'), (2, 'foo bar');
+--disable_warnings
+CREATE TABLE t2 (
+ colA int(11) NOT NULL,
+ colB varchar(255) character set utf8mb4 NOT NULL,
+ KEY bad (colA,colB(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+--enable_warnings
+INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar');
+SELECT * FROM t1 JOIN t2 ON t1.colA=t2.colA AND t1.colB=t2.colB
+WHERE t1.colA < 3;
+DROP TABLE t1, t2;
+
+#
+# Bug#29205: truncation of UTF8 values when the UNION statement
+# forces collation to the binary charset
+#
+
+SELECT 'н1234567890' UNION SELECT _binary '1';
+SELECT 'н1234567890' UNION SELECT 1;
+
+SELECT '1' UNION SELECT 'н1234567890';
+SELECT 1 UNION SELECT 'н1234567890';
+
+CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8mb4;
+CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT);
+
+INSERT INTO t1 (c) VALUES ('н1234567890');
+INSERT INTO t2 (b, i) VALUES ('1', 1);
+
+SELECT c FROM t1 UNION SELECT b FROM t2;
+SELECT c FROM t1 UNION SELECT i FROM t2;
+
+SELECT b FROM t2 UNION SELECT c FROM t1;
+SELECT i FROM t2 UNION SELECT c FROM t1;
+
+DROP TABLE t1, t2;
+
+#
+# Bug#30982: CHAR(..USING..) can return a not-well-formed string
+# Bug #30986: Character set introducer followed by a HEX string can return bad result
+#
+set sql_mode=traditional;
+select hex(char(0xFF using utf8mb4));
+select hex(convert(0xFF using utf8mb4));
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8mb4 0x616263FF);
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8mb4 X'616263FF');
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8mb4 B'001111111111');
+--error ER_INVALID_CHARACTER_STRING
+select (_utf8mb4 X'616263FF');
+set sql_mode=default;
+select hex(char(0xFF using utf8mb4));
+select hex(convert(0xFF using utf8mb4));
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8mb4 0x616263FF);
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8mb4 X'616263FF');
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8mb4 B'001111111111');
+--error ER_INVALID_CHARACTER_STRING
+select (_utf8mb4 X'616263FF');
+
+#
+# Bug #36772: When using UTF8, CONVERT with GROUP BY returns truncated results
+#
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
+INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
+ALTER TABLE t1 ADD UNIQUE (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+DROP INDEX b ON t1;
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+ALTER TABLE t1 ADD INDEX (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (
+ predicted_order int NOT NULL,
+ utf8mb4_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
+SELECT predicted_order, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_sinhala_ci;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#32914 Character sets: illegal characters in utf8mb4 and utf32 columns
+--echo #
+create table t1 (utf8mb4 char(1) character set utf8mb4);
+--echo Testing [F0][90..BF][80..BF][80..BF]
+insert into t1 values (0xF0908080);
+insert into t1 values (0xF0BFBFBF);
+insert into t1 values (0xF08F8080);
+select hex(utf8mb4) from t1;
+delete from t1;
+
+--echo Testing [F2..F3][80..BF][80..BF][80..BF]
+insert into t1 values (0xF2808080);
+insert into t1 values (0xF2BFBFBF);
+select hex(utf8mb4) from t1;
+delete from t1;
+
+--echo Testing [F4][80..8F][80..BF][80..BF]
+insert into t1 values (0xF4808080);
+insert into t1 values (0xF48F8080);
+insert into t1 values (0xF4908080);
+select hex(utf8mb4) from t1;
+drop table t1;
+
+
+--echo #
+--echo # Check strnxfrm() with odd length
+--echo #
+set max_sort_length=5;
+select @@max_sort_length;
+create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci);
+insert into t1 values ('a'),('b'),('c');
+select * from t1 order by a;
+alter table t1 modify a varchar(128) character set utf8mb4 collate utf8mb4_bin;
+select * from t1 order by a;
+drop table t1;
+set max_sort_length=default;
+
+--echo #
+--echo # Bug#26180: Can't add columns to tables created with utf8mb4 text indexes
+--echo #
+CREATE TABLE t1 (
+ clipid INT NOT NULL,
+ Tape TINYTEXT,
+ PRIMARY KEY (clipid),
+ KEY tape(Tape(255))
+) CHARACTER SET=utf8mb4;
+ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+#--echo #
+#--echo # Check that supplementary characters are not allowed in identifiers
+#--echo #
+# TODO: activate this when system_charset_info is changed to utf8mb4
+#--error 1300
+#CREATE DATABASE `𐀀`;
+#--error 1300
+#CREATE TABLE `𐀀` (a int);
+#--error 1166
+#CREATE TABLE test.t1 SELECT '𐀀';
+#--error 1300
+#CREATE USER `𐀀`;
+
+--echo #
+--echo # Testing 4-byte values.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (
+ u_decimal int NOT NULL,
+ utf8mb4_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8mb4;
+# Source of the following values: http://www.fileformat.info/info/unicode/block/index.htm
+# SINGLE BARLINE
+INSERT INTO t1 VALUES (119040, x'f09d8480'),
+# G CLEF
+ (119070, x'f09d849e'),
+# HALF NOTE
+ (119134, x'f09d859e'),
+# MUSICAL SYMBOL CROIX
+ (119247, x'f09d878f'),
+# MATHEMATICAL BOLD ITALIC CAPITAL DELTA
+ (120607, x'f09d9c9f'),
+# SANS-SERIF BOLD ITALIC CAPITAL PI
+ (120735, x'f09d9e9f'),
+# <Plane 16 Private Use, Last> (last 4 byte character)
+ (1114111, x'f48fbfbf'),
+# VARIATION SELECTOR-256
+ (917999, x'f3a087af');
+# All from musical chars
+INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480');
+# Mix of 3-byte and 4-byte chars
+INSERT INTO t1 VALUES (65131, x'efb9abf09d849ef09d859ef09d859ef09d8480f09d859fefb9abefb9abf09d85a0efb9ab');
+# All from musical chars, but 11 instead of 10 chars. truncated
+INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0');
+
+SELECT u_decimal, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_general_ci, BINARY utf8mb4_encoding;
+
+# First invalid 4 byte value
+INSERT INTO t1 VALUES (1114111, x'f5808080');
+
+
+--disable_warnings
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+CREATE TABLE t2 (
+ u_decimal int NOT NULL,
+ utf8mb3_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8mb3;
+# LATIN CAPITAL LETTER VEND
+INSERT INTO t2 VALUES (42856, x'ea9da8');
+# SMALL COMMERCIAL AT
+INSERT INTO t2 VALUES (65131, x'efb9ab');
+# <Plane 16 Private Use, Last> (last 4 byte character)
+INSERT INTO t2 VALUES (1114111, x'f48fbfbf');
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #
+--echo # Testing that mixing utf8 and utf8mb4 collations returns utf8mb4
+--echo #
+SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b'));
+
+CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL);
+INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf');
+SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0;
+
+CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL);
+INSERT INTO t2 VALUES (x'ea9da8');
+
+SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
+SELECT CHARSET(CONCAT(utf8mb4, utf8mb3)) FROM t1, t2 LIMIT 1;
+
+CREATE TEMPORARY TABLE t3 AS SELECT *, concat(utf8mb4,utf8mb3) FROM t1, t2;
+SHOW CREATE TABLE t3;
+DROP TEMPORARY TABLE t3;
+
+SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
+SELECT * FROM t1, t2 WHERE t1.utf8mb4 = t2.utf8mb3;
+SELECT * FROM t1, t2 WHERE t1.utf8mb4 < t2.utf8mb3;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #
+--echo # Check that mixing utf8mb4 with an invalid utf8 constant returns error
+--echo #
+# This should perhaps be changed to return ER_INVALID_CHARACTER_STRING
+CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4);
+INSERT INTO t1 VALUES (x'f48fbfbf');
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CONCAT(utf8mb4, _utf8 '') FROM t1;
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT CONCAT('a', _utf8 '') FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
+--echo # End of tests
+--echo #
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 3b73a47534e..acd67e0e766 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -291,6 +291,21 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
DROP TABLE t1;
DROP FUNCTION f1;
+
+--echo #
+--echo # Bug #49552 : sql_buffer_result cause crash + not found records
+--echo # in multitable delete/subquery
+--echo #
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SET SESSION SQL_BUFFER_RESULT=1;
+DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
+
+SET SESSION SQL_BUFFER_RESULT=DEFAULT;
+SELECT * FROM t1;
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
@@ -513,18 +528,4 @@ DELETE IGNORE FROM t1;
DROP TABLE t1;
---echo #
---echo # Bug #49552 : sql_buffer_result cause crash + not found records
---echo # in multitable delete/subquery
---echo #
-
-CREATE TABLE t1(a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-SET SESSION SQL_BUFFER_RESULT=1;
-DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
-
-SET SESSION SQL_BUFFER_RESULT=DEFAULT;
-SELECT * FROM t1;
-DROP TABLE t1;
-
--echo End of 5.1 tests
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index c95bc213dec..97a1b5e39dc 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -553,6 +553,27 @@ SELECT count(*) FROM t1 WHERE
DROP TABLE t1,t2,t3;
+#
+# BUG#50351 - ft_min_word_len=2 Causes query to hang
+#
+CREATE TABLE t1 (a VARCHAR(4), FULLTEXT(a));
+INSERT INTO t1 VALUES
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
+('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('awrd'),('cwrd'),
+('awrd');
+SELECT COUNT(*) FROM t1 WHERE MATCH(a) AGAINST("+awrd bwrd* +cwrd*" IN BOOLEAN MODE);
+DROP TABLE t1;
--echo #
--echo # Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 71d3d5a140b..0b4f0be114c 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -693,6 +693,21 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN
DROP TABLE t1, t2;
+#
+# Bug #49487: crash with explain extended and group_concat in a derived table
+#
+
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (),();
+
+EXPLAIN EXTENDED SELECT 1 FROM
+ (SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
+
+SELECT 1 FROM
+ (SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index a570e70d81d..556a19efce5 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -442,7 +442,7 @@ where collation(t2.a) = _utf8'binary' order by t1.a,t2.a;
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where charset(t2.a) = _utf8'binary' order by t1.a,t2.a;
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
-where coercibility(t2.a) = 2 order by t1.a,t2.a;
+where coercibility(t2.a) = 5 order by t1.a,t2.a;
DROP TABLE t1, t2;
#
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 7ed8dfe5784..4f92ff65177 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1159,3 +1159,53 @@ SELECT COUNT(i) FROM t1 WHERE i > 1;
DROP TABLE t1;
SET @@sql_mode = @old_sql_mode;
+--echo #
+--echo # Bug #45640: optimizer bug produces wrong results
+--echo #
+
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (4, 40), (1, 10), (2, 20), (2, 20), (3, 30);
+
+--echo # should return 4 ordered records:
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
+
+SELECT (SELECT (SELECT t1.a)) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
+
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
+
+--echo # should return the same result in a reverse order:
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
+
+--echo # execution plan should not use temporary table:
+EXPLAIN EXTENDED
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
+
+EXPLAIN EXTENDED
+SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
+
+--echo # should return only one record
+SELECT (SELECT tt.a FROM t1 tt LIMIT 1) aa, COUNT(DISTINCT b) FROM t1
+ GROUP BY aa;
+
+CREATE TABLE t2 SELECT DISTINCT a FROM t1;
+
+--echo # originally reported queries (1st two columns of next two query
+--echo # results should be same):
+
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
+ FROM t1 GROUP BY aa, b;
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
+ FROM t1 GROUP BY aa, b;
+
+--echo # ORDER BY for sure:
+
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
+ FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
+SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
+ FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
+
+DROP TABLE t1, t2;
+
+--echo #
+
+--echo # End of 5.1 tests
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 1e7f28d5916..81274b04bcd 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -1044,6 +1044,16 @@ SELECT a, MAX(b) FROM t WHERE b GROUP BY a;
DROP TABLE t;
+#
+# BUG#49902 - SELECT returns incorrect results
+#
+CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, KEY (b));
+INSERT INTO t1 VALUES(1,1),(2,1);
+ANALYZE TABLE t1;
+SELECT 1 AS c, b FROM t1 WHERE b IN (1,2) GROUP BY c, b;
+SELECT a FROM t1 WHERE b=1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index af9af4fe1fc..185ca4bdddb 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -442,4 +442,30 @@ INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL);
SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
DROP TABLE t1;
+
+--echo #
+--echo # Bug#50995 Having clause on subquery result produces incorrect results.
+--echo #
+
+CREATE TABLE t1
+(
+ id1 INT,
+ id2 INT NOT NULL,
+ INDEX id1(id2)
+);
+
+INSERT INTO t1 SET id1=1, id2=1;
+INSERT INTO t1 SET id1=2, id2=1;
+INSERT INTO t1 SET id1=3, id2=1;
+
+SELECT t1.id1,
+(SELECT 0 FROM DUAL
+ WHERE t1.id1=t1.id1) AS amount FROM t1
+WHERE t1.id2 = 1
+HAVING amount > 0
+ORDER BY t1.id1;
+
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/init_connect-master.opt b/mysql-test/t/init_connect-master.opt
index 108a8687aa2..db17a49c058 100644
--- a/mysql-test/t/init_connect-master.opt
+++ b/mysql-test/t/init_connect-master.opt
@@ -1 +1 @@
---set-variable=init_connect="set @a='a\\0c'"
+--init_connect="set @a='a\\0c'"
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index d7a255a7f39..b5dec54bed2 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -536,6 +536,28 @@ DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug #49324: more valgrind errors in test_if_skip_sort_order
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
+--echo #should not cause valgrind warnings
+SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#50843: Filesort used instead of clustered index led to
+--echo # performance degradation.
+--echo #
+create table t1(f1 int not null primary key, f2 int) engine=innodb;
+create table t2(f1 int not null, key (f1)) engine=innodb;
+insert into t1 values (1,1),(2,2),(3,3);
+insert into t2 values (1),(2),(3);
+explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
+drop table t1,t2;
+--echo #
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index dbf36dedec8..761121313e5 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -804,3 +804,28 @@ DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1, t2;
+
+#
+# Bug#45195 valgrind warnings about uninitialized values in store_record_in_cache()
+#
+CREATE TABLE t1(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+CREATE TABLE t2(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+INSERT INTO t1 VALUES ('1',null),(null,null);
+INSERT INTO t2 VALUES ('1',null),(null,null);
+CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
+ENGINE=MERGE UNION=(t1,t2);
+SELECT t1.a FROM mm1,t1;
+DROP TABLE t1, t2, mm1;
+
+--echo #
+--echo # Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
+--echo #
+
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
+INSERT INTO t1 VALUES (0,0), (1,1);
+
+SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/multi_update-master.opt b/mysql-test/t/multi_update-master.opt
index 9f1a29461ff..da78f987af3 100644
--- a/mysql-test/t/multi_update-master.opt
+++ b/mysql-test/t/multi_update-master.opt
@@ -1 +1 @@
---set-variable=tmp_table_size=1024
+--tmp_table_size=1024
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 68b44a33428..0db6c44873d 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -638,5 +638,17 @@ drop table t1, t2, t3;
# Add further tests from here
#
+--echo #
+--echo # Bug#49534: multitable IGNORE update with sql_safe_updates error
+--echo # causes debug assertion
+--echo #
+CREATE TABLE t1( a INT, KEY( a ) );
+INSERT INTO t1 VALUES (1), (2), (3);
+SET SESSION sql_safe_updates = 1;
+--echo # Must not cause failed assertion
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
+UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
+DROP TABLE t1;
+
--echo end of tests
diff --git a/mysql-test/t/multi_update2-master.opt b/mysql-test/t/multi_update2-master.opt
index 9f1a29461ff..da78f987af3 100644
--- a/mysql-test/t/multi_update2-master.opt
+++ b/mysql-test/t/multi_update2-master.opt
@@ -1 +1 @@
---set-variable=tmp_table_size=1024
+--tmp_table_size=1024
diff --git a/mysql-test/t/multi_update_tiny_hash-master.opt b/mysql-test/t/multi_update_tiny_hash-master.opt
index d81cc55090d..2fa4c2b903d 100644
--- a/mysql-test/t/multi_update_tiny_hash-master.opt
+++ b/mysql-test/t/multi_update_tiny_hash-master.opt
@@ -1 +1 @@
---set-variable=max_heap_table_size=16384
+--max_heap_table_size=16384
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 8d9e98be8ea..47f53cac9ee 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1200,6 +1200,17 @@ CHECKSUM TABLE t1 EXTENDED;
DROP TABLE t1;
+--echo #
+--echo # BUG#48438 - crash with error in unioned query against merge table and view...
+--echo #
+SET GLOBAL table_open_cache=3;
+CREATE TABLE t1(a INT);
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+DROP TABLE t1;
+SET GLOBAL table_open_cache=DEFAULT;
+
--echo End of 5.0 tests
@@ -1565,5 +1576,18 @@ SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
CHECK TABLE t1;
DROP TABLE t1;
+
+--echo #
+--echo # BUG#49628 - corrupt table after legal SQL, LONGTEXT column
+--echo #
+CREATE TABLE t1(a INT, b LONGTEXT, UNIQUE(a));
+REPLACE INTO t1 VALUES
+(1, REPEAT('a', 129015)),(1, NULL),
+(2, NULL),(3, NULL),(4, NULL),(5, NULL),(6, NULL),(7, NULL),
+(1, REPEAT('b', 129016)),(1, NULL),
+(1, REPEAT('c', 129015)),(1, REPEAT('d', 129015));
+CHECK TABLE t1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/no_binlog.test b/mysql-test/t/no_binlog.test
new file mode 100644
index 00000000000..fa9c87079de
--- /dev/null
+++ b/mysql-test/t/no_binlog.test
@@ -0,0 +1,6 @@
+-- source include/not_embedded.inc
+
+# BUG#50780: 'show binary logs' debug assertion when binary logging is disabled
+
+-- error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
diff --git a/mysql-test/t/order_fill_sortbuf-master.opt b/mysql-test/t/order_fill_sortbuf-master.opt
index 9aa3cc76221..7b6ade99226 100644
--- a/mysql-test/t/order_fill_sortbuf-master.opt
+++ b/mysql-test/t/order_fill_sortbuf-master.opt
@@ -1 +1 @@
---set-variable=sort_buffer=32804
+--sort_buffer=32804
diff --git a/mysql-test/t/partition_debug_sync.test b/mysql-test/t/partition_debug_sync.test
new file mode 100644
index 00000000000..9165006f537
--- /dev/null
+++ b/mysql-test/t/partition_debug_sync.test
@@ -0,0 +1,89 @@
+#--disable_abort_on_error
+#
+# Test for the partition storage engine which require DEBUG_SYNC feature to
+# Created by Mattias Jonsson
+#
+--source include/have_partition.inc
+--source include/have_debug_sync.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+SET DEBUG_SYNC= 'RESET';
+--enable_warnings
+
+--echo #
+--echo # Bug#42438: Crash ha_partition::change_table_ptr
+--echo # Test when remove partitioning is done while drop table is waiting
+--echo # for the table.
+--echo # After MDL was introduced, there is no longer any race, so test is done
+--echo # by adding a small sleep to verify that the delete waits.
+connect(con1, localhost, root,,);
+--echo # Con 1
+SET DEBUG_SYNC= 'RESET';
+CREATE TABLE t1
+(a INTEGER,
+ b INTEGER NOT NULL,
+ KEY (b))
+ENGINE = MYISAM
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (2),
+ PARTITION p1 VALUES LESS THAN (20),
+ PARTITION p2 VALUES LESS THAN (100),
+ PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
+SET SESSION debug= "+d,sleep_before_create_table_no_lock";
+SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter';
+SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL partitioning_removed';
+--send ALTER TABLE t1 REMOVE PARTITIONING
+connection default;
+--echo # Con default
+SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
+SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed';
+DROP TABLE IF EXISTS t1;
+--echo # Con 1
+connection con1;
+--reap
+SET SESSION debug= "-d,sleep_before_create_table_no_lock";
+connection default;
+SET DEBUG_SYNC= 'RESET';
+connection con1;
+SET DEBUG_SYNC= 'RESET';
+
+--echo #
+--echo # Bug#42438: Crash ha_partition::change_table_ptr
+--echo # Test when remove partitioning is failing due to drop table is already
+--echo # in progress.
+--echo # After MDL was introduced, there is no longer any race, so test is done
+--echo # by adding a small sleep to verify that the alter waits.
+CREATE TABLE t2
+(a INTEGER,
+ b INTEGER NOT NULL,
+ KEY (b))
+ENGINE = MYISAM
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (2),
+ PARTITION p1 VALUES LESS THAN (20),
+ PARTITION p2 VALUES LESS THAN (100),
+ PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
+SET DEBUG_SYNC= 'open_tables_acquire_upgradable_mdl SIGNAL removing_partitions WAIT_FOR waiting_for_alter';
+SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
+--send ALTER TABLE t2 REMOVE PARTITIONING
+connection default;
+--echo # Con default
+SET SESSION debug= "+d,sleep_before_part2_delete_table";
+SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
+SET DEBUG_SYNC= 'rm_table_part2_before_delete_table SIGNAL waiting_for_alter';
+SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done';
+DROP TABLE IF EXISTS t2;
+SET SESSION debug= "-d,sleep_before_part2_delete_table";
+--echo # Con 1
+connection con1;
+--error ER_NO_SUCH_TABLE
+--reap
+SET DEBUG_SYNC= 'RESET';
+disconnect con1;
+connection default;
+--echo # Con default
+SET DEBUG_SYNC= 'RESET';
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/sp-bugs.test b/mysql-test/t/sp-bugs.test
index 7b94e65a5e9..8aa0791e265 100644
--- a/mysql-test/t/sp-bugs.test
+++ b/mysql-test/t/sp-bugs.test
@@ -57,5 +57,48 @@ SELECT f2 ();
DROP SCHEMA testdb;
+USE test;
+
+--echo #
+--echo # Bug#50423: Crash on second call of a procedure dropping a trigger
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TRIGGER IF EXISTS tr1;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
+CREATE PROCEDURE p1 () DROP TRIGGER tr1;
+
+CALL p1 ();
+--error ER_TRG_DOES_NOT_EXIST
+CALL p1 ();
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # Bug#50423: Crash on second call of a procedure dropping a trigger
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TRIGGER IF EXISTS tr1;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
+CREATE PROCEDURE p1 () DROP TRIGGER tr1;
+
+CALL p1 ();
+--error ER_TRG_DOES_NOT_EXIST
+CALL p1 ();
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
--echo End of 5.1 tests
diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test
index f7984952e33..83accecabb5 100644
--- a/mysql-test/t/sp_notembedded.test
+++ b/mysql-test/t/sp_notembedded.test
@@ -413,6 +413,43 @@ let $wait_condition=
--source include/wait_condition.inc
DROP PROCEDURE p;
+#
+# Bug#47736 killing a select from a view when the view is processing a function, asserts
+#
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1);
+CREATE FUNCTION f1 (inp TEXT) RETURNS INT NO SQL RETURN sleep(60);
+CREATE VIEW v1 AS SELECT f1('a') FROM t1;
+
+--connect (con1, localhost, root,,)
+--let $ID_1= `SELECT connection_id()`
+--send SELECT * FROM v1;
+
+--connect (con2, localhost, root,,)
+--let $ID_2= `SELECT connection_id()`
+--send SELECT * FROM v1
+
+--connection default
+--disable_query_log
+--eval KILL QUERY $ID_2
+--eval KILL QUERY $ID_1
+--enable_query_log
+
+--connection con1
+--error ER_QUERY_INTERRUPTED
+--reap
+--connection con2
+--error ER_QUERY_INTERRUPTED
+--reap
+
+--connection default
+DROP VIEW v1;
+DROP TABLE t1;
+DROP FUNCTION f1;
+--disconnect con1
+--disconnect con2
+
+
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index bb4e7d623f8..50f2644ff9e 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3820,4 +3820,21 @@ SELECT 1 FROM t1 WHERE a <> SOME
);
DROP TABLE t1;
+--echo #
+--echo # Bug #45989 take 2 : memory leak after explain encounters an
+--echo # error in the query
+--echo #
+
+CREATE TABLE t1(a LONGTEXT);
+INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet));
+INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet));
+
+--error ER_BAD_FIELD_ERROR
+EXPLAIN EXTENDED SELECT DISTINCT 1 FROM t1,
+(SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) AS d1
+WHERE t1.a = d1.a;
+
+DROP TABLE t1;
+
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 530389b3ab9..8bedf9357ef 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -425,4 +425,17 @@ select hex(a) from t1;
show create table t1;
drop table t1;
+--echo #
+--echo # Bug#50591 bit(31) causes Duplicate entry '1-NULL' for key 'group_key'
+--echo #
+CREATE TABLE t1(a INT, b BIT(7) NOT NULL);
+INSERT INTO t1 VALUES (NULL, 0),(NULL, 0);
+SELECT SUM(a) FROM t1 GROUP BY b, a;
+DROP TABLE t1;
+
+CREATE TABLE t1(a INT, b BIT(7) NOT NULL, c BIT(8) NOT NULL);
+INSERT INTO t1 VALUES (NULL, 0, 0),(NULL, 0, 0);
+SELECT SUM(a) FROM t1 GROUP BY c, b, a;
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 2cca4ccd186..d1a4d78e58f 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3906,6 +3906,52 @@ ALTER TABLE v1;
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # Bug#48449: hang on show create view after upgrading when
+--echo # view contains function of view
+--echo #
+
+--disable_warnings
+DROP VIEW IF EXISTS v1,v2;
+DROP TABLE IF EXISTS t1,t2;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+
+delimiter //;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ SELECT a FROM v2 INTO @a;
+ RETURN @a;
+END//
+delimiter ;//
+
+--echo # Trigger pre-locking when opening v2.
+CREATE VIEW v1 AS SELECT f1() FROM t1;
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+copy_file std_data/bug48449.frm $MYSQLD_DATADIR/test/v2.frm;
+
+SHOW CREATE VIEW v1;
+
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;
+DROP FUNCTION f1;
+
+
+#
+# Bug#48294 assertion when creating a view based on some row() construct in select query
+#
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES ();
+
+CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE
+ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' )));
+
+DROP VIEW v1;
+DROP TABLE t1;
--echo # -----------------------------------------------------------------
--echo # -- End of 5.1 tests.
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index d94bcfc29ed..3ccef94d7ea 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -1532,3 +1532,17 @@ SELECT a FROM v2;
--disconnect mysqluser1
DROP USER mysqluser1;
DROP DATABASE mysqltest1;
+USE test;
+
+--echo #
+--echo # Bug#47734: Assertion failed: ! is_set() when locking a view with non-existing definer
+--echo #
+
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+CREATE DEFINER=`unknown`@`unknown` SQL SECURITY DEFINER VIEW v1 AS SELECT 1;
+--error ER_NO_SUCH_USER
+LOCK TABLES v1 READ;
+DROP VIEW v1;