summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am2
-rw-r--r--mysql-test/extra/binlog_tests/ctype_cp932.test14
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_UUID.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_blob.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_func003.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp006.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test4
-rw-r--r--mysql-test/include/add_anonymous_users.inc7
-rw-r--r--mysql-test/include/delete_anonymous_users.inc5
-rw-r--r--mysql-test/include/get_binlog_dump_thread_id.inc19
-rw-r--r--mysql-test/include/gis_generic.inc4
-rw-r--r--mysql-test/include/have_openssl.inc4
-rw-r--r--mysql-test/include/have_ssl.inc4
-rw-r--r--mysql-test/include/mix2.inc222
-rw-r--r--mysql-test/include/mix2_ucs2.inc228
-rw-r--r--mysql-test/include/ps_conv.inc12
-rw-r--r--mysql-test/lib/init_db.sql652
-rw-r--r--mysql-test/lib/mtr_misc.pl17
-rw-r--r--mysql-test/lib/mtr_process.pl39
-rwxr-xr-xmysql-test/mysql-test-run.pl157
-rw-r--r--mysql-test/r/alter_table.result36
-rw-r--r--mysql-test/r/archive_gis.result4
-rw-r--r--mysql-test/r/binlog_row_ctype_cp932.result10
-rwxr-xr-xmysql-test/r/binlog_stm_ctype_cp932.result10
-rw-r--r--mysql-test/r/bootstrap.result8
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/r/csv.result7
-rw-r--r--mysql-test/r/delayed.result7
-rw-r--r--mysql-test/r/derived.result2
-rw-r--r--mysql-test/r/endspace.result15
-rw-r--r--mysql-test/r/events_logs_tests.result1
-rw-r--r--mysql-test/r/explain.result30
-rw-r--r--mysql-test/r/federated_server.result2
-rw-r--r--mysql-test/r/flush2.result18
-rw-r--r--mysql-test/r/func_default.result2
-rw-r--r--mysql-test/r/func_group.result30
-rw-r--r--mysql-test/r/func_in.result78
-rw-r--r--mysql-test/r/func_regexp.result2
-rw-r--r--mysql-test/r/func_sapdb.result4
-rw-r--r--mysql-test/r/func_str.result49
-rw-r--r--mysql-test/r/func_test.result4
-rw-r--r--mysql-test/r/func_time.result25
-rw-r--r--mysql-test/r/gis-rtree.result562
-rw-r--r--mysql-test/r/gis.result50
-rw-r--r--mysql-test/r/group_by.result112
-rw-r--r--mysql-test/r/have_ssl.require (renamed from mysql-test/r/have_openssl.require)2
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/heap.result7
-rw-r--r--mysql-test/r/innodb-ucs2.result313
-rw-r--r--mysql-test/r/innodb.result312
-rw-r--r--mysql-test/r/innodb_gis.result4
-rw-r--r--mysql-test/r/insert.result1
-rw-r--r--mysql-test/r/insert_update.result22
-rw-r--r--mysql-test/r/join.result2
-rw-r--r--mysql-test/r/key.result41
-rw-r--r--mysql-test/r/loaddata.result16
-rw-r--r--mysql-test/r/log_state.result4
-rw-r--r--mysql-test/r/merge.result18
-rw-r--r--mysql-test/r/mix2_myisam.result312
-rw-r--r--mysql-test/r/mix2_myisam_ucs2.result312
-rw-r--r--mysql-test/r/mysql.result10
-rw-r--r--mysql-test/r/mysql_cp932.result10
-rw-r--r--mysql-test/r/mysql_upgrade.result130
-rw-r--r--mysql-test/r/mysqlbinlog-cp932.result19
-rw-r--r--mysql-test/r/mysqlbinlog.result20
-rw-r--r--mysql-test/r/mysqltest.result7
-rw-r--r--mysql-test/r/ndb_gis.result8
-rw-r--r--mysql-test/r/ndb_single_user.result46
-rw-r--r--mysql-test/r/olap.result9
-rw-r--r--mysql-test/r/order_by.result54
-rw-r--r--mysql-test/r/outfile.resultbin1159 -> 1382 bytes
-rw-r--r--mysql-test/r/ps_2myisam.result12
-rw-r--r--mysql-test/r/ps_3innodb.result12
-rw-r--r--mysql-test/r/ps_4heap.result12
-rw-r--r--mysql-test/r/ps_5merge.result24
-rw-r--r--mysql-test/r/ps_7ndb.result12
-rw-r--r--mysql-test/r/query_cache.result2
-rw-r--r--mysql-test/r/rpl_ndb_log.result6
-rw-r--r--mysql-test/r/rpl_read_only.result3
-rw-r--r--mysql-test/r/rpl_row_NOW.result1
-rw-r--r--mysql-test/r/rpl_row_USER.result10
-rw-r--r--mysql-test/r/rpl_row_basic_11bugs.result2
-rw-r--r--mysql-test/r/rpl_row_func002.result1
-rw-r--r--mysql-test/r/rpl_row_log.result6
-rw-r--r--mysql-test/r/rpl_row_log_innodb.result6
-rw-r--r--mysql-test/r/rpl_row_sp008.result1
-rw-r--r--mysql-test/r/rpl_row_sp012.result1
-rw-r--r--mysql-test/r/rpl_row_tabledefs_2myisam.result2
-rw-r--r--mysql-test/r/rpl_row_tabledefs_3innodb.result2
-rw-r--r--mysql-test/r/rpl_row_tabledefs_7ndb.result2
-rw-r--r--mysql-test/r/rpl_row_view01.result1
-rw-r--r--mysql-test/r/rpl_slave_status.result1
-rw-r--r--mysql-test/r/rpl_ssl.result93
-rw-r--r--mysql-test/r/rpl_stm_log.result8
-rw-r--r--mysql-test/r/rpl_switch_stm_row_mixed.result2
-rw-r--r--mysql-test/r/select.result38
-rw-r--r--mysql-test/r/skip_grants.result12
-rw-r--r--mysql-test/r/sp-security.result6
-rw-r--r--mysql-test/r/sp-ucs2.result14
-rw-r--r--mysql-test/r/sp.result28
-rw-r--r--mysql-test/r/ssl_des.result2159
-rw-r--r--mysql-test/r/subselect.result49
-rw-r--r--mysql-test/r/trigger.result41
-rw-r--r--mysql-test/r/type_blob.result24
-rw-r--r--mysql-test/r/union.result13
-rw-r--r--mysql-test/r/update.result4
-rw-r--r--mysql-test/r/varbinary.result3
-rw-r--r--mysql-test/r/variables.result16
-rw-r--r--mysql-test/r/view.result37
-rw-r--r--mysql-test/t/alter_table.test27
-rw-r--r--mysql-test/t/bootstrap.test46
-rw-r--r--mysql-test/t/create.test4
-rw-r--r--mysql-test/t/csv.test50
-rw-r--r--mysql-test/t/ctype_ucs2_def-master.opt2
-rw-r--r--mysql-test/t/ctype_ucs2_def.test2
-rw-r--r--mysql-test/t/delayed.test8
-rw-r--r--mysql-test/t/derived.test7
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/endspace.test9
-rw-r--r--mysql-test/t/events_logs_tests.test2
-rw-r--r--mysql-test/t/explain.test15
-rw-r--r--mysql-test/t/flush2.test4
-rw-r--r--mysql-test/t/func_des_encrypt.test2
-rw-r--r--mysql-test/t/func_encrypt.test2
-rw-r--r--mysql-test/t/func_group.test6
-rw-r--r--mysql-test/t/func_in.test62
-rw-r--r--mysql-test/t/func_str.test46
-rw-r--r--mysql-test/t/func_time.test27
-rw-r--r--mysql-test/t/gis-rtree.test562
-rw-r--r--mysql-test/t/gis.test40
-rw-r--r--mysql-test/t/grant2.test4
-rw-r--r--mysql-test/t/grant_cache.test6
-rw-r--r--mysql-test/t/group_by.test68
-rw-r--r--mysql-test/t/heap.test9
-rw-r--r--mysql-test/t/init_connect.test4
-rw-r--r--mysql-test/t/innodb-ucs2.test226
-rw-r--r--mysql-test/t/innodb.test221
-rw-r--r--mysql-test/t/insert.test2
-rw-r--r--mysql-test/t/insert_update.test33
-rw-r--r--mysql-test/t/key.test48
-rw-r--r--mysql-test/t/loaddata.test23
-rw-r--r--mysql-test/t/lock_multi.test6
-rw-r--r--mysql-test/t/log_state.test9
-rw-r--r--mysql-test/t/merge.test26
-rw-r--r--mysql-test/t/mix2_myisam_ucs2.test27
-rw-r--r--mysql-test/t/mysql.test34
-rw-r--r--mysql-test/t/mysql_cp932.test22
-rw-r--r--mysql-test/t/mysqlbinlog-cp932-master.opt1
-rw-r--r--mysql-test/t/mysqlbinlog-cp932.test20
-rw-r--r--mysql-test/t/mysqlbinlog.test46
-rw-r--r--mysql-test/t/mysqldump.test34
-rw-r--r--mysql-test/t/mysqltest.test129
-rw-r--r--mysql-test/t/ndb_basic.test6
-rw-r--r--mysql-test/t/ndb_index_ordered.test4
-rw-r--r--mysql-test/t/ndb_multi.test4
-rw-r--r--mysql-test/t/ndb_multi_row.test4
-rw-r--r--mysql-test/t/ndb_single_user.test84
-rw-r--r--mysql-test/t/olap.test15
-rw-r--r--mysql-test/t/openssl_1.test7
-rw-r--r--mysql-test/t/order_by.test54
-rw-r--r--mysql-test/t/outfile.test12
-rw-r--r--mysql-test/t/overflow.test2
-rw-r--r--mysql-test/t/query_cache.test4
-rw-r--r--mysql-test/t/rpl_ndb_bank.test2
-rw-r--r--mysql-test/t/rpl_ndb_dd_advance.test2
-rw-r--r--mysql-test/t/rpl_openssl.test2
-rw-r--r--mysql-test/t/rpl_rbr_to_sbr.test2
-rw-r--r--mysql-test/t/rpl_read_only.test8
-rw-r--r--mysql-test/t/rpl_row_NOW.test3
-rw-r--r--mysql-test/t/rpl_row_USER.test4
-rw-r--r--mysql-test/t/rpl_row_basic_11bugs.test6
-rw-r--r--mysql-test/t/rpl_row_func002.test3
-rw-r--r--mysql-test/t/rpl_row_sp001.test2
-rw-r--r--mysql-test/t/rpl_row_sp008.test1
-rw-r--r--mysql-test/t/rpl_row_sp011.test2
-rw-r--r--mysql-test/t/rpl_row_sp012.test1
-rw-r--r--mysql-test/t/rpl_row_trig001.test2
-rw-r--r--mysql-test/t/rpl_row_trig003.test2
-rw-r--r--mysql-test/t/rpl_row_view01.test1
-rw-r--r--mysql-test/t/rpl_slave_status.test1
-rw-r--r--mysql-test/t/rpl_sp004.test2
-rw-r--r--mysql-test/t/rpl_ssl.test60
-rw-r--r--mysql-test/t/rpl_switch_stm_row_mixed.test10
-rw-r--r--mysql-test/t/rpl_temporary.test14
-rw-r--r--mysql-test/t/select.test47
-rw-r--r--mysql-test/t/skip_grants.test7
-rw-r--r--mysql-test/t/sp-ucs2.test28
-rw-r--r--mysql-test/t/sp.test41
-rw-r--r--mysql-test/t/ssl.test2
-rw-r--r--mysql-test/t/ssl_compress.test2
-rw-r--r--mysql-test/t/ssl_connect.test2
-rw-r--r--mysql-test/t/ssl_des.test19
-rw-r--r--mysql-test/t/subselect.test12
-rw-r--r--mysql-test/t/trigger-grant.test18
-rw-r--r--mysql-test/t/trigger.test38
-rw-r--r--mysql-test/t/type_blob.test27
-rw-r--r--mysql-test/t/type_varchar.test5
-rw-r--r--mysql-test/t/union.test13
-rw-r--r--mysql-test/t/update.test8
-rw-r--r--mysql-test/t/varbinary.test1
-rw-r--r--mysql-test/t/variables.test19
-rw-r--r--mysql-test/t/view.test39
-rw-r--r--mysql-test/t/xa.test2
204 files changed, 4975 insertions, 4425 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index ede012c1870..839dc434e46 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -70,7 +70,6 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51
- $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(distdir)/lib
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
install-data-local:
@@ -112,7 +111,6 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51
- $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
uninstall-local:
diff --git a/mysql-test/extra/binlog_tests/ctype_cp932.test b/mysql-test/extra/binlog_tests/ctype_cp932.test
index c6196b928b0..fc2fa934641 100644
--- a/mysql-test/extra/binlog_tests/ctype_cp932.test
+++ b/mysql-test/extra/binlog_tests/ctype_cp932.test
@@ -424,3 +424,17 @@ show warnings;
select * from t1;
select hex(a) from t1;
drop table t1;
+
+#
+# BUG#16217 - MySQL client misinterpretes multi-byte char as escape `\'
+#
+
+# new command \C or charset
+--exec $MYSQL --default-character-set=utf8 test -e "\C cp932 \g"
+--exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
+
+# its usage to switch internally in mysql to requested charset
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ƒ\'); select * from t1; drop table t1;"
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select 'ƒ\'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select 'ƒ\'"
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index cc3a9b4ffb5..9f6f4bf7e57 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -125,6 +125,8 @@ show slave status;
--error 1220
show binlog events in 'slave-bin.000005' from 4;
+connection master;
+
# The table drops caused Cluster Replication wrapper to fail as event ID would never be the same.# Moving drops here.
DROP TABLE t1;
@@ -149,3 +151,5 @@ drop table t1;
# End of 4.1 tests
+sync_with_master;
+
diff --git a/mysql-test/extra/rpl_tests/rpl_row_UUID.test b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
index 962572d3aec..b3fa2fabe2c 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_UUID.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
@@ -72,7 +72,7 @@ DROP TABLE test.t2;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching :-)
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql;
# Cleanup dump files.
# Long-term "system rm" is not portable; we could live without
diff --git a/mysql-test/extra/rpl_tests/rpl_row_blob.test b/mysql-test/extra/rpl_tests/rpl_row_blob.test
index 75a2dc2cf9e..2dc6867df32 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_blob.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_blob.test
@@ -179,7 +179,7 @@ connection master;
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_blob_slave.sql
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_blob_slave.sql
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_blob_slave.sql;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_func003.test b/mysql-test/extra/rpl_tests/rpl_row_func003.test
index 153a03da2e7..662f1454096 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_func003.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_func003.test
@@ -80,7 +80,7 @@ SET AUTOCOMMIT=1;
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_slave.sql
-# First lets cleanupi
+# First lets cleanup
DROP FUNCTION test.f1;
DROP TABLE test.t1;
@@ -90,7 +90,7 @@ DROP TABLE test.t1;
# the files yourself to see what is not matching :-) File are located
# in $MYSQLTEST_VARDIR/tmp
-exec diff $MYSQLTEST_VARDIR/tmp/func003_master.sql $MYSQLTEST_VARDIR/tmp/func003_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/func003_master.sql $MYSQLTEST_VARDIR/tmp/func003_slave.sql;
# End of 5.0 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp006.test b/mysql-test/extra/rpl_tests/rpl_row_sp006.test
index 25073e54991..da9206d7d3f 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp006.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp006.test
@@ -84,7 +84,7 @@ DROP DATABASE mysqltest1;
# the files your self to see what is not matching :-) Failed test
# Dump files will be located in $MYSQLTEST_VARDIR/tmp.
-exec diff $MYSQLTEST_VARDIR/tmp/sp006_master.sql $MYSQLTEST_VARDIR/tmp/sp006_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/sp006_master.sql $MYSQLTEST_VARDIR/tmp/sp006_slave.sql;
sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index c50a5613386..0cf43d45348 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -12,6 +12,7 @@ DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
--enable_warnings
sync_slave_with_master;
STOP SLAVE;
+SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
@@ -238,3 +239,6 @@ DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
sync_slave_with_master;
+
+# Restore sql_mode
+SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/include/add_anonymous_users.inc b/mysql-test/include/add_anonymous_users.inc
new file mode 100644
index 00000000000..a59aa971d59
--- /dev/null
+++ b/mysql-test/include/add_anonymous_users.inc
@@ -0,0 +1,7 @@
+# Allow anonymous users to connect
+disable_warnings;
+disable_query_log;
+INSERT INTO mysql.user (host, user) VALUES ('localhost','');
+FLUSH PRIVILEGES;
+enable_query_log;
+enable_warnings;
diff --git a/mysql-test/include/delete_anonymous_users.inc b/mysql-test/include/delete_anonymous_users.inc
new file mode 100644
index 00000000000..9f642223748
--- /dev/null
+++ b/mysql-test/include/delete_anonymous_users.inc
@@ -0,0 +1,5 @@
+# Remove anonymous users added by add_anonymous_users.inc
+disable_query_log;
+DELETE FROM mysql.user where host='localhost' and user='';
+FLUSH PRIVILEGES;
+enable_query_log;
diff --git a/mysql-test/include/get_binlog_dump_thread_id.inc b/mysql-test/include/get_binlog_dump_thread_id.inc
index 830a88b5db6..bfc8506b39e 100644
--- a/mysql-test/include/get_binlog_dump_thread_id.inc
+++ b/mysql-test/include/get_binlog_dump_thread_id.inc
@@ -1,9 +1,22 @@
---exec $MYSQL test -e 'show processlist' | grep 'Binlog Dump' | cut -f1 > $MYSQLTEST_VARDIR/tmp/bl_dump_thread_id
+--exec $MYSQL test -e "show processlist" > $MYSQLTEST_VARDIR/tmp/bl_dump_thread_id
--disable_warnings
drop table if exists t999;
--enable_warnings
-create temporary table t999 (f int);
+# Create a table to hold the process list
+create temporary table t999(
+ id int,
+ user char(255),
+ host char(255),
+ db char(255),
+ Command char(255),
+ time int,
+ State char(255),
+ info char(255)
+);
+# Load processlist into table, headers will create seom warnings
+--disable_warnings
--replace_result $MYSQLTEST_VARDIR "."
eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/bl_dump_thread_id" into table t999;
-let $id = `select f from t999`;
+--enable_warnings
+let $id = `select Id from t999 where Command="Binlog Dump"`;
drop table t999;
diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc
index 3abc18283fa..e3b716953c3 100644
--- a/mysql-test/include/gis_generic.inc
+++ b/mysql-test/include/gis_generic.inc
@@ -166,14 +166,14 @@ insert IGNORE into t1 (a) values ('Garbage');
drop table t1;
-create table t1 (pk integer primary key auto_increment, fl geometry);
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
--error 1416
insert into t1 (fl) values (1);
--error 1416
insert into t1 (fl) values (1.11);
--error 1416
insert into t1 (fl) values ("qwerty");
---error 1416
+--error 1048
insert into t1 (fl) values (pointfromtext('point(1,1)'));
drop table t1;
diff --git a/mysql-test/include/have_openssl.inc b/mysql-test/include/have_openssl.inc
deleted file mode 100644
index 54c5b04b3e4..00000000000
--- a/mysql-test/include/have_openssl.inc
+++ /dev/null
@@ -1,4 +0,0 @@
--- require r/have_openssl.require
-disable_query_log;
-show variables like "have_openssl";
-enable_query_log;
diff --git a/mysql-test/include/have_ssl.inc b/mysql-test/include/have_ssl.inc
new file mode 100644
index 00000000000..fab57d630e5
--- /dev/null
+++ b/mysql-test/include/have_ssl.inc
@@ -0,0 +1,4 @@
+-- require r/have_ssl.require
+disable_query_log;
+show variables like "have_ssl";
+enable_query_log;
diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc
index 9bbf2dc0be4..76666cb7bc0 100644
--- a/mysql-test/include/mix2.inc
+++ b/mysql-test/include/mix2.inc
@@ -1770,139 +1770,6 @@ disconnect a;
disconnect b;
}
-#
-# BUG 14056 Column prefix index on UTF-8 primary key column causes: Can't find record..
-#
-
-eval create table t1 (
- a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = $engine_type;
-eval create table t2 (
- a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = $engine_type;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-
-eval create table t1 (
- a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = $engine_type;
-eval create table t2 (
- a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = $engine_type;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-
-eval create table t1 (
- a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = $engine_type;
-eval create table t2 (
- a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = $engine_type;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-
-eval create table t1 (
- a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = $engine_type;
-eval create table t2 (
- a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = $engine_type;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-commit;
-
# tests for bugs #9802 and #13778
if ($test_foreign_keys)
@@ -2099,95 +1966,6 @@ drop table t2,t1;
}
# End FOREIGN KEY tests
-#
-# Test cases for bug #15308 Problem of Order with Enum Column in Primary Key
-#
-eval CREATE TABLE t1 (
- ind enum('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=$engine_type DEFAULT CHARSET=utf8;
-eval CREATE TABLE t2 (
- ind enum('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=$engine_type DEFAULT CHARSET=ucs2;
-
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-drop table t1,t2;
-
-eval CREATE TABLE t1 (
- ind set('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=$engine_type DEFAULT CHARSET=utf8;
-eval CREATE TABLE t2 (
- ind set('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=$engine_type DEFAULT CHARSET=ucs2;
-
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-drop table t1,t2;
-
-eval CREATE TABLE t1 (
- ind bit not null,
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=$engine_type DEFAULT CHARSET=utf8;
-eval CREATE TABLE t2 (
- ind bit not null,
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=$engine_type DEFAULT CHARSET=ucs2;
-insert into t1 values(0,''),(1,'');
-insert into t2 values(0,''),(1,'');
-select hex(ind),hex(string1) from t1 order by string1;
-select hex(ind),hex(string1) from t2 order by string1;
-drop table t1,t2;
-
-# tests for bug #14056 Column prefix index on UTF-8 primary key column causes 'Can't find record..'
-
-eval create table t2 (
- a int, b char(10), filler char(10), primary key(a, b(2))
-) character set utf8 engine = $engine_type;
-
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-eval create table t2 (
- a int, b char(10), filler char(10), primary key(a, b(2))
-) character set ucs2 engine = $engine_type;
-
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-
-eval create table t1(a int not null, b char(110),primary key(a,b(100))) engine=$engine_type default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-update t1 set b = 'three' where a = 6;
-drop table t1;
-eval create table t1(a int not null, b text(110),primary key(a,b(100))) engine=$engine_type default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-update t1 set b = 'three' where a = 6;
-drop table t1;
-
if ($test_foreign_keys)
{
# Ensure that <tablename>_ibfk_0 is not mistreated as a
diff --git a/mysql-test/include/mix2_ucs2.inc b/mysql-test/include/mix2_ucs2.inc
new file mode 100644
index 00000000000..418bc7aad74
--- /dev/null
+++ b/mysql-test/include/mix2_ucs2.inc
@@ -0,0 +1,228 @@
+#
+# Tests from mix2.inc which require ucs2 character sets should go here
+#
+
+#
+# BUG 14056 Column prefix index on UTF-8 primary key column causes: Can't find record..
+#
+
+eval create table t1 (
+ a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = $engine_type;
+eval create table t2 (
+ a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = $engine_type;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+
+eval create table t1 (
+ a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = $engine_type;
+eval create table t2 (
+ a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = $engine_type;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+
+
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+
+eval create table t1 (
+ a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = $engine_type;
+eval create table t2 (
+ a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = $engine_type;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+
+eval create table t1 (
+ a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = $engine_type;
+eval create table t2 (
+ a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = $engine_type;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+commit;
+
+#
+# Test cases for bug #15308 Problem of Order with Enum Column in Primary Key
+#
+eval CREATE TABLE t1 (
+ ind enum('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=$engine_type DEFAULT CHARSET=utf8;
+eval CREATE TABLE t2 (
+ ind enum('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=$engine_type DEFAULT CHARSET=ucs2;
+
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+drop table t1,t2;
+
+eval CREATE TABLE t1 (
+ ind set('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=$engine_type DEFAULT CHARSET=utf8;
+eval CREATE TABLE t2 (
+ ind set('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=$engine_type DEFAULT CHARSET=ucs2;
+
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+drop table t1,t2;
+
+eval CREATE TABLE t1 (
+ ind bit not null,
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=$engine_type DEFAULT CHARSET=utf8;
+eval CREATE TABLE t2 (
+ ind bit not null,
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=$engine_type DEFAULT CHARSET=ucs2;
+insert into t1 values(0,''),(1,'');
+insert into t2 values(0,''),(1,'');
+select hex(ind),hex(string1) from t1 order by string1;
+select hex(ind),hex(string1) from t2 order by string1;
+drop table t1,t2;
+
+# tests for bug #14056 Column prefix index on UTF-8 primary key column causes 'Can't find record..'
+
+eval create table t2 (
+ a int, b char(10), filler char(10), primary key(a, b(2))
+) character set utf8 engine = $engine_type;
+
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+eval create table t2 (
+ a int, b char(10), filler char(10), primary key(a, b(2))
+) character set ucs2 engine = $engine_type;
+
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+
+eval create table t1(a int not null, b char(110),primary key(a,b(100))) engine=$engine_type default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+update t1 set b = 'three' where a = 6;
+drop table t1;
+eval create table t1(a int not null, b text(110),primary key(a,b(100))) engine=$engine_type default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+update t1 set b = 'three' where a = 6;
+drop table t1;
+
diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc
index 0dd819f6e62..09290d760ce 100644
--- a/mysql-test/include/ps_conv.inc
+++ b/mysql-test/include/ps_conv.inc
@@ -1152,19 +1152,19 @@ select '-- select .. where date/time column = .. --' as test_sequence ;
######## SELECT .. WHERE column(date/time/..)=value(CHAR(n)/LONGTEXT) ########
set @arg00= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01'" ;
execute stmt1 ;
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
@@ -1177,7 +1177,7 @@ where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
c17= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
prepare stmt1 from "select 'true' as found from t9
where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
@@ -1187,7 +1187,7 @@ where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
c17= CAST('1991-01-01 01:01:01' as datetime)" ;
execute stmt1 ;
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql
deleted file mode 100644
index e689db94e9f..00000000000
--- a/mysql-test/lib/init_db.sql
+++ /dev/null
@@ -1,652 +0,0 @@
-use mysql;
-set table_type=myisam;
-
-CREATE TABLE db (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(64) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,Db,User),
- KEY User (User)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='Database privileges';
-
-
-INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
-INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
-
-
-CREATE TABLE host (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(64) binary DEFAULT '' NOT NULL,
- Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,Db)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='Host privileges; Merged with database privileges';
-
-
-CREATE TABLE user (
- Host char(60) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL,
- Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- ssl_cipher BLOB NOT NULL,
- x509_issuer BLOB NOT NULL,
- x509_subject BLOB NOT NULL,
- max_questions int(11) unsigned DEFAULT 0 NOT NULL,
- max_updates int(11) unsigned DEFAULT 0 NOT NULL,
- max_connections int(11) unsigned DEFAULT 0 NOT NULL,
- max_user_connections int(11) unsigned DEFAULT 0 NOT NULL,
- PRIMARY KEY Host (Host,User)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='Users and global privileges';
-
-
-INSERT INTO user VALUES ('localhost' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-INSERT INTO user VALUES ('@HOSTNAME@%' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-REPLACE INTO user VALUES ('127.0.0.1' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-INSERT INTO user (host,user) VALUES ('localhost','');
-INSERT INTO user (host,user) VALUES ('@HOSTNAME@%','');
-
-CREATE TABLE servers (
- Server_name char(64) NOT NULL DEFAULT '',
- Host char(64) NOT NULL DEFAULT '',
- Db char(64) NOT NULL DEFAULT '',
- Username char(64) NOT NULL DEFAULT '',
- Password char(64) NOT NULL DEFAULT '',
- Port INT(4) NOT NULL DEFAULT '0',
- Socket char(64) NOT NULL DEFAULT '',
- Wrapper char(64) NOT NULL DEFAULT '',
- Owner char(64) NOT NULL DEFAULT '',
- PRIMARY KEY (Server_name))
- CHARACTER SET utf8 comment='MySQL Foreign Servers table';
-
-INSERT INTO servers VALUES ('test','localhost','test','root','', 0,'','mysql','root');
-
-CREATE TABLE func (
- name char(64) binary DEFAULT '' NOT NULL,
- ret tinyint(1) DEFAULT '0' NOT NULL,
- dl char(128) DEFAULT '' NOT NULL,
- type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL,
- PRIMARY KEY (name)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='User defined functions';
-
-
-CREATE TABLE plugin (
- name char(64) binary DEFAULT '' NOT NULL,
- dl char(128) DEFAULT '' NOT NULL,
- PRIMARY KEY (name)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='MySQL plugins';
-
-
-CREATE TABLE tables_priv (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(64) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Table_name char(64) binary DEFAULT '' NOT NULL,
- Grantor char(77) DEFAULT '' NOT NULL,
- Timestamp timestamp(14),
- Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='Table privileges';
-
-
-CREATE TABLE columns_priv (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(64) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Table_name char(64) binary DEFAULT '' NOT NULL,
- Column_name char(64) binary DEFAULT '' NOT NULL,
- Timestamp timestamp(14),
- Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- PRIMARY KEY (Host,Db,User,Table_name,Column_name)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='Column privileges';
-
-
-CREATE TABLE help_topic (
- help_topic_id int unsigned not null,
- name char(64) not null,
- help_category_id smallint unsigned not null,
- description text not null,
- example text not null,
- url char(128) not null,
- primary key (help_topic_id),
- unique index (name)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='help topics';
-
-
-CREATE TABLE help_category (
- help_category_id smallint unsigned not null,
- name char(64) not null,
- parent_category_id smallint unsigned null,
- url char(128) not null,
- primary key (help_category_id),unique index (name)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='help categories';
-
-
-CREATE TABLE help_keyword (
- help_keyword_id int unsigned not null,
- name char(64) not null,
- primary key (help_keyword_id),unique index (name)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='help keywords';
-
-
-CREATE TABLE help_relation (
- help_topic_id int unsigned not null references help_topic,
- help_keyword_id int unsigned not null references help_keyword,
- primary key (help_keyword_id, help_topic_id)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='keyword-topic relation';
-
-
-CREATE TABLE time_zone_name (
- Name char(64) NOT NULL,
- Time_zone_id int unsigned NOT NULL,
- PRIMARY KEY Name (Name)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='Time zone names';
-
-
-INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES
- ('MET', 1), ('UTC', 2), ('Universal', 2),
- ('Europe/Moscow',3), ('leap/Europe/Moscow',4),
- ('Japan', 5);
-
-
-CREATE TABLE time_zone (
- Time_zone_id int unsigned NOT NULL auto_increment,
- Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
- PRIMARY KEY TzId (Time_zone_id)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='Time zones';
-
-
-INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)
- VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');
-
-
-CREATE TABLE time_zone_transition (
- Time_zone_id int unsigned NOT NULL,
- Transition_time bigint signed NOT NULL,
- Transition_type_id int unsigned NOT NULL,
- PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='Time zone transitions';
-
-
-INSERT INTO time_zone_transition
- (Time_zone_id, Transition_time, Transition_type_id)
-VALUES
- (1, -1693706400, 0) ,(1, -1680483600, 1)
- ,(1, -1663455600, 2) ,(1, -1650150000, 3)
- ,(1, -1632006000, 2) ,(1, -1618700400, 3)
- ,(1, -938905200, 2) ,(1, -857257200, 3)
- ,(1, -844556400, 2) ,(1, -828226800, 3)
- ,(1, -812502000, 2) ,(1, -796777200, 3)
- ,(1, 228877200, 2) ,(1, 243997200, 3)
- ,(1, 260326800, 2) ,(1, 276051600, 3)
- ,(1, 291776400, 2) ,(1, 307501200, 3)
- ,(1, 323830800, 2) ,(1, 338950800, 3)
- ,(1, 354675600, 2) ,(1, 370400400, 3)
- ,(1, 386125200, 2) ,(1, 401850000, 3)
- ,(1, 417574800, 2) ,(1, 433299600, 3)
- ,(1, 449024400, 2) ,(1, 465354000, 3)
- ,(1, 481078800, 2) ,(1, 496803600, 3)
- ,(1, 512528400, 2) ,(1, 528253200, 3)
- ,(1, 543978000, 2) ,(1, 559702800, 3)
- ,(1, 575427600, 2) ,(1, 591152400, 3)
- ,(1, 606877200, 2) ,(1, 622602000, 3)
- ,(1, 638326800, 2) ,(1, 654656400, 3)
- ,(1, 670381200, 2) ,(1, 686106000, 3)
- ,(1, 701830800, 2) ,(1, 717555600, 3)
- ,(1, 733280400, 2) ,(1, 749005200, 3)
- ,(1, 764730000, 2) ,(1, 780454800, 3)
- ,(1, 796179600, 2) ,(1, 811904400, 3)
- ,(1, 828234000, 2) ,(1, 846378000, 3)
- ,(1, 859683600, 2) ,(1, 877827600, 3)
- ,(1, 891133200, 2) ,(1, 909277200, 3)
- ,(1, 922582800, 2) ,(1, 941331600, 3)
- ,(1, 954032400, 2) ,(1, 972781200, 3)
- ,(1, 985482000, 2) ,(1, 1004230800, 3)
- ,(1, 1017536400, 2) ,(1, 1035680400, 3)
- ,(1, 1048986000, 2) ,(1, 1067130000, 3)
- ,(1, 1080435600, 2) ,(1, 1099184400, 3)
- ,(1, 1111885200, 2) ,(1, 1130634000, 3)
- ,(1, 1143334800, 2) ,(1, 1162083600, 3)
- ,(1, 1174784400, 2) ,(1, 1193533200, 3)
- ,(1, 1206838800, 2) ,(1, 1224982800, 3)
- ,(1, 1238288400, 2) ,(1, 1256432400, 3)
- ,(1, 1269738000, 2) ,(1, 1288486800, 3)
- ,(1, 1301187600, 2) ,(1, 1319936400, 3)
- ,(1, 1332637200, 2) ,(1, 1351386000, 3)
- ,(1, 1364691600, 2) ,(1, 1382835600, 3)
- ,(1, 1396141200, 2) ,(1, 1414285200, 3)
- ,(1, 1427590800, 2) ,(1, 1445734800, 3)
- ,(1, 1459040400, 2) ,(1, 1477789200, 3)
- ,(1, 1490490000, 2) ,(1, 1509238800, 3)
- ,(1, 1521939600, 2) ,(1, 1540688400, 3)
- ,(1, 1553994000, 2) ,(1, 1572138000, 3)
- ,(1, 1585443600, 2) ,(1, 1603587600, 3)
- ,(1, 1616893200, 2) ,(1, 1635642000, 3)
- ,(1, 1648342800, 2) ,(1, 1667091600, 3)
- ,(1, 1679792400, 2) ,(1, 1698541200, 3)
- ,(1, 1711846800, 2) ,(1, 1729990800, 3)
- ,(1, 1743296400, 2) ,(1, 1761440400, 3)
- ,(1, 1774746000, 2) ,(1, 1792890000, 3)
- ,(1, 1806195600, 2) ,(1, 1824944400, 3)
- ,(1, 1837645200, 2) ,(1, 1856394000, 3)
- ,(1, 1869094800, 2) ,(1, 1887843600, 3)
- ,(1, 1901149200, 2) ,(1, 1919293200, 3)
- ,(1, 1932598800, 2) ,(1, 1950742800, 3)
- ,(1, 1964048400, 2) ,(1, 1982797200, 3)
- ,(1, 1995498000, 2) ,(1, 2014246800, 3)
- ,(1, 2026947600, 2) ,(1, 2045696400, 3)
- ,(1, 2058397200, 2) ,(1, 2077146000, 3)
- ,(1, 2090451600, 2) ,(1, 2108595600, 3)
- ,(1, 2121901200, 2) ,(1, 2140045200, 3)
- ,(3, -1688265000, 2) ,(3, -1656819048, 1)
- ,(3, -1641353448, 2) ,(3, -1627965048, 3)
- ,(3, -1618716648, 1) ,(3, -1596429048, 3)
- ,(3, -1593829848, 5) ,(3, -1589860800, 4)
- ,(3, -1542427200, 5) ,(3, -1539493200, 6)
- ,(3, -1525323600, 5) ,(3, -1522728000, 4)
- ,(3, -1491188400, 7) ,(3, -1247536800, 4)
- ,(3, 354920400, 5) ,(3, 370728000, 4)
- ,(3, 386456400, 5) ,(3, 402264000, 4)
- ,(3, 417992400, 5) ,(3, 433800000, 4)
- ,(3, 449614800, 5) ,(3, 465346800, 8)
- ,(3, 481071600, 9) ,(3, 496796400, 8)
- ,(3, 512521200, 9) ,(3, 528246000, 8)
- ,(3, 543970800, 9) ,(3, 559695600, 8)
- ,(3, 575420400, 9) ,(3, 591145200, 8)
- ,(3, 606870000, 9) ,(3, 622594800, 8)
- ,(3, 638319600, 9) ,(3, 654649200, 8)
- ,(3, 670374000, 10) ,(3, 686102400, 11)
- ,(3, 695779200, 8) ,(3, 701812800, 5)
- ,(3, 717534000, 4) ,(3, 733273200, 9)
- ,(3, 748998000, 8) ,(3, 764722800, 9)
- ,(3, 780447600, 8) ,(3, 796172400, 9)
- ,(3, 811897200, 8) ,(3, 828226800, 9)
- ,(3, 846370800, 8) ,(3, 859676400, 9)
- ,(3, 877820400, 8) ,(3, 891126000, 9)
- ,(3, 909270000, 8) ,(3, 922575600, 9)
- ,(3, 941324400, 8) ,(3, 954025200, 9)
- ,(3, 972774000, 8) ,(3, 985474800, 9)
- ,(3, 1004223600, 8) ,(3, 1017529200, 9)
- ,(3, 1035673200, 8) ,(3, 1048978800, 9)
- ,(3, 1067122800, 8) ,(3, 1080428400, 9)
- ,(3, 1099177200, 8) ,(3, 1111878000, 9)
- ,(3, 1130626800, 8) ,(3, 1143327600, 9)
- ,(3, 1162076400, 8) ,(3, 1174777200, 9)
- ,(3, 1193526000, 8) ,(3, 1206831600, 9)
- ,(3, 1224975600, 8) ,(3, 1238281200, 9)
- ,(3, 1256425200, 8) ,(3, 1269730800, 9)
- ,(3, 1288479600, 8) ,(3, 1301180400, 9)
- ,(3, 1319929200, 8) ,(3, 1332630000, 9)
- ,(3, 1351378800, 8) ,(3, 1364684400, 9)
- ,(3, 1382828400, 8) ,(3, 1396134000, 9)
- ,(3, 1414278000, 8) ,(3, 1427583600, 9)
- ,(3, 1445727600, 8) ,(3, 1459033200, 9)
- ,(3, 1477782000, 8) ,(3, 1490482800, 9)
- ,(3, 1509231600, 8) ,(3, 1521932400, 9)
- ,(3, 1540681200, 8) ,(3, 1553986800, 9)
- ,(3, 1572130800, 8) ,(3, 1585436400, 9)
- ,(3, 1603580400, 8) ,(3, 1616886000, 9)
- ,(3, 1635634800, 8) ,(3, 1648335600, 9)
- ,(3, 1667084400, 8) ,(3, 1679785200, 9)
- ,(3, 1698534000, 8) ,(3, 1711839600, 9)
- ,(3, 1729983600, 8) ,(3, 1743289200, 9)
- ,(3, 1761433200, 8) ,(3, 1774738800, 9)
- ,(3, 1792882800, 8) ,(3, 1806188400, 9)
- ,(3, 1824937200, 8) ,(3, 1837638000, 9)
- ,(3, 1856386800, 8) ,(3, 1869087600, 9)
- ,(3, 1887836400, 8) ,(3, 1901142000, 9)
- ,(3, 1919286000, 8) ,(3, 1932591600, 9)
- ,(3, 1950735600, 8) ,(3, 1964041200, 9)
- ,(3, 1982790000, 8) ,(3, 1995490800, 9)
- ,(3, 2014239600, 8) ,(3, 2026940400, 9)
- ,(3, 2045689200, 8) ,(3, 2058390000, 9)
- ,(3, 2077138800, 8) ,(3, 2090444400, 9)
- ,(3, 2108588400, 8) ,(3, 2121894000, 9)
- ,(3, 2140038000, 8)
- ,(4, -1688265000, 2) ,(4, -1656819048, 1)
- ,(4, -1641353448, 2) ,(4, -1627965048, 3)
- ,(4, -1618716648, 1) ,(4, -1596429048, 3)
- ,(4, -1593829848, 5) ,(4, -1589860800, 4)
- ,(4, -1542427200, 5) ,(4, -1539493200, 6)
- ,(4, -1525323600, 5) ,(4, -1522728000, 4)
- ,(4, -1491188400, 7) ,(4, -1247536800, 4)
- ,(4, 354920409, 5) ,(4, 370728010, 4)
- ,(4, 386456410, 5) ,(4, 402264011, 4)
- ,(4, 417992411, 5) ,(4, 433800012, 4)
- ,(4, 449614812, 5) ,(4, 465346812, 8)
- ,(4, 481071612, 9) ,(4, 496796413, 8)
- ,(4, 512521213, 9) ,(4, 528246013, 8)
- ,(4, 543970813, 9) ,(4, 559695613, 8)
- ,(4, 575420414, 9) ,(4, 591145214, 8)
- ,(4, 606870014, 9) ,(4, 622594814, 8)
- ,(4, 638319615, 9) ,(4, 654649215, 8)
- ,(4, 670374016, 10) ,(4, 686102416, 11)
- ,(4, 695779216, 8) ,(4, 701812816, 5)
- ,(4, 717534017, 4) ,(4, 733273217, 9)
- ,(4, 748998018, 8) ,(4, 764722818, 9)
- ,(4, 780447619, 8) ,(4, 796172419, 9)
- ,(4, 811897219, 8) ,(4, 828226820, 9)
- ,(4, 846370820, 8) ,(4, 859676420, 9)
- ,(4, 877820421, 8) ,(4, 891126021, 9)
- ,(4, 909270021, 8) ,(4, 922575622, 9)
- ,(4, 941324422, 8) ,(4, 954025222, 9)
- ,(4, 972774022, 8) ,(4, 985474822, 9)
- ,(4, 1004223622, 8) ,(4, 1017529222, 9)
- ,(4, 1035673222, 8) ,(4, 1048978822, 9)
- ,(4, 1067122822, 8) ,(4, 1080428422, 9)
- ,(4, 1099177222, 8) ,(4, 1111878022, 9)
- ,(4, 1130626822, 8) ,(4, 1143327622, 9)
- ,(4, 1162076422, 8) ,(4, 1174777222, 9)
- ,(4, 1193526022, 8) ,(4, 1206831622, 9)
- ,(4, 1224975622, 8) ,(4, 1238281222, 9)
- ,(4, 1256425222, 8) ,(4, 1269730822, 9)
- ,(4, 1288479622, 8) ,(4, 1301180422, 9)
- ,(4, 1319929222, 8) ,(4, 1332630022, 9)
- ,(4, 1351378822, 8) ,(4, 1364684422, 9)
- ,(4, 1382828422, 8) ,(4, 1396134022, 9)
- ,(4, 1414278022, 8) ,(4, 1427583622, 9)
- ,(4, 1445727622, 8) ,(4, 1459033222, 9)
- ,(4, 1477782022, 8) ,(4, 1490482822, 9)
- ,(4, 1509231622, 8) ,(4, 1521932422, 9)
- ,(4, 1540681222, 8) ,(4, 1553986822, 9)
- ,(4, 1572130822, 8) ,(4, 1585436422, 9)
- ,(4, 1603580422, 8) ,(4, 1616886022, 9)
- ,(4, 1635634822, 8) ,(4, 1648335622, 9)
- ,(4, 1667084422, 8) ,(4, 1679785222, 9)
- ,(4, 1698534022, 8) ,(4, 1711839622, 9)
- ,(4, 1729983622, 8) ,(4, 1743289222, 9)
- ,(4, 1761433222, 8) ,(4, 1774738822, 9)
- ,(4, 1792882822, 8) ,(4, 1806188422, 9)
- ,(4, 1824937222, 8) ,(4, 1837638022, 9)
- ,(4, 1856386822, 8) ,(4, 1869087622, 9)
- ,(4, 1887836422, 8) ,(4, 1901142022, 9)
- ,(4, 1919286022, 8) ,(4, 1932591622, 9)
- ,(4, 1950735622, 8) ,(4, 1964041222, 9)
- ,(4, 1982790022, 8) ,(4, 1995490822, 9)
- ,(4, 2014239622, 8) ,(4, 2026940422, 9)
- ,(4, 2045689222, 8) ,(4, 2058390022, 9)
- ,(4, 2077138822, 8) ,(4, 2090444422, 9)
- ,(4, 2108588422, 8) ,(4, 2121894022, 9)
- ,(4, 2140038022, 8)
- ,(5, -1009875600, 1);
-
-
-CREATE TABLE time_zone_transition_type (
- Time_zone_id int unsigned NOT NULL,
- Transition_type_id int unsigned NOT NULL,
- Offset int signed DEFAULT 0 NOT NULL,
- Is_DST tinyint unsigned DEFAULT 0 NOT NULL,
- Abbreviation char(8) DEFAULT '' NOT NULL,
- PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='Time zone transition types';
-
-
-INSERT INTO time_zone_transition_type (
- Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
- (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')
- ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')
- ,(2, 0, 0, 0, 'UTC')
- ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')
- ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')
- ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')
- ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')
- ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')
- ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')
- ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')
- ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')
- ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')
- ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')
- ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')
- ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')
- ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');
-
-
-CREATE TABLE time_zone_leap_second (
- Transition_time bigint signed NOT NULL,
- Correction int signed NOT NULL,
- PRIMARY KEY TranTime (Transition_time)
-) engine=MyISAM
-CHARACTER SET utf8
-comment='Leap seconds information for time zones';
-
-
-INSERT INTO time_zone_leap_second (
- Transition_time, Correction) VALUES
- (78796800, 1) ,(94694401, 2) ,(126230402, 3)
- ,(157766403, 4) ,(189302404, 5) ,(220924805, 6)
- ,(252460806, 7) ,(283996807, 8) ,(315532808, 9)
- ,(362793609, 10) ,(394329610, 11) ,(425865611, 12)
- ,(489024012, 13) ,(567993613, 14) ,(631152014, 15)
- ,(662688015, 16) ,(709948816, 17) ,(741484817, 18)
- ,(773020818, 19) ,(820454419, 20) ,(867715220, 21)
- ,(915148821, 22);
-
-
-CREATE TABLE procs_priv (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(64) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Routine_name char(64) binary DEFAULT '' NOT NULL,
- Routine_type enum('FUNCTION','PROCEDURE') NOT NULL,
- Grantor char(77) DEFAULT '' NOT NULL,
- Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- Timestamp timestamp(14),
- PRIMARY KEY (Host,Db,User,Routine_name,Routine_type),
- KEY Grantor (Grantor)
-) engine=MyISAM
-CHARACTER SET utf8 COLLATE utf8_bin
-comment='Procedure privileges';
-
-
-CREATE TABLE proc (
- db char(64) collate utf8_bin DEFAULT '' NOT NULL,
- name char(64) DEFAULT '' NOT NULL,
- type enum('FUNCTION','PROCEDURE') NOT NULL,
- specific_name char(64) DEFAULT '' NOT NULL,
- language enum('SQL') DEFAULT 'SQL' NOT NULL,
- sql_data_access enum('CONTAINS_SQL',
- 'NO_SQL',
- 'READS_SQL_DATA',
- 'MODIFIES_SQL_DATA'
- ) DEFAULT 'CONTAINS_SQL' NOT NULL,
- is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL,
- security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL,
- param_list blob DEFAULT '' NOT NULL,
- returns char(64) DEFAULT '' NOT NULL,
- body longblob DEFAULT '' NOT NULL,
- definer char(77) collate utf8_bin DEFAULT '' NOT NULL,
- created timestamp,
- modified timestamp,
- sql_mode set(
- 'REAL_AS_FLOAT',
- 'PIPES_AS_CONCAT',
- 'ANSI_QUOTES',
- 'IGNORE_SPACE',
- 'NOT_USED',
- 'ONLY_FULL_GROUP_BY',
- 'NO_UNSIGNED_SUBTRACTION',
- 'NO_DIR_IN_CREATE',
- 'POSTGRESQL',
- 'ORACLE',
- 'MSSQL',
- 'DB2',
- 'MAXDB',
- 'NO_KEY_OPTIONS',
- 'NO_TABLE_OPTIONS',
- 'NO_FIELD_OPTIONS',
- 'MYSQL323',
- 'MYSQL40',
- 'ANSI',
- 'NO_AUTO_VALUE_ON_ZERO',
- 'NO_BACKSLASH_ESCAPES',
- 'STRICT_TRANS_TABLES',
- 'STRICT_ALL_TABLES',
- 'NO_ZERO_IN_DATE',
- 'NO_ZERO_DATE',
- 'INVALID_DATES',
- 'ERROR_FOR_DIVISION_BY_ZERO',
- 'TRADITIONAL',
- 'NO_AUTO_CREATE_USER',
- 'HIGH_NOT_PRECEDENCE'
- ) DEFAULT '' NOT NULL,
- comment char(64) collate utf8_bin DEFAULT '' NOT NULL,
- PRIMARY KEY (db,name,type)
-) character set utf8 comment='Stored Procedures';
-
-
-CREATE PROCEDURE create_log_tables() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; CREATE TABLE slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END;
-CALL create_log_tables();
-DROP PROCEDURE create_log_tables;
-
-CREATE TABLE event (
- db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
- name char(64) CHARACTER SET utf8 NOT NULL default '',
- body longblob NOT NULL,
- definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
- execute_at DATETIME default NULL,
- interval_value int(11) default NULL,
- interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK',
- 'SECOND','MICROSECOND', 'YEAR_MONTH','DAY_HOUR',
- 'DAY_MINUTE','DAY_SECOND',
- 'HOUR_MINUTE','HOUR_SECOND',
- 'MINUTE_SECOND','DAY_MICROSECOND',
- 'HOUR_MICROSECOND','MINUTE_MICROSECOND',
- 'SECOND_MICROSECOND') default NULL,
- created TIMESTAMP NOT NULL,
- modified TIMESTAMP NOT NULL,
- last_executed DATETIME default NULL,
- starts DATETIME default NULL,
- ends DATETIME default NULL,
- status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED',
- on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP',
- sql_mode set(
- 'REAL_AS_FLOAT',
- 'PIPES_AS_CONCAT',
- 'ANSI_QUOTES',
- 'IGNORE_SPACE',
- 'NOT_USED',
- 'ONLY_FULL_GROUP_BY',
- 'NO_UNSIGNED_SUBTRACTION',
- 'NO_DIR_IN_CREATE',
- 'POSTGRESQL',
- 'ORACLE',
- 'MSSQL',
- 'DB2',
- 'MAXDB',
- 'NO_KEY_OPTIONS',
- 'NO_TABLE_OPTIONS',
- 'NO_FIELD_OPTIONS',
- 'MYSQL323',
- 'MYSQL40',
- 'ANSI',
- 'NO_AUTO_VALUE_ON_ZERO',
- 'NO_BACKSLASH_ESCAPES',
- 'STRICT_TRANS_TABLES',
- 'STRICT_ALL_TABLES',
- 'NO_ZERO_IN_DATE',
- 'NO_ZERO_DATE',
- 'INVALID_DATES',
- 'ERROR_FOR_DIVISION_BY_ZERO',
- 'TRADITIONAL',
- 'NO_AUTO_CREATE_USER',
- 'HIGH_NOT_PRECEDENCE'
- ) DEFAULT '' NOT NULL,
- comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
- time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
- PRIMARY KEY (db, name)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
-
-CREATE TABLE IF NOT EXISTS mysql.ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index 97b0a6fc131..dc22f88bd7f 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -22,6 +22,7 @@ use strict;
sub mtr_full_hostname ();
sub mtr_short_hostname ();
+sub mtr_native_path($);
sub mtr_init_args ($);
sub mtr_add_arg ($$@);
sub mtr_path_exists(@);
@@ -63,6 +64,22 @@ sub mtr_short_hostname () {
return $hostname;
}
+# Convert path to OS native format
+sub mtr_native_path($)
+{
+ my $path= shift;
+
+ # MySQL version before 5.0 still use cygwin, no need
+ # to convert path
+ return $path
+ if ($::mysql_version_id < 50000);
+
+ $path=~ s/\//\\/g
+ if ($::glob_win32);
+ return $path;
+}
+
+
# FIXME move to own lib
sub mtr_init_args ($) {
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index f63009cd24c..690ca8313dd 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -22,7 +22,7 @@ use Socket;
use Errno;
use strict;
-use POSIX 'WNOHANG';
+use POSIX qw(WNOHANG SIGHUP);
sub mtr_run ($$$$$$;$);
sub mtr_spawn ($$$$$$;$);
@@ -139,19 +139,18 @@ sub spawn_impl ($$$$$$$$) {
{
if ( $! == $!{EAGAIN} ) # See "perldoc Errno"
{
- mtr_debug("Got EAGAIN from fork(), sleep 1 second and redo");
+ mtr_warning("Got EAGAIN from fork(), sleep 1 second and redo");
sleep(1);
redo FORK;
}
- else
- {
- mtr_error("$path ($pid) can't be forked");
- }
+
+ mtr_error("$path ($pid) can't be forked, error: $!");
+
}
if ( $pid )
{
- spawn_parent_impl($pid,$mode,$path);
+ return spawn_parent_impl($pid,$mode,$path);
}
else
{
@@ -216,8 +215,11 @@ sub spawn_impl ($$$$$$$$) {
{
mtr_child_error("failed to execute \"$path\": $!");
}
+ mtr_error("Should never come here 1!");
}
+ mtr_error("Should never come here 2!");
}
+ mtr_error("Should never come here 3!");
}
@@ -230,12 +232,21 @@ sub spawn_parent_impl {
{
if ( $mode eq 'run' )
{
- # Simple run of command, we wait for it to return
+ # Simple run of command, wait blocking for it to return
my $ret_pid= waitpid($pid,0);
if ( $ret_pid != $pid )
{
- mtr_error("waitpid($pid, 0) returned $ret_pid " .
- "when waiting for '$path'");
+ # The "simple" waitpid has failed, print debug info
+ # and try to handle the error
+ mtr_warning("waitpid($pid, 0) returned $ret_pid " .
+ "when waiting for '$path', error: '$!'");
+ if ( $ret_pid == -1 )
+ {
+ # waitpid returned -1, that would indicate the process
+ # no longer exist and waitpid couldn't wait for it.
+ return 1;
+ }
+ mtr_error("Error handling failed");
}
return mtr_process_exit_status($?);
@@ -1109,12 +1120,6 @@ sub mtr_kill_processes ($) {
#
##############################################################################
-# FIXME something is wrong, we sometimes terminate with "Hangup" written
-# to tty, and no STDERR output telling us why.
-
-# FIXME for some reason, setting HUP to 'IGNORE' will cause exit() to
-# write out "Hangup", and maybe loose some output. We insert a sleep...
-
sub mtr_exit ($) {
my $code= shift;
mtr_timer_stop_all($::glob_timers);
@@ -1126,7 +1131,7 @@ sub mtr_exit ($) {
# set ourselves as the group leader at startup (with
# POSIX::setpgrp(0,0)), but then care must be needed to always do
# proper child process cleanup.
- kill('HUP', -$$) if !$::glob_win32_perl and $$ == getpgrp();
+ POSIX::kill(SIGHUP, -$$) if !$::glob_win32_perl and $$ == getpgrp();
exit($code);
}
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 10483d93427..7a825af174a 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -300,6 +300,8 @@ our $path_ndb_examples_dir;
our $exe_ndb_example;
our $path_ndb_testrun_log;
+our $path_sql_dir;
+
our @data_dir_lst;
our $used_binlog_format;
@@ -357,6 +359,7 @@ sub stop_all_servers ();
sub run_mysqltest ($);
sub usage ($);
+
######################################################################
#
# Main program
@@ -766,7 +769,7 @@ sub command_line_setup () {
foreach my $arg ( @opt_extra_mysqld_opt )
{
- if ( $arg =~ /binlog-format=(\S+)/ )
+ if ( $arg =~ /binlog[-_]format=(\S+)/ )
{
$used_binlog_format= $1;
}
@@ -1492,6 +1495,10 @@ sub executable_setup () {
if (!$opt_extern)
{
+ # Look for SQL scripts directory
+ $path_sql_dir= mtr_path_exists("$glob_basedir/share",
+ "$glob_basedir/scripts");
+
if ( $mysql_version_id >= 50100 )
{
$exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap");
@@ -1585,7 +1592,8 @@ sub executable_setup () {
sub generate_cmdline_mysqldump ($) {
my($mysqld) = @_;
return
- "$exe_mysqldump --no-defaults --debug-info -uroot " .
+ mtr_native_path($exe_mysqldump) .
+ " --no-defaults -uroot --debug-info " .
"--port=$mysqld->{'port'} " .
"--socket=$mysqld->{'path_sock'} --password=";
}
@@ -1727,7 +1735,7 @@ sub environment_setup () {
my $deb_version;
if ( $opt_valgrind and -d $debug_libraries_path and
(! -e '/etc/debian_version' or
- ($deb_version= mtr_grab_file('/etc/debian_version')) == 0 or
+ ($deb_version= mtr_grab_file('/etc/debian_version')) !~ /^[0-9]+\.[0-9]$/ or
$deb_version > 3.1 ) )
{
push(@ld_library_paths, $debug_libraries_path);
@@ -1831,7 +1839,8 @@ sub environment_setup () {
# Setup env so childs can execute mysqlcheck
# ----------------------------------------------------
my $cmdline_mysqlcheck=
- "$exe_mysqlcheck --no-defaults --debug-info -uroot " .
+ mtr_native_path($exe_mysqlcheck) .
+ " --no-defaults --debug-info -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1865,7 +1874,8 @@ sub environment_setup () {
if ( $exe_mysqlslap )
{
my $cmdline_mysqlslap=
- "$exe_mysqlslap -uroot " .
+ mtr_native_path($exe_mysqlslap) .
+ " -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password= " .
"--lock-directory=$opt_tmpdir";
@@ -1882,7 +1892,8 @@ sub environment_setup () {
# Setup env so childs can execute mysqlimport
# ----------------------------------------------------
my $cmdline_mysqlimport=
- "$exe_mysqlimport --debug-info -uroot " .
+ mtr_native_path($exe_mysqlimport) .
+ " -uroot --debug-info " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1898,7 +1909,8 @@ sub environment_setup () {
# Setup env so childs can execute mysqlshow
# ----------------------------------------------------
my $cmdline_mysqlshow=
- "$exe_mysqlshow --debug-info -uroot " .
+ mtr_native_path($exe_mysqlshow) .
+ " -uroot --debug-info " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1913,7 +1925,7 @@ sub environment_setup () {
# Setup env so childs can execute mysqlbinlog
# ----------------------------------------------------
my $cmdline_mysqlbinlog=
- "$exe_mysqlbinlog" .
+ mtr_native_path($exe_mysqlbinlog) .
" --no-defaults --disable-force-if-open --debug-info --local-load=$opt_tmpdir";
if ( !$opt_extern && $mysql_version_id >= 50000 )
{
@@ -1931,7 +1943,8 @@ sub environment_setup () {
# Setup env so childs can execute mysql
# ----------------------------------------------------
my $cmdline_mysql=
- "$exe_mysql --no-defaults --debug-info --host=localhost --user=root --password= " .
+ mtr_native_path($exe_mysql) .
+ " --no-defaults --debug-info --host=localhost --user=root --password= " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} ".
"--character-sets-dir=$path_charsetsdir";
@@ -1963,6 +1976,7 @@ sub environment_setup () {
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'}";
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
+
}
if (!$opt_extern)
{
@@ -1972,17 +1986,17 @@ sub environment_setup () {
# ----------------------------------------------------
# Setup env so childs can execute my_print_defaults
# ----------------------------------------------------
- $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
+ $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
# ----------------------------------------------------
# Setup env so childs can execute mysqladmin
# ----------------------------------------------------
- $ENV{'MYSQLADMIN'}= $exe_mysqladmin;
+ $ENV{'MYSQLADMIN'}= mtr_native_path($exe_mysqladmin);
# ----------------------------------------------------
# Setup env so childs can execute perror
# ----------------------------------------------------
- $ENV{'MY_PERROR'}= $exe_perror;
+ $ENV{'MY_PERROR'}= mtr_native_path($exe_perror);
# ----------------------------------------------------
# Add the path where mysqld will find udf_example.so
@@ -2141,6 +2155,16 @@ sub remove_stale_vardir () {
mtr_verbose("Removing $opt_vardir/");
rmtree("$opt_vardir/");
}
+
+ if ( $opt_mem )
+ {
+ # A symlink from var/ to $opt_mem will be set up
+ # remove the $opt_mem dir to assure the symlink
+ # won't point at an old directory
+ mtr_verbose("Removing $opt_mem");
+ rmtree($opt_mem);
+ }
+
}
else
{
@@ -2892,42 +2916,13 @@ sub install_db ($$) {
my $type= shift;
my $data_dir= shift;
- my $init_db_sql= "lib/init_db.sql";
- my $init_db_sql_tmp= "/tmp/init_db.sql$$";
- my $args;
-
mtr_report("Installing \u$type Database");
- open(IN, $init_db_sql)
- or mtr_error("Can't open $init_db_sql: $!");
- open(OUT, ">", $init_db_sql_tmp)
- or mtr_error("Can't write to $init_db_sql_tmp: $!");
- while (<IN>)
- {
- chomp;
- s/\@HOSTNAME\@/$glob_hostname/;
- if ( /^\s*$/ )
- {
- print OUT "\n";
- }
- elsif (/;$/)
- {
- print OUT "$_\n";
- }
- else
- {
- print OUT "$_ ";
- }
- }
- close OUT;
- close IN;
+ my $args;
mtr_init_args(\$args);
-
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--bootstrap");
- mtr_add_arg($args, "--console");
- mtr_add_arg($args, "--skip-grant-tables");
mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
mtr_add_arg($args, "--datadir=%s", $data_dir);
mtr_add_arg($args, "--skip-innodb");
@@ -2954,21 +2949,55 @@ sub install_db ($$) {
# --bootstrap, to accommodate this.
my $exe_mysqld_bootstrap = $ENV{'MYSQLD_BOOTSTRAP'} || $exe_mysqld;
+ # ----------------------------------------------------------------------
+ # export MYSQLD_BOOTSTRAP_CMD variable containing <path>/mysqld <args>
+ # ----------------------------------------------------------------------
+ $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
+
+ # ----------------------------------------------------------------------
+ # Create the bootstrap.sql file
+ # ----------------------------------------------------------------------
+ my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
+
+ # Use the mysql database for system tables
+ mtr_tofile($bootstrap_sql_file, "use mysql");
+
+ # Add the offical mysql system tables
+ # for a production system
+ mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
+ $bootstrap_sql_file);
+
+ # Add the mysql system tables initial data
+ # for a production system
+ mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables_data.sql",
+ $bootstrap_sql_file);
+
+ # Add test data for timezone - this is just a subset, on a real
+ # system these tables will be populated either by mysql_tzinfo_to_sql
+ # or by downloading the timezone table package from our website
+ mtr_appendfile_to_file("$path_sql_dir/mysql_test_data_timezone.sql",
+ $bootstrap_sql_file);
+
+ # Fill help tables, just an empty file when running from bk repo
+ # but will be replaced by a real fill_help_tables.sql when
+ # building the source dist
+ mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql",
+ $bootstrap_sql_file);
+
# Log bootstrap command
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
mtr_tofile($path_bootstrap_log,
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
- if ( mtr_run($exe_mysqld_bootstrap, $args, $init_db_sql_tmp,
+ if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
$path_bootstrap_log, $path_bootstrap_log,
"", { append_log_file => 1 }) != 0 )
{
- unlink($init_db_sql_tmp);
mtr_error("Error executing mysqld --bootstrap\n" .
- "Could not install $type test DBs");
+ "Could not install system database from $bootstrap_sql_file\n" .
+ "see $path_bootstrap_log for errors");
}
- unlink($init_db_sql_tmp);
}
@@ -3625,6 +3654,12 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
+ if ( $mysql_version_id >= 50036)
+ {
+ # Prevent the started mysqld to access files outside of vardir
+ mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
+ }
+
if ( $mysql_version_id >= 50000 )
{
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
@@ -4671,7 +4706,8 @@ sub run_mysqltest ($) {
# ----------------------------------------------------------------------
# export MYSQL_TEST variable containing <path>/mysqltest <args>
# ----------------------------------------------------------------------
- $ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args);
+ $ENV{'MYSQL_TEST'}=
+ mtr_native_path($exe_mysqltest) . " " . join(" ", @$args);
# ----------------------------------------------------------------------
# Add arguments that should not go into the MYSQL_TEST env var
@@ -4882,9 +4918,7 @@ sub debugger_arguments {
my $exe= shift;
my $debugger= $opt_debugger || $opt_client_debugger;
- # FIXME Need to change the below "eq"'s to
- # "case unsensitive string contains"
- if ( $debugger eq "vcexpress" or $debugger eq "vc")
+ if ( $debugger =~ /vcexpress|vc|devenv/ )
{
# vc[express] /debugexe exe arg1 .. argn
@@ -4892,22 +4926,37 @@ sub debugger_arguments {
unshift(@$$args, "/debugexe");
unshift(@$$args, "$$exe");
+ # Set exe to debuggername
+ $$exe= $debugger;
+
}
- elsif ( $debugger eq "windbg" )
+ elsif ( $debugger =~ /windbg/ )
{
# windbg exe arg1 .. argn
# Add name of the exe before args
unshift(@$$args, "$$exe");
+ # Set exe to debuggername
+ $$exe= $debugger;
+
+ }
+ elsif ( $debugger eq "dbx" )
+ {
+ # xterm -e dbx -r exe arg1 .. argn
+
+ unshift(@$$args, $$exe);
+ unshift(@$$args, "-r");
+ unshift(@$$args, $debugger);
+ unshift(@$$args, "-e");
+
+ $$exe= "xterm";
+
}
else
{
mtr_error("Unknown argument \"$debugger\" passed to --debugger");
}
-
- # Set exe to debuggername
- $$exe= $debugger;
}
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 571ac8498b3..fa18b58a927 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -881,6 +881,42 @@ create table t1 (t varchar(255) default null, key t (t(80)))
engine=myisam default charset=latin1;
alter table t1 change t t text;
drop table t1;
+CREATE TABLE t1 (a varchar(500));
+ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) DEFAULT NULL,
+ `b` geometry NOT NULL,
+ SPATIAL KEY `b` (`b`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD KEY(b(50));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) DEFAULT NULL,
+ `b` geometry NOT NULL,
+ SPATIAL KEY `b` (`b`),
+ KEY `b_2` (`b`(50))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD c POINT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) DEFAULT NULL,
+ `b` geometry NOT NULL,
+ `c` point DEFAULT NULL,
+ SPATIAL KEY `b` (`b`),
+ KEY `b_2` (`b`(50))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 (a INT, KEY (a(20)));
+ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+ALTER TABLE t1 ADD d INT;
+ALTER TABLE t1 ADD KEY (d(20));
+ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+ALTER TABLE t1 ADD e GEOMETRY NOT NULL, ADD SPATIAL KEY (e(30));
+ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+DROP TABLE t1;
CREATE TABLE t1 (s CHAR(8) BINARY);
INSERT INTO t1 VALUES ('test');
SELECT LENGTH(s) FROM t1;
diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result
index 9ab8a5e758b..210140ea11b 100644
--- a/mysql-test/r/archive_gis.result
+++ b/mysql-test/r/archive_gis.result
@@ -450,7 +450,7 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert IGNORE into t1 (a) values ('Garbage');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
-create table t1 (pk integer primary key auto_increment, fl geometry);
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (1.11);
@@ -458,5 +458,5 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR 23000: Column 'fl' cannot be null
drop table t1;
diff --git a/mysql-test/r/binlog_row_ctype_cp932.result b/mysql-test/r/binlog_row_ctype_cp932.result
index 10451686e2c..ca70f98c0e6 100644
--- a/mysql-test/r/binlog_row_ctype_cp932.result
+++ b/mysql-test/r/binlog_row_ctype_cp932.result
@@ -11365,3 +11365,13 @@ select hex(a) from t1;
hex(a)
82A0
drop table t1;
+ƒ\
+ƒ\
+c_cp932
+ƒ\
+ƒ\
+ƒ\
+ソ
+ソ
+ƒ\
+ƒ\
diff --git a/mysql-test/r/binlog_stm_ctype_cp932.result b/mysql-test/r/binlog_stm_ctype_cp932.result
index 10451686e2c..ca70f98c0e6 100755
--- a/mysql-test/r/binlog_stm_ctype_cp932.result
+++ b/mysql-test/r/binlog_stm_ctype_cp932.result
@@ -11365,3 +11365,13 @@ select hex(a) from t1;
hex(a)
82A0
drop table t1;
+ƒ\
+ƒ\
+c_cp932
+ƒ\
+ƒ\
+ƒ\
+ソ
+ソ
+ƒ\
+ƒ\
diff --git a/mysql-test/r/bootstrap.result b/mysql-test/r/bootstrap.result
new file mode 100644
index 00000000000..3301ca74324
--- /dev/null
+++ b/mysql-test/r/bootstrap.result
@@ -0,0 +1,8 @@
+drop table if exists t1;
+drop table t1;
+drop table t1;
+ERROR 42S02: Unknown table 't1'
+set @my_max_allowed_packet= @@max_allowed_packet;
+set global max_allowed_packet=100*@@max_allowed_packet;
+set global max_allowed_packet=@my_max_allowed_packet;
+drop table t1;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index c2bbb01af8c..ab9e6762d21 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -522,9 +522,11 @@ drop database mysqltest;
select database();
database()
NULL
+create user mysqltest_1;
select database(), user();
database() user()
NULL mysqltest_1@localhost
+drop user mysqltest_1;
use test;
create table t1 (a int, index `primary` (a));
ERROR 42000: Incorrect index name 'primary'
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index d253d121e99..ede5d9a32fd 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5007,7 +5007,6 @@ Warnings:
Error 1194 Table 'test_repair_table2' is marked as crashed and should be repaired
SELECT * from test_repair_table2;
val
-test_repair_table2.CSM
CHECK TABLE test_repair_table2;
Table Op Msg_type Msg_text
test.test_repair_table2 check status OK
@@ -5210,15 +5209,9 @@ create table bug22080_3 (id int,string varchar(64)) Engine=CSV;
insert into bug22080_1 values(1,'string');
insert into bug22080_1 values(2,'string');
insert into bug22080_1 values(3,'string');
-1,"string"
-2","string"
-3,"string"
check table bug22080_2;
Table Op Msg_type Msg_text
test.bug22080_2 check error Corrupt
-1,"string"
-2,"string"
-3,"string"
check table bug22080_3;
Table Op Msg_type Msg_text
test.bug22080_3 check error Corrupt
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index a514ffcddd2..a21b6f4f3a5 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -243,3 +243,10 @@ SET @@session.auto_increment_offset=
@bug20830_old_session_auto_increment_offset;
SET @@session.auto_increment_increment=
@bug20830_old_session_auto_increment_increment;
+CREATE TABLE t1(a BIT);
+INSERT DELAYED INTO t1 VALUES(1);
+FLUSH TABLE t1;
+SELECT HEX(a) FROM t1;
+HEX(a)
+1
+DROP TABLE t1;
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 8c7e39e0e90..3a098308b49 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -202,6 +202,7 @@ drop table t1,t2;
SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
x
1
+create user mysqltest_1;
create table t1 select 1 as a;
select 2 as a from (select * from t1) b;
ERROR 3D000: No database selected
@@ -380,3 +381,4 @@ ID DATA FID
select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
ID DATA FID
drop table t1, t2;
+drop user mysqltest_1;
diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result
index 003ee7ffd5e..6fb33dee826 100644
--- a/mysql-test/r/endspace.result
+++ b/mysql-test/r/endspace.result
@@ -25,10 +25,11 @@ insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
-select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 ignore key (key1) where text1='teststring' or
+text1 like 'teststring_%' ORDER BY text1;
text1
-teststring
teststring
+teststring
select * from t1 where text1='teststring' or text1 like 'teststring_%';
text1
teststring
@@ -48,10 +49,11 @@ alter table t1 modify text1 char(32) binary not null;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
-select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 ignore key (key1) where text1='teststring' or
+text1 like 'teststring_%' ORDER BY text1;
text1
-teststring
teststring
+teststring
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
concat('|', text1, '|')
|teststring |
@@ -132,10 +134,11 @@ concat('|', text1, '|')
drop table t1;
create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap;
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
-select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 ignore key (key1) where text1='teststring' or
+text1 like 'teststring_%' ORDER BY text1;
text1
-teststring
teststring
+teststring
select * from t1 where text1='teststring' or text1 like 'teststring_%';
text1
teststring
diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result
index 1efd3fa602e..ede7d0f4e25 100644
--- a/mysql-test/r/events_logs_tests.result
+++ b/mysql-test/r/events_logs_tests.result
@@ -97,3 +97,4 @@ DROP TABLE slow_event_test;
SET GLOBAL long_query_time =@old_global_long_query_time;
SET SESSION long_query_time =@old_session_long_query_time;
DROP DATABASE events_test;
+SET GLOBAL event_scheduler=off;
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index e0d9f5131b4..6f348447fbb 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -57,3 +57,33 @@ select 3 into @v1;
explain select 3 into @v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
+create table t1(f1 int, f2 int);
+insert into t1 values (1,1);
+create view v1 as select * from t1 where f1=1;
+explain extended select * from v1 where f2=1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
+explain extended select * from t1 where 0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 0
+explain extended select * from t1 where 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
+explain extended select * from t1 having 0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
+Warnings:
+Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` having 0
+explain extended select * from t1 having 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1
+drop view v1;
+drop table t1;
diff --git a/mysql-test/r/federated_server.result b/mysql-test/r/federated_server.result
index 43a99454e1e..7a1a6e0970d 100644
--- a/mysql-test/r/federated_server.result
+++ b/mysql-test/r/federated_server.result
@@ -49,7 +49,6 @@ SOCKET '',
OWNER 'root');
select * from mysql.servers;
Server_name Host Db Username Password Port Socket Wrapper Owner
-test localhost test root 0 mysql root
server_one 127.0.0.1 first_db root SLAVE_PORT mysql root
server_two 127.0.0.1 second_db root SLAVE_PORT mysql root
DROP TABLE IF EXISTS federated.old;
@@ -101,7 +100,6 @@ drop server 'server_one';
drop server 'server_two';
select * from mysql.servers;
Server_name Host Db Username Password Port Socket Wrapper Owner
-test localhost test root 0 mysql root
drop table first_db.t1;
drop table second_db.t1;
drop database first_db;
diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result
index 8257fa05b41..13bcc371ef6 100644
--- a/mysql-test/r/flush2.result
+++ b/mysql-test/r/flush2.result
@@ -1,26 +1,12 @@
flush logs;
set global expire_logs_days = 3;
-show variables like 'log%';
+show variables like 'log_bin%';
Variable_name Value
-log ON
log_bin OFF
log_bin_trust_function_creators ON
-log_error
-log_output TABLE
-log_queries_not_using_indexes OFF
-log_slave_updates OFF
-log_slow_queries OFF
-log_warnings 1
flush logs;
-show variables like 'log%';
+show variables like 'log_bin%';
Variable_name Value
-log ON
log_bin OFF
log_bin_trust_function_creators ON
-log_error
-log_output TABLE
-log_queries_not_using_indexes OFF
-log_slave_updates OFF
-log_slow_queries OFF
-log_warnings 1
set global expire_logs_days = 0;
diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result
index 7f1e53b00e0..a8f59f73e88 100644
--- a/mysql-test/r/func_default.result
+++ b/mysql-test/r/func_default.result
@@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select default(`test`.`t1`.`str`) AS `default(str)`,default(`test`.`t1`.`strnull`) AS `default(strnull)`,default(`test`.`t1`.`intg`) AS `default(intg)`,default(`test`.`t1`.`rel`) AS `default(rel)` from `test`.`t1`
+Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from `test`.`t1`
select * from t1 where str <> default(str);
str strnull intg rel
0 0
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 64324b57fe3..972bb99d56f 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1171,11 +1171,11 @@ i count(*) std(s1/s2)
1 4 0.00000000
2 4 0.00000000
3 4 0.00000000
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-i count(*) std(o1/o2)
-1 4 0
-2 4 0
-3 4 0
+select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i;
+i count(*) round(std(o1/o2), 16)
+1 4 0.0000000000000000
+2 4 0.0000000000000000
+3 4 0.0000000000000000
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 4 0.00000000
@@ -1197,11 +1197,11 @@ i count(*) std(s1/s2)
1 4 0.000000000000000000000000000000
2 4 0.000000000000000000000000000000
3 4 0.000000000000000000000000000000
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-i count(*) std(o1/o2)
-1 4 0
-2 4 0
-3 4 0
+select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i;
+i count(*) round(std(o1/o2), 16)
+1 4 0.0000000000000000
+2 4 0.0000000000000000
+3 4 0.0000000000000000
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 4 0.000000000000000000000000000000
@@ -1222,11 +1222,11 @@ i count(*) std(s1/s2)
1 4 0.000000000000000000000000000000
2 4 0.000000000000000000000000000000
3 4 0.000000000000000000000000000000
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-i count(*) std(o1/o2)
-1 4 0
-2 4 0
-3 4 0
+select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i;
+i count(*) round(std(o1/o2), 16)
+1 4 0.0000000000000000
+2 4 0.0000000000000000
+3 4 0.0000000000000000
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 4 0.000000000000000000000000000000
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 9ec621b7f35..7a8f59c65f4 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -399,6 +399,84 @@ WHERE t3.a=t1.a AND t3.a=t2.a;
3
3
DROP TABLE t1,t2,t3,t4;
+CREATE TABLE t1(a BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (0xFFFFFFFFFFFFFFFF);
+SELECT * FROM t1 WHERE a=-1 OR a=-2 ;
+a
+SELECT * FROM t1 WHERE a IN (-1, -2);
+a
+CREATE TABLE t2 (a BIGINT UNSIGNED);
+insert into t2 values(13491727406643098568),
+(0x7fffffefffffffff),
+(0x7ffffffeffffffff),
+(0x7fffffffefffffff),
+(0x7ffffffffeffffff),
+(0x7fffffffffefffff),
+(0x7ffffffffffeffff),
+(0x7fffffffffffefff),
+(0x7ffffffffffffeff),
+(0x7fffffffffffffef),
+(0x7ffffffffffffffe),
+(0x7fffffffffffffff),
+(0x8000000000000000),
+(0x8000000000000001),
+(0x8000000000000002),
+(0x8000000000000300),
+(0x8000000000000400),
+(0x8000000000000401),
+(0x8000000000004001),
+(0x8000000000040001),
+(0x8000000000400001),
+(0x8000000004000001),
+(0x8000000040000001),
+(0x8000000400000001),
+(0x8000004000000001),
+(0x8000040000000001);
+SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
+HEX(a)
+BB3C3E98175D33C8
+SELECT HEX(a) FROM t2 WHERE a IN
+(0xBB3C3E98175D33C8,
+0x7fffffffffffffff,
+0x8000000000000000,
+0x8000000000000400,
+0x8000000000000401,
+42);
+HEX(a)
+BB3C3E98175D33C8
+7FFFFFFFFFFFFEFF
+7FFFFFFFFFFFFFEF
+7FFFFFFFFFFFFFFE
+7FFFFFFFFFFFFFFF
+8000000000000000
+8000000000000001
+8000000000000002
+8000000000000300
+8000000000000400
+8000000000000401
+SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
+HEX(a)
+7FFFFFFFFFFFFFFF
+8000000000000001
+SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
+HEX(a)
+7FFFFFFFFFFFFFFE
+7FFFFFFFFFFFFFFF
+SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
+HEX(a)
+7FFFFFFFFFFFFFFE
+7FFFFFFFFFFFFFFF
+CREATE TABLE t3 (a BIGINT UNSIGNED);
+INSERT INTO t3 VALUES (9223372036854775551);
+SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);
+HEX(a)
+CREATE TABLE t4 (a DATE);
+INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
+SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
+a
+Warnings:
+Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1
+DROP TABLE t1,t2,t3,t4;
End of 5.0 tests
create table t1(f1 char(1));
insert into t1 values ('a'),('b'),('1');
diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result
index 803f606d3dd..4e35c2a1348 100644
--- a/mysql-test/r/func_regexp.result
+++ b/mysql-test/r/func_regexp.result
@@ -40,7 +40,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select `test`.`t1`.`xxx` AS `xxx` from `test`.`t1` where (`test`.`t1`.`xxx` regexp _latin1'is a test of some long text to')
+Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from `test`.`t1` where ('this is a test of some long text to see what happens' regexp _latin1'is a test of some long text to')
select * from t1 where xxx regexp('is a test of some long text to ');
xxx
this is a test of some long text to see what happens
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 29ceb6ecaa4..124b20e9b46 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -240,9 +240,7 @@ a
10000
select microsecond(19971231235959.01) as a;
a
-0
-Warnings:
-Warning 1292 Truncated incorrect time value: '19971231235959.01'
+10000
select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a;
a
1997-12-31 00:00:10.090000
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index e6c323276ea..8bc613be4c0 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1309,12 +1309,12 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select encode(`test`.`t1`.`f1`,_latin1'zxcv') AS `enc` from `test`.`t1`
+Note 1003 select encode('',_latin1'zxcv') AS `enc` from `test`.`t1`
explain extended select decode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select decode(`test`.`t1`.`f1`,_latin1'zxcv') AS `enc` from `test`.`t1`
+Note 1003 select decode('',_latin1'zxcv') AS `enc` from `test`.`t1`
drop table t1;
End of 4.1 tests
create table t1 (d decimal default null);
@@ -1378,7 +1378,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 const PRIMARY PRIMARY 12 const 1 100.00 Using index
1 SIMPLE t1 ref code code 13 const 3 100.00 Using where; Using index
Warnings:
-Note 1003 select `test`.`t1`.`code` AS `code`,`test`.`t2`.`id` AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5))
+Note 1003 select `test`.`t1`.`code` AS `code`,'a12' AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5))
DROP TABLE t1,t2;
select encode(NULL, NULL);
encode(NULL, NULL)
@@ -2273,4 +2273,47 @@ abcxx
select lpad('abc', cast(5 as unsigned integer), 'x');
lpad('abc', cast(5 as unsigned integer), 'x')
xxabc
+create table t1(f1 longtext);
+insert into t1 values ("123"),("456");
+select substring(f1,1,1) from t1 group by 1;
+substring(f1,1,1)
+1
+4
+create table t2(f1 varchar(3));
+insert into t1 values ("123"),("456");
+select substring(f1,4,1), substring(f1,-4,1) from t2;
+substring(f1,4,1) substring(f1,-4,1)
+drop table t1,t2;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE `t1` (
+`id` varchar(20) NOT NULL,
+`tire` tinyint(3) unsigned NOT NULL,
+PRIMARY KEY (`id`)
+);
+INSERT INTO `t1` (`id`, `tire`) VALUES ('A', 0), ('B', 1),('C', 2);
+SELECT REPEAT( '#', tire ) AS A,
+REPEAT( '#', tire % 999 ) AS B, tire FROM `t1`;
+A B tire
+ 0
+# # 1
+## ## 2
+DROP TABLE t1;
+SELECT UNHEX('G');
+UNHEX('G')
+NULL
+SELECT UNHEX('G') IS NULL;
+UNHEX('G') IS NULL
+1
+SELECT INSERT('abc', 3, 3, '1234');
+INSERT('abc', 3, 3, '1234')
+ab1234
+SELECT INSERT('abc', 4, 3, '1234');
+INSERT('abc', 4, 3, '1234')
+abc1234
+SELECT INSERT('abc', 5, 3, '1234');
+INSERT('abc', 5, 3, '1234')
+abc
+SELECT INSERT('abc', 6, 3, '1234');
+INSERT('abc', 6, 3, '1234')
+abc
End of 5.0 tests
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index 9a5cc666ca8..a97e6869d09 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -79,7 +79,7 @@ explain extended select * from t1 where 1 xor 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1`
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
select - a from t1;
- a
-1
@@ -87,7 +87,7 @@ explain extended select - a from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select -(`test`.`t1`.`a`) AS `- a` from `test`.`t1`
+Note 1003 select -('1') AS `- a` from `test`.`t1`
drop table t1;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index d5888d13a06..16a1e5d01d7 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1050,6 +1050,10 @@ H
select last_day('0000-00-00');
last_day('0000-00-00')
NULL
+select isnull(week(now() + 0)), isnull(week(now() + 0.2)),
+week(20061108), week(20061108.01), week(20061108085411.000002);
+isnull(week(now() + 0)) isnull(week(now() + 0.2)) week(20061108) week(20061108.01) week(20061108085411.000002)
+0 0 45 45 45
End of 4.1 tests
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;
@@ -1183,6 +1187,23 @@ set time_zone= @@global.time_zone;
select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
NULL
+create table t1 (field DATE);
+insert into t1 values ('2006-11-06');
+select * from t1 where field < '2006-11-06 04:08:36.0';
+field
+2006-11-06
+select * from t1 where field = '2006-11-06 04:08:36.0';
+field
+select * from t1 where field = '2006-11-06';
+field
+2006-11-06
+select * from t1 where CAST(field as DATETIME) < '2006-11-06 04:08:36.0';
+field
+2006-11-06
+select * from t1 where CAST(field as DATE) < '2006-11-06 04:08:36.0';
+field
+2006-11-06
+drop table t1;
CREATE TABLE t1 (a int, t1 time, t2 time, d date, PRIMARY KEY (a));
INSERT INTO t1 VALUES (1, '10:00:00', NULL, NULL),
(2, '11:00:00', '11:15:00', '1972-02-06');
@@ -1197,6 +1218,10 @@ t1 t2 SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ) QUARTER(d)
11:00:00 11:15:00 00:15:00 1
10:00:00 NULL NULL NULL
DROP TABLE t1;
+SELECT TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") FROM (SELECT 3020399 AS a UNION SELECT 3020398 ) x GROUP BY 1;
+TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s")
+838:59:58
+838:59:59
End of 5.0 tests
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index 138360edc49..a3955e8c008 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -10,7 +10,7 @@ t1 CREATE TABLE `t1` (
`fid` int(11) NOT NULL AUTO_INCREMENT,
`g` geometry NOT NULL,
PRIMARY KEY (`fid`),
- SPATIAL KEY `g` (`g`(32))
+ SPATIAL KEY `g` (`g`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)'));
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)'));
@@ -293,7 +293,7 @@ t2 CREATE TABLE `t2` (
`fid` int(11) NOT NULL AUTO_INCREMENT,
`g` geometry NOT NULL,
PRIMARY KEY (`fid`),
- SPATIAL KEY `g` (`g`(32))
+ SPATIAL KEY `g` (`g`)
) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
SELECT count(*) FROM t2;
count(*)
@@ -803,7 +803,7 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1, t2;
-CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'geometry' can't have a default value
INSERT INTO t1 (geometry) VALUES
@@ -820,7 +820,7 @@ test.t1 check status OK
drop table t1;
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
-SPATIAL KEY i1 (c1(32))
+SPATIAL KEY i1 (c1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'c1' can't have a default value
@@ -836,7 +836,7 @@ test.t1 check status OK
DROP TABLE t1;
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
-SPATIAL KEY i1 (c1(32))
+SPATIAL KEY i1 (c1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'c1' can't have a default value
@@ -873,6 +873,558 @@ SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
1
1
DROP TABLE t1;
+CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment,
+c2 varchar(15) collate utf8_bin default NULL,
+c1 varchar(15) collate utf8_bin default NULL,
+c3 varchar(10) collate utf8_bin default NULL,
+spatial_point point NOT NULL,
+PRIMARY KEY(id),
+SPATIAL KEY (spatial_point)
+)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+('y', 's', 'j', GeomFromText('POINT(167 74)')),
+('r', 'n', 'd', GeomFromText('POINT(215 118)')),
+('g', 'n', 'e', GeomFromText('POINT(203 98)')),
+('h', 'd', 'd', GeomFromText('POINT(54 193)')),
+('r', 'x', 'y', GeomFromText('POINT(47 69)')),
+('t', 'q', 'r', GeomFromText('POINT(109 42)')),
+('a', 'z', 'd', GeomFromText('POINT(0 154)')),
+('x', 'v', 'o', GeomFromText('POINT(174 131)')),
+('b', 'r', 'a', GeomFromText('POINT(114 253)')),
+('x', 'z', 'i', GeomFromText('POINT(163 21)')),
+('w', 'p', 'i', GeomFromText('POINT(42 102)')),
+('g', 'j', 'j', GeomFromText('POINT(170 133)')),
+('m', 'g', 'n', GeomFromText('POINT(28 22)')),
+('b', 'z', 'h', GeomFromText('POINT(174 28)')),
+('q', 'k', 'f', GeomFromText('POINT(233 73)')),
+('w', 'w', 'a', GeomFromText('POINT(124 200)')),
+('t', 'j', 'w', GeomFromText('POINT(252 101)')),
+('d', 'r', 'd', GeomFromText('POINT(98 18)')),
+('w', 'o', 'y', GeomFromText('POINT(165 31)')),
+('y', 'h', 't', GeomFromText('POINT(14 220)')),
+('d', 'p', 'u', GeomFromText('POINT(223 196)')),
+('g', 'y', 'g', GeomFromText('POINT(207 96)')),
+('x', 'm', 'n', GeomFromText('POINT(214 3)')),
+('g', 'v', 'e', GeomFromText('POINT(140 205)')),
+('g', 'm', 'm', GeomFromText('POINT(10 236)')),
+('i', 'r', 'j', GeomFromText('POINT(137 228)')),
+('w', 's', 'p', GeomFromText('POINT(115 6)')),
+('o', 'n', 'k', GeomFromText('POINT(158 129)')),
+('j', 'h', 'l', GeomFromText('POINT(129 72)')),
+('f', 'x', 'l', GeomFromText('POINT(139 207)')),
+('u', 'd', 'n', GeomFromText('POINT(125 109)')),
+('b', 'a', 'z', GeomFromText('POINT(30 32)')),
+('m', 'h', 'o', GeomFromText('POINT(251 251)')),
+('f', 'r', 'd', GeomFromText('POINT(243 211)')),
+('b', 'd', 'r', GeomFromText('POINT(232 80)')),
+('g', 'k', 'v', GeomFromText('POINT(15 100)')),
+('i', 'f', 'c', GeomFromText('POINT(109 66)')),
+('r', 't', 'j', GeomFromText('POINT(178 6)')),
+('y', 'n', 'f', GeomFromText('POINT(233 211)')),
+('f', 'y', 'm', GeomFromText('POINT(99 16)')),
+('z', 'q', 'l', GeomFromText('POINT(39 49)')),
+('j', 'c', 'r', GeomFromText('POINT(75 187)')),
+('c', 'y', 'y', GeomFromText('POINT(246 253)')),
+('w', 'u', 'd', GeomFromText('POINT(56 190)')),
+('n', 'q', 'm', GeomFromText('POINT(73 149)')),
+('d', 'y', 'a', GeomFromText('POINT(134 6)')),
+('z', 's', 'w', GeomFromText('POINT(216 225)')),
+('d', 'u', 'k', GeomFromText('POINT(132 70)')),
+('f', 'v', 't', GeomFromText('POINT(187 141)')),
+('r', 'r', 'a', GeomFromText('POINT(152 39)')),
+('y', 'p', 'o', GeomFromText('POINT(45 27)')),
+('p', 'n', 'm', GeomFromText('POINT(228 148)')),
+('e', 'g', 'e', GeomFromText('POINT(88 81)')),
+('m', 'a', 'h', GeomFromText('POINT(35 29)')),
+('m', 'h', 'f', GeomFromText('POINT(30 71)')),
+('h', 'k', 'i', GeomFromText('POINT(244 78)')),
+('z', 'v', 'd', GeomFromText('POINT(241 38)')),
+('q', 'l', 'j', GeomFromText('POINT(13 71)')),
+('s', 'p', 'g', GeomFromText('POINT(108 38)')),
+('q', 's', 'j', GeomFromText('POINT(92 101)')),
+('l', 'h', 'g', GeomFromText('POINT(120 78)')),
+('w', 't', 'b', GeomFromText('POINT(193 109)')),
+('b', 's', 's', GeomFromText('POINT(223 211)')),
+('w', 'w', 'y', GeomFromText('POINT(122 42)')),
+('q', 'c', 'c', GeomFromText('POINT(104 102)')),
+('w', 'g', 'n', GeomFromText('POINT(213 120)')),
+('p', 'q', 'a', GeomFromText('POINT(247 148)')),
+('c', 'z', 'e', GeomFromText('POINT(18 106)')),
+('z', 'u', 'n', GeomFromText('POINT(70 133)')),
+('j', 'n', 'x', GeomFromText('POINT(232 13)')),
+('e', 'h', 'f', GeomFromText('POINT(22 135)')),
+('w', 'l', 'f', GeomFromText('POINT(9 180)')),
+('a', 'v', 'q', GeomFromText('POINT(163 228)')),
+('i', 'z', 'o', GeomFromText('POINT(180 100)')),
+('e', 'c', 'l', GeomFromText('POINT(182 231)')),
+('c', 'k', 'o', GeomFromText('POINT(19 60)')),
+('q', 'f', 'p', GeomFromText('POINT(79 95)')),
+('m', 'd', 'r', GeomFromText('POINT(3 127)')),
+('m', 'e', 't', GeomFromText('POINT(136 154)')),
+('w', 'w', 'w', GeomFromText('POINT(102 15)')),
+('l', 'n', 'q', GeomFromText('POINT(71 196)')),
+('p', 'k', 'c', GeomFromText('POINT(47 139)')),
+('j', 'o', 'r', GeomFromText('POINT(177 128)')),
+('j', 'q', 'a', GeomFromText('POINT(170 6)')),
+('b', 'a', 'o', GeomFromText('POINT(63 211)')),
+('g', 's', 'o', GeomFromText('POINT(144 251)')),
+('w', 'u', 'w', GeomFromText('POINT(221 214)')),
+('g', 'a', 'm', GeomFromText('POINT(14 102)')),
+('u', 'q', 'z', GeomFromText('POINT(86 200)')),
+('k', 'a', 'm', GeomFromText('POINT(144 222)')),
+('j', 'u', 'r', GeomFromText('POINT(216 142)')),
+('q', 'k', 'v', GeomFromText('POINT(121 236)')),
+('p', 'o', 'r', GeomFromText('POINT(108 102)')),
+('b', 'd', 'x', GeomFromText('POINT(127 198)')),
+('k', 's', 'a', GeomFromText('POINT(2 150)')),
+('f', 'm', 'f', GeomFromText('POINT(160 191)')),
+('q', 'y', 'x', GeomFromText('POINT(98 111)')),
+('o', 'f', 'm', GeomFromText('POINT(232 218)')),
+('c', 'w', 'j', GeomFromText('POINT(156 165)')),
+('s', 'q', 'v', GeomFromText('POINT(98 161)'));
+SET @@RAND_SEED1=692635050, @@RAND_SEED2=297339954;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=159925977, @@RAND_SEED2=942570618;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=328169745, @@RAND_SEED2=410451954;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=178507359, @@RAND_SEED2=332493072;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=1034033013, @@RAND_SEED2=558966507;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+UPDATE t1 set spatial_point=GeomFromText('POINT(230 9)') where c1 like 'y%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(95 35)') where c1 like 'j%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(93 99)') where c1 like 'a%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(19 81)') where c1 like 'r%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(20 177)') where c1 like 'h%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(221 193)') where c1 like 'u%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(195 205)') where c1 like 'd%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(15 213)') where c1 like 'u%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(214 63)') where c1 like 'n%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(243 171)') where c1 like 'c%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(198 82)') where c1 like 'y%';
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+('f', 'y', 'p', GeomFromText('POINT(109 235)')),
+('b', 'e', 'v', GeomFromText('POINT(20 48)')),
+('i', 'u', 'f', GeomFromText('POINT(15 55)')),
+('o', 'r', 'z', GeomFromText('POINT(105 64)')),
+('a', 'p', 'a', GeomFromText('POINT(142 236)')),
+('g', 'i', 'k', GeomFromText('POINT(10 49)')),
+('x', 'z', 'x', GeomFromText('POINT(192 200)')),
+('c', 'v', 'r', GeomFromText('POINT(94 168)')),
+('y', 'z', 'e', GeomFromText('POINT(141 51)')),
+('h', 'm', 'd', GeomFromText('POINT(35 251)')),
+('v', 'm', 'q', GeomFromText('POINT(44 90)')),
+('j', 'l', 'z', GeomFromText('POINT(67 237)')),
+('i', 'v', 'a', GeomFromText('POINT(75 14)')),
+('b', 'q', 't', GeomFromText('POINT(153 33)')),
+('e', 'm', 'a', GeomFromText('POINT(247 49)')),
+('l', 'y', 'g', GeomFromText('POINT(56 203)')),
+('v', 'o', 'r', GeomFromText('POINT(90 54)')),
+('r', 'n', 'd', GeomFromText('POINT(135 83)')),
+('j', 't', 'u', GeomFromText('POINT(174 239)')),
+('u', 'n', 'g', GeomFromText('POINT(104 191)')),
+('p', 'q', 'y', GeomFromText('POINT(63 171)')),
+('o', 'q', 'p', GeomFromText('POINT(192 103)')),
+('f', 'x', 'e', GeomFromText('POINT(244 30)')),
+('n', 'x', 'c', GeomFromText('POINT(92 103)')),
+('r', 'q', 'z', GeomFromText('POINT(166 20)')),
+('s', 'a', 'j', GeomFromText('POINT(137 205)')),
+('z', 't', 't', GeomFromText('POINT(99 134)')),
+('o', 'm', 'j', GeomFromText('POINT(217 3)')),
+('n', 'h', 'j', GeomFromText('POINT(211 17)')),
+('v', 'v', 'a', GeomFromText('POINT(41 137)')),
+('q', 'o', 'j', GeomFromText('POINT(5 92)')),
+('z', 'y', 'e', GeomFromText('POINT(175 212)')),
+('j', 'z', 'h', GeomFromText('POINT(224 194)')),
+('a', 'g', 'm', GeomFromText('POINT(31 119)')),
+('p', 'c', 'f', GeomFromText('POINT(17 221)')),
+('t', 'h', 'k', GeomFromText('POINT(26 203)')),
+('u', 'w', 'p', GeomFromText('POINT(47 185)')),
+('z', 'a', 'c', GeomFromText('POINT(61 133)')),
+('u', 'k', 'a', GeomFromText('POINT(210 115)')),
+('k', 'f', 'h', GeomFromText('POINT(125 113)')),
+('t', 'v', 'y', GeomFromText('POINT(12 239)')),
+('u', 'v', 'd', GeomFromText('POINT(90 24)')),
+('m', 'y', 'w', GeomFromText('POINT(25 243)')),
+('d', 'n', 'g', GeomFromText('POINT(122 92)')),
+('z', 'm', 'f', GeomFromText('POINT(235 110)')),
+('q', 'd', 'f', GeomFromText('POINT(233 217)')),
+('a', 'v', 'u', GeomFromText('POINT(69 59)')),
+('x', 'k', 'p', GeomFromText('POINT(240 14)')),
+('i', 'v', 'r', GeomFromText('POINT(154 42)')),
+('w', 'h', 'l', GeomFromText('POINT(178 156)')),
+('d', 'h', 'n', GeomFromText('POINT(65 157)')),
+('c', 'k', 'z', GeomFromText('POINT(62 33)')),
+('e', 'l', 'w', GeomFromText('POINT(162 1)')),
+('r', 'f', 'i', GeomFromText('POINT(127 71)')),
+('q', 'm', 'c', GeomFromText('POINT(63 118)')),
+('c', 'h', 'u', GeomFromText('POINT(205 203)')),
+('d', 't', 'p', GeomFromText('POINT(234 87)')),
+('s', 'g', 'h', GeomFromText('POINT(149 34)')),
+('o', 'b', 'q', GeomFromText('POINT(159 179)')),
+('k', 'u', 'f', GeomFromText('POINT(202 254)')),
+('u', 'f', 'g', GeomFromText('POINT(70 15)')),
+('x', 's', 'b', GeomFromText('POINT(25 181)')),
+('s', 'c', 'g', GeomFromText('POINT(252 17)')),
+('a', 'c', 'f', GeomFromText('POINT(89 67)')),
+('r', 'e', 'q', GeomFromText('POINT(55 54)')),
+('f', 'i', 'k', GeomFromText('POINT(178 230)')),
+('p', 'e', 'l', GeomFromText('POINT(198 28)')),
+('w', 'o', 'd', GeomFromText('POINT(204 189)')),
+('c', 'a', 'g', GeomFromText('POINT(230 178)')),
+('r', 'o', 'e', GeomFromText('POINT(61 116)')),
+('w', 'a', 'a', GeomFromText('POINT(178 237)')),
+('v', 'd', 'e', GeomFromText('POINT(70 85)')),
+('k', 'c', 'e', GeomFromText('POINT(147 118)')),
+('d', 'q', 't', GeomFromText('POINT(218 77)')),
+('k', 'g', 'f', GeomFromText('POINT(192 113)')),
+('w', 'n', 'e', GeomFromText('POINT(92 124)')),
+('r', 'm', 'q', GeomFromText('POINT(130 65)')),
+('o', 'r', 'r', GeomFromText('POINT(174 233)')),
+('k', 'n', 't', GeomFromText('POINT(175 147)')),
+('q', 'm', 'r', GeomFromText('POINT(18 208)')),
+('l', 'd', 'i', GeomFromText('POINT(13 104)')),
+('w', 'o', 'y', GeomFromText('POINT(207 39)')),
+('p', 'u', 'o', GeomFromText('POINT(114 31)')),
+('y', 'a', 'p', GeomFromText('POINT(106 59)')),
+('a', 'x', 'z', GeomFromText('POINT(17 57)')),
+('v', 'h', 'x', GeomFromText('POINT(170 13)')),
+('t', 's', 'u', GeomFromText('POINT(84 18)')),
+('z', 'z', 'f', GeomFromText('POINT(250 197)')),
+('l', 'z', 't', GeomFromText('POINT(59 80)')),
+('j', 'g', 's', GeomFromText('POINT(54 26)')),
+('g', 'v', 'm', GeomFromText('POINT(89 98)')),
+('q', 'v', 'b', GeomFromText('POINT(39 240)')),
+('x', 'k', 'v', GeomFromText('POINT(246 207)')),
+('k', 'u', 'i', GeomFromText('POINT(105 111)')),
+('w', 'z', 's', GeomFromText('POINT(235 8)')),
+('d', 'd', 'd', GeomFromText('POINT(105 4)')),
+('c', 'z', 'q', GeomFromText('POINT(13 140)')),
+('m', 'k', 'i', GeomFromText('POINT(208 120)')),
+('g', 'a', 'g', GeomFromText('POINT(9 182)')),
+('z', 'j', 'r', GeomFromText('POINT(149 153)')),
+('h', 'f', 'g', GeomFromText('POINT(81 236)')),
+('m', 'e', 'q', GeomFromText('POINT(209 215)')),
+('c', 'h', 'y', GeomFromText('POINT(235 70)')),
+('i', 'e', 'g', GeomFromText('POINT(138 26)')),
+('m', 't', 'u', GeomFromText('POINT(119 237)')),
+('o', 'w', 's', GeomFromText('POINT(193 166)')),
+('f', 'm', 'q', GeomFromText('POINT(85 96)')),
+('x', 'l', 'x', GeomFromText('POINT(58 115)')),
+('x', 'q', 'u', GeomFromText('POINT(108 210)')),
+('b', 'h', 'i', GeomFromText('POINT(250 139)')),
+('y', 'd', 'x', GeomFromText('POINT(199 135)')),
+('w', 'h', 'p', GeomFromText('POINT(247 233)')),
+('p', 'z', 't', GeomFromText('POINT(148 249)')),
+('q', 'a', 'u', GeomFromText('POINT(174 78)')),
+('v', 't', 'm', GeomFromText('POINT(70 228)')),
+('t', 'n', 'f', GeomFromText('POINT(123 2)')),
+('x', 't', 'b', GeomFromText('POINT(35 50)')),
+('r', 'j', 'f', GeomFromText('POINT(200 51)')),
+('s', 'q', 'o', GeomFromText('POINT(23 184)')),
+('u', 'v', 'z', GeomFromText('POINT(7 113)')),
+('v', 'u', 'l', GeomFromText('POINT(145 190)')),
+('o', 'k', 'i', GeomFromText('POINT(161 122)')),
+('l', 'y', 'e', GeomFromText('POINT(17 232)')),
+('t', 'b', 'e', GeomFromText('POINT(120 50)')),
+('e', 's', 'u', GeomFromText('POINT(254 1)')),
+('d', 'd', 'u', GeomFromText('POINT(167 140)')),
+('o', 'b', 'x', GeomFromText('POINT(186 237)')),
+('m', 's', 's', GeomFromText('POINT(172 149)')),
+('t', 'y', 'a', GeomFromText('POINT(149 85)')),
+('x', 't', 'r', GeomFromText('POINT(10 165)')),
+('g', 'c', 'e', GeomFromText('POINT(95 165)')),
+('e', 'e', 'z', GeomFromText('POINT(98 65)')),
+('f', 'v', 'i', GeomFromText('POINT(149 144)')),
+('o', 'p', 'm', GeomFromText('POINT(233 67)')),
+('t', 'u', 'b', GeomFromText('POINT(109 215)')),
+('o', 'o', 'b', GeomFromText('POINT(130 48)')),
+('e', 'm', 'h', GeomFromText('POINT(88 189)')),
+('e', 'v', 'y', GeomFromText('POINT(55 29)')),
+('e', 't', 'm', GeomFromText('POINT(129 55)')),
+('p', 'p', 'i', GeomFromText('POINT(126 222)')),
+('c', 'i', 'c', GeomFromText('POINT(19 158)')),
+('c', 'b', 's', GeomFromText('POINT(13 19)')),
+('u', 'y', 'a', GeomFromText('POINT(114 5)')),
+('a', 'o', 'f', GeomFromText('POINT(227 232)')),
+('t', 'c', 'z', GeomFromText('POINT(63 62)')),
+('d', 'o', 'k', GeomFromText('POINT(48 228)')),
+('x', 'c', 'e', GeomFromText('POINT(204 2)')),
+('e', 'e', 'g', GeomFromText('POINT(125 43)')),
+('o', 'r', 'f', GeomFromText('POINT(171 140)'));
+UPDATE t1 set spatial_point=GeomFromText('POINT(163 157)') where c1 like 'w%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(53 151)') where c1 like 'd%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(96 183)') where c1 like 'r%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(57 91)') where c1 like 'q%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(202 110)') where c1 like 'c%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(120 137)') where c1 like 'w%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(207 147)') where c1 like 'c%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(31 125)') where c1 like 'e%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(27 36)') where c1 like 'r%';
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+('b', 'c', 'e', GeomFromText('POINT(41 137)')),
+('p', 'y', 'k', GeomFromText('POINT(50 22)')),
+('s', 'c', 'h', GeomFromText('POINT(208 173)')),
+('x', 'u', 'l', GeomFromText('POINT(199 175)')),
+('s', 'r', 'h', GeomFromText('POINT(85 192)')),
+('j', 'k', 'u', GeomFromText('POINT(18 25)')),
+('p', 'w', 'h', GeomFromText('POINT(152 197)')),
+('e', 'd', 'c', GeomFromText('POINT(229 3)')),
+('o', 'x', 'k', GeomFromText('POINT(187 155)')),
+('o', 'b', 'k', GeomFromText('POINT(208 150)')),
+('d', 'a', 'j', GeomFromText('POINT(70 87)')),
+('f', 'e', 'k', GeomFromText('POINT(156 96)')),
+('u', 'y', 'p', GeomFromText('POINT(239 193)')),
+('n', 'v', 'p', GeomFromText('POINT(223 98)')),
+('z', 'j', 'r', GeomFromText('POINT(87 89)')),
+('h', 'x', 'x', GeomFromText('POINT(92 0)')),
+('r', 'v', 'r', GeomFromText('POINT(159 139)')),
+('v', 'g', 'g', GeomFromText('POINT(16 229)')),
+('z', 'k', 'u', GeomFromText('POINT(99 52)')),
+('p', 'p', 'o', GeomFromText('POINT(105 125)')),
+('w', 'h', 'y', GeomFromText('POINT(105 154)')),
+('v', 'y', 'z', GeomFromText('POINT(134 238)')),
+('x', 'o', 'o', GeomFromText('POINT(178 88)')),
+('z', 'w', 'd', GeomFromText('POINT(123 60)')),
+('q', 'f', 'u', GeomFromText('POINT(64 90)')),
+('s', 'n', 't', GeomFromText('POINT(50 138)')),
+('v', 'p', 't', GeomFromText('POINT(114 91)')),
+('a', 'o', 'n', GeomFromText('POINT(78 43)')),
+('k', 'u', 'd', GeomFromText('POINT(185 161)')),
+('w', 'd', 'n', GeomFromText('POINT(25 92)')),
+('k', 'w', 'a', GeomFromText('POINT(59 238)')),
+('t', 'c', 'f', GeomFromText('POINT(65 87)')),
+('g', 's', 'p', GeomFromText('POINT(238 126)')),
+('d', 'n', 'y', GeomFromText('POINT(107 173)')),
+('l', 'a', 'w', GeomFromText('POINT(125 152)')),
+('m', 'd', 'j', GeomFromText('POINT(146 53)')),
+('q', 'm', 'c', GeomFromText('POINT(217 187)')),
+('i', 'r', 'r', GeomFromText('POINT(6 113)')),
+('e', 'j', 'b', GeomFromText('POINT(37 83)')),
+('w', 'w', 'h', GeomFromText('POINT(83 199)')),
+('k', 'b', 's', GeomFromText('POINT(170 64)')),
+('s', 'b', 'c', GeomFromText('POINT(163 130)')),
+('c', 'h', 'a', GeomFromText('POINT(141 3)')),
+('k', 'j', 'u', GeomFromText('POINT(143 76)')),
+('r', 'h', 'o', GeomFromText('POINT(243 92)')),
+('i', 'd', 'b', GeomFromText('POINT(205 13)')),
+('r', 'y', 'q', GeomFromText('POINT(138 8)')),
+('m', 'o', 'i', GeomFromText('POINT(36 45)')),
+('v', 'g', 'm', GeomFromText('POINT(0 40)')),
+('f', 'e', 'i', GeomFromText('POINT(76 6)')),
+('c', 'q', 'q', GeomFromText('POINT(115 248)')),
+('x', 'c', 'i', GeomFromText('POINT(29 74)')),
+('l', 's', 't', GeomFromText('POINT(83 18)')),
+('t', 't', 'a', GeomFromText('POINT(26 168)')),
+('u', 'n', 'x', GeomFromText('POINT(200 110)')),
+('j', 'b', 'd', GeomFromText('POINT(216 136)')),
+('s', 'p', 'w', GeomFromText('POINT(38 156)')),
+('f', 'b', 'v', GeomFromText('POINT(29 186)')),
+('v', 'e', 'r', GeomFromText('POINT(149 40)')),
+('v', 't', 'm', GeomFromText('POINT(184 24)')),
+('y', 'g', 'a', GeomFromText('POINT(219 105)')),
+('s', 'f', 'i', GeomFromText('POINT(114 130)')),
+('e', 'q', 'h', GeomFromText('POINT(203 135)')),
+('h', 'g', 'b', GeomFromText('POINT(9 208)')),
+('o', 'l', 'r', GeomFromText('POINT(245 79)')),
+('s', 's', 'v', GeomFromText('POINT(238 198)')),
+('w', 'w', 'z', GeomFromText('POINT(209 232)')),
+('v', 'd', 'n', GeomFromText('POINT(30 193)')),
+('q', 'w', 'k', GeomFromText('POINT(133 18)')),
+('o', 'h', 'o', GeomFromText('POINT(42 140)')),
+('f', 'f', 'h', GeomFromText('POINT(145 1)')),
+('u', 's', 'r', GeomFromText('POINT(70 62)')),
+('x', 'n', 'q', GeomFromText('POINT(33 86)')),
+('u', 'p', 'v', GeomFromText('POINT(232 220)')),
+('z', 'e', 'a', GeomFromText('POINT(130 69)')),
+('r', 'u', 'z', GeomFromText('POINT(243 241)')),
+('b', 'n', 't', GeomFromText('POINT(120 12)')),
+('u', 'f', 's', GeomFromText('POINT(190 212)')),
+('a', 'd', 'q', GeomFromText('POINT(235 191)')),
+('f', 'q', 'm', GeomFromText('POINT(176 2)')),
+('n', 'c', 's', GeomFromText('POINT(218 163)')),
+('e', 'm', 'h', GeomFromText('POINT(163 108)')),
+('c', 'f', 'l', GeomFromText('POINT(220 115)')),
+('c', 'v', 'q', GeomFromText('POINT(66 45)')),
+('w', 'v', 'x', GeomFromText('POINT(251 220)')),
+('f', 'w', 'z', GeomFromText('POINT(146 149)')),
+('h', 'n', 'h', GeomFromText('POINT(148 128)')),
+('y', 'k', 'v', GeomFromText('POINT(28 110)')),
+('c', 'x', 'q', GeomFromText('POINT(13 13)')),
+('e', 'd', 's', GeomFromText('POINT(91 190)')),
+('c', 'w', 'c', GeomFromText('POINT(10 231)')),
+('u', 'j', 'n', GeomFromText('POINT(250 21)')),
+('w', 'n', 'x', GeomFromText('POINT(141 69)')),
+('f', 'p', 'y', GeomFromText('POINT(228 246)')),
+('d', 'q', 'f', GeomFromText('POINT(194 22)')),
+('d', 'z', 'l', GeomFromText('POINT(233 181)')),
+('c', 'a', 'q', GeomFromText('POINT(183 96)')),
+('m', 'i', 'd', GeomFromText('POINT(117 226)')),
+('z', 'y', 'y', GeomFromText('POINT(62 81)')),
+('g', 'v', 'm', GeomFromText('POINT(66 158)'));
+SET @@RAND_SEED1=481064922, @@RAND_SEED2=438133497;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=280535103, @@RAND_SEED2=444518646;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=1072017234, @@RAND_SEED2=484203885;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=358851897, @@RAND_SEED2=358495224;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=509031459, @@RAND_SEED2=675962925;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+UPDATE t1 set spatial_point=GeomFromText('POINT(61 203)') where c1 like 'y%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(202 194)') where c1 like 'f%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(228 18)') where c1 like 'h%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(88 18)') where c1 like 'l%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(176 94)') where c1 like 'e%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(44 47)') where c1 like 'g%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(95 191)') where c1 like 'b%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(179 218)') where c1 like 'y%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(239 40)') where c1 like 'g%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(248 41)') where c1 like 'q%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(167 82)') where c1 like 't%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(13 104)') where c1 like 'u%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(139 84)') where c1 like 'a%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(145 108)') where c1 like 'p%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(147 57)') where c1 like 't%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(217 144)') where c1 like 'n%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(160 224)') where c1 like 'w%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(38 28)') where c1 like 'j%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(104 114)') where c1 like 'q%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(88 19)') where c1 like 'c%';
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+('f', 'x', 'p', GeomFromText('POINT(92 181)')),
+('s', 'i', 'c', GeomFromText('POINT(49 60)')),
+('c', 'c', 'i', GeomFromText('POINT(7 57)')),
+('n', 'g', 'k', GeomFromText('POINT(252 105)')),
+('g', 'b', 'm', GeomFromText('POINT(180 11)')),
+('u', 'l', 'r', GeomFromText('POINT(32 90)')),
+('c', 'x', 'e', GeomFromText('POINT(143 24)')),
+('x', 'u', 'a', GeomFromText('POINT(123 92)')),
+('s', 'b', 'h', GeomFromText('POINT(190 108)')),
+('c', 'x', 'b', GeomFromText('POINT(104 100)')),
+('i', 'd', 't', GeomFromText('POINT(214 104)')),
+('r', 'w', 'g', GeomFromText('POINT(29 67)')),
+('b', 'f', 'g', GeomFromText('POINT(149 46)')),
+('r', 'r', 'd', GeomFromText('POINT(242 196)')),
+('j', 'l', 'a', GeomFromText('POINT(90 196)')),
+('e', 't', 'b', GeomFromText('POINT(190 64)')),
+('l', 'x', 'w', GeomFromText('POINT(250 73)')),
+('q', 'y', 'r', GeomFromText('POINT(120 182)')),
+('s', 'j', 'a', GeomFromText('POINT(180 175)')),
+('n', 'i', 'y', GeomFromText('POINT(124 136)')),
+('s', 'x', 's', GeomFromText('POINT(176 209)')),
+('u', 'f', 's', GeomFromText('POINT(215 173)')),
+('m', 'j', 'x', GeomFromText('POINT(44 140)')),
+('v', 'g', 'x', GeomFromText('POINT(177 233)')),
+('u', 't', 'b', GeomFromText('POINT(136 197)')),
+('f', 'g', 'b', GeomFromText('POINT(10 8)')),
+('v', 'c', 'j', GeomFromText('POINT(13 81)')),
+('d', 's', 'q', GeomFromText('POINT(200 100)')),
+('a', 'p', 'j', GeomFromText('POINT(33 40)')),
+('i', 'c', 'g', GeomFromText('POINT(168 204)')),
+('k', 'h', 'i', GeomFromText('POINT(93 243)')),
+('s', 'b', 's', GeomFromText('POINT(157 13)')),
+('v', 'l', 'l', GeomFromText('POINT(103 6)')),
+('r', 'b', 'k', GeomFromText('POINT(244 137)')),
+('l', 'd', 'r', GeomFromText('POINT(162 254)')),
+('q', 'b', 'z', GeomFromText('POINT(136 246)')),
+('x', 'x', 'p', GeomFromText('POINT(120 37)')),
+('m', 'e', 'z', GeomFromText('POINT(203 167)')),
+('q', 'n', 'p', GeomFromText('POINT(94 119)')),
+('b', 'g', 'u', GeomFromText('POINT(93 248)')),
+('r', 'v', 'v', GeomFromText('POINT(53 88)')),
+('y', 'a', 'i', GeomFromText('POINT(98 219)')),
+('a', 's', 'g', GeomFromText('POINT(173 138)')),
+('c', 'a', 't', GeomFromText('POINT(235 135)')),
+('q', 'm', 'd', GeomFromText('POINT(224 208)')),
+('e', 'p', 'k', GeomFromText('POINT(161 238)')),
+('n', 'g', 'q', GeomFromText('POINT(35 204)')),
+('t', 't', 'x', GeomFromText('POINT(230 178)')),
+('w', 'f', 'a', GeomFromText('POINT(150 221)')),
+('z', 'm', 'z', GeomFromText('POINT(119 42)')),
+('l', 'j', 's', GeomFromText('POINT(97 96)')),
+('f', 'z', 'x', GeomFromText('POINT(208 65)')),
+('i', 'v', 'c', GeomFromText('POINT(145 79)')),
+('l', 'f', 'k', GeomFromText('POINT(83 234)')),
+('u', 'a', 's', GeomFromText('POINT(250 49)')),
+('o', 'k', 'p', GeomFromText('POINT(46 50)')),
+('d', 'e', 'z', GeomFromText('POINT(30 198)')),
+('r', 'r', 'l', GeomFromText('POINT(78 189)')),
+('y', 'l', 'f', GeomFromText('POINT(188 132)')),
+('d', 'q', 'm', GeomFromText('POINT(247 107)')),
+('p', 'j', 'n', GeomFromText('POINT(148 227)')),
+('b', 'o', 'i', GeomFromText('POINT(172 25)')),
+('e', 'v', 'd', GeomFromText('POINT(94 248)')),
+('q', 'd', 'f', GeomFromText('POINT(15 29)')),
+('w', 'b', 'b', GeomFromText('POINT(74 111)')),
+('g', 'q', 'f', GeomFromText('POINT(107 215)')),
+('o', 'h', 'r', GeomFromText('POINT(25 168)')),
+('u', 't', 'w', GeomFromText('POINT(251 188)')),
+('h', 's', 'w', GeomFromText('POINT(254 247)')),
+('f', 'f', 'b', GeomFromText('POINT(166 103)'));
+SET @@RAND_SEED1=866613816, @@RAND_SEED2=92289615;
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+('l', 'c', 'l', GeomFromText('POINT(202 98)')),
+('k', 'c', 'b', GeomFromText('POINT(46 206)')),
+('r', 'y', 'm', GeomFromText('POINT(74 140)')),
+('y', 'z', 'd', GeomFromText('POINT(200 160)')),
+('s', 'y', 's', GeomFromText('POINT(156 205)')),
+('u', 'v', 'p', GeomFromText('POINT(86 82)')),
+('j', 's', 's', GeomFromText('POINT(91 233)')),
+('x', 'j', 'f', GeomFromText('POINT(3 14)')),
+('l', 'z', 'v', GeomFromText('POINT(123 156)')),
+('h', 'i', 'o', GeomFromText('POINT(145 229)')),
+('o', 'r', 'd', GeomFromText('POINT(15 22)')),
+('f', 'x', 't', GeomFromText('POINT(21 60)')),
+('t', 'g', 'h', GeomFromText('POINT(50 153)')),
+('g', 'u', 'b', GeomFromText('POINT(82 85)')),
+('v', 'a', 'p', GeomFromText('POINT(231 178)')),
+('n', 'v', 'o', GeomFromText('POINT(183 25)')),
+('j', 'n', 'm', GeomFromText('POINT(50 144)')),
+('e', 'f', 'i', GeomFromText('POINT(46 16)')),
+('d', 'w', 'a', GeomFromText('POINT(66 6)')),
+('f', 'x', 'a', GeomFromText('POINT(107 197)')),
+('m', 'o', 'a', GeomFromText('POINT(142 80)')),
+('q', 'l', 'g', GeomFromText('POINT(251 23)')),
+('c', 's', 's', GeomFromText('POINT(158 43)')),
+('y', 'd', 'o', GeomFromText('POINT(196 228)')),
+('d', 'p', 'l', GeomFromText('POINT(107 5)')),
+('h', 'a', 'b', GeomFromText('POINT(183 166)')),
+('m', 'w', 'p', GeomFromText('POINT(19 59)')),
+('b', 'y', 'o', GeomFromText('POINT(178 30)')),
+('x', 'w', 'i', GeomFromText('POINT(168 94)')),
+('t', 'k', 'z', GeomFromText('POINT(171 5)')),
+('r', 'm', 'a', GeomFromText('POINT(222 19)')),
+('u', 'v', 'e', GeomFromText('POINT(224 80)')),
+('q', 'r', 'k', GeomFromText('POINT(212 218)')),
+('d', 'p', 'j', GeomFromText('POINT(169 7)')),
+('d', 'r', 'v', GeomFromText('POINT(193 23)')),
+('n', 'y', 'y', GeomFromText('POINT(130 178)')),
+('m', 'z', 'r', GeomFromText('POINT(81 200)')),
+('j', 'e', 'w', GeomFromText('POINT(145 239)')),
+('v', 'h', 'x', GeomFromText('POINT(24 105)')),
+('z', 'm', 'a', GeomFromText('POINT(175 129)')),
+('b', 'c', 'v', GeomFromText('POINT(213 10)')),
+('t', 't', 'u', GeomFromText('POINT(2 129)')),
+('r', 's', 'v', GeomFromText('POINT(209 192)')),
+('x', 'p', 'g', GeomFromText('POINT(43 63)')),
+('t', 'e', 'u', GeomFromText('POINT(139 210)')),
+('l', 'e', 't', GeomFromText('POINT(245 148)')),
+('a', 'i', 'k', GeomFromText('POINT(167 195)')),
+('m', 'o', 'h', GeomFromText('POINT(206 120)')),
+('g', 'z', 's', GeomFromText('POINT(169 240)')),
+('z', 'u', 's', GeomFromText('POINT(202 120)')),
+('i', 'b', 'a', GeomFromText('POINT(216 18)')),
+('w', 'y', 'g', GeomFromText('POINT(119 236)')),
+('h', 'y', 'p', GeomFromText('POINT(161 24)'));
+UPDATE t1 set spatial_point=GeomFromText('POINT(33 100)') where c1 like 't%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%';
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1(foo) VALUES (NULL);
ERROR 23000: Column 'foo' cannot be null
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 6483b12acb0..8f81c7c4b66 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -578,7 +578,7 @@ create table t1 select GeomFromWKB(POINT(1,3));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `GeomFromWKB(POINT(1,3))` geometry NOT NULL DEFAULT ''
+ `GeomFromWKB(POINT(1,3))` geometry DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
@@ -657,7 +657,7 @@ t1 where object_id=85984;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469)
drop table t1;
-create table t1 (fl geometry);
+create table t1 (fl geometry not null);
insert into t1 values (1);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (1.11);
@@ -665,7 +665,7 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (pointfromtext('point(1,1)'));
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR 23000: Column 'fl' cannot be null
drop table t1;
select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))))
@@ -689,6 +689,48 @@ load data infile '../std_data_ln/bad_gis_data.dat' into table t1;
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'b' at row 1
alter table t1 enable keys;
drop table t1;
+create table t1 (a int, b blob);
+insert into t1 values (1, ''), (2, NULL), (3, '1');
+select * from t1;
+a b
+1
+2 NULL
+3 1
+select
+geometryfromtext(b) IS NULL, geometryfromwkb(b) IS NULL, astext(b) IS NULL,
+aswkb(b) IS NULL, geometrytype(b) IS NULL, centroid(b) IS NULL,
+envelope(b) IS NULL, startpoint(b) IS NULL, endpoint(b) IS NULL,
+exteriorring(b) IS NULL, pointn(b, 1) IS NULL, geometryn(b, 1) IS NULL,
+interiorringn(b, 1) IS NULL, multipoint(b) IS NULL, isempty(b) IS NULL,
+issimple(b) IS NULL, isclosed(b) IS NULL, dimension(b) IS NULL,
+numgeometries(b) IS NULL, numinteriorrings(b) IS NULL, numpoints(b) IS NULL,
+area(b) IS NULL, glength(b) IS NULL, srid(b) IS NULL, x(b) IS NULL,
+y(b) IS NULL
+from t1;
+geometryfromtext(b) IS NULL geometryfromwkb(b) IS NULL astext(b) IS NULL aswkb(b) IS NULL geometrytype(b) IS NULL centroid(b) IS NULL envelope(b) IS NULL startpoint(b) IS NULL endpoint(b) IS NULL exteriorring(b) IS NULL pointn(b, 1) IS NULL geometryn(b, 1) IS NULL interiorringn(b, 1) IS NULL multipoint(b) IS NULL isempty(b) IS NULL issimple(b) IS NULL isclosed(b) IS NULL dimension(b) IS NULL numgeometries(b) IS NULL numinteriorrings(b) IS NULL numpoints(b) IS NULL area(b) IS NULL glength(b) IS NULL srid(b) IS NULL x(b) IS NULL y(b) IS NULL
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+select
+within(b, b) IS NULL, contains(b, b) IS NULL, overlaps(b, b) IS NULL,
+equals(b, b) IS NULL, disjoint(b, b) IS NULL, touches(b, b) IS NULL,
+intersects(b, b) IS NULL, crosses(b, b) IS NULL
+from t1;
+within(b, b) IS NULL contains(b, b) IS NULL overlaps(b, b) IS NULL equals(b, b) IS NULL disjoint(b, b) IS NULL touches(b, b) IS NULL intersects(b, b) IS NULL crosses(b, b) IS NULL
+1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1
+select
+point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS NULL,
+multilinestring(b) IS NULL, multipolygon(b) IS NULL,
+geometrycollection(b) IS NULL
+from t1;
+point(b, b) IS NULL linestring(b) IS NULL polygon(b) IS NULL multipoint(b) IS NULL multilinestring(b) IS NULL multipolygon(b) IS NULL geometrycollection(b) IS NULL
+0 1 1 1 1 1 1
+1 1 1 1 1 1 1
+0 1 1 1 1 1 1
+drop table t1;
+End of 4.1 tests
create table t1 (s1 geometry not null,s2 char(100));
create trigger t1_bu before update on t1 for each row set new.s1 = null;
insert into t1 values (null,null);
@@ -716,7 +758,7 @@ drop table t1;
create table t1 select GeomFromText('point(1 1)');
desc t1;
Field Type Null Key Default Extra
-GeomFromText('point(1 1)') geometry NO
+GeomFromText('point(1 1)') geometry YES NULL
drop table t1;
create table t1 (g geometry not null);
insert into t1 values(default);
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index d583eb02aeb..5cff5fec7ed 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1035,12 +1035,110 @@ HAVING SUM(t1_inner.b)+t1_outer.b > 5);
ERROR 42000: 'test.t1_outer.b' isn't in GROUP BY
DROP TABLE t1;
SET SQL_MODE = '';
-CREATE TABLE t1 (a INT, b INT, KEY(a));
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
-EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
+CREATE TABLE t1 (a INT, b INT,
+PRIMARY KEY (a),
+KEY i2(a,b));
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
+INSERT INTO t1 SELECT a + 8,b FROM t1;
+INSERT INTO t1 SELECT a + 16,b FROM t1;
+INSERT INTO t1 SELECT a + 32,b FROM t1;
+INSERT INTO t1 SELECT a + 64,b FROM t1;
+INSERT INTO t1 SELECT a + 128,b FROM t1;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+EXPLAIN SELECT a FROM t1 WHERE a < 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL a 5 NULL 4
-EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
+1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index
+EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
-DROP TABLE t1;
+1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index
+EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index
+EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index; Using filesort
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY)
+IGNORE INDEX FOR GROUP BY (i2) GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index
+EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+EXPLAIN SELECT a FROM t1 FORCE INDEX (i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+EXPLAIN SELECT a FROM t1 USE INDEX ();
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+EXPLAIN SELECT a FROM t1
+FORCE INDEX (PRIMARY)
+IGNORE INDEX FOR GROUP BY (i2)
+IGNORE INDEX FOR ORDER BY (i2)
+USE INDEX (i2);
+ERROR HY000: Incorrect usage of USE INDEX and FORCE INDEX
+EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX ();
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+EXPLAIN SELECT a FROM t1 FORCE INDEX ();
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
+EXPLAIN SELECT a FROM t1 IGNORE INDEX ();
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
+EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2)
+USE INDEX FOR GROUP BY (i2) GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2)
+FORCE INDEX FOR GROUP BY (i2) GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL i2 4 NULL 257 Using index for group-by
+EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX ();
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+EXPLAIN SELECT a FROM t1
+USE INDEX FOR GROUP BY (i2)
+USE INDEX FOR ORDER BY (i2)
+USE INDEX FOR JOIN (i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+EXPLAIN SELECT a FROM t1
+USE INDEX FOR JOIN (i2)
+USE INDEX FOR JOIN (i2)
+USE INDEX FOR JOIN (i2,i2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+EXPLAIN SELECT 1 FROM t1 WHERE a IN
+(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 256 Using where; Using index
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where
+CREATE TABLE t2 (a INT, b INT, KEY(a));
+INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4);
+EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL a 5 NULL 4
+EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
+EXPLAIN SELECT 1 FROM t2 WHERE a IN
+(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/have_openssl.require b/mysql-test/r/have_ssl.require
index dae48a472b5..9bdffdf0c13 100644
--- a/mysql-test/r/have_openssl.require
+++ b/mysql-test/r/have_ssl.require
@@ -1,2 +1,2 @@
Variable_name Value
-have_openssl YES
+have_ssl YES
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 721d17c97a4..149391396b6 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select count(`test`.`t1`.`a`) AS `b` from `test`.`t1` where 0 having (`b` >= 0)
+Note 1003 select count('0') AS `b` from `test`.`t1` where 0 having (`b` >= 0)
drop table t1;
CREATE TABLE t1 (
raw_id int(10) NOT NULL default '0',
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index 29bdfcbef7a..ddf675e2f73 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -731,3 +731,10 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
COUNT(*)
2
DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('', 0);
+ALTER TABLE t1 MODIFY c1 VARCHAR(101);
+SELECT c2 FROM t1;
+c2
+0
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb-ucs2.result b/mysql-test/r/innodb-ucs2.result
new file mode 100644
index 00000000000..a1c73c912b2
--- /dev/null
+++ b/mysql-test/r/innodb-ucs2.result
@@ -0,0 +1,313 @@
+create table t1 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+4 E880BDD0B1E880BD E880BDD0B1E880BD seven
+4 E880BDE880BD E880BDE880BD six
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 05630563 05630563 email
+4 0563 0563 email
+4 05612020 05612020 email
+4 01FC 01FC email
+4 0120 0120 email
+4 00640065 00640065 email
+4 00E400E50068 00E400E50068 email
+4 0000E400 0000E400 email
+4 0000563001FC0563 0000563001FC0563 email
+1 0061006200630064006500660067 0061006200630064006500660067 one
+3 0071007200730074007500760077 0071007200730074007500760077 three
+2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+4 E880BDD0B1E880BD E880BDD0B1E880BD seven
+4 E880BDE880BD E880BDE880BD six
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 05630563 05630563 email
+4 0563 0563 email
+4 05612020 05612020 email
+4 01FC 01FC email
+4 0120 0120 email
+4 00640065 00640065 email
+4 00E400E50068 00E400E50068 email
+4 0000E400 0000E400 email
+4 0000563001FC0563 0000563001FC0563 email
+1 0061006200630064006500660067 0061006200630064006500660067 one
+3 0071007200730074007500760077 0071007200730074007500760077 three
+2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+4 E880BDD0B1E880BD E880BDD0B1E880BD seven
+4 E880BDE880BD E880BDE880BD six
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 0120 0120 email
+4 01FC 01FC email
+4 0563 0563 email
+4 0000563001FC0563 0000563001FC0563 email
+4 0000E400 0000E400 email
+4 00640065 00640065 email
+4 00E400E50068 00E400E50068 email
+4 05612020 05612020 email
+4 05630563 05630563 email
+1 0061006200630064006500660067 0061006200630064006500660067 one
+3 0071007200730074007500760077 0071007200730074007500760077 three
+2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 0000E400 0000E400 email
+4 00640065 00640065 email
+4 00E400E50068 00E400E50068 email
+4 0120 0120 email
+4 01FC 01FC email
+4 05612020 05612020 email
+4 0563 0563 email
+1 61626364656667 61626364656667 one
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+drop table t1;
+drop table t2;
+commit;
+CREATE TABLE t1 (
+ind enum('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind enum('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+hex(ind) hex(string1)
+31
+32
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+hex(ind) hex(string1)
+0031
+0032
+drop table t1,t2;
+CREATE TABLE t1 (
+ind set('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind set('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+hex(ind) hex(string1)
+31
+32
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+hex(ind) hex(string1)
+0031
+0032
+drop table t1,t2;
+CREATE TABLE t1 (
+ind bit not null,
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind bit not null,
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+insert into t1 values(0,''),(1,'');
+insert into t2 values(0,''),(1,'');
+select hex(ind),hex(string1) from t1 order by string1;
+hex(ind) hex(string1)
+0
+1
+select hex(ind),hex(string1) from t2 order by string1;
+hex(ind) hex(string1)
+0
+1
+drop table t1,t2;
+create table t2 (
+a int, b char(10), filler char(10), primary key(a, b(2))
+) character set utf8 engine = innodb;
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+create table t2 (
+a int, b char(10), filler char(10), primary key(a, b(2))
+) character set ucs2 engine = innodb;
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+create table t1(a int not null, b char(110),primary key(a,b(100))) engine=innodb default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+a hex(b)
+1 61626364656667
+2 6465666768696A6B
+6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
+7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
+update t1 set b = 'three' where a = 6;
+drop table t1;
+create table t1(a int not null, b text(110),primary key(a,b(100))) engine=innodb default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+a hex(b)
+1 61626364656667
+2 6465666768696A6B
+6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
+7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
+update t1 set b = 'three' where a = 6;
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 642c9ff2bef..f2d504f555f 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -2666,215 +2666,6 @@ checksum table t1;
Table Checksum
test.t1 2050879373
drop table t1;
-create table t1 (
-a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
-a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-4 E880BDD0B1E880BD E880BDD0B1E880BD seven
-4 E880BDE880BD E880BDE880BD six
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 05630563 05630563 email
-4 0563 0563 email
-4 05612020 05612020 email
-4 01FC 01FC email
-4 0120 0120 email
-4 00640065 00640065 email
-4 00E400E50068 00E400E50068 email
-4 0000E400 0000E400 email
-4 0000563001FC0563 0000563001FC0563 email
-1 0061006200630064006500660067 0061006200630064006500660067 one
-3 0071007200730074007500760077 0071007200730074007500760077 three
-2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
-drop table t1;
-drop table t2;
-create table t1 (
-a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
-a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-4 E880BDD0B1E880BD E880BDD0B1E880BD seven
-4 E880BDE880BD E880BDE880BD six
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 05630563 05630563 email
-4 0563 0563 email
-4 05612020 05612020 email
-4 01FC 01FC email
-4 0120 0120 email
-4 00640065 00640065 email
-4 00E400E50068 00E400E50068 email
-4 0000E400 0000E400 email
-4 0000563001FC0563 0000563001FC0563 email
-1 0061006200630064006500660067 0061006200630064006500660067 one
-3 0071007200730074007500760077 0071007200730074007500760077 three
-2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
-drop table t1;
-drop table t2;
-create table t1 (
-a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
-a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-4 E880BDD0B1E880BD E880BDD0B1E880BD seven
-4 E880BDE880BD E880BDE880BD six
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 0120 0120 email
-4 01FC 01FC email
-4 0563 0563 email
-4 0000563001FC0563 0000563001FC0563 email
-4 0000E400 0000E400 email
-4 00640065 00640065 email
-4 00E400E50068 00E400E50068 email
-4 05612020 05612020 email
-4 05630563 05630563 email
-1 0061006200630064006500660067 0061006200630064006500660067 one
-3 0071007200730074007500760077 0071007200730074007500760077 three
-2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
-drop table t1;
-drop table t2;
-create table t1 (
-a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
-a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 0000E400 0000E400 email
-4 00640065 00640065 email
-4 00E400E50068 00E400E50068 email
-4 0120 0120 email
-4 01FC 01FC email
-4 05612020 05612020 email
-4 0563 0563 email
-1 61626364656667 61626364656667 one
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-drop table t1;
-drop table t2;
-commit;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
@@ -3051,109 +2842,6 @@ select hex(s1) from t2;
hex(s1)
12
drop table t2,t1;
-CREATE TABLE t1 (
-ind enum('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
-ind enum('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-hex(ind) hex(string1)
-31
-32
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-hex(ind) hex(string1)
-0031
-0032
-drop table t1,t2;
-CREATE TABLE t1 (
-ind set('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
-ind set('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-hex(ind) hex(string1)
-31
-32
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-hex(ind) hex(string1)
-0031
-0032
-drop table t1,t2;
-CREATE TABLE t1 (
-ind bit not null,
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
-ind bit not null,
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
-insert into t1 values(0,''),(1,'');
-insert into t2 values(0,''),(1,'');
-select hex(ind),hex(string1) from t1 order by string1;
-hex(ind) hex(string1)
-0
-1
-select hex(ind),hex(string1) from t2 order by string1;
-hex(ind) hex(string1)
-0
-1
-drop table t1,t2;
-create table t2 (
-a int, b char(10), filler char(10), primary key(a, b(2))
-) character set utf8 engine = innodb;
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-create table t2 (
-a int, b char(10), filler char(10), primary key(a, b(2))
-) character set ucs2 engine = innodb;
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-create table t1(a int not null, b char(110),primary key(a,b(100))) engine=innodb default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-a hex(b)
-1 61626364656667
-2 6465666768696A6B
-6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
-7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
-update t1 set b = 'three' where a = 6;
-drop table t1;
-create table t1(a int not null, b text(110),primary key(a,b(100))) engine=innodb default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-a hex(b)
-1 61626364656667
-2 6465666768696A6B
-6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
-7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
-update t1 set b = 'three' where a = 6;
-drop table t1;
CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
CREATE TABLE t2(a INT) ENGINE=InnoDB;
ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result
index e714dbeffc0..a65155909f1 100644
--- a/mysql-test/r/innodb_gis.result
+++ b/mysql-test/r/innodb_gis.result
@@ -450,7 +450,7 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert IGNORE into t1 (a) values ('Garbage');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
-create table t1 (pk integer primary key auto_increment, fl geometry);
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (1.11);
@@ -458,7 +458,7 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR 23000: Column 'fl' cannot be null
drop table t1;
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
ERROR HY000: The used table type doesn't support SPATIAL indexes
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index b039ee49235..2ddd904c5ea 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -383,3 +383,4 @@ id data
7 130
8 140
9 150
+drop table t1;
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index f608e0e7895..c7351258266 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -236,3 +236,25 @@ INSERT INTO t2 VALUES (1), (3);
INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a;
ERROR 42S22: Unknown column 'a' in 'field list'
DROP TABLE t1,t2;
+SET SQL_MODE = 'TRADITIONAL';
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL);
+INSERT INTO t1 (a) VALUES (1);
+ERROR HY000: Field 'b' doesn't have a default value
+INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b;
+ERROR HY000: Field 'b' doesn't have a default value
+INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b;
+ERROR HY000: Field 'b' doesn't have a default value
+SELECT * FROM t1;
+a b
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INT AUTO_INCREMENT PRIMARY KEY,
+f2 VARCHAR(5) NOT NULL UNIQUE);
+INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1);
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+1
+INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1);
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+1
+DROP TABLE t1;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index fbddc6ffeab..0a45aa2eb9b 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -701,7 +701,7 @@ select * from information_schema.statistics join information_schema.columns
using(table_name,column_name) where table_name='user';
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI #
-user User NULL mysql 0 mysql PRIMARY 2 A 5 NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
+user User NULL mysql 0 mysql PRIMARY 2 A 3 NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
drop table t1;
drop table t2;
drop table t3;
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 853b837c46e..e348a387252 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -489,3 +489,44 @@ EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
drop table t1;
+CREATE TABLE t1 (
+a INTEGER auto_increment PRIMARY KEY,
+b INTEGER NOT NULL,
+c INTEGER NOT NULL,
+d CHAR(64)
+);
+CREATE TABLE t2 (
+a INTEGER auto_increment PRIMARY KEY,
+b INTEGER NOT NULL,
+c SMALLINT NOT NULL,
+d DATETIME NOT NULL,
+e SMALLINT NOT NULL,
+f INTEGER NOT NULL,
+g INTEGER NOT NULL,
+h SMALLINT NOT NULL,
+i INTEGER NOT NULL,
+j INTEGER NOT NULL,
+UNIQUE INDEX (b),
+INDEX (b, d, e, f, g, h, i, j, c),
+INDEX (c)
+);
+INSERT INTO t2 VALUES
+(NULL, 1, 254, '1000-01-01 00:00:00', 257, 0, 0, 0, 0, 0),
+(NULL, 2, 1, '2004-11-30 12:00:00', 1, 0, 0, 0, 0, 0),
+(NULL, 3, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -21600, 0),
+(NULL, 4, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -10800, 0),
+(NULL, 5, 1, '2004-11-30 12:00:00', 1, 0, 0, 5, -10800, 0),
+(NULL, 6, 1, '2004-11-30 12:00:00', 102, 0, 0, 0, 0, 0),
+(NULL, 7, 1, '2004-11-30 12:00:00', 105, 2, 0, 0, 0, 0),
+(NULL, 8, 1, '2004-11-30 12:00:00', 105, 10, 0, 0, 0, 0);
+INSERT INTO t1 (b, c, d) VALUES
+(3388000, -553000, NULL),
+(3388000, -553000, NULL);
+SELECT *
+FROM t2 c JOIN t1 pa ON c.b = pa.a
+WHERE c.c = 1
+ORDER BY c.b, c.d
+;
+a b c d e f g h i j a b c d
+2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 481b3de9f02..c8fcdf14ea0 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -148,6 +148,22 @@ select * from t1;
a b c
10 NULL Ten
15 NULL Fifteen
+show variables like "secure_file_pri%";
+Variable_name Value
+secure_file_priv MYSQLTEST_VARDIR/
+select @@secure_file_priv;
+@@secure_file_priv
+MYSQLTEST_VARDIR/
+set @@secure_file_priv= 0;
+ERROR HY000: Variable 'secure_file_priv' is a read only variable
+truncate table t1;
+load data infile 'MYSQL_TEST_DIR/Makefile' into table t1;
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+select * from t1;
+a b c
+select load_file("MYSQL_TEST_DIR/Makefile");
+load_file("MYSQL_TEST_DIR/Makefile")
+NULL
drop table t1, t2;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 0547c5a5bbf..946797aeec7 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -94,8 +94,8 @@ Variable_name Value
log_output FILE,TABLE
set global general_log_file='/not exiting path/log.master';
ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
-set global general_log_file='/tmp';
-ERROR 42000: Variable 'general_log_file' can't be set to the value of '/tmp'
+set global general_log_file='MYSQLTEST_VARDIR';
+ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR'
set global general_log_file='';
ERROR 42000: Variable 'general_log_file' can't be set to the value of ''
show variables like 'general_log_file';
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index c654392f6e1..34f1b76ba05 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -806,6 +806,24 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1);
SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, tm1;
+CREATE TABLE t1(c1 INT) ENGINE=MyISAM;
+CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1);
+INSERT DELAYED INTO t2 VALUES(1);
+ERROR HY000: Table storage engine for 't2' doesn't have this option
+DROP TABLE t1, t2;
+CREATE TABLE t1(c1 VARCHAR(1));
+CREATE TABLE m1 LIKE t1;
+ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
+SELECT * FROM m1;
+c1
+DROP TABLE t1, m1;
+CREATE TABLE t1(c1 VARCHAR(4), c2 TINYINT, c3 TINYINT, c4 TINYINT,
+c5 TINYINT, c6 TINYINT, c7 TINYINT, c8 TINYINT, c9 TINYINT);
+CREATE TABLE m1 LIKE t1;
+ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
+SELECT * FROM m1;
+c1 c2 c3 c4 c5 c6 c7 c8 c9
+DROP TABLE t1, m1;
create table t1 (b bit(1));
create table t2 (b bit(1));
create table tm (b bit(1)) engine = merge union = (t1,t2);
diff --git a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result
index 569eefb34ec..cabc4de8d21 100644
--- a/mysql-test/r/mix2_myisam.result
+++ b/mysql-test/r/mix2_myisam.result
@@ -2058,318 +2058,6 @@ delete t1 from t1,t2 where f1=f3 and f4='cc';
select * from t1;
f1 f2
drop table t1,t2;
-create table t1 (
-a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = MyISAM;
-create table t2 (
-a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = MyISAM;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-4 E880BDD0B1E880BD E880BDD0B1E880BD seven
-4 E880BDE880BD E880BDE880BD six
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 05612020 05612020 email
-4 0000563001FC0563 0000563001FC0563 email
-4 05630563 05630563 email
-4 0563 0563 email
-4 0120 0120 email
-4 01FC 01FC email
-4 00E400E50068 00E400E50068 email
-4 00640065 00640065 email
-4 0000E400 0000E400 email
-1 0061006200630064006500660067 0061006200630064006500660067 one
-3 0071007200730074007500760077 0071007200730074007500760077 three
-2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
-drop table t1;
-drop table t2;
-create table t1 (
-a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = MyISAM;
-create table t2 (
-a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = MyISAM;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-4 E880BDD0B1E880BD E880BDD0B1E880BD seven
-4 E880BDE880BD E880BDE880BD six
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 05612020 05612020 email
-4 0000563001FC0563 0000563001FC0563 email
-4 05630563 05630563 email
-4 0563 0563 email
-4 0120 0120 email
-4 01FC 01FC email
-4 00E400E50068 00E400E50068 email
-4 00640065 00640065 email
-4 0000E400 0000E400 email
-1 0061006200630064006500660067 0061006200630064006500660067 one
-3 0071007200730074007500760077 0071007200730074007500760077 three
-2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
-drop table t1;
-drop table t2;
-create table t1 (
-a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = MyISAM;
-create table t2 (
-a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = MyISAM;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-4 E880BDD0B1E880BD E880BDD0B1E880BD seven
-4 E880BDE880BD E880BDE880BD six
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 0000E400 0000E400 email
-4 00640065 00640065 email
-4 00E400E50068 00E400E50068 email
-4 01FC 01FC email
-4 0120 0120 email
-4 0563 0563 email
-4 05630563 05630563 email
-4 0000563001FC0563 0000563001FC0563 email
-4 05612020 05612020 email
-1 0061006200630064006500660067 0061006200630064006500660067 one
-3 0071007200730074007500760077 0071007200730074007500760077 three
-2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
-drop table t1;
-drop table t2;
-create table t1 (
-a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = MyISAM;
-create table t2 (
-a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = MyISAM;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-a hex(b) hex(c) filler
-1 61626364656667 61626364656667 boo
-4 D0B1 D0B1 eight
-4 5B 5B five
-4 E880BD E880BD four
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-select a,hex(b),hex(c),filler from t2 order by filler;
-a hex(b) hex(c) filler
-4 0000E400 0000E400 email
-4 00640065 00640065 email
-4 00E400E50068 00E400E50068 email
-4 01FC 01FC email
-4 0120 0120 email
-4 0563 0563 email
-4 05612020 05612020 email
-1 61626364656667 61626364656667 one
-3 71727374757677 71727374757677 three
-2 696A6B696C6D6E 696A6B696C6D6E two
-drop table t1;
-drop table t2;
-commit;
-CREATE TABLE t1 (
-ind enum('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
-ind enum('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=MyISAM DEFAULT CHARSET=ucs2;
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-hex(ind) hex(string1)
-31
-32
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-hex(ind) hex(string1)
-0031
-0032
-drop table t1,t2;
-CREATE TABLE t1 (
-ind set('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
-ind set('0','1','2') NOT NULL default '0',
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=MyISAM DEFAULT CHARSET=ucs2;
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-hex(ind) hex(string1)
-31
-32
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-hex(ind) hex(string1)
-0031
-0032
-drop table t1,t2;
-CREATE TABLE t1 (
-ind bit not null,
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
-ind bit not null,
-string1 varchar(250) NOT NULL,
-PRIMARY KEY (ind)
-) ENGINE=MyISAM DEFAULT CHARSET=ucs2;
-insert into t1 values(0,''),(1,'');
-insert into t2 values(0,''),(1,'');
-select hex(ind),hex(string1) from t1 order by string1;
-hex(ind) hex(string1)
-0
-1
-select hex(ind),hex(string1) from t2 order by string1;
-hex(ind) hex(string1)
-0
-1
-drop table t1,t2;
-create table t2 (
-a int, b char(10), filler char(10), primary key(a, b(2))
-) character set utf8 engine = MyISAM;
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-create table t2 (
-a int, b char(10), filler char(10), primary key(a, b(2))
-) character set ucs2 engine = MyISAM;
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-create table t1(a int not null, b char(110),primary key(a,b(100))) engine=MyISAM default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-a hex(b)
-1 61626364656667
-2 6465666768696A6B
-6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
-7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
-update t1 set b = 'three' where a = 6;
-drop table t1;
-create table t1(a int not null, b text(110),primary key(a,b(100))) engine=MyISAM default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-a hex(b)
-1 61626364656667
-2 6465666768696A6B
-6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
-7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
-update t1 set b = 'three' where a = 6;
-drop table t1;
create table t1(a int not null, b int, c int, d int, primary key(a)) engine=MyISAM;
insert into t1(a) values (1),(2),(3);
commit;
diff --git a/mysql-test/r/mix2_myisam_ucs2.result b/mysql-test/r/mix2_myisam_ucs2.result
new file mode 100644
index 00000000000..830d3b87eb5
--- /dev/null
+++ b/mysql-test/r/mix2_myisam_ucs2.result
@@ -0,0 +1,312 @@
+create table t1 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = MyISAM;
+create table t2 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = MyISAM;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+4 E880BDD0B1E880BD E880BDD0B1E880BD seven
+4 E880BDE880BD E880BDE880BD six
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 05612020 05612020 email
+4 0000563001FC0563 0000563001FC0563 email
+4 05630563 05630563 email
+4 0563 0563 email
+4 0120 0120 email
+4 01FC 01FC email
+4 00E400E50068 00E400E50068 email
+4 00640065 00640065 email
+4 0000E400 0000E400 email
+1 0061006200630064006500660067 0061006200630064006500660067 one
+3 0071007200730074007500760077 0071007200730074007500760077 three
+2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = MyISAM;
+create table t2 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = MyISAM;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+4 E880BDD0B1E880BD E880BDD0B1E880BD seven
+4 E880BDE880BD E880BDE880BD six
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 05612020 05612020 email
+4 0000563001FC0563 0000563001FC0563 email
+4 05630563 05630563 email
+4 0563 0563 email
+4 0120 0120 email
+4 01FC 01FC email
+4 00E400E50068 00E400E50068 email
+4 00640065 00640065 email
+4 0000E400 0000E400 email
+1 0061006200630064006500660067 0061006200630064006500660067 one
+3 0071007200730074007500760077 0071007200730074007500760077 three
+2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = MyISAM;
+create table t2 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = MyISAM;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+4 E880BDD0B1E880BD E880BDD0B1E880BD seven
+4 E880BDE880BD E880BDE880BD six
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 0000E400 0000E400 email
+4 00640065 00640065 email
+4 00E400E50068 00E400E50068 email
+4 01FC 01FC email
+4 0120 0120 email
+4 0563 0563 email
+4 05630563 05630563 email
+4 0000563001FC0563 0000563001FC0563 email
+4 05612020 05612020 email
+1 0061006200630064006500660067 0061006200630064006500660067 one
+3 0071007200730074007500760077 0071007200730074007500760077 three
+2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = MyISAM;
+create table t2 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = MyISAM;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a hex(b) hex(c) filler
+1 61626364656667 61626364656667 boo
+4 D0B1 D0B1 eight
+4 5B 5B five
+4 E880BD E880BD four
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a hex(b) hex(c) filler
+4 0000E400 0000E400 email
+4 00640065 00640065 email
+4 00E400E50068 00E400E50068 email
+4 01FC 01FC email
+4 0120 0120 email
+4 0563 0563 email
+4 05612020 05612020 email
+1 61626364656667 61626364656667 one
+3 71727374757677 71727374757677 three
+2 696A6B696C6D6E 696A6B696C6D6E two
+drop table t1;
+drop table t2;
+commit;
+CREATE TABLE t1 (
+ind enum('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind enum('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=MyISAM DEFAULT CHARSET=ucs2;
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+hex(ind) hex(string1)
+31
+32
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+hex(ind) hex(string1)
+0031
+0032
+drop table t1,t2;
+CREATE TABLE t1 (
+ind set('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind set('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=MyISAM DEFAULT CHARSET=ucs2;
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+hex(ind) hex(string1)
+31
+32
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+hex(ind) hex(string1)
+0031
+0032
+drop table t1,t2;
+CREATE TABLE t1 (
+ind bit not null,
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind bit not null,
+string1 varchar(250) NOT NULL,
+PRIMARY KEY (ind)
+) ENGINE=MyISAM DEFAULT CHARSET=ucs2;
+insert into t1 values(0,''),(1,'');
+insert into t2 values(0,''),(1,'');
+select hex(ind),hex(string1) from t1 order by string1;
+hex(ind) hex(string1)
+0
+1
+select hex(ind),hex(string1) from t2 order by string1;
+hex(ind) hex(string1)
+0
+1
+drop table t1,t2;
+create table t2 (
+a int, b char(10), filler char(10), primary key(a, b(2))
+) character set utf8 engine = MyISAM;
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+create table t2 (
+a int, b char(10), filler char(10), primary key(a, b(2))
+) character set ucs2 engine = MyISAM;
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+create table t1(a int not null, b char(110),primary key(a,b(100))) engine=MyISAM default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+a hex(b)
+1 61626364656667
+2 6465666768696A6B
+6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
+7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
+update t1 set b = 'three' where a = 6;
+drop table t1;
+create table t1(a int not null, b text(110),primary key(a,b(100))) engine=MyISAM default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+a hex(b)
+1 61626364656667
+2 6465666768696A6B
+6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
+7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
+update t1 set b = 'three' where a = 6;
+drop table t1;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 3bba1944c52..e83bbe97eaa 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -61,16 +61,6 @@ database()
test
unlock tables;
drop table t1;
-ƒ\
-ƒ\
-c_cp932
-ƒ\
-ƒ\
-ƒ\
-ソ
-ソ
-ƒ\
-ƒ\
+----------------------+------------+--------+
| concat('>',col1,'<') | col2 | col3 |
+----------------------+------------+--------+
diff --git a/mysql-test/r/mysql_cp932.result b/mysql-test/r/mysql_cp932.result
new file mode 100644
index 00000000000..e15c97720cd
--- /dev/null
+++ b/mysql-test/r/mysql_cp932.result
@@ -0,0 +1,10 @@
+ƒ\
+ƒ\
+c_cp932
+ƒ\
+ƒ\
+ƒ\
+ソ
+ソ
+ƒ\
+ƒ\
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index a65020754be..e24580632c9 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -1,3 +1,133 @@
Run mysql_upgrade once
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.general_log OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.ndb_binlog_index OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.servers OK
+mysql.slow_log OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+@hadGrantPriv:=1
+1
+1
+1
+@hadShowDbPriv:=1
+1
+1
+1
+@hadCreateViewPriv:=1
+1
+1
+1
+@hadCreateRoutinePriv:=1
+1
+1
+1
+@hadCreateUserPriv:=1
+1
+1
+1
+@hadEventPriv :=1
+1
+1
+1
+@hadTriggerPriv :=1
+1
+1
+1
Run it again - should say already completed
+@hadGrantPriv:=1
+1
+1
+1
+@hadShowDbPriv:=1
+1
+1
+1
+@hadCreateViewPriv:=1
+1
+1
+1
+@hadCreateRoutinePriv:=1
+1
+1
+1
+@hadCreateUserPriv:=1
+1
+1
+1
+@hadEventPriv :=1
+1
+1
+1
+@hadTriggerPriv :=1
+1
+1
+1
Force should run it regardless of wheter it's been run before
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.general_log OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.ndb_binlog_index OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.servers OK
+mysql.slow_log OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+@hadGrantPriv:=1
+1
+1
+1
+@hadShowDbPriv:=1
+1
+1
+1
+@hadCreateViewPriv:=1
+1
+1
+1
+@hadCreateRoutinePriv:=1
+1
+1
+1
+@hadCreateUserPriv:=1
+1
+1
+1
+@hadEventPriv :=1
+1
+1
+1
+@hadTriggerPriv :=1
+1
+1
+1
diff --git a/mysql-test/r/mysqlbinlog-cp932.result b/mysql-test/r/mysqlbinlog-cp932.result
new file mode 100644
index 00000000000..1640a3b1642
--- /dev/null
+++ b/mysql-test/r/mysqlbinlog-cp932.result
@@ -0,0 +1,19 @@
+flush logs;
+create table t3 (f text character set utf8);
+create table t4 (f text character set cp932);
+flush logs;
+rename table t3 to t03, t4 to t04;
+select HEX(f) from t03;
+HEX(f)
+E382BD
+select HEX(f) from t3;
+HEX(f)
+E382BD
+select HEX(f) from t04;
+HEX(f)
+835C
+select HEX(f) from t4;
+HEX(f)
+835C
+drop table t3, t4, t03, t04;
+End of 5.0 tests
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index 73e60f833c7..5a7dcca2420 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -194,24 +194,6 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t1,t2;
flush logs;
-create table t3 (f text character set utf8);
-create table t4 (f text character set cp932);
-flush logs;
-rename table t3 to t03, t4 to t04;
-select HEX(f) from t03;
-HEX(f)
-E382BD
-select HEX(f) from t3;
-HEX(f)
-E382BD
-select HEX(f) from t04;
-HEX(f)
-835C
-select HEX(f) from t4;
-HEX(f)
-835C
-drop table t3,t4,t03,t04;
-flush logs;
flush logs;
select * from t5 /* must be (1),(1) */;
a
@@ -331,4 +313,6 @@ DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+End of 5.0 tests
flush logs;
+End of 5.1 tests
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 21d8336c119..0188fe87bbd 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -210,7 +210,6 @@ source database
"MySQL: The world's most popular ;open source database"
echo message echo message
-mysqltest: At line 1: Empty variable
mysqltest: At line 1: command "false" failed
mysqltest: At line 1: Missing argument in exec
MySQL
@@ -518,8 +517,10 @@ drop table t1;
mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file'
mysqltest: At line 1: Missing required argument 'filename' to command 'write_file'
mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
-mysqltest: At line 1: End of line junk detected: "write_file filename ";
-"
+Some data
+for cat_file command
+of mysqltest
+mysqltest: At line 1: Failed to open file non_existing_file
mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists'
mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file'
mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file'
diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result
index ecdba448f1b..23341ee0216 100644
--- a/mysql-test/r/ndb_gis.result
+++ b/mysql-test/r/ndb_gis.result
@@ -450,7 +450,7 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert IGNORE into t1 (a) values ('Garbage');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
-create table t1 (pk integer primary key auto_increment, fl geometry);
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (1.11);
@@ -458,7 +458,7 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR 23000: Column 'fl' cannot be null
drop table t1;
set engine_condition_pushdown = on;
DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
@@ -912,7 +912,7 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert IGNORE into t1 (a) values ('Garbage');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
-create table t1 (pk integer primary key auto_increment, fl geometry);
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (1.11);
@@ -920,5 +920,5 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR 23000: Column 'fl' cannot be null
drop table t1;
diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result
new file mode 100644
index 00000000000..771a02ecc84
--- /dev/null
+++ b/mysql-test/r/ndb_single_user.result
@@ -0,0 +1,46 @@
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+create table t1 (a int key, b int unique, c int) engine ndb;
+ERROR HY000: Can't create table 'test.t1' (errno: 4007)
+create table t1 (a int key, b int unique, c int) engine ndb;
+insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+create table t2 as select * from t1;
+select * from t1 where a = 1;
+a b c
+1 1 0
+select * from t1 where b = 4;
+a b c
+4 4 0
+select * from t1 where a > 4 order by a;
+a b c
+5 5 0
+6 6 0
+7 7 0
+8 8 0
+9 9 0
+10 10 0
+update t1 set b=102 where a = 2;
+update t1 set b=103 where b = 3;
+update t1 set b=b+100;
+update t1 set b=b+100 where a > 7;
+delete from t1;
+insert into t1 select * from t2;
+drop table t1;
+ERROR 42S02: Unknown table 't1'
+create index new_index on t1 (c);
+ERROR 42S02: Table 'test.t1' doesn't exist
+insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+ERROR 42S02: Table 'test.t1' doesn't exist
+select * from t1 where a = 1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select * from t1 where b = 4;
+ERROR 42S02: Table 'test.t1' doesn't exist
+update t1 set b=102 where a = 2;
+ERROR 42S02: Table 'test.t1' doesn't exist
+update t1 set b=103 where b = 3;
+ERROR 42S02: Table 'test.t1' doesn't exist
+update t1 set b=b+100;
+ERROR 42S02: Table 'test.t1' doesn't exist
+update t1 set b=b+100 where a > 7;
+ERROR 42S02: Table 'test.t1' doesn't exist
+drop table t1;
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index fd657c93bd7..66499946b63 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -645,3 +645,12 @@ a LENGTH(a) COUNT(*)
NULL NULL 2
DROP VIEW v1;
DROP TABLE t1;
+CREATE TABLE t1 (a int, KEY (a));
+INSERT INTO t1 VALUES (3), (1), (4), (1), (3), (1), (1);
+SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t;
+a SUM(a)
+1 4
+3 6
+4 4
+NULL 14
+DROP TABLE t1;
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index a056e1244e6..c7adfb784de 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -874,6 +874,30 @@ num (select num + 2 FROM t1 LIMIT 1)
SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
ERROR 42S22: Unknown column 'num' in 'on clause'
DROP TABLE t1;
+CREATE TABLE bug25126 (
+val int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
+);
+UPDATE bug25126 SET MissingCol = MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'field list'
+UPDATE bug25126 SET val = val ORDER BY MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+UPDATE bug25126 SET val = val ORDER BY val;
+UPDATE bug25126 SET val = 1 ORDER BY val;
+UPDATE bug25126 SET val = 1 ORDER BY MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+UPDATE bug25126 SET val = 1 ORDER BY val, MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+UPDATE bug25126 SET val = MissingCol ORDER BY MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+UPDATE bug25126 SET MissingCol = 1 ORDER BY val, MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+UPDATE bug25126 SET MissingCol = 1 ORDER BY MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+UPDATE bug25126 SET MissingCol = val ORDER BY MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+UPDATE bug25126 SET MissingCol = MissingCol ORDER BY MissingCol;
+ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+DROP TABLE bug25126;
CREATE TABLE t1 (a int);
SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1;
val val1
@@ -926,6 +950,36 @@ NULL
2
3
DROP TABLE t1,t2,t3,t4;
+create table t1 (a int, b int, c int);
+insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9);
+select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc;
+a ratio
+1 0.5000
+19 1.3333
+9 2.6667
+drop table t1;
+CREATE TABLE t1 (a INT UNSIGNED NOT NULL, b TIME);
+INSERT INTO t1 (a) VALUES (100000), (0), (100), (1000000),(10000), (1000), (10);
+UPDATE t1 SET b = SEC_TO_TIME(a);
+SELECT a, b FROM t1 ORDER BY b DESC;
+a b
+1000000 277:46:40
+100000 27:46:40
+10000 02:46:40
+1000 00:16:40
+100 00:01:40
+10 00:00:10
+0 00:00:00
+SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC;
+a b
+1000000 277:46:40
+100000 27:46:40
+10000 02:46:40
+1000 00:16:40
+100 00:01:40
+10 00:00:10
+0 00:00:00
+DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE KEY b (b));
INSERT INTO t1 VALUES (1,1),(2,2);
CREATE TABLE t2 (a INT, b INT, KEY a (a,b));
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
index 040dff576f8..023c4ea205f 100644
--- a/mysql-test/r/outfile.result
+++ b/mysql-test/r/outfile.result
Binary files differ
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 2bfd6d31ac9..af7a762c5a8 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -3046,25 +3046,25 @@ test_sequence
-- select .. where date/time column = .. --
set @arg00= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01' ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01'" ;
execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
@@ -3078,7 +3078,7 @@ c17= CAST('1991-01-01 01:01:01' as datetime) ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
@@ -3092,7 +3092,7 @@ execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 607a0426bd7..8c0b9f1e19b 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -3029,25 +3029,25 @@ test_sequence
-- select .. where date/time column = .. --
set @arg00= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01' ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01'" ;
execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
@@ -3061,7 +3061,7 @@ c17= CAST('1991-01-01 01:01:01' as datetime) ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
@@ -3075,7 +3075,7 @@ execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index f4eec0c610c..7ad6e3ea722 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -3030,25 +3030,25 @@ test_sequence
-- select .. where date/time column = .. --
set @arg00= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01' ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01'" ;
execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
@@ -3062,7 +3062,7 @@ c17= CAST('1991-01-01 01:01:01' as datetime) ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
@@ -3076,7 +3076,7 @@ execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 38e4626d59c..1e2c27e6e4f 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -2966,25 +2966,25 @@ test_sequence
-- select .. where date/time column = .. --
set @arg00= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01' ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01'" ;
execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
@@ -2998,7 +2998,7 @@ c17= CAST('1991-01-01 01:01:01' as datetime) ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
@@ -3012,7 +3012,7 @@ execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
@@ -5980,25 +5980,25 @@ test_sequence
-- select .. where date/time column = .. --
set @arg00= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01' ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01'" ;
execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
@@ -6012,7 +6012,7 @@ c17= CAST('1991-01-01 01:01:01' as datetime) ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
@@ -6026,7 +6026,7 @@ execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index 432a07df9d0..e43f6b4ed6c 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -3029,25 +3029,25 @@ test_sequence
-- select .. where date/time column = .. --
set @arg00= '1991-01-01 01:01:01' ;
select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01' ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
c17= '1991-01-01 01:01:01'" ;
execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
@@ -3061,7 +3061,7 @@ c17= CAST('1991-01-01 01:01:01' as datetime) ;
found
true
select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
found
true
@@ -3075,7 +3075,7 @@ execute stmt1 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
found
true
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 657f1387136..866701d2204 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -624,7 +624,7 @@ word
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-load data infile 'TEST_DIR/std_data/words.dat' into table t1;
+load data infile 'MYSQLTEST_VARDIR/std_data_ln/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result
index 66db8c24bb2..543af3b9abe 100644
--- a/mysql-test/r/rpl_ndb_log.result
+++ b/mysql-test/r/rpl_ndb_log.result
@@ -139,9 +139,9 @@ set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
select * from t1;
a b
1 1
diff --git a/mysql-test/r/rpl_read_only.result b/mysql-test/r/rpl_read_only.result
index 0b06a3d414a..6b1404b4f68 100644
--- a/mysql-test/r/rpl_read_only.result
+++ b/mysql-test/r/rpl_read_only.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+create user test;
create table t1(a int) engine=InnoDB;
create table t2(a int) engine=MyISAM;
insert into t1 values(1001);
@@ -109,5 +110,7 @@ insert into t1 values(1006);
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2006);
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+drop user test;
drop table t1;
drop table t2;
+set global read_only=0;
diff --git a/mysql-test/r/rpl_row_NOW.result b/mysql-test/r/rpl_row_NOW.result
index ed045efa7af..23f95878608 100644
--- a/mysql-test/r/rpl_row_NOW.result
+++ b/mysql-test/r/rpl_row_NOW.result
@@ -26,3 +26,4 @@ END|
INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
+DROP DATABASE mysqltest1;
diff --git a/mysql-test/r/rpl_row_USER.result b/mysql-test/r/rpl_row_USER.result
index c061ccbdc62..98755fb4653 100644
--- a/mysql-test/r/rpl_row_USER.result
+++ b/mysql-test/r/rpl_row_USER.result
@@ -22,15 +22,17 @@ CALL mysqltest1.p1();
SELECT * FROM mysqltest1.t1 ORDER BY a;
a users
1 tester@localhost
-2 @localhost
+2 @localhost%
3 tester@localhost
-4 @localhost
+4 @localhost%
SELECT * FROM mysqltest1.t1 ORDER BY a;
a users
1 tester@localhost
-2 @localhost
+2 @localhost%
3 tester@localhost
-4 @localhost
+4 @localhost%
DROP DATABASE mysqltest1;
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
+DROP USER tester@'%';
+DROP USER ''@'localhost%';
diff --git a/mysql-test/r/rpl_row_basic_11bugs.result b/mysql-test/r/rpl_row_basic_11bugs.result
index 8af2e8639aa..6f7bd6e3f85 100644
--- a/mysql-test/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/r/rpl_row_basic_11bugs.result
@@ -97,6 +97,7 @@ a
7
8
9
+SET GLOBAL QUERY_CACHE_SIZE=0;
================ Test for BUG#22550 ================
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
@@ -118,3 +119,4 @@ HEX(a) b
SELECT HEX(a),b FROM t1;
HEX(a) b
0 2
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_row_func002.result b/mysql-test/r/rpl_row_func002.result
index e65c0a35180..03f5b3115c3 100644
--- a/mysql-test/r/rpl_row_func002.result
+++ b/mysql-test/r/rpl_row_func002.result
@@ -23,3 +23,4 @@ SET TIMESTAMP=333300000;
INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
DROP FUNCTION test.f1;
DROP TABLE test.t1;
+DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result
index 89163e1e37b..c6b85e7b329 100644
--- a/mysql-test/r/rpl_row_log.result
+++ b/mysql-test/r/rpl_row_log.result
@@ -107,9 +107,9 @@ set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
select * from t1;
a b
1 1
diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/r/rpl_row_log_innodb.result
index 3bcd8a6a0fb..bc13047f973 100644
--- a/mysql-test/r/rpl_row_log_innodb.result
+++ b/mysql-test/r/rpl_row_log_innodb.result
@@ -115,9 +115,9 @@ set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
select * from t1;
a b
1 1
diff --git a/mysql-test/r/rpl_row_sp008.result b/mysql-test/r/rpl_row_sp008.result
index 2026ba8a03a..23197964a24 100644
--- a/mysql-test/r/rpl_row_sp008.result
+++ b/mysql-test/r/rpl_row_sp008.result
@@ -31,3 +31,4 @@ a
2
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
diff --git a/mysql-test/r/rpl_row_sp012.result b/mysql-test/r/rpl_row_sp012.result
index 28da1c3208e..b9c818bad9a 100644
--- a/mysql-test/r/rpl_row_sp012.result
+++ b/mysql-test/r/rpl_row_sp012.result
@@ -56,3 +56,4 @@ DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+DROP USER user1@localhost;
diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/r/rpl_row_tabledefs_2myisam.result
index 700163fa3d1..d62650fa142 100644
--- a/mysql-test/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/r/rpl_row_tabledefs_2myisam.result
@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
+SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
@@ -379,3 +380,4 @@ a b x
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/r/rpl_row_tabledefs_3innodb.result
index 29901c51124..0c3bb734e95 100644
--- a/mysql-test/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/r/rpl_row_tabledefs_3innodb.result
@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
+SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
@@ -379,3 +380,4 @@ a b x
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/r/rpl_row_tabledefs_7ndb.result b/mysql-test/r/rpl_row_tabledefs_7ndb.result
index 0d0da3b6185..5876a0e1b65 100644
--- a/mysql-test/r/rpl_row_tabledefs_7ndb.result
+++ b/mysql-test/r/rpl_row_tabledefs_7ndb.result
@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
+SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='NDB';
@@ -284,3 +285,4 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
+SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/r/rpl_row_view01.result b/mysql-test/r/rpl_row_view01.result
index 0006ec99f5e..a4b8d0a05e3 100644
--- a/mysql-test/r/rpl_row_view01.result
+++ b/mysql-test/r/rpl_row_view01.result
@@ -98,3 +98,4 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
+DROP DATABASE mysqltest1;
diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result
index 641a65f5ed7..c7a5d32ddd7 100644
--- a/mysql-test/r/rpl_slave_status.result
+++ b/mysql-test/r/rpl_slave_status.result
@@ -53,4 +53,5 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master NULL
drop table t1;
+delete from mysql.user where user='rpl';
drop table t1;
diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result
new file mode 100644
index 00000000000..33deb9a8c92
--- /dev/null
+++ b/mysql-test/r/rpl_ssl.result
@@ -0,0 +1,93 @@
+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;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+stop slave;
+change master to
+master_user='replssl',
+master_password='',
+master_ssl=1,
+master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem',
+master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem',
+master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
+start slave;
+insert into t1 values(1);
+select * from t1;
+t
+1
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User replssl
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed Yes
+Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
+Master_SSL_CA_Path
+Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
+Master_SSL_Cipher
+Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
+Seconds_Behind_Master #
+STOP SLAVE;
+select * from t1;
+t
+1
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User replssl
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed Yes
+Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
+Master_SSL_CA_Path
+Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
+Master_SSL_Cipher
+Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
+Seconds_Behind_Master #
diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result
index e0b1aa12c9b..496685981aa 100644
--- a/mysql-test/r/rpl_stm_log.result
+++ b/mysql-test/r/rpl_stm_log.result
@@ -105,10 +105,10 @@ set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Intvar 2 # LAST_INSERT_ID=1
-slave-bin.000001 # Intvar 2 # INSERT_ID=5
-slave-bin.000001 # Query 2 # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id())
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Intvar 1 # LAST_INSERT_ID=1
+master-bin.000001 # Intvar 1 # INSERT_ID=5
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id())
select * from t1;
a b
1 1
diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/r/rpl_switch_stm_row_mixed.result
index 48b228550a7..fe0d986eba6 100644
--- a/mysql-test/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/r/rpl_switch_stm_row_mixed.result
@@ -7,6 +7,7 @@ start slave;
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
+set @my_binlog_format= @@global.binlog_format;
set session binlog_format=mixed;
show session variables like "binlog_format%";
Variable_name Value
@@ -1025,3 +1026,4 @@ master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t12 (data LONG)
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
drop database mysqltest1;
+set global binlog_format =@my_binlog_format;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index e9fda0c2ad6..f88f046f0ac 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3933,4 +3933,42 @@ cc cc 7
aa aa 2
aa aa 2
DROP TABLE t1,t2;
+CREATE TABLE t1 (
+access_id int NOT NULL default '0',
+name varchar(20) default NULL,
+rank int NOT NULL default '0',
+KEY idx (access_id)
+);
+CREATE TABLE t2 (
+faq_group_id int NOT NULL default '0',
+faq_id int NOT NULL default '0',
+access_id int default NULL,
+UNIQUE KEY idx1 (faq_id),
+KEY idx2 (faq_group_id,faq_id)
+);
+INSERT INTO t1 VALUES
+(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4);
+INSERT INTO t2 VALUES
+(261,265,1),(490,494,1);
+SELECT t2.faq_id
+FROM t1 INNER JOIN t2 IGNORE INDEX (idx1)
+ON (t1.access_id = t2.access_id)
+LEFT JOIN t2 t
+ON (t.faq_group_id = t2.faq_group_id AND
+find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4'))
+WHERE
+t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265);
+faq_id
+265
+SELECT t2.faq_id
+FROM t1 INNER JOIN t2
+ON (t1.access_id = t2.access_id)
+LEFT JOIN t2 t
+ON (t.faq_group_id = t2.faq_group_id AND
+find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4'))
+WHERE
+t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265);
+faq_id
+265
+DROP TABLE t1,t2;
End of 5.0 tests
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index 9efeb56a837..0961ffd734c 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -60,3 +60,15 @@ DROP FUNCTION f2;
DROP FUNCTION f3;
set global event_scheduler=1;
ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED or --skip-grant-tables option so it cannot execute this statement
+select count(*) from information_schema.COLUMN_PRIVILEGES;
+count(*)
+0
+select count(*) from information_schema.SCHEMA_PRIVILEGES;
+count(*)
+0
+select count(*) from information_schema.TABLE_PRIVILEGES;
+count(*)
+0
+select count(*) from information_schema.USER_PRIVILEGES;
+count(*)
+0
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index 7729890ff02..b2fdf6a864e 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -45,7 +45,7 @@ db1_secret
select * from db1_secret.t1;
ERROR 42000: SELECT command denied to user ''@'localhost' for table 't1'
create procedure db1_secret.dummy() begin end;
-ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user ''@'%' to database 'db1_secret'
drop procedure db1_secret.dummy;
ERROR 42000: PROCEDURE db1_secret.dummy does not exist
select * from t1;
@@ -76,9 +76,9 @@ ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
select db1_secret.db();
ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
call db1_secret.stamp(6);
-ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user ''@'%' to database 'db1_secret'
select db1_secret.db();
-ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user ''@'%' to database 'db1_secret'
drop database if exists db2;
create database db2;
use db2;
diff --git a/mysql-test/r/sp-ucs2.result b/mysql-test/r/sp-ucs2.result
new file mode 100644
index 00000000000..ce6be5b0a65
--- /dev/null
+++ b/mysql-test/r/sp-ucs2.result
@@ -0,0 +1,14 @@
+drop function if exists bug17615|
+create table t3 (a varchar(256) unicode)|
+create function bug17615() returns varchar(256) unicode
+begin
+declare tmp_res varchar(256) unicode;
+set tmp_res= 'foo string';
+return tmp_res;
+end|
+insert into t3 values(bug17615())|
+select * from t3|
+a
+foo string
+drop function bug17615|
+drop table t3|
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index ce555b987cd..4abbb35bd6a 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -4718,20 +4718,6 @@ Handler
Inner
drop procedure bug15011|
drop table t3|
-drop function if exists bug17615|
-create table t3 (a varchar(256) unicode)|
-create function bug17615() returns varchar(256) unicode
-begin
-declare tmp_res varchar(256) unicode;
-set tmp_res= 'foo string';
-return tmp_res;
-end|
-insert into t3 values(bug17615())|
-select * from t3|
-a
-foo string
-drop function bug17615|
-drop table t3|
drop procedure if exists bug17476|
create table t3 ( d date )|
insert into t3 values
@@ -5845,6 +5831,7 @@ bug23760_rc_test(ROW_COUNT())
DROP TABLE bug23760, bug23760_log|
DROP PROCEDURE bug23760_update_log|
DROP PROCEDURE bug23760_test_row_count|
+DROP PROCEDURE bug23760_test_row_count2|
DROP FUNCTION bug23760_rc_test|
DROP PROCEDURE IF EXISTS bug24117|
DROP TABLE IF EXISTS t3|
@@ -6061,4 +6048,17 @@ drop procedure proc_26503_ok_1|
drop procedure proc_26503_ok_2|
drop procedure proc_26503_ok_3|
drop procedure proc_26503_ok_4|
+DROP FUNCTION IF EXISTS bug25373|
+CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER
+LANGUAGE SQL DETERMINISTIC
+RETURN p1;|
+CREATE TABLE t3 (f1 INT, f2 FLOAT)|
+INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
+SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
+SUM(f2) bug25373(f1)
+6.3000000715256 1
+15 2
+21.300000071526 NULL
+DROP FUNCTION bug25373|
+DROP TABLE t3|
drop table t1,t2;
diff --git a/mysql-test/r/ssl_des.result b/mysql-test/r/ssl_des.result
deleted file mode 100644
index cd8bf52139e..00000000000
--- a/mysql-test/r/ssl_des.result
+++ /dev/null
@@ -1,2159 +0,0 @@
-SHOW STATUS LIKE 'Ssl_cipher';
-Variable_name Value
-Ssl_cipher DHE-RSA-AES256-SHA
-drop table if exists t1,t2,t3,t4;
-CREATE TABLE t1 (
-Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
-Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
-);
-INSERT INTO t1 VALUES (9410,9412);
-select period from t1;
-period
-9410
-select * from t1;
-Period Varor_period
-9410 9412
-select t1.* from t1;
-Period Varor_period
-9410 9412
-CREATE TABLE t2 (
-auto int not null auto_increment,
-fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
-companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
-fld3 char(30) DEFAULT '' NOT NULL,
-fld4 char(35) DEFAULT '' NOT NULL,
-fld5 char(35) DEFAULT '' NOT NULL,
-fld6 char(4) DEFAULT '' NOT NULL,
-UNIQUE fld1 (fld1),
-KEY fld3 (fld3),
-PRIMARY KEY (auto)
-);
-select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
-fld3
-imaginable
-select fld3 from t2 where fld3 like "%cultivation" ;
-fld3
-cultivation
-select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
-fld3 companynr
-concoct 58
-druggists 58
-engrossing 58
-Eurydice 58
-exclaimers 58
-ferociousness 58
-hopelessness 58
-Huey 58
-imaginable 58
-judges 58
-merging 58
-ostrich 58
-peering 58
-Phelps 58
-presumes 58
-Ruth 58
-sentences 58
-Shylock 58
-straggled 58
-synergy 58
-thanking 58
-tying 58
-unlocks 58
-select fld3,companynr from t2 where companynr = 58 order by fld3;
-fld3 companynr
-concoct 58
-druggists 58
-engrossing 58
-Eurydice 58
-exclaimers 58
-ferociousness 58
-hopelessness 58
-Huey 58
-imaginable 58
-judges 58
-merging 58
-ostrich 58
-peering 58
-Phelps 58
-presumes 58
-Ruth 58
-sentences 58
-Shylock 58
-straggled 58
-synergy 58
-thanking 58
-tying 58
-unlocks 58
-select fld3 from t2 order by fld3 desc limit 10;
-fld3
-youthfulness
-yelped
-Wotan
-workers
-Witt
-witchcraft
-Winsett
-Willy
-willed
-wildcats
-select fld3 from t2 order by fld3 desc limit 5;
-fld3
-youthfulness
-yelped
-Wotan
-workers
-Witt
-select fld3 from t2 order by fld3 desc limit 5,5;
-fld3
-witchcraft
-Winsett
-Willy
-willed
-wildcats
-select t2.fld3 from t2 where fld3 = 'honeysuckle';
-fld3
-honeysuckle
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
-fld3
-honeysuckle
-select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
-fld3
-honeysuckle
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
-fld3
-honeysuckle
-select t2.fld3 from t2 where fld3 LIKE 'h%le';
-fld3
-honeysuckle
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
-fld3
-explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
-explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
-explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
-explain select fld3 from t2 ignore index (fld3,not_used);
-ERROR HY000: Key 'not_used' doesn't exist in table 't2'
-explain select fld3 from t2 use index (not_used);
-ERROR HY000: Key 'not_used' doesn't exist in table 't2'
-select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
-fld3
-honeysuckle
-honoring
-explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index
-select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
-fld1 fld3
-148504 Colombo
-068305 Colombo
-000000 nondecreasing
-select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
-fld1 fld3
-232605 appendixes
-1232605 appendixes
-1232606 appendixes
-1232607 appendixes
-1232608 appendixes
-1232609 appendixes
-select fld1 from t2 where fld1=250501 or fld1="250502";
-fld1
-250501
-250502
-explain select fld1 from t2 where fld1=250501 or fld1="250502";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index
-select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
-fld1
-250501
-250502
-250505
-250601
-explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index
-select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
-fld1 fld3
-218401 faithful
-018007 fanatic
-228311 fated
-018017 featherweight
-218022 feed
-088303 feminine
-058004 Fenton
-038017 fetched
-018054 fetters
-208101 fiftieth
-238007 filial
-013606 fingerings
-218008 finishers
-038205 firearm
-188505 fitting
-202301 Fitzpatrick
-238008 fixedly
-012001 flanking
-018103 flint
-018104 flopping
-188007 flurried
-013602 foldout
-226205 foothill
-232102 forgivably
-228306 forthcoming
-186002 freakish
-208113 freest
-231315 freezes
-036002 funereal
-226209 furnishings
-198006 furthermore
-select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
-fld3
-select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
-fld3
-Chantilly
-select fld1,fld3 from t2 where fld1 like "25050%";
-fld1 fld3
-250501 poisoning
-250502 Iraqis
-250503 heaving
-250504 population
-250505 bomb
-select fld1,fld3 from t2 where fld1 like "25050_";
-fld1 fld3
-250501 poisoning
-250502 Iraqis
-250503 heaving
-250504 population
-250505 bomb
-select distinct companynr from t2;
-companynr
-00
-37
-36
-50
-58
-29
-40
-53
-65
-41
-34
-68
-select distinct companynr from t2 order by companynr;
-companynr
-00
-29
-34
-36
-37
-40
-41
-50
-53
-58
-65
-68
-select distinct companynr from t2 order by companynr desc;
-companynr
-68
-65
-58
-53
-50
-41
-40
-37
-36
-34
-29
-00
-select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
-fld3 period
-obliterates 9410
-offload 9410
-opaquely 9410
-organizer 9410
-overestimating 9410
-overlay 9410
-select distinct fld3 from t2 where companynr = 34 order by fld3;
-fld3
-absentee
-accessed
-ahead
-alphabetic
-Asiaticizations
-attitude
-aye
-bankruptcies
-belays
-Blythe
-bomb
-boulevard
-bulldozes
-cannot
-caressing
-charcoal
-checksumming
-chess
-clubroom
-colorful
-cosy
-creator
-crying
-Darius
-diffusing
-duality
-Eiffel
-Epiphany
-Ernestine
-explorers
-exterminated
-famine
-forked
-Gershwins
-heaving
-Hodges
-Iraqis
-Italianization
-Lagos
-landslide
-libretto
-Majorca
-mastering
-narrowed
-occurred
-offerers
-Palestine
-Peruvianizes
-pharmaceutic
-poisoning
-population
-Pygmalion
-rats
-realest
-recording
-regimented
-retransmitting
-reviver
-rouses
-scars
-sicker
-sleepwalk
-stopped
-sugars
-translatable
-uncles
-unexpected
-uprisings
-versatility
-vest
-select distinct fld3 from t2 limit 10;
-fld3
-abates
-abiding
-Abraham
-abrogating
-absentee
-abut
-accessed
-accruing
-accumulating
-accuracies
-select distinct fld3 from t2 having fld3 like "A%" limit 10;
-fld3
-abates
-abiding
-Abraham
-abrogating
-absentee
-abut
-accessed
-accruing
-accumulating
-accuracies
-select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
-substring(fld3,1,3)
-aba
-abi
-Abr
-abs
-abu
-acc
-acq
-acu
-Ade
-adj
-Adl
-adm
-Ado
-ads
-adv
-aer
-aff
-afi
-afl
-afo
-agi
-ahe
-aim
-air
-Ald
-alg
-ali
-all
-alp
-alr
-ama
-ame
-amm
-ana
-and
-ane
-Ang
-ani
-Ann
-Ant
-api
-app
-aqu
-Ara
-arc
-Arm
-arr
-Art
-Asi
-ask
-asp
-ass
-ast
-att
-aud
-Aug
-aut
-ave
-avo
-awe
-aye
-Azt
-select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
-a
-aba
-abi
-Abr
-abs
-abu
-acc
-acq
-acu
-Ade
-adj
-select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
-substring(fld3,1,3)
-aba
-abi
-Abr
-abs
-abu
-acc
-acq
-acu
-Ade
-adj
-select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
-a
-aba
-abi
-Abr
-abs
-abu
-acc
-acq
-acu
-Ade
-adj
-create table t3 (
-period int not null,
-name char(32) not null,
-companynr int not null,
-price double(11,0),
-price2 double(11,0),
-key (period),
-key (name)
-);
-create temporary table tmp engine = myisam select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-alter table t3 add t2nr int not null auto_increment primary key first;
-drop table tmp;
-SET SQL_BIG_TABLES=1;
-select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
-namn
-Abraham Abraham
-abrogating abrogating
-admonishing admonishing
-Adolph Adolph
-afield afield
-aging aging
-ammonium ammonium
-analyzable analyzable
-animals animals
-animized animized
-SET SQL_BIG_TABLES=0;
-select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
-concat(fld3," ",fld3)
-Abraham Abraham
-abrogating abrogating
-admonishing admonishing
-Adolph Adolph
-afield afield
-aging aging
-ammonium ammonium
-analyzable analyzable
-animals animals
-animized animized
-select distinct fld5 from t2 limit 10;
-fld5
-neat
-Steinberg
-jarring
-tinily
-balled
-persist
-attainments
-fanatic
-measures
-rightfulness
-select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-fld3 count(*)
-affixed 1
-and 1
-annoyers 1
-Anthony 1
-assayed 1
-assurers 1
-attendants 1
-bedlam 1
-bedpost 1
-boasted 1
-SET SQL_BIG_TABLES=1;
-select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-fld3 count(*)
-affixed 1
-and 1
-annoyers 1
-Anthony 1
-assayed 1
-assurers 1
-attendants 1
-bedlam 1
-bedpost 1
-boasted 1
-SET SQL_BIG_TABLES=0;
-select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
-fld3 repeat("a",length(fld3)) count(*)
-circus aaaaaa 1
-cited aaaaa 1
-Colombo aaaaaaa 1
-congresswoman aaaaaaaaaaaaa 1
-contrition aaaaaaaaaa 1
-corny aaaaa 1
-cultivation aaaaaaaaaaa 1
-definiteness aaaaaaaaaaaa 1
-demultiplex aaaaaaaaaaa 1
-disappointing aaaaaaaaaaaaa 1
-select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
-companynr rtrim(space(512+companynr))
-37
-78
-101
-154
-311
-447
-512
-select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
-fld3
-explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
-explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
-explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index period period 4 NULL 41810
-1 SIMPLE t1 ref period period 4 test.t3.period 4181
-explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index period period 4 NULL 41810
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
-select period from t1;
-period
-9410
-select period from t1 where period=1900;
-period
-select fld3,period from t1,t2 where fld1 = 011401 order by period;
-fld3 period
-breaking 9410
-select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
-fld3 period
-breaking 1001
-explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 const fld1 fld1 4 const 1
-1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1
-select fld3,period from t2,t1 where companynr*10 = 37*10;
-fld3 period
-breaking 9410
-Romans 9410
-intercepted 9410
-bewilderingly 9410
-astound 9410
-admonishing 9410
-sumac 9410
-flanking 9410
-combed 9410
-subjective 9410
-scatterbrain 9410
-Eulerian 9410
-Kane 9410
-overlay 9410
-perturb 9410
-goblins 9410
-annihilates 9410
-Wotan 9410
-snatching 9410
-concludes 9410
-laterally 9410
-yelped 9410
-grazing 9410
-Baird 9410
-celery 9410
-misunderstander 9410
-handgun 9410
-foldout 9410
-mystic 9410
-succumbed 9410
-Nabisco 9410
-fingerings 9410
-aging 9410
-afield 9410
-ammonium 9410
-boat 9410
-intelligibility 9410
-Augustine 9410
-teethe 9410
-dreaded 9410
-scholastics 9410
-audiology 9410
-wallet 9410
-parters 9410
-eschew 9410
-quitter 9410
-neat 9410
-Steinberg 9410
-jarring 9410
-tinily 9410
-balled 9410
-persist 9410
-attainments 9410
-fanatic 9410
-measures 9410
-rightfulness 9410
-capably 9410
-impulsive 9410
-starlet 9410
-terminators 9410
-untying 9410
-announces 9410
-featherweight 9410
-pessimist 9410
-daughter 9410
-decliner 9410
-lawgiver 9410
-stated 9410
-readable 9410
-attrition 9410
-cascade 9410
-motors 9410
-interrogate 9410
-pests 9410
-stairway 9410
-dopers 9410
-testicle 9410
-Parsifal 9410
-leavings 9410
-postulation 9410
-squeaking 9410
-contrasted 9410
-leftover 9410
-whiteners 9410
-erases 9410
-Punjab 9410
-Merritt 9410
-Quixotism 9410
-sweetish 9410
-dogging 9410
-scornfully 9410
-bellow 9410
-bills 9410
-cupboard 9410
-sureties 9410
-puddings 9410
-fetters 9410
-bivalves 9410
-incurring 9410
-Adolph 9410
-pithed 9410
-Miles 9410
-trimmings 9410
-tragedies 9410
-skulking 9410
-flint 9410
-flopping 9410
-relaxing 9410
-offload 9410
-suites 9410
-lists 9410
-animized 9410
-multilayer 9410
-standardizes 9410
-Judas 9410
-vacuuming 9410
-dentally 9410
-humanness 9410
-inch 9410
-Weissmuller 9410
-irresponsibly 9410
-luckily 9410
-culled 9410
-medical 9410
-bloodbath 9410
-subschema 9410
-animals 9410
-Micronesia 9410
-repetitions 9410
-Antares 9410
-ventilate 9410
-pityingly 9410
-interdependent 9410
-Graves 9410
-neonatal 9410
-chafe 9410
-honoring 9410
-realtor 9410
-elite 9410
-funereal 9410
-abrogating 9410
-sorters 9410
-Conley 9410
-lectured 9410
-Abraham 9410
-Hawaii 9410
-cage 9410
-hushes 9410
-Simla 9410
-reporters 9410
-Dutchman 9410
-descendants 9410
-groupings 9410
-dissociate 9410
-coexist 9410
-Beebe 9410
-Taoism 9410
-Connally 9410
-fetched 9410
-checkpoints 9410
-rusting 9410
-galling 9410
-obliterates 9410
-traitor 9410
-resumes 9410
-analyzable 9410
-terminator 9410
-gritty 9410
-firearm 9410
-minima 9410
-Selfridge 9410
-disable 9410
-witchcraft 9410
-betroth 9410
-Manhattanize 9410
-imprint 9410
-peeked 9410
-swelling 9410
-interrelationships 9410
-riser 9410
-Gandhian 9410
-peacock 9410
-bee 9410
-kanji 9410
-dental 9410
-scarf 9410
-chasm 9410
-insolence 9410
-syndicate 9410
-alike 9410
-imperial 9410
-convulsion 9410
-railway 9410
-validate 9410
-normalizes 9410
-comprehensive 9410
-chewing 9410
-denizen 9410
-schemer 9410
-chronicle 9410
-Kline 9410
-Anatole 9410
-partridges 9410
-brunch 9410
-recruited 9410
-dimensions 9410
-Chicana 9410
-announced 9410
-praised 9410
-employing 9410
-linear 9410
-quagmire 9410
-western 9410
-relishing 9410
-serving 9410
-scheduling 9410
-lore 9410
-eventful 9410
-arteriole 9410
-disentangle 9410
-cured 9410
-Fenton 9410
-avoidable 9410
-drains 9410
-detectably 9410
-husky 9410
-impelling 9410
-undoes 9410
-evened 9410
-squeezes 9410
-destroyer 9410
-rudeness 9410
-beaner 9410
-boorish 9410
-Everhart 9410
-encompass 9410
-mushrooms 9410
-Alison 9410
-externally 9410
-pellagra 9410
-cult 9410
-creek 9410
-Huffman 9410
-Majorca 9410
-governing 9410
-gadfly 9410
-reassigned 9410
-intentness 9410
-craziness 9410
-psychic 9410
-squabbled 9410
-burlesque 9410
-capped 9410
-extracted 9410
-DiMaggio 9410
-exclamation 9410
-subdirectory 9410
-Gothicism 9410
-feminine 9410
-metaphysically 9410
-sanding 9410
-Miltonism 9410
-freakish 9410
-index 9410
-straight 9410
-flurried 9410
-denotative 9410
-coming 9410
-commencements 9410
-gentleman 9410
-gifted 9410
-Shanghais 9410
-sportswriting 9410
-sloping 9410
-navies 9410
-leaflet 9410
-shooter 9410
-Joplin 9410
-babies 9410
-assails 9410
-admiring 9410
-swaying 9410
-Goldstine 9410
-fitting 9410
-Norwalk 9410
-analogy 9410
-deludes 9410
-cokes 9410
-Clayton 9410
-exhausts 9410
-causality 9410
-sating 9410
-icon 9410
-throttles 9410
-communicants 9410
-dehydrate 9410
-priceless 9410
-publicly 9410
-incidentals 9410
-commonplace 9410
-mumbles 9410
-furthermore 9410
-cautioned 9410
-parametrized 9410
-registration 9410
-sadly 9410
-positioning 9410
-babysitting 9410
-eternal 9410
-hoarder 9410
-congregates 9410
-rains 9410
-workers 9410
-sags 9410
-unplug 9410
-garage 9410
-boulder 9410
-specifics 9410
-Teresa 9410
-Winsett 9410
-convenient 9410
-buckboards 9410
-amenities 9410
-resplendent 9410
-sews 9410
-participated 9410
-Simon 9410
-certificates 9410
-Fitzpatrick 9410
-Evanston 9410
-misted 9410
-textures 9410
-save 9410
-count 9410
-rightful 9410
-chaperone 9410
-Lizzy 9410
-clenched 9410
-effortlessly 9410
-accessed 9410
-beaters 9410
-Hornblower 9410
-vests 9410
-indulgences 9410
-infallibly 9410
-unwilling 9410
-excrete 9410
-spools 9410
-crunches 9410
-overestimating 9410
-ineffective 9410
-humiliation 9410
-sophomore 9410
-star 9410
-rifles 9410
-dialysis 9410
-arriving 9410
-indulge 9410
-clockers 9410
-languages 9410
-Antarctica 9410
-percentage 9410
-ceiling 9410
-specification 9410
-regimented 9410
-ciphers 9410
-pictures 9410
-serpents 9410
-allot 9410
-realized 9410
-mayoral 9410
-opaquely 9410
-hostess 9410
-fiftieth 9410
-incorrectly 9410
-decomposition 9410
-stranglings 9410
-mixture 9410
-electroencephalography 9410
-similarities 9410
-charges 9410
-freest 9410
-Greenberg 9410
-tinting 9410
-expelled 9410
-warm 9410
-smoothed 9410
-deductions 9410
-Romano 9410
-bitterroot 9410
-corset 9410
-securing 9410
-environing 9410
-cute 9410
-Crays 9410
-heiress 9410
-inform 9410
-avenge 9410
-universals 9410
-Kinsey 9410
-ravines 9410
-bestseller 9410
-equilibrium 9410
-extents 9410
-relatively 9410
-pressure 9410
-critiques 9410
-befouled 9410
-rightfully 9410
-mechanizing 9410
-Latinizes 9410
-timesharing 9410
-Aden 9410
-embassies 9410
-males 9410
-shapelessly 9410
-mastering 9410
-Newtonian 9410
-finishers 9410
-abates 9410
-teem 9410
-kiting 9410
-stodgy 9410
-feed 9410
-guitars 9410
-airships 9410
-store 9410
-denounces 9410
-Pyle 9410
-Saxony 9410
-serializations 9410
-Peruvian 9410
-taxonomically 9410
-kingdom 9410
-stint 9410
-Sault 9410
-faithful 9410
-Ganymede 9410
-tidiness 9410
-gainful 9410
-contrary 9410
-Tipperary 9410
-tropics 9410
-theorizers 9410
-renew 9410
-already 9410
-terminal 9410
-Hegelian 9410
-hypothesizer 9410
-warningly 9410
-journalizing 9410
-nested 9410
-Lars 9410
-saplings 9410
-foothill 9410
-labeled 9410
-imperiously 9410
-reporters 9410
-furnishings 9410
-precipitable 9410
-discounts 9410
-excises 9410
-Stalin 9410
-despot 9410
-ripeness 9410
-Arabia 9410
-unruly 9410
-mournfulness 9410
-boom 9410
-slaughter 9410
-Sabine 9410
-handy 9410
-rural 9410
-organizer 9410
-shipyard 9410
-civics 9410
-inaccuracy 9410
-rules 9410
-juveniles 9410
-comprised 9410
-investigations 9410
-stabilizes 9410
-seminaries 9410
-Hunter 9410
-sporty 9410
-test 9410
-weasels 9410
-CERN 9410
-tempering 9410
-afore 9410
-Galatean 9410
-techniques 9410
-error 9410
-veranda 9410
-severely 9410
-Cassites 9410
-forthcoming 9410
-guides 9410
-vanish 9410
-lied 9410
-sawtooth 9410
-fated 9410
-gradually 9410
-widens 9410
-preclude 9410
-evenhandedly 9410
-percentage 9410
-disobedience 9410
-humility 9410
-gleaning 9410
-petted 9410
-bloater 9410
-minion 9410
-marginal 9410
-apiary 9410
-measures 9410
-precaution 9410
-repelled 9410
-primary 9410
-coverings 9410
-Artemia 9410
-navigate 9410
-spatial 9410
-Gurkha 9410
-meanwhile 9410
-Melinda 9410
-Butterfield 9410
-Aldrich 9410
-previewing 9410
-glut 9410
-unaffected 9410
-inmate 9410
-mineral 9410
-impending 9410
-meditation 9410
-ideas 9410
-miniaturizes 9410
-lewdly 9410
-title 9410
-youthfulness 9410
-creak 9410
-Chippewa 9410
-clamored 9410
-freezes 9410
-forgivably 9410
-reduce 9410
-McGovern 9410
-Nazis 9410
-epistle 9410
-socializes 9410
-conceptions 9410
-Kevin 9410
-uncovering 9410
-chews 9410
-appendixes 9410
-appendixes 9410
-appendixes 9410
-appendixes 9410
-appendixes 9410
-appendixes 9410
-raining 9410
-infest 9410
-compartment 9410
-minting 9410
-ducks 9410
-roped 9410
-waltz 9410
-Lillian 9410
-repressions 9410
-chillingly 9410
-noncritical 9410
-lithograph 9410
-spongers 9410
-parenthood 9410
-posed 9410
-instruments 9410
-filial 9410
-fixedly 9410
-relives 9410
-Pandora 9410
-watering 9410
-ungrateful 9410
-secures 9410
-poison 9410
-dusted 9410
-encompasses 9410
-presentation 9410
-Kantian 9410
-select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
-fld3 period price price2
-admonishing 1002 28357832 8723648
-analyzable 1002 28357832 8723648
-annihilates 1001 5987435 234724
-Antares 1002 28357832 8723648
-astound 1001 5987435 234724
-audiology 1001 5987435 234724
-Augustine 1002 28357832 8723648
-Baird 1002 28357832 8723648
-bewilderingly 1001 5987435 234724
-breaking 1001 5987435 234724
-Conley 1001 5987435 234724
-dentally 1002 28357832 8723648
-dissociate 1002 28357832 8723648
-elite 1001 5987435 234724
-eschew 1001 5987435 234724
-Eulerian 1001 5987435 234724
-flanking 1001 5987435 234724
-foldout 1002 28357832 8723648
-funereal 1002 28357832 8723648
-galling 1002 28357832 8723648
-Graves 1001 5987435 234724
-grazing 1001 5987435 234724
-groupings 1001 5987435 234724
-handgun 1001 5987435 234724
-humility 1002 28357832 8723648
-impulsive 1002 28357832 8723648
-inch 1001 5987435 234724
-intelligibility 1001 5987435 234724
-jarring 1001 5987435 234724
-lawgiver 1001 5987435 234724
-lectured 1002 28357832 8723648
-Merritt 1002 28357832 8723648
-neonatal 1001 5987435 234724
-offload 1002 28357832 8723648
-parters 1002 28357832 8723648
-pityingly 1002 28357832 8723648
-puddings 1002 28357832 8723648
-Punjab 1001 5987435 234724
-quitter 1002 28357832 8723648
-realtor 1001 5987435 234724
-relaxing 1001 5987435 234724
-repetitions 1001 5987435 234724
-resumes 1001 5987435 234724
-Romans 1002 28357832 8723648
-rusting 1001 5987435 234724
-scholastics 1001 5987435 234724
-skulking 1002 28357832 8723648
-stated 1002 28357832 8723648
-suites 1002 28357832 8723648
-sureties 1001 5987435 234724
-testicle 1002 28357832 8723648
-tinily 1002 28357832 8723648
-tragedies 1001 5987435 234724
-trimmings 1001 5987435 234724
-vacuuming 1001 5987435 234724
-ventilate 1001 5987435 234724
-wallet 1001 5987435 234724
-Weissmuller 1002 28357832 8723648
-Wotan 1002 28357832 8723648
-select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
-fld1 fld3 period price price2
-018201 relaxing 1001 5987435 234724
-018601 vacuuming 1001 5987435 234724
-018801 inch 1001 5987435 234724
-018811 repetitions 1001 5987435 234724
-create table t4 (
-companynr tinyint(2) unsigned zerofill NOT NULL default '00',
-companyname char(30) NOT NULL default '',
-PRIMARY KEY (companynr),
-UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
-select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
-companynr companyname
-00 Unknown
-29 company 1
-34 company 2
-36 company 3
-37 company 4
-40 company 5
-41 company 6
-50 company 11
-53 company 7
-58 company 8
-65 company 9
-68 company 10
-select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
-companynr companyname
-00 Unknown
-29 company 1
-34 company 2
-36 company 3
-37 company 4
-40 company 5
-41 company 6
-50 company 11
-53 company 7
-58 company 8
-65 company 9
-68 company 10
-select * from t1,t1 t12;
-Period Varor_period Period Varor_period
-9410 9412 9410 9412
-select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
-fld1 fld1
-250501 250501
-250502 250501
-250503 250501
-250504 250501
-250505 250501
-250501 250502
-250502 250502
-250503 250502
-250504 250502
-250505 250502
-250501 250503
-250502 250503
-250503 250503
-250504 250503
-250505 250503
-250501 250504
-250502 250504
-250503 250504
-250504 250504
-250505 250504
-250501 250505
-250502 250505
-250503 250505
-250504 250505
-250505 250505
-insert into t2 (fld1, companynr) values (999999,99);
-select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
-companynr companyname
-99 NULL
-select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
-count(*)
-1199
-explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1200
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists
-select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
-companynr companyname
-select count(*) from t2 left join t4 using (companynr) where companynr is not null;
-count(*)
-1200
-explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-delete from t2 where fld1=999999;
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
-explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
-select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
-companynr companynr
-37 36
-41 40
-explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
-fld1 companynr fld3 period
-038008 37 reporters 1008
-038208 37 Selfridge 1008
-select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
-fld1 companynr fld3 period
-038008 37 reporters 1008
-038208 37 Selfridge 1008
-select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
-fld1 companynr fld3 period
-038008 37 reporters 1008
-038208 37 Selfridge 1008
-select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
-period
-9410
-select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
-period
-9410
-select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
-fld1
-250501
-250502
-250503
-250505
-select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
-fld1
-250502
-250503
-select fld1 from t2 where fld1 between 250502 and 250504;
-fld1
-250502
-250503
-250504
-select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
-fld3
-label
-labeled
-labeled
-landslide
-laterally
-leaflet
-lewdly
-Lillian
-luckily
-select count(*) from t1;
-count(*)
-1
-select companynr,count(*),sum(fld1) from t2 group by companynr;
-companynr count(*) sum(fld1)
-00 82 10355753
-29 95 14473298
-34 70 17788966
-36 215 22786296
-37 588 83602098
-40 37 6618386
-41 52 12816335
-50 11 1595438
-53 4 793210
-58 23 2254293
-65 10 2284055
-68 12 3097288
-select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
-companynr count(*)
-68 12
-65 10
-58 23
-53 4
-50 11
-select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
-count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
-70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
-explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-Warnings:
-Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1''))
-select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
-companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
-00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087
-29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026
-34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
-select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
-companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
-37 1 1 5987435 5987435 5987435 5987435.0000
-37 2 1 28357832 28357832 28357832 28357832.0000
-37 3 1 39654943 39654943 39654943 39654943.0000
-37 11 1 5987435 5987435 5987435 5987435.0000
-37 12 1 28357832 28357832 28357832 28357832.0000
-37 13 1 39654943 39654943 39654943 39654943.0000
-37 21 1 5987435 5987435 5987435 5987435.0000
-37 22 1 28357832 28357832 28357832 28357832.0000
-37 23 1 39654943 39654943 39654943 39654943.0000
-37 31 1 5987435 5987435 5987435 5987435.0000
-select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
-companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
-37 1 1 5987435 5987435 5987435 5987435.0000
-37 2 1 28357832 28357832 28357832 28357832.0000
-37 3 1 39654943 39654943 39654943 39654943.0000
-37 11 1 5987435 5987435 5987435 5987435.0000
-37 12 1 28357832 28357832 28357832 28357832.0000
-37 13 1 39654943 39654943 39654943 39654943.0000
-37 21 1 5987435 5987435 5987435 5987435.0000
-37 22 1 28357832 28357832 28357832 28357832.0000
-37 23 1 39654943 39654943 39654943 39654943.0000
-37 31 1 5987435 5987435 5987435 5987435.0000
-select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
-companynr count(price) sum(price) min(price) max(price) avg(price)
-37 12543 309394878010 5987435 39654943 24666736.6667
-78 8362 414611089292 726498 98439034 49582766.0000
-101 4181 3489454238 834598 834598 834598.0000
-154 4181 4112197254950 983543950 983543950 983543950.0000
-311 4181 979599938 234298 234298 234298.0000
-447 4181 9929180954 2374834 2374834 2374834.0000
-512 4181 3288532102 786542 786542 786542.0000
-select distinct mod(companynr,10) from t4 group by companynr;
-mod(companynr,10)
-0
-9
-4
-6
-7
-1
-3
-8
-5
-select distinct 1 from t4 group by companynr;
-1
-1
-select count(distinct fld1) from t2;
-count(distinct fld1)
-1199
-select companynr,count(distinct fld1) from t2 group by companynr;
-companynr count(distinct fld1)
-00 82
-29 95
-34 70
-36 215
-37 588
-40 37
-41 52
-50 11
-53 4
-58 23
-65 10
-68 12
-select companynr,count(*) from t2 group by companynr;
-companynr count(*)
-00 82
-29 95
-34 70
-36 215
-37 588
-40 37
-41 52
-50 11
-53 4
-58 23
-65 10
-68 12
-select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
-companynr count(distinct concat(fld1,repeat(65,1000)))
-00 82
-29 95
-34 70
-36 215
-37 588
-40 37
-41 52
-50 11
-53 4
-58 23
-65 10
-68 12
-select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
-companynr count(distinct concat(fld1,repeat(65,200)))
-00 82
-29 95
-34 70
-36 215
-37 588
-40 37
-41 52
-50 11
-53 4
-58 23
-65 10
-68 12
-select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
-companynr count(distinct floor(fld1/100))
-00 47
-29 35
-34 14
-36 69
-37 108
-40 16
-41 11
-50 9
-53 1
-58 1
-65 1
-68 1
-select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
-companynr count(distinct concat(repeat(65,1000),floor(fld1/100)))
-00 47
-29 35
-34 14
-36 69
-37 108
-40 16
-41 11
-50 9
-53 1
-58 1
-65 1
-68 1
-select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
-sum(fld1) fld3
-11402 Romans
-select name,count(*) from t3 where name='cloakroom' group by name;
-name count(*)
-cloakroom 4181
-select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
-name count(*)
-cloakroom 4181
-select count(*) from t3 where name='cloakroom' and price2=823742;
-count(*)
-4181
-select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
-name count(*)
-cloakroom 4181
-select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
-name count(*)
-extramarital 4181
-gazer 4181
-gems 4181
-Iranizes 4181
-spates 4181
-tucked 4181
-violinist 4181
-select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
-fld3 count(*)
-spates 4181
-select companynr|0,companyname from t4 group by 1;
-companynr|0 companyname
-0 Unknown
-29 company 1
-34 company 2
-36 company 3
-37 company 4
-40 company 5
-41 company 6
-50 company 11
-53 company 7
-58 company 8
-65 company 9
-68 company 10
-select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
-companynr companyname count(*)
-29 company 1 95
-68 company 10 12
-50 company 11 11
-34 company 2 70
-36 company 3 215
-37 company 4 588
-40 company 5 37
-41 company 6 52
-53 company 7 4
-58 company 8 23
-65 company 9 10
-00 Unknown 82
-select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
-fld1 count(*)
-158402 4181
-select sum(Period)/count(*) from t1;
-sum(Period)/count(*)
-9410.0000
-select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
-companynr count sum diff func
-37 12543 309394878010 0.0000 464091
-78 8362 414611089292 0.0000 652236
-101 4181 3489454238 0.0000 422281
-154 4181 4112197254950 0.0000 643874
-311 4181 979599938 0.0000 1300291
-447 4181 9929180954 0.0000 1868907
-512 4181 3288532102 0.0000 2140672
-select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
-companynr avg
-154 983543950.0000
-select companynr,count(*) from t2 group by companynr order by 2 desc;
-companynr count(*)
-37 588
-36 215
-29 95
-00 82
-34 70
-41 52
-40 37
-58 23
-68 12
-50 11
-65 10
-53 4
-select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
-companynr count(*)
-41 52
-58 23
-68 12
-50 11
-65 10
-53 4
-select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
-fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)
-teethe 000001 1 5987435 5987435 5987435 5987435.0000
-dreaded 011401 1 5987435 5987435 5987435 5987435.0000
-scholastics 011402 1 28357832 28357832 28357832 28357832.0000
-audiology 011403 1 39654943 39654943 39654943 39654943.0000
-wallet 011501 1 5987435 5987435 5987435 5987435.0000
-parters 011701 1 5987435 5987435 5987435 5987435.0000
-eschew 011702 1 28357832 28357832 28357832 28357832.0000
-quitter 011703 1 39654943 39654943 39654943 39654943.0000
-neat 012001 1 5987435 5987435 5987435 5987435.0000
-Steinberg 012003 1 39654943 39654943 39654943 39654943.0000
-balled 012301 1 5987435 5987435 5987435 5987435.0000
-persist 012302 1 28357832 28357832 28357832 28357832.0000
-attainments 012303 1 39654943 39654943 39654943 39654943.0000
-capably 012501 1 5987435 5987435 5987435 5987435.0000
-impulsive 012602 1 28357832 28357832 28357832 28357832.0000
-starlet 012603 1 39654943 39654943 39654943 39654943.0000
-featherweight 012701 1 5987435 5987435 5987435 5987435.0000
-pessimist 012702 1 28357832 28357832 28357832 28357832.0000
-daughter 012703 1 39654943 39654943 39654943 39654943.0000
-lawgiver 013601 1 5987435 5987435 5987435 5987435.0000
-stated 013602 1 28357832 28357832 28357832 28357832.0000
-readable 013603 1 39654943 39654943 39654943 39654943.0000
-testicle 013801 1 5987435 5987435 5987435 5987435.0000
-Parsifal 013802 1 28357832 28357832 28357832 28357832.0000
-leavings 013803 1 39654943 39654943 39654943 39654943.0000
-squeaking 013901 1 5987435 5987435 5987435 5987435.0000
-contrasted 016001 1 5987435 5987435 5987435 5987435.0000
-leftover 016201 1 5987435 5987435 5987435 5987435.0000
-whiteners 016202 1 28357832 28357832 28357832 28357832.0000
-erases 016301 1 5987435 5987435 5987435 5987435.0000
-Punjab 016302 1 28357832 28357832 28357832 28357832.0000
-Merritt 016303 1 39654943 39654943 39654943 39654943.0000
-sweetish 018001 1 5987435 5987435 5987435 5987435.0000
-dogging 018002 1 28357832 28357832 28357832 28357832.0000
-scornfully 018003 1 39654943 39654943 39654943 39654943.0000
-fetters 018012 1 28357832 28357832 28357832 28357832.0000
-bivalves 018013 1 39654943 39654943 39654943 39654943.0000
-skulking 018021 1 5987435 5987435 5987435 5987435.0000
-flint 018022 1 28357832 28357832 28357832 28357832.0000
-flopping 018023 1 39654943 39654943 39654943 39654943.0000
-Judas 018032 1 28357832 28357832 28357832 28357832.0000
-vacuuming 018033 1 39654943 39654943 39654943 39654943.0000
-medical 018041 1 5987435 5987435 5987435 5987435.0000
-bloodbath 018042 1 28357832 28357832 28357832 28357832.0000
-subschema 018043 1 39654943 39654943 39654943 39654943.0000
-interdependent 018051 1 5987435 5987435 5987435 5987435.0000
-Graves 018052 1 28357832 28357832 28357832 28357832.0000
-neonatal 018053 1 39654943 39654943 39654943 39654943.0000
-sorters 018061 1 5987435 5987435 5987435 5987435.0000
-epistle 018062 1 28357832 28357832 28357832 28357832.0000
-Conley 018101 1 5987435 5987435 5987435 5987435.0000
-lectured 018102 1 28357832 28357832 28357832 28357832.0000
-Abraham 018103 1 39654943 39654943 39654943 39654943.0000
-cage 018201 1 5987435 5987435 5987435 5987435.0000
-hushes 018202 1 28357832 28357832 28357832 28357832.0000
-Simla 018402 1 28357832 28357832 28357832 28357832.0000
-reporters 018403 1 39654943 39654943 39654943 39654943.0000
-coexist 018601 1 5987435 5987435 5987435 5987435.0000
-Beebe 018602 1 28357832 28357832 28357832 28357832.0000
-Taoism 018603 1 39654943 39654943 39654943 39654943.0000
-Connally 018801 1 5987435 5987435 5987435 5987435.0000
-fetched 018802 1 28357832 28357832 28357832 28357832.0000
-checkpoints 018803 1 39654943 39654943 39654943 39654943.0000
-gritty 018811 1 5987435 5987435 5987435 5987435.0000
-firearm 018812 1 28357832 28357832 28357832 28357832.0000
-minima 019101 1 5987435 5987435 5987435 5987435.0000
-Selfridge 019102 1 28357832 28357832 28357832 28357832.0000
-disable 019103 1 39654943 39654943 39654943 39654943.0000
-witchcraft 019201 1 5987435 5987435 5987435 5987435.0000
-betroth 030501 1 5987435 5987435 5987435 5987435.0000
-Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000
-imprint 030503 1 39654943 39654943 39654943 39654943.0000
-swelling 031901 1 5987435 5987435 5987435 5987435.0000
-interrelationships 036001 1 5987435 5987435 5987435 5987435.0000
-riser 036002 1 28357832 28357832 28357832 28357832.0000
-bee 038001 1 5987435 5987435 5987435 5987435.0000
-kanji 038002 1 28357832 28357832 28357832 28357832.0000
-dental 038003 1 39654943 39654943 39654943 39654943.0000
-railway 038011 1 5987435 5987435 5987435 5987435.0000
-validate 038012 1 28357832 28357832 28357832 28357832.0000
-normalizes 038013 1 39654943 39654943 39654943 39654943.0000
-Kline 038101 1 5987435 5987435 5987435 5987435.0000
-Anatole 038102 1 28357832 28357832 28357832 28357832.0000
-partridges 038103 1 39654943 39654943 39654943 39654943.0000
-recruited 038201 1 5987435 5987435 5987435 5987435.0000
-dimensions 038202 1 28357832 28357832 28357832 28357832.0000
-Chicana 038203 1 39654943 39654943 39654943 39654943.0000
-select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
-companynr fld3 sum(price)
-512 boat 786542
-512 capably 786542
-512 cupboard 786542
-512 decliner 786542
-512 descendants 786542
-512 dopers 786542
-512 erases 786542
-512 Micronesia 786542
-512 Miles 786542
-512 skies 786542
-select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
-companynr count(*) min(fld3) max(fld3) sum(price) avg(price)
-00 1 Omaha Omaha 5987435 5987435.0000
-36 1 dubbed dubbed 28357832 28357832.0000
-37 83 Abraham Wotan 1908978016 22999735.1325
-50 2 scribbled tapestry 68012775 34006387.5000
-select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
-t3.companynr+0 t2nr fld3 sum(price)
-37 1 Omaha 5987435
-37 11401 breaking 5987435
-37 11402 Romans 28357832
-37 11403 intercepted 39654943
-37 11501 bewilderingly 5987435
-37 11701 astound 5987435
-37 11702 admonishing 28357832
-37 11703 sumac 39654943
-37 12001 flanking 5987435
-37 12003 combed 39654943
-37 12301 Eulerian 5987435
-37 12302 dubbed 28357832
-37 12303 Kane 39654943
-37 12501 annihilates 5987435
-37 12602 Wotan 28357832
-37 12603 snatching 39654943
-37 12701 grazing 5987435
-37 12702 Baird 28357832
-37 12703 celery 39654943
-37 13601 handgun 5987435
-37 13602 foldout 28357832
-37 13603 mystic 39654943
-37 13801 intelligibility 5987435
-37 13802 Augustine 28357832
-37 13803 teethe 39654943
-37 13901 scholastics 5987435
-37 16001 audiology 5987435
-37 16201 wallet 5987435
-37 16202 parters 28357832
-37 16301 eschew 5987435
-37 16302 quitter 28357832
-37 16303 neat 39654943
-37 18001 jarring 5987435
-37 18002 tinily 28357832
-37 18003 balled 39654943
-37 18012 impulsive 28357832
-37 18013 starlet 39654943
-37 18021 lawgiver 5987435
-37 18022 stated 28357832
-37 18023 readable 39654943
-37 18032 testicle 28357832
-37 18033 Parsifal 39654943
-37 18041 Punjab 5987435
-37 18042 Merritt 28357832
-37 18043 Quixotism 39654943
-37 18051 sureties 5987435
-37 18052 puddings 28357832
-37 18053 tapestry 39654943
-37 18061 trimmings 5987435
-37 18062 humility 28357832
-37 18101 tragedies 5987435
-37 18102 skulking 28357832
-37 18103 flint 39654943
-37 18201 relaxing 5987435
-37 18202 offload 28357832
-37 18402 suites 28357832
-37 18403 lists 39654943
-37 18601 vacuuming 5987435
-37 18602 dentally 28357832
-37 18603 humanness 39654943
-37 18801 inch 5987435
-37 18802 Weissmuller 28357832
-37 18803 irresponsibly 39654943
-37 18811 repetitions 5987435
-37 18812 Antares 28357832
-37 19101 ventilate 5987435
-37 19102 pityingly 28357832
-37 19103 interdependent 39654943
-37 19201 Graves 5987435
-37 30501 neonatal 5987435
-37 30502 scribbled 28357832
-37 30503 chafe 39654943
-37 31901 realtor 5987435
-37 36001 elite 5987435
-37 36002 funereal 28357832
-37 38001 Conley 5987435
-37 38002 lectured 28357832
-37 38003 Abraham 39654943
-37 38011 groupings 5987435
-37 38012 dissociate 28357832
-37 38013 coexist 39654943
-37 38101 rusting 5987435
-37 38102 galling 28357832
-37 38103 obliterates 39654943
-37 38201 resumes 5987435
-37 38202 analyzable 28357832
-37 38203 terminator 39654943
-select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
-sum(price)
-234298
-select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
-fld1 sum(price)
-038008 234298
-explain select fld3 from t2 where 1>2 or 2>3;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-explain select fld3 from t2 where fld1=fld1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
-select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
-companynr fld1
-34 250501
-34 250502
-select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
-companynr fld1
-34 250501
-34 250502
-select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
-companynr count sum
-00 82 10355753
-29 95 14473298
-34 70 17788966
-37 588 83602098
-41 52 12816335
-select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
-companynr
-00
-29
-34
-37
-41
-select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
-companynr companyname count(*)
-68 company 10 12
-50 company 11 11
-40 company 5 37
-41 company 6 52
-53 company 7 4
-58 company 8 23
-65 company 9 10
-select count(*) from t2;
-count(*)
-1199
-select count(*) from t2 where fld1 < 098024;
-count(*)
-387
-select min(fld1) from t2 where fld1>= 098024;
-min(fld1)
-98024
-select max(fld1) from t2 where fld1>= 098024;
-max(fld1)
-1232609
-select count(*) from t3 where price2=76234234;
-count(*)
-4181
-select count(*) from t3 where companynr=512 and price2=76234234;
-count(*)
-4181
-explain select min(fld1),max(fld1),count(*) from t2;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
-select min(fld1),max(fld1),count(*) from t2;
-min(fld1) max(fld1) count(*)
-0 1232609 1199
-select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
-min(t2nr) max(t2nr)
-2115 2115
-select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
-count(*) min(t2nr) max(t2nr)
-4181 4 41804
-select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
-t2nr count(*)
-9 1
-19 1
-29 1
-39 1
-49 1
-59 1
-69 1
-79 1
-89 1
-99 1
-109 1
-119 1
-129 1
-139 1
-149 1
-159 1
-169 1
-179 1
-189 1
-199 1
-select max(t2nr) from t3 where price=983543950;
-max(t2nr)
-41807
-select t1.period from t3 = t1 limit 1;
-period
-1001
-select t1.period from t1 as t1 limit 1;
-period
-9410
-select t1.period as "Nuvarande period" from t1 as t1 limit 1;
-Nuvarande period
-9410
-select period as ok_period from t1 limit 1;
-ok_period
-9410
-select period as ok_period from t1 group by ok_period limit 1;
-ok_period
-9410
-select 1+1 as summa from t1 group by summa limit 1;
-summa
-2
-select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
-Nuvarande period
-9410
-show tables;
-Tables_in_test
-t1
-t2
-t3
-t4
-show tables from test like "s%";
-Tables_in_test (s%)
-show tables from test like "t?";
-Tables_in_test (t?)
-show full columns from t2;
-Field Type Collation Null Key Default Extra Privileges Comment
-auto int(11) NULL NO PRI NULL auto_increment #
-fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
-companynr tinyint(2) unsigned zerofill NULL NO 00 #
-fld3 char(30) latin1_swedish_ci NO MUL #
-fld4 char(35) latin1_swedish_ci NO #
-fld5 char(35) latin1_swedish_ci NO #
-fld6 char(4) latin1_swedish_ci NO #
-show full columns from t2 from test like 'f%';
-Field Type Collation Null Key Default Extra Privileges Comment
-fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
-fld3 char(30) latin1_swedish_ci NO MUL #
-fld4 char(35) latin1_swedish_ci NO #
-fld5 char(35) latin1_swedish_ci NO #
-fld6 char(4) latin1_swedish_ci NO #
-show full columns from t2 from test like 's%';
-Field Type Collation Null Key Default Extra Privileges Comment
-show keys from t2;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
-t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
-t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
-drop table t4, t3, t2, t1;
-CREATE TABLE t1 (
-cont_nr int(11) NOT NULL auto_increment,
-ver_nr int(11) NOT NULL default '0',
-aufnr int(11) NOT NULL default '0',
-username varchar(50) NOT NULL default '',
-hdl_nr int(11) NOT NULL default '0',
-eintrag date NOT NULL default '0000-00-00',
-st_klasse varchar(40) NOT NULL default '',
-st_wert varchar(40) NOT NULL default '',
-st_zusatz varchar(40) NOT NULL default '',
-st_bemerkung varchar(255) NOT NULL default '',
-kunden_art varchar(40) NOT NULL default '',
-mcbs_knr int(11) default NULL,
-mcbs_aufnr int(11) NOT NULL default '0',
-schufa_status char(1) default '?',
-bemerkung text,
-wirknetz text,
-wf_igz int(11) NOT NULL default '0',
-tarifcode varchar(80) default NULL,
-recycle char(1) default NULL,
-sim varchar(30) default NULL,
-mcbs_tpl varchar(30) default NULL,
-emp_nr int(11) NOT NULL default '0',
-laufzeit int(11) default NULL,
-hdl_name varchar(30) default NULL,
-prov_hdl_nr int(11) NOT NULL default '0',
-auto_wirknetz varchar(50) default NULL,
-auto_billing varchar(50) default NULL,
-touch timestamp NOT NULL,
-kategorie varchar(50) default NULL,
-kundentyp varchar(20) NOT NULL default '',
-sammel_rech_msisdn varchar(30) NOT NULL default '',
-p_nr varchar(9) NOT NULL default '',
-suffix char(3) NOT NULL default '',
-PRIMARY KEY (cont_nr),
-KEY idx_aufnr(aufnr),
-KEY idx_hdl_nr(hdl_nr),
-KEY idx_st_klasse(st_klasse),
-KEY ver_nr(ver_nr),
-KEY eintrag_idx(eintrag),
-KEY emp_nr_idx(emp_nr),
-KEY wf_igz(wf_igz),
-KEY touch(touch),
-KEY hdl_tag(eintrag,hdl_nr),
-KEY prov_hdl_nr(prov_hdl_nr),
-KEY mcbs_aufnr(mcbs_aufnr),
-KEY kundentyp(kundentyp),
-KEY p_nr(p_nr,suffix)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
-INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
-Kundentyp kategorie
-Privat (Private Nutzung) Mobilfunk
-Warnings:
-Warning 1052 Column 'kundentyp' in group statement is ambiguous
-drop table t1;
-SHOW STATUS LIKE 'Ssl_cipher';
-Variable_name Value
-Ssl_cipher DHE-RSA-AES256-SHA
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 30e6d073d9a..1372ac3687c 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -50,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select `b`.`a` AS `a`) = 1)
+Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select '1' AS `a`) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
1
@@ -204,7 +204,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
+Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -315,7 +315,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select (select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 select (select '2' AS `a` from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -368,7 +368,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00
3 SUBQUERY t8 const PRIMARY PRIMARY 37 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` AS `email` from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1
+Note 1003 select 'joce' AS `pseudo`,(select 'test' AS `email` from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM
t8 WHERE pseudo='joce');
ERROR 21000: Operand should contain 1 column(s)
@@ -421,7 +421,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select 1 AS `1` from `test`.`t1`
+Note 1003 select 1 AS `1` from `test`.`t1` where 1
drop table t1;
CREATE TABLE `t1` (
`numeropost` mediumint(8) unsigned NOT NULL auto_increment,
@@ -547,7 +547,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings:
-Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = _latin1'1'))
+Note 1003 select '3' AS `numreponse` from `test`.`t1` where (('1' = _latin1'1'))
drop table t1;
CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1);
@@ -1180,7 +1180,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a`)) AS `0 IN (SELECT 1 FROM t1 a)`
+Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
INSERT INTO t1 (pseudo) VALUES ('test1');
SELECT 0 IN (SELECT 1 FROM t1 a);
0 IN (SELECT 1 FROM t1 a)
@@ -1190,7 +1190,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a`)) AS `0 IN (SELECT 1 FROM t1 a)`
+Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
drop table t1;
CREATE TABLE `t1` (
`i` int(11) NOT NULL default '0',
@@ -1430,7 +1430,7 @@ explain extended (select * from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 (select `test`.`t1`.`s1` AS `s1` from `test`.`t1`)
+Note 1003 (select 'tttt' AS `s1` from `test`.`t1`)
(select * from t1);
s1
tttt
@@ -1497,7 +1497,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max(`test`.`t2`.`b`) from `test`.`t2`)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max('0') from `test`.`t2`)))
select * from t3 where a >= some (select b from t2);
a
explain extended select * from t3 where a >= some (select b from t2);
@@ -1505,7 +1505,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(`test`.`t2`.`b`) from `test`.`t2`)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min('0') from `test`.`t2`)))
select * from t3 where a >= all (select b from t2 group by 1);
a
6
@@ -1516,7 +1516,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select '0' AS `b` from `test`.`t2` group by 1)))
select * from t3 where a >= some (select b from t2 group by 1);
a
explain extended select * from t3 where a >= some (select b from t2 group by 1);
@@ -1524,7 +1524,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select '0' AS `b` from `test`.`t2` group by 1)))
select * from t3 where NULL >= any (select b from t2);
a
explain extended select * from t3 where NULL >= any (select b from t2);
@@ -1532,7 +1532,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
select * from t3 where NULL >= any (select b from t2 group by 1);
a
explain extended select * from t3 where NULL >= any (select b from t2 group by 1);
@@ -1540,7 +1540,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
select * from t3 where NULL >= some (select b from t2);
a
explain extended select * from t3 where NULL >= some (select b from t2);
@@ -1548,7 +1548,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
select * from t3 where NULL >= some (select b from t2 group by 1);
a
explain extended select * from t3 where NULL >= some (select b from t2 group by 1);
@@ -1556,7 +1556,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
insert into t2 values (2,2), (2,1), (3,3), (3,1);
select * from t3 where a > all (select max(b) from t2 group by a);
a
@@ -1618,7 +1618,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION t1 system NULL NULL NULL NULL 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select `test`.`t1`.`s1` AS `s1` from `test`.`t1`
+Note 1003 select 'e' AS `s1` from `test`.`t1` where 1
drop table t1;
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
@@ -3873,3 +3873,16 @@ id_1
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t1xt2;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3), (1), (2);
+SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1;
+col1 col2
+this is a test. 3
+this is a test. 1
+this is a test. 2
+SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t;
+col1 t2
+this is a test. 3
+this is a test. 1
+this is a test. 2
+DROP table t1;
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index e5d1b5a3f1f..edd083f73aa 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -1372,4 +1372,45 @@ INSERT INTO bug22580_t1 VALUES (1,1);
DROP TABLE bug22580_t1;
DROP PROCEDURE bug22580_proc_1;
DROP PROCEDURE bug22580_proc_2;
+DROP TRIGGER IF EXISTS trg27006_a_update;
+DROP TRIGGER IF EXISTS trg27006_a_insert;
+CREATE TABLE t1 (
+`id` int(10) unsigned NOT NULL auto_increment,
+`val` varchar(10) NOT NULL,
+PRIMARY KEY (`id`)
+);
+CREATE TABLE t2 like t1;
+CREATE TRIGGER trg27006_a_insert AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+insert into t2 values (NULL,new.val);
+END |
+CREATE TRIGGER trg27006_a_update AFTER UPDATE ON t1 FOR EACH ROW
+BEGIN
+insert into t2 values (NULL,new.val);
+END |
+INSERT INTO t1(val) VALUES ('test1'),('test2');
+SELECT * FROM t1;
+id val
+1 test1
+2 test2
+SELECT * FROM t2;
+id val
+1 test1
+2 test2
+INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val);
+INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val);
+SELECT * FROM t1;
+id val
+1 test1
+2 test2
+3 test3
+SELECT * FROM t2;
+id val
+1 test1
+2 test2
+3 test2
+4 test3
+DROP TRIGGER trg27006_a_insert;
+DROP TRIGGER trg27006_a_update;
+drop table t1,t2;
End of 5.0 tests
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 5e5bc7682d3..869efb535e6 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -506,26 +506,26 @@ create table t1 (id integer auto_increment unique,imagem LONGBLOB not null defau
Warnings:
Warning 1101 BLOB/TEXT column 'imagem' can't have a default value
insert into t1 (id) values (1);
-select
-charset(load_file('../../std_data/words.dat')),
-collation(load_file('../../std_data/words.dat')),
-coercibility(load_file('../../std_data/words.dat'));
-charset(load_file('../../std_data/words.dat')) collation(load_file('../../std_data/words.dat')) coercibility(load_file('../../std_data/words.dat'))
+select
+charset(load_file('../std_data_ln/words.dat')),
+collation(load_file('../std_data_ln/words.dat')),
+coercibility(load_file('../std_data_ln/words.dat'));
+charset(load_file('../std_data_ln/words.dat')) collation(load_file('../std_data_ln/words.dat')) coercibility(load_file('../std_data_ln/words.dat'))
binary binary 4
-explain extended select
-charset(load_file('../../std_data/words.dat')),
-collation(load_file('../../std_data/words.dat')),
-coercibility(load_file('../../std_data/words.dat'));
+explain extended select
+charset(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat')),
+collation(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat')),
+coercibility(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))`
-update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
+Note 1003 select charset(load_file(_latin1'MYSQLTEST_VARDIR/std_data_ln/words.dat')) AS `charset(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'))`,collation(load_file(_latin1'MYSQLTEST_VARDIR/std_data_ln/words.dat')) AS `collation(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'))`,coercibility(load_file(_latin1'MYSQLTEST_VARDIR/std_data_ln/words.dat')) AS `coercibility(load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat'))`
+update t1 set imagem=load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
if(imagem is null, "ERROR", "OK") length(imagem)
OK 581
drop table t1;
-create table t1 select load_file('../../std_data/words.dat') l;
+create table t1 select load_file('MYSQLTEST_VARDIR/std_data_ln/words.dat') l;
show full fields from t1;
Field Type Collation Null Key Default Extra Privileges Comment
l longblob NULL YES NULL #
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 9805b788a73..2c33ffc08d7 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -480,7 +480,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 UNION t2 const PRIMARY PRIMARY 4 const 1 100.00
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 (select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` = 1)) union (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` = 1))
+Note 1003 (select '1' AS `a`,'1' AS `b` from `test`.`t1` where ('1' = 1)) union (select '1' AS `a`,'10' AS `b` from `test`.`t2` where ('1' = 1))
(select * from t1 where a=5) union (select * from t2 where a=1);
a b
1 10
@@ -1426,4 +1426,15 @@ select _utf8'12' union select _latin1'12345';
12
12
12345
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3),(1),(2),(4),(1);
+SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a) AS test;
+a
+1
+2
+3
+4
+SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test;
+ERROR 42S22: Unknown column 'c' in 'order clause'
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index a40d3451a62..94b62625c3f 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -377,6 +377,10 @@ create table t1(f1 int, `*f2` int);
insert into t1 values (1,1);
update t1 set `*f2`=1;
drop table t1;
+create table t1(f1 int);
+update t1 set f2=1 order by f2;
+ERROR 42S22: Unknown column 'f2' in 'order clause'
+drop table t1;
CREATE TABLE t1 (
request_id int unsigned NOT NULL auto_increment,
user_id varchar(12) default NULL,
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index e1ac58ecd52..f30af2ea1a3 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -15,7 +15,7 @@ explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 const UNIQ UNIQ 8 const 1 100.00
Warnings:
-Note 1003 select `test`.`t1`.`ID` AS `ID`,`test`.`t1`.`UNIQ` AS `UNIQ` from `test`.`t1` where 1
+Note 1003 select '00000001' AS `ID`,'004084688022709641610' AS `UNIQ` from `test`.`t1` where 1
drop table t1;
select x'hello';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1
@@ -78,3 +78,4 @@ alter table t1 modify a varchar(255);
select length(a) from t1;
length(a)
6
+drop table t1;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index ec4c7c9b2aa..6927f07da6b 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -9,12 +9,11 @@ set @my_key_buffer_size =@@global.key_buffer_size;
set @my_max_binlog_cache_size =@@global.max_binlog_cache_size;
set @my_max_binlog_size =@@global.max_binlog_size;
set @my_max_connect_errors =@@global.max_connect_errors;
+set @my_max_connections =@@global.max_connections;
set @my_max_delayed_threads =@@global.max_delayed_threads;
set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size;
-set @my_max_user_connections =@@global.max_user_connections;
-set @my_max_write_lock_count =@@global.max_write_lock_count;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
@@ -903,6 +902,14 @@ select @@&;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&' at line 1
select @@@;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@' at line 1
+select @@hostname;
+@@hostname
+#
+set @@hostname= "anothername";
+ERROR HY000: Variable 'hostname' is a read only variable
+show variables like 'hostname';
+Variable_name Value
+hostname #
End of 5.0 tests
set global binlog_cache_size =@my_binlog_cache_size;
set global connect_timeout =@my_connect_timeout;
@@ -914,12 +921,13 @@ set global key_buffer_size =@my_key_buffer_size;
set global max_binlog_cache_size =default;
set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors;
+set global max_connections =@my_max_connections;
set global max_delayed_threads =@my_max_delayed_threads;
set global max_heap_table_size =@my_max_heap_table_size;
set global max_insert_delayed_threads=@my_max_insert_delayed_threads;
set global max_join_size =@my_max_join_size;
-set global max_user_connections =@my_max_user_connections;
-set global max_write_lock_count =@my_max_write_lock_count;
+set global max_user_connections =default;
+set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index ee79601b498..46b09b55565 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3264,6 +3264,43 @@ a IS TRUE old_istrue a IS NOT TRUE old_isnottrue a IS FALSE old_isfalse a IS NOT
drop view view_24532_a;
drop view view_24532_b;
drop table table_24532;
+CREATE TABLE t1 (
+lid int NOT NULL PRIMARY KEY,
+name char(10) NOT NULL
+);
+INSERT INTO t1 (lid, name) VALUES
+(1, 'YES'), (2, 'NO');
+CREATE TABLE t2 (
+id int NOT NULL PRIMARY KEY,
+gid int NOT NULL,
+lid int NOT NULL,
+dt date
+);
+INSERT INTO t2 (id, gid, lid, dt) VALUES
+(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'),
+(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02');
+SELECT DISTINCT t2.gid AS lgid,
+(SELECT t1.name FROM t1, t2
+WHERE t1.lid = t2.lid AND t2.gid = lgid
+ORDER BY t2.dt DESC LIMIT 1
+) as clid
+FROM t2;
+lgid clid
+1 NO
+2 YES
+CREATE VIEW v1 AS
+SELECT DISTINCT t2.gid AS lgid,
+(SELECT t1.name FROM t1, t2
+WHERE t1.lid = t2.lid AND t2.gid = lgid
+ORDER BY t2.dt DESC LIMIT 1
+) as clid
+FROM t2;
+SELECT * FROM v1;
+lgid clid
+1 NO
+2 YES
+DROP VIEW v1;
+DROP table t1,t2;
End of 5.0 tests.
DROP DATABASE IF EXISTS `d-1`;
CREATE DATABASE `d-1`;
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 297813dfead..b8ba35b78ca 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -642,6 +642,33 @@ alter table t1 change t t text;
drop table t1;
#
+# Bug #26794: Adding an index with a prefix on a SPATIAL type breaks ALTER
+# TABLE
+#
+CREATE TABLE t1 (a varchar(500));
+
+ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b);
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD KEY(b(50));
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 ADD c POINT;
+SHOW CREATE TABLE t1;
+
+--error ER_WRONG_SUB_KEY
+CREATE TABLE t2 (a INT, KEY (a(20)));
+
+ALTER TABLE t1 ADD d INT;
+--error ER_WRONG_SUB_KEY
+ALTER TABLE t1 ADD KEY (d(20));
+
+# the 5.1 part of the test
+--error ER_WRONG_SUB_KEY
+ALTER TABLE t1 ADD e GEOMETRY NOT NULL, ADD SPATIAL KEY (e(30));
+
+DROP TABLE t1;
+
+#
# Bug#18038 MySQL server corrupts binary columns data
#
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test
new file mode 100644
index 00000000000..1c2952e93d0
--- /dev/null
+++ b/mysql-test/t/bootstrap.test
@@ -0,0 +1,46 @@
+#
+# test mysqld in bootstrap mode
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+
+#
+# Check that --bootstrap reads from stdin
+#
+--write_file $MYSQLTEST_VARDIR/tmp/bootstrap.sql
+use test;
+CREATE TABLE t1(a int);
+EOF
+--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+drop table t1;
+
+#
+# Check that --bootstrap of file with SQL error returns error
+#
+--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql
+use test;
+CREATE TABLE t1;
+EOF
+--error 1
+--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+# Table t1 should not exists
+--error 1051
+drop table t1;
+
+#
+# Bootstrap with a query larger than 2*thd->net.max_packet
+#
+set @my_max_allowed_packet= @@max_allowed_packet;
+set global max_allowed_packet=100*@@max_allowed_packet;
+--disable_query_log
+create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
+eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
+--enable_query_log
+--error 1
+--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+
+set global max_allowed_packet=@my_max_allowed_packet;
+drop table t1;
+
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index b4837b4ccbb..ffdcee06488 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -410,12 +410,14 @@ select database();
drop database mysqltest;
select database();
-# Connect without a database
+# Connect without a database as user mysqltest_1
+create user mysqltest_1;
connect (user1,localhost,mysqltest_1,,*NO-ONE*);
connection user1;
select database(), user();
connection default;
disconnect user1;
+drop user mysqltest_1;
use test;
#
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index c7d34a43d95..62482d576b2 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1406,7 +1406,7 @@ DROP TABLE test_repair_table;
#
CREATE TABLE test_repair_table2 ( val integer ) ENGINE = CSV;
---exec rm $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
+--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
# Should give a warning and perform autorepair. We also disable ps-protocol
# here, as mysql-test eats up warnings in ps-protocol mode
@@ -1416,15 +1416,19 @@ SELECT * from test_repair_table2;
--enable_ps_protocol
# this should work ok, as the table is already repaired
SELECT * from test_repair_table2;
-# check that the metafile appeared again. chop the path to it
---exec ls $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM | perl -pi -e "s/.*\///"
+# check that the metafile appeared again.
+--file_exists $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
CHECK TABLE test_repair_table2;
DROP TABLE test_repair_table2;
# Corrupt csv file and see if we can repair it
CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV;
---exec perl -e 'print "\"1\"\n\"4\"\n\"3";' > $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
+--write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
+"1"
+"4"
+"3
+EOF
CHECK TABLE test_repair_table3;
REPAIR TABLE test_repair_table3;
SELECT * FROM test_repair_table3;
@@ -1439,7 +1443,7 @@ CREATE TABLE test_repair_table4 (
founded char(4) DEFAULT '' NOT NULL
) ENGINE = CSV;
---exec rm $MYSQLTEST_VARDIR/master-data/test/test_repair_table4.CSM
+--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table4.CSM
--disable_ps_protocol
SELECT * FROM test_repair_table4;
--enable_ps_protocol
@@ -1472,7 +1476,9 @@ CREATE TABLE test_repair_table5 (
) ENGINE = CSV;
# Corrupt a table -- put a file with wrong # of columns
---exec perl -e 'print "\"1\",\"101\",\"IBM\"\n";' > $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+--write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+"1","101","IBM"
+EOF
CHECK TABLE test_repair_table5;
REPAIR TABLE test_repair_table5;
@@ -1481,7 +1487,9 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876);
SELECT * FROM test_repair_table5;
# Corrupt a table -- put a row with wrong # of columns at end of file
---exec perl -e 'print "\"1\",\"101\",\"IBM\"\n";' >> $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+--append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+"1","101","IBM"
+EOF
FLUSH TABLES;
CHECK TABLE test_repair_table5;
@@ -1492,7 +1500,9 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876);
SELECT * FROM test_repair_table5;
# Corrupt table again -- put a row with wrong # of columns at end of file
---exec perl -e 'print "\"1\",\"101\",\"IBM\"\n";' >> $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+--append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+"1","101","IBM"
+EOF
FLUSH TABLES;
CHECK TABLE test_repair_table5;
@@ -1573,13 +1583,15 @@ drop table t1;
create table bug15205 (val int(11) default null) engine=csv;
create table bug15205_2 (val int(11) default null) engine=csv;
---exec rm $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
+--remove_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
# system error (can't open the datafile)
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--error 13
select * from bug15205;
select * from bug15205_2;
---exec touch $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
+# Create empty file
+--write_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
+EOF
select * from bug15205;
drop table bug15205;
drop table bug15205_2;
@@ -1595,14 +1607,22 @@ insert into bug22080_1 values(1,'string');
insert into bug22080_1 values(2,'string');
insert into bug22080_1 values(3,'string');
-# Currupt the file as described in the bug report
---exec sed -e 's/2/2"/' $MYSQLTEST_VARDIR/master-data/test/bug22080_1.CSV > $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
---exec sed -e 's/2","/2",/' $MYSQLTEST_VARDIR/master-data/test/bug22080_1.CSV > $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
+# Create first corrupt file as described in bug report
+--write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
+1,"string"
+2","string"
+3,"string"
+EOF
+
+# Create second corrupt file as described in bug report
+--write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
+1,"string"
+"2",string"
+3,"string"
+EOF
---exec cat $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
check table bug22080_2;
---exec cat $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
check table bug22080_3;
drop tables bug22080_1,bug22080_2,bug22080_3;
diff --git a/mysql-test/t/ctype_ucs2_def-master.opt b/mysql-test/t/ctype_ucs2_def-master.opt
index a0b5b061860..84d2a52b639 100644
--- a/mysql-test/t/ctype_ucs2_def-master.opt
+++ b/mysql-test/t/ctype_ucs2_def-master.opt
@@ -1 +1 @@
---default-collation=ucs2_unicode_ci --default-character-set=ucs2
+--default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1
diff --git a/mysql-test/t/ctype_ucs2_def.test b/mysql-test/t/ctype_ucs2_def.test
index 00f636d79dc..e435d1fb07d 100644
--- a/mysql-test/t/ctype_ucs2_def.test
+++ b/mysql-test/t/ctype_ucs2_def.test
@@ -1,3 +1,5 @@
+-- source include/have_ucs2.inc
+
#
# MySQL Bug#15276: MySQL ignores collation-server
#
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 3ccee525d10..6f161581287 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -234,3 +234,11 @@ SET @@session.auto_increment_offset=
SET @@session.auto_increment_increment=
@bug20830_old_session_auto_increment_increment;
+#
+# BUG#26238 - inserted delayed always inserts 0 for BIT columns
+#
+CREATE TABLE t1(a BIT);
+INSERT DELAYED INTO t1 VALUES(1);
+FLUSH TABLE t1;
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 3ad33dddcbe..4d8a8e3c3af 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -99,7 +99,8 @@ SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
#
# Test for select if database is not selected.
#
-# Connect without a database
+# Connect without a database as user mysqltest_1
+create user mysqltest_1;
create table t1 select 1 as a;
connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection con1;
@@ -271,4 +272,8 @@ select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID);
select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
drop table t1, t2;
+disconnect con1;
+connection default;
+drop user mysqltest_1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 2d37ab0b2c5..913fe8e62ee 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -35,7 +35,7 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb
#ndb_binlog_discover : bug#21806 2006-08-24
#ndb_autodiscover3 : bug#21806
-mysql_upgrade : Bug#25074 mysql_upgrade gives inconsisten results
plugin : Bug#25659 memory leak via "plugins" test
rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
ndb_alter_table : Bug##25774 ndb_alter_table.test fails in DBUG_ASSERT() on Linux x64
+ndb_single_user : Bug#27021 Error codes in mysqld in single user mode varies
diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test
index c4d53450910..b223c683cde 100644
--- a/mysql-test/t/endspace.test
+++ b/mysql-test/t/endspace.test
@@ -16,7 +16,8 @@ drop table if exists t1;
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
check table t1;
-select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 ignore key (key1) where text1='teststring' or
+ text1 like 'teststring_%' ORDER BY text1;
select * from t1 where text1='teststring' or text1 like 'teststring_%';
select * from t1 where text1='teststring' or text1 > 'teststring\t';
select * from t1 order by text1;
@@ -24,7 +25,8 @@ explain select * from t1 order by text1;
alter table t1 modify text1 char(32) binary not null;
check table t1;
-select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 ignore key (key1) where text1='teststring' or
+ text1 like 'teststring_%' ORDER BY text1;
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
select text1, length(text1) from t1 order by text1;
@@ -57,7 +59,8 @@ drop table t1;
create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap;
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
-select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 ignore key (key1) where text1='teststring' or
+ text1 like 'teststring_%' ORDER BY text1;
select * from t1 where text1='teststring' or text1 like 'teststring_%';
select * from t1 where text1='teststring' or text1 >= 'teststring\t';
select * from t1 order by text1;
diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test
index e45fea1dfad..64ce4a5c3df 100644
--- a/mysql-test/t/events_logs_tests.test
+++ b/mysql-test/t/events_logs_tests.test
@@ -104,3 +104,5 @@ SET GLOBAL long_query_time =@old_global_long_query_time;
SET SESSION long_query_time =@old_session_long_query_time;
DROP DATABASE events_test;
+
+SET GLOBAL event_scheduler=off;
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index efce0cdf3b5..04cf37f457a 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -51,4 +51,19 @@ set names latin1;
select 3 into @v1;
explain select 3 into @v1;
+#
+# Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were
+# optimized away.
+#
+create table t1(f1 int, f2 int);
+insert into t1 values (1,1);
+create view v1 as select * from t1 where f1=1;
+explain extended select * from v1 where f2=1;
+explain extended select * from t1 where 0;
+explain extended select * from t1 where 1;
+explain extended select * from t1 having 0;
+explain extended select * from t1 having 1;
+drop view v1;
+drop table t1;
+
# End of 5.0 tests.
diff --git a/mysql-test/t/flush2.test b/mysql-test/t/flush2.test
index fc9e88e3141..7582ab8426b 100644
--- a/mysql-test/t/flush2.test
+++ b/mysql-test/t/flush2.test
@@ -3,7 +3,7 @@
#
flush logs;
set global expire_logs_days = 3;
-show variables like 'log%';
+show variables like 'log_bin%';
flush logs;
-show variables like 'log%';
+show variables like 'log_bin%';
set global expire_logs_days = 0;
diff --git a/mysql-test/t/func_des_encrypt.test b/mysql-test/t/func_des_encrypt.test
index 5d102bd02eb..b757a632adf 100644
--- a/mysql-test/t/func_des_encrypt.test
+++ b/mysql-test/t/func_des_encrypt.test
@@ -1,4 +1,4 @@
--- source include/have_openssl.inc
+-- source include/have_ssl.inc
# This test can't be in func_encrypt.test, because it requires
# --des-key-file to not be set.
diff --git a/mysql-test/t/func_encrypt.test b/mysql-test/t/func_encrypt.test
index a7364fa43da..bcf1e5a77f4 100644
--- a/mysql-test/t/func_encrypt.test
+++ b/mysql-test/t/func_encrypt.test
@@ -1,4 +1,4 @@
--- source include/have_openssl.inc
+-- source include/have_ssl.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index cae3d91071a..4989199f3aa 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -754,7 +754,7 @@ insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76
insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
+select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i;
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
select std(s1/s2) from bug22555;
select std(o1/o2) from bug22555;
@@ -762,14 +762,14 @@ select std(e1/e2) from bug22555;
set @saved_div_precision_increment=@@div_precision_increment;
set div_precision_increment=19;
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
+select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i;
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
select round(std(s1/s2), 17) from bug22555;
select std(o1/o2) from bug22555;
select round(std(e1/e2), 17) from bug22555;
set div_precision_increment=20;
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
+select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i;
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
select round(std(s1/s2), 17) from bug22555;
select std(o1/o2) from bug22555;
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index c4274034889..31352e4c639 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -299,6 +299,68 @@ SELECT STRAIGHT_JOIN
DROP TABLE t1,t2,t3,t4;
+#
+# BUG#19342: IN works incorrectly for BIGINT UNSIGNED values
+#
+CREATE TABLE t1(a BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (0xFFFFFFFFFFFFFFFF);
+
+SELECT * FROM t1 WHERE a=-1 OR a=-2 ;
+SELECT * FROM t1 WHERE a IN (-1, -2);
+
+CREATE TABLE t2 (a BIGINT UNSIGNED);
+insert into t2 values(13491727406643098568),
+ (0x7fffffefffffffff),
+ (0x7ffffffeffffffff),
+ (0x7fffffffefffffff),
+ (0x7ffffffffeffffff),
+ (0x7fffffffffefffff),
+ (0x7ffffffffffeffff),
+ (0x7fffffffffffefff),
+ (0x7ffffffffffffeff),
+ (0x7fffffffffffffef),
+ (0x7ffffffffffffffe),
+ (0x7fffffffffffffff),
+ (0x8000000000000000),
+ (0x8000000000000001),
+ (0x8000000000000002),
+ (0x8000000000000300),
+ (0x8000000000000400),
+ (0x8000000000000401),
+ (0x8000000000004001),
+ (0x8000000000040001),
+ (0x8000000000400001),
+ (0x8000000004000001),
+ (0x8000000040000001),
+ (0x8000000400000001),
+ (0x8000004000000001),
+ (0x8000040000000001);
+
+SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
+
+SELECT HEX(a) FROM t2 WHERE a IN
+(0xBB3C3E98175D33C8,
+ 0x7fffffffffffffff,
+ 0x8000000000000000,
+ 0x8000000000000400,
+ 0x8000000000000401,
+ 42);
+
+SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
+SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
+SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
+
+CREATE TABLE t3 (a BIGINT UNSIGNED);
+INSERT INTO t3 VALUES (9223372036854775551);
+
+SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);
+
+CREATE TABLE t4 (a DATE);
+INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
+SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
+
+DROP TABLE t1,t2,t3,t4;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 535af6907ad..849d39cfc32 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1115,4 +1115,50 @@ select repeat('a', cast(2 as unsigned int));
select rpad('abc', cast(5 as unsigned integer), 'x');
select lpad('abc', cast(5 as unsigned integer), 'x');
+#
+# Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
+#
+create table t1(f1 longtext);
+insert into t1 values ("123"),("456");
+select substring(f1,1,1) from t1 group by 1;
+create table t2(f1 varchar(3));
+insert into t1 values ("123"),("456");
+select substring(f1,4,1), substring(f1,-4,1) from t2;
+drop table t1,t2;
+
+#
+# Bug #25197 :repeat function returns null when using table field directly as count
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE `t1` (
+ `id` varchar(20) NOT NULL,
+ `tire` tinyint(3) unsigned NOT NULL,
+ PRIMARY KEY (`id`)
+);
+
+INSERT INTO `t1` (`id`, `tire`) VALUES ('A', 0), ('B', 1),('C', 2);
+
+SELECT REPEAT( '#', tire ) AS A,
+ REPEAT( '#', tire % 999 ) AS B, tire FROM `t1`;
+
+DROP TABLE t1;
+
+#
+# Bug #26537: UNHEX() IS NULL comparison fails
+#
+SELECT UNHEX('G');
+SELECT UNHEX('G') IS NULL;
+
+#
+# Bug #26281: INSERT() function mishandles NUL on boundary condition
+#
+SELECT INSERT('abc', 3, 3, '1234');
+SELECT INSERT('abc', 4, 3, '1234');
+SELECT INSERT('abc', 5, 3, '1234');
+SELECT INSERT('abc', 6, 3, '1234');
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 9e5a3012934..4b952b66ff3 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -571,6 +571,13 @@ union
select last_day('0000-00-00');
+#
+# Bug 23616: datetime functions with double argumets
+#
+
+select isnull(week(now() + 0)), isnull(week(now() + 0.2)),
+ week(20061108), week(20061108.01), week(20061108085411.000002);
+
--echo End of 4.1 tests
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
@@ -694,6 +701,19 @@ set time_zone= @@global.time_zone;
select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
#
+# Bug #21103: DATE column not compared as DATE
+#
+
+create table t1 (field DATE);
+insert into t1 values ('2006-11-06');
+select * from t1 where field < '2006-11-06 04:08:36.0';
+select * from t1 where field = '2006-11-06 04:08:36.0';
+select * from t1 where field = '2006-11-06';
+select * from t1 where CAST(field as DATETIME) < '2006-11-06 04:08:36.0';
+select * from t1 where CAST(field as DATE) < '2006-11-06 04:08:36.0';
+drop table t1;
+
+#
# Bug #25643: SEC_TO_TIME function problem
#
CREATE TABLE t1 (a int, t1 time, t2 time, d date, PRIMARY KEY (a));
@@ -704,6 +724,13 @@ SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d)
SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d)
FROM t1 ORDER BY a DESC;
DROP TABLE t1;
+
+#
+# Bug #20293: group by cuts off value from time_format
+#
+# Check if using GROUP BY with TIME_FORMAT() produces correct results
+
+SELECT TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") FROM (SELECT 3020399 AS a UNION SELECT 3020398 ) x GROUP BY 1;
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 1704fe7dc80..579ec65f149 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -172,7 +172,7 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
drop table t1, t2;
-CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 (geometry) VALUES
(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
@@ -192,7 +192,7 @@ drop table t1;
#
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
- SPATIAL KEY i1 (c1(32))
+ SPATIAL KEY i1 (c1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
@@ -206,7 +206,7 @@ DROP TABLE t1;
#
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
- SPATIAL KEY i1 (c1(32))
+ SPATIAL KEY i1 (c1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
@@ -241,6 +241,562 @@ INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0)));
SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
DROP TABLE t1;
+
+#
+# Bug#25673 - spatial index corruption, error 126 incorrect key file for table
+#
+CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment,
+ c2 varchar(15) collate utf8_bin default NULL,
+ c1 varchar(15) collate utf8_bin default NULL,
+ c3 varchar(10) collate utf8_bin default NULL,
+ spatial_point point NOT NULL,
+ PRIMARY KEY(id),
+ SPATIAL KEY (spatial_point)
+ )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+#
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+ ('y', 's', 'j', GeomFromText('POINT(167 74)')),
+ ('r', 'n', 'd', GeomFromText('POINT(215 118)')),
+ ('g', 'n', 'e', GeomFromText('POINT(203 98)')),
+ ('h', 'd', 'd', GeomFromText('POINT(54 193)')),
+ ('r', 'x', 'y', GeomFromText('POINT(47 69)')),
+ ('t', 'q', 'r', GeomFromText('POINT(109 42)')),
+ ('a', 'z', 'd', GeomFromText('POINT(0 154)')),
+ ('x', 'v', 'o', GeomFromText('POINT(174 131)')),
+ ('b', 'r', 'a', GeomFromText('POINT(114 253)')),
+ ('x', 'z', 'i', GeomFromText('POINT(163 21)')),
+ ('w', 'p', 'i', GeomFromText('POINT(42 102)')),
+ ('g', 'j', 'j', GeomFromText('POINT(170 133)')),
+ ('m', 'g', 'n', GeomFromText('POINT(28 22)')),
+ ('b', 'z', 'h', GeomFromText('POINT(174 28)')),
+ ('q', 'k', 'f', GeomFromText('POINT(233 73)')),
+ ('w', 'w', 'a', GeomFromText('POINT(124 200)')),
+ ('t', 'j', 'w', GeomFromText('POINT(252 101)')),
+ ('d', 'r', 'd', GeomFromText('POINT(98 18)')),
+ ('w', 'o', 'y', GeomFromText('POINT(165 31)')),
+ ('y', 'h', 't', GeomFromText('POINT(14 220)')),
+ ('d', 'p', 'u', GeomFromText('POINT(223 196)')),
+ ('g', 'y', 'g', GeomFromText('POINT(207 96)')),
+ ('x', 'm', 'n', GeomFromText('POINT(214 3)')),
+ ('g', 'v', 'e', GeomFromText('POINT(140 205)')),
+ ('g', 'm', 'm', GeomFromText('POINT(10 236)')),
+ ('i', 'r', 'j', GeomFromText('POINT(137 228)')),
+ ('w', 's', 'p', GeomFromText('POINT(115 6)')),
+ ('o', 'n', 'k', GeomFromText('POINT(158 129)')),
+ ('j', 'h', 'l', GeomFromText('POINT(129 72)')),
+ ('f', 'x', 'l', GeomFromText('POINT(139 207)')),
+ ('u', 'd', 'n', GeomFromText('POINT(125 109)')),
+ ('b', 'a', 'z', GeomFromText('POINT(30 32)')),
+ ('m', 'h', 'o', GeomFromText('POINT(251 251)')),
+ ('f', 'r', 'd', GeomFromText('POINT(243 211)')),
+ ('b', 'd', 'r', GeomFromText('POINT(232 80)')),
+ ('g', 'k', 'v', GeomFromText('POINT(15 100)')),
+ ('i', 'f', 'c', GeomFromText('POINT(109 66)')),
+ ('r', 't', 'j', GeomFromText('POINT(178 6)')),
+ ('y', 'n', 'f', GeomFromText('POINT(233 211)')),
+ ('f', 'y', 'm', GeomFromText('POINT(99 16)')),
+ ('z', 'q', 'l', GeomFromText('POINT(39 49)')),
+ ('j', 'c', 'r', GeomFromText('POINT(75 187)')),
+ ('c', 'y', 'y', GeomFromText('POINT(246 253)')),
+ ('w', 'u', 'd', GeomFromText('POINT(56 190)')),
+ ('n', 'q', 'm', GeomFromText('POINT(73 149)')),
+ ('d', 'y', 'a', GeomFromText('POINT(134 6)')),
+ ('z', 's', 'w', GeomFromText('POINT(216 225)')),
+ ('d', 'u', 'k', GeomFromText('POINT(132 70)')),
+ ('f', 'v', 't', GeomFromText('POINT(187 141)')),
+ ('r', 'r', 'a', GeomFromText('POINT(152 39)')),
+ ('y', 'p', 'o', GeomFromText('POINT(45 27)')),
+ ('p', 'n', 'm', GeomFromText('POINT(228 148)')),
+ ('e', 'g', 'e', GeomFromText('POINT(88 81)')),
+ ('m', 'a', 'h', GeomFromText('POINT(35 29)')),
+ ('m', 'h', 'f', GeomFromText('POINT(30 71)')),
+ ('h', 'k', 'i', GeomFromText('POINT(244 78)')),
+ ('z', 'v', 'd', GeomFromText('POINT(241 38)')),
+ ('q', 'l', 'j', GeomFromText('POINT(13 71)')),
+ ('s', 'p', 'g', GeomFromText('POINT(108 38)')),
+ ('q', 's', 'j', GeomFromText('POINT(92 101)')),
+ ('l', 'h', 'g', GeomFromText('POINT(120 78)')),
+ ('w', 't', 'b', GeomFromText('POINT(193 109)')),
+ ('b', 's', 's', GeomFromText('POINT(223 211)')),
+ ('w', 'w', 'y', GeomFromText('POINT(122 42)')),
+ ('q', 'c', 'c', GeomFromText('POINT(104 102)')),
+ ('w', 'g', 'n', GeomFromText('POINT(213 120)')),
+ ('p', 'q', 'a', GeomFromText('POINT(247 148)')),
+ ('c', 'z', 'e', GeomFromText('POINT(18 106)')),
+ ('z', 'u', 'n', GeomFromText('POINT(70 133)')),
+ ('j', 'n', 'x', GeomFromText('POINT(232 13)')),
+ ('e', 'h', 'f', GeomFromText('POINT(22 135)')),
+ ('w', 'l', 'f', GeomFromText('POINT(9 180)')),
+ ('a', 'v', 'q', GeomFromText('POINT(163 228)')),
+ ('i', 'z', 'o', GeomFromText('POINT(180 100)')),
+ ('e', 'c', 'l', GeomFromText('POINT(182 231)')),
+ ('c', 'k', 'o', GeomFromText('POINT(19 60)')),
+ ('q', 'f', 'p', GeomFromText('POINT(79 95)')),
+ ('m', 'd', 'r', GeomFromText('POINT(3 127)')),
+ ('m', 'e', 't', GeomFromText('POINT(136 154)')),
+ ('w', 'w', 'w', GeomFromText('POINT(102 15)')),
+ ('l', 'n', 'q', GeomFromText('POINT(71 196)')),
+ ('p', 'k', 'c', GeomFromText('POINT(47 139)')),
+ ('j', 'o', 'r', GeomFromText('POINT(177 128)')),
+ ('j', 'q', 'a', GeomFromText('POINT(170 6)')),
+ ('b', 'a', 'o', GeomFromText('POINT(63 211)')),
+ ('g', 's', 'o', GeomFromText('POINT(144 251)')),
+ ('w', 'u', 'w', GeomFromText('POINT(221 214)')),
+ ('g', 'a', 'm', GeomFromText('POINT(14 102)')),
+ ('u', 'q', 'z', GeomFromText('POINT(86 200)')),
+ ('k', 'a', 'm', GeomFromText('POINT(144 222)')),
+ ('j', 'u', 'r', GeomFromText('POINT(216 142)')),
+ ('q', 'k', 'v', GeomFromText('POINT(121 236)')),
+ ('p', 'o', 'r', GeomFromText('POINT(108 102)')),
+ ('b', 'd', 'x', GeomFromText('POINT(127 198)')),
+ ('k', 's', 'a', GeomFromText('POINT(2 150)')),
+ ('f', 'm', 'f', GeomFromText('POINT(160 191)')),
+ ('q', 'y', 'x', GeomFromText('POINT(98 111)')),
+ ('o', 'f', 'm', GeomFromText('POINT(232 218)')),
+ ('c', 'w', 'j', GeomFromText('POINT(156 165)')),
+ ('s', 'q', 'v', GeomFromText('POINT(98 161)'));
+SET @@RAND_SEED1=692635050, @@RAND_SEED2=297339954;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=159925977, @@RAND_SEED2=942570618;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=328169745, @@RAND_SEED2=410451954;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=178507359, @@RAND_SEED2=332493072;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=1034033013, @@RAND_SEED2=558966507;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+UPDATE t1 set spatial_point=GeomFromText('POINT(230 9)') where c1 like 'y%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(95 35)') where c1 like 'j%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(93 99)') where c1 like 'a%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(19 81)') where c1 like 'r%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(20 177)') where c1 like 'h%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(221 193)') where c1 like 'u%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(195 205)') where c1 like 'd%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(15 213)') where c1 like 'u%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(214 63)') where c1 like 'n%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(243 171)') where c1 like 'c%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(198 82)') where c1 like 'y%';
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+ ('f', 'y', 'p', GeomFromText('POINT(109 235)')),
+ ('b', 'e', 'v', GeomFromText('POINT(20 48)')),
+ ('i', 'u', 'f', GeomFromText('POINT(15 55)')),
+ ('o', 'r', 'z', GeomFromText('POINT(105 64)')),
+ ('a', 'p', 'a', GeomFromText('POINT(142 236)')),
+ ('g', 'i', 'k', GeomFromText('POINT(10 49)')),
+ ('x', 'z', 'x', GeomFromText('POINT(192 200)')),
+ ('c', 'v', 'r', GeomFromText('POINT(94 168)')),
+ ('y', 'z', 'e', GeomFromText('POINT(141 51)')),
+ ('h', 'm', 'd', GeomFromText('POINT(35 251)')),
+ ('v', 'm', 'q', GeomFromText('POINT(44 90)')),
+ ('j', 'l', 'z', GeomFromText('POINT(67 237)')),
+ ('i', 'v', 'a', GeomFromText('POINT(75 14)')),
+ ('b', 'q', 't', GeomFromText('POINT(153 33)')),
+ ('e', 'm', 'a', GeomFromText('POINT(247 49)')),
+ ('l', 'y', 'g', GeomFromText('POINT(56 203)')),
+ ('v', 'o', 'r', GeomFromText('POINT(90 54)')),
+ ('r', 'n', 'd', GeomFromText('POINT(135 83)')),
+ ('j', 't', 'u', GeomFromText('POINT(174 239)')),
+ ('u', 'n', 'g', GeomFromText('POINT(104 191)')),
+ ('p', 'q', 'y', GeomFromText('POINT(63 171)')),
+ ('o', 'q', 'p', GeomFromText('POINT(192 103)')),
+ ('f', 'x', 'e', GeomFromText('POINT(244 30)')),
+ ('n', 'x', 'c', GeomFromText('POINT(92 103)')),
+ ('r', 'q', 'z', GeomFromText('POINT(166 20)')),
+ ('s', 'a', 'j', GeomFromText('POINT(137 205)')),
+ ('z', 't', 't', GeomFromText('POINT(99 134)')),
+ ('o', 'm', 'j', GeomFromText('POINT(217 3)')),
+ ('n', 'h', 'j', GeomFromText('POINT(211 17)')),
+ ('v', 'v', 'a', GeomFromText('POINT(41 137)')),
+ ('q', 'o', 'j', GeomFromText('POINT(5 92)')),
+ ('z', 'y', 'e', GeomFromText('POINT(175 212)')),
+ ('j', 'z', 'h', GeomFromText('POINT(224 194)')),
+ ('a', 'g', 'm', GeomFromText('POINT(31 119)')),
+ ('p', 'c', 'f', GeomFromText('POINT(17 221)')),
+ ('t', 'h', 'k', GeomFromText('POINT(26 203)')),
+ ('u', 'w', 'p', GeomFromText('POINT(47 185)')),
+ ('z', 'a', 'c', GeomFromText('POINT(61 133)')),
+ ('u', 'k', 'a', GeomFromText('POINT(210 115)')),
+ ('k', 'f', 'h', GeomFromText('POINT(125 113)')),
+ ('t', 'v', 'y', GeomFromText('POINT(12 239)')),
+ ('u', 'v', 'd', GeomFromText('POINT(90 24)')),
+ ('m', 'y', 'w', GeomFromText('POINT(25 243)')),
+ ('d', 'n', 'g', GeomFromText('POINT(122 92)')),
+ ('z', 'm', 'f', GeomFromText('POINT(235 110)')),
+ ('q', 'd', 'f', GeomFromText('POINT(233 217)')),
+ ('a', 'v', 'u', GeomFromText('POINT(69 59)')),
+ ('x', 'k', 'p', GeomFromText('POINT(240 14)')),
+ ('i', 'v', 'r', GeomFromText('POINT(154 42)')),
+ ('w', 'h', 'l', GeomFromText('POINT(178 156)')),
+ ('d', 'h', 'n', GeomFromText('POINT(65 157)')),
+ ('c', 'k', 'z', GeomFromText('POINT(62 33)')),
+ ('e', 'l', 'w', GeomFromText('POINT(162 1)')),
+ ('r', 'f', 'i', GeomFromText('POINT(127 71)')),
+ ('q', 'm', 'c', GeomFromText('POINT(63 118)')),
+ ('c', 'h', 'u', GeomFromText('POINT(205 203)')),
+ ('d', 't', 'p', GeomFromText('POINT(234 87)')),
+ ('s', 'g', 'h', GeomFromText('POINT(149 34)')),
+ ('o', 'b', 'q', GeomFromText('POINT(159 179)')),
+ ('k', 'u', 'f', GeomFromText('POINT(202 254)')),
+ ('u', 'f', 'g', GeomFromText('POINT(70 15)')),
+ ('x', 's', 'b', GeomFromText('POINT(25 181)')),
+ ('s', 'c', 'g', GeomFromText('POINT(252 17)')),
+ ('a', 'c', 'f', GeomFromText('POINT(89 67)')),
+ ('r', 'e', 'q', GeomFromText('POINT(55 54)')),
+ ('f', 'i', 'k', GeomFromText('POINT(178 230)')),
+ ('p', 'e', 'l', GeomFromText('POINT(198 28)')),
+ ('w', 'o', 'd', GeomFromText('POINT(204 189)')),
+ ('c', 'a', 'g', GeomFromText('POINT(230 178)')),
+ ('r', 'o', 'e', GeomFromText('POINT(61 116)')),
+ ('w', 'a', 'a', GeomFromText('POINT(178 237)')),
+ ('v', 'd', 'e', GeomFromText('POINT(70 85)')),
+ ('k', 'c', 'e', GeomFromText('POINT(147 118)')),
+ ('d', 'q', 't', GeomFromText('POINT(218 77)')),
+ ('k', 'g', 'f', GeomFromText('POINT(192 113)')),
+ ('w', 'n', 'e', GeomFromText('POINT(92 124)')),
+ ('r', 'm', 'q', GeomFromText('POINT(130 65)')),
+ ('o', 'r', 'r', GeomFromText('POINT(174 233)')),
+ ('k', 'n', 't', GeomFromText('POINT(175 147)')),
+ ('q', 'm', 'r', GeomFromText('POINT(18 208)')),
+ ('l', 'd', 'i', GeomFromText('POINT(13 104)')),
+ ('w', 'o', 'y', GeomFromText('POINT(207 39)')),
+ ('p', 'u', 'o', GeomFromText('POINT(114 31)')),
+ ('y', 'a', 'p', GeomFromText('POINT(106 59)')),
+ ('a', 'x', 'z', GeomFromText('POINT(17 57)')),
+ ('v', 'h', 'x', GeomFromText('POINT(170 13)')),
+ ('t', 's', 'u', GeomFromText('POINT(84 18)')),
+ ('z', 'z', 'f', GeomFromText('POINT(250 197)')),
+ ('l', 'z', 't', GeomFromText('POINT(59 80)')),
+ ('j', 'g', 's', GeomFromText('POINT(54 26)')),
+ ('g', 'v', 'm', GeomFromText('POINT(89 98)')),
+ ('q', 'v', 'b', GeomFromText('POINT(39 240)')),
+ ('x', 'k', 'v', GeomFromText('POINT(246 207)')),
+ ('k', 'u', 'i', GeomFromText('POINT(105 111)')),
+ ('w', 'z', 's', GeomFromText('POINT(235 8)')),
+ ('d', 'd', 'd', GeomFromText('POINT(105 4)')),
+ ('c', 'z', 'q', GeomFromText('POINT(13 140)')),
+ ('m', 'k', 'i', GeomFromText('POINT(208 120)')),
+ ('g', 'a', 'g', GeomFromText('POINT(9 182)')),
+ ('z', 'j', 'r', GeomFromText('POINT(149 153)')),
+ ('h', 'f', 'g', GeomFromText('POINT(81 236)')),
+ ('m', 'e', 'q', GeomFromText('POINT(209 215)')),
+ ('c', 'h', 'y', GeomFromText('POINT(235 70)')),
+ ('i', 'e', 'g', GeomFromText('POINT(138 26)')),
+ ('m', 't', 'u', GeomFromText('POINT(119 237)')),
+ ('o', 'w', 's', GeomFromText('POINT(193 166)')),
+ ('f', 'm', 'q', GeomFromText('POINT(85 96)')),
+ ('x', 'l', 'x', GeomFromText('POINT(58 115)')),
+ ('x', 'q', 'u', GeomFromText('POINT(108 210)')),
+ ('b', 'h', 'i', GeomFromText('POINT(250 139)')),
+ ('y', 'd', 'x', GeomFromText('POINT(199 135)')),
+ ('w', 'h', 'p', GeomFromText('POINT(247 233)')),
+ ('p', 'z', 't', GeomFromText('POINT(148 249)')),
+ ('q', 'a', 'u', GeomFromText('POINT(174 78)')),
+ ('v', 't', 'm', GeomFromText('POINT(70 228)')),
+ ('t', 'n', 'f', GeomFromText('POINT(123 2)')),
+ ('x', 't', 'b', GeomFromText('POINT(35 50)')),
+ ('r', 'j', 'f', GeomFromText('POINT(200 51)')),
+ ('s', 'q', 'o', GeomFromText('POINT(23 184)')),
+ ('u', 'v', 'z', GeomFromText('POINT(7 113)')),
+ ('v', 'u', 'l', GeomFromText('POINT(145 190)')),
+ ('o', 'k', 'i', GeomFromText('POINT(161 122)')),
+ ('l', 'y', 'e', GeomFromText('POINT(17 232)')),
+ ('t', 'b', 'e', GeomFromText('POINT(120 50)')),
+ ('e', 's', 'u', GeomFromText('POINT(254 1)')),
+ ('d', 'd', 'u', GeomFromText('POINT(167 140)')),
+ ('o', 'b', 'x', GeomFromText('POINT(186 237)')),
+ ('m', 's', 's', GeomFromText('POINT(172 149)')),
+ ('t', 'y', 'a', GeomFromText('POINT(149 85)')),
+ ('x', 't', 'r', GeomFromText('POINT(10 165)')),
+ ('g', 'c', 'e', GeomFromText('POINT(95 165)')),
+ ('e', 'e', 'z', GeomFromText('POINT(98 65)')),
+ ('f', 'v', 'i', GeomFromText('POINT(149 144)')),
+ ('o', 'p', 'm', GeomFromText('POINT(233 67)')),
+ ('t', 'u', 'b', GeomFromText('POINT(109 215)')),
+ ('o', 'o', 'b', GeomFromText('POINT(130 48)')),
+ ('e', 'm', 'h', GeomFromText('POINT(88 189)')),
+ ('e', 'v', 'y', GeomFromText('POINT(55 29)')),
+ ('e', 't', 'm', GeomFromText('POINT(129 55)')),
+ ('p', 'p', 'i', GeomFromText('POINT(126 222)')),
+ ('c', 'i', 'c', GeomFromText('POINT(19 158)')),
+ ('c', 'b', 's', GeomFromText('POINT(13 19)')),
+ ('u', 'y', 'a', GeomFromText('POINT(114 5)')),
+ ('a', 'o', 'f', GeomFromText('POINT(227 232)')),
+ ('t', 'c', 'z', GeomFromText('POINT(63 62)')),
+ ('d', 'o', 'k', GeomFromText('POINT(48 228)')),
+ ('x', 'c', 'e', GeomFromText('POINT(204 2)')),
+ ('e', 'e', 'g', GeomFromText('POINT(125 43)')),
+ ('o', 'r', 'f', GeomFromText('POINT(171 140)'));
+UPDATE t1 set spatial_point=GeomFromText('POINT(163 157)') where c1 like 'w%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(53 151)') where c1 like 'd%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(96 183)') where c1 like 'r%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(57 91)') where c1 like 'q%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(202 110)') where c1 like 'c%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(120 137)') where c1 like 'w%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(207 147)') where c1 like 'c%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(31 125)') where c1 like 'e%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(27 36)') where c1 like 'r%';
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+ ('b', 'c', 'e', GeomFromText('POINT(41 137)')),
+ ('p', 'y', 'k', GeomFromText('POINT(50 22)')),
+ ('s', 'c', 'h', GeomFromText('POINT(208 173)')),
+ ('x', 'u', 'l', GeomFromText('POINT(199 175)')),
+ ('s', 'r', 'h', GeomFromText('POINT(85 192)')),
+ ('j', 'k', 'u', GeomFromText('POINT(18 25)')),
+ ('p', 'w', 'h', GeomFromText('POINT(152 197)')),
+ ('e', 'd', 'c', GeomFromText('POINT(229 3)')),
+ ('o', 'x', 'k', GeomFromText('POINT(187 155)')),
+ ('o', 'b', 'k', GeomFromText('POINT(208 150)')),
+ ('d', 'a', 'j', GeomFromText('POINT(70 87)')),
+ ('f', 'e', 'k', GeomFromText('POINT(156 96)')),
+ ('u', 'y', 'p', GeomFromText('POINT(239 193)')),
+ ('n', 'v', 'p', GeomFromText('POINT(223 98)')),
+ ('z', 'j', 'r', GeomFromText('POINT(87 89)')),
+ ('h', 'x', 'x', GeomFromText('POINT(92 0)')),
+ ('r', 'v', 'r', GeomFromText('POINT(159 139)')),
+ ('v', 'g', 'g', GeomFromText('POINT(16 229)')),
+ ('z', 'k', 'u', GeomFromText('POINT(99 52)')),
+ ('p', 'p', 'o', GeomFromText('POINT(105 125)')),
+ ('w', 'h', 'y', GeomFromText('POINT(105 154)')),
+ ('v', 'y', 'z', GeomFromText('POINT(134 238)')),
+ ('x', 'o', 'o', GeomFromText('POINT(178 88)')),
+ ('z', 'w', 'd', GeomFromText('POINT(123 60)')),
+ ('q', 'f', 'u', GeomFromText('POINT(64 90)')),
+ ('s', 'n', 't', GeomFromText('POINT(50 138)')),
+ ('v', 'p', 't', GeomFromText('POINT(114 91)')),
+ ('a', 'o', 'n', GeomFromText('POINT(78 43)')),
+ ('k', 'u', 'd', GeomFromText('POINT(185 161)')),
+ ('w', 'd', 'n', GeomFromText('POINT(25 92)')),
+ ('k', 'w', 'a', GeomFromText('POINT(59 238)')),
+ ('t', 'c', 'f', GeomFromText('POINT(65 87)')),
+ ('g', 's', 'p', GeomFromText('POINT(238 126)')),
+ ('d', 'n', 'y', GeomFromText('POINT(107 173)')),
+ ('l', 'a', 'w', GeomFromText('POINT(125 152)')),
+ ('m', 'd', 'j', GeomFromText('POINT(146 53)')),
+ ('q', 'm', 'c', GeomFromText('POINT(217 187)')),
+ ('i', 'r', 'r', GeomFromText('POINT(6 113)')),
+ ('e', 'j', 'b', GeomFromText('POINT(37 83)')),
+ ('w', 'w', 'h', GeomFromText('POINT(83 199)')),
+ ('k', 'b', 's', GeomFromText('POINT(170 64)')),
+ ('s', 'b', 'c', GeomFromText('POINT(163 130)')),
+ ('c', 'h', 'a', GeomFromText('POINT(141 3)')),
+ ('k', 'j', 'u', GeomFromText('POINT(143 76)')),
+ ('r', 'h', 'o', GeomFromText('POINT(243 92)')),
+ ('i', 'd', 'b', GeomFromText('POINT(205 13)')),
+ ('r', 'y', 'q', GeomFromText('POINT(138 8)')),
+ ('m', 'o', 'i', GeomFromText('POINT(36 45)')),
+ ('v', 'g', 'm', GeomFromText('POINT(0 40)')),
+ ('f', 'e', 'i', GeomFromText('POINT(76 6)')),
+ ('c', 'q', 'q', GeomFromText('POINT(115 248)')),
+ ('x', 'c', 'i', GeomFromText('POINT(29 74)')),
+ ('l', 's', 't', GeomFromText('POINT(83 18)')),
+ ('t', 't', 'a', GeomFromText('POINT(26 168)')),
+ ('u', 'n', 'x', GeomFromText('POINT(200 110)')),
+ ('j', 'b', 'd', GeomFromText('POINT(216 136)')),
+ ('s', 'p', 'w', GeomFromText('POINT(38 156)')),
+ ('f', 'b', 'v', GeomFromText('POINT(29 186)')),
+ ('v', 'e', 'r', GeomFromText('POINT(149 40)')),
+ ('v', 't', 'm', GeomFromText('POINT(184 24)')),
+ ('y', 'g', 'a', GeomFromText('POINT(219 105)')),
+ ('s', 'f', 'i', GeomFromText('POINT(114 130)')),
+ ('e', 'q', 'h', GeomFromText('POINT(203 135)')),
+ ('h', 'g', 'b', GeomFromText('POINT(9 208)')),
+ ('o', 'l', 'r', GeomFromText('POINT(245 79)')),
+ ('s', 's', 'v', GeomFromText('POINT(238 198)')),
+ ('w', 'w', 'z', GeomFromText('POINT(209 232)')),
+ ('v', 'd', 'n', GeomFromText('POINT(30 193)')),
+ ('q', 'w', 'k', GeomFromText('POINT(133 18)')),
+ ('o', 'h', 'o', GeomFromText('POINT(42 140)')),
+ ('f', 'f', 'h', GeomFromText('POINT(145 1)')),
+ ('u', 's', 'r', GeomFromText('POINT(70 62)')),
+ ('x', 'n', 'q', GeomFromText('POINT(33 86)')),
+ ('u', 'p', 'v', GeomFromText('POINT(232 220)')),
+ ('z', 'e', 'a', GeomFromText('POINT(130 69)')),
+ ('r', 'u', 'z', GeomFromText('POINT(243 241)')),
+ ('b', 'n', 't', GeomFromText('POINT(120 12)')),
+ ('u', 'f', 's', GeomFromText('POINT(190 212)')),
+ ('a', 'd', 'q', GeomFromText('POINT(235 191)')),
+ ('f', 'q', 'm', GeomFromText('POINT(176 2)')),
+ ('n', 'c', 's', GeomFromText('POINT(218 163)')),
+ ('e', 'm', 'h', GeomFromText('POINT(163 108)')),
+ ('c', 'f', 'l', GeomFromText('POINT(220 115)')),
+ ('c', 'v', 'q', GeomFromText('POINT(66 45)')),
+ ('w', 'v', 'x', GeomFromText('POINT(251 220)')),
+ ('f', 'w', 'z', GeomFromText('POINT(146 149)')),
+ ('h', 'n', 'h', GeomFromText('POINT(148 128)')),
+ ('y', 'k', 'v', GeomFromText('POINT(28 110)')),
+ ('c', 'x', 'q', GeomFromText('POINT(13 13)')),
+ ('e', 'd', 's', GeomFromText('POINT(91 190)')),
+ ('c', 'w', 'c', GeomFromText('POINT(10 231)')),
+ ('u', 'j', 'n', GeomFromText('POINT(250 21)')),
+ ('w', 'n', 'x', GeomFromText('POINT(141 69)')),
+ ('f', 'p', 'y', GeomFromText('POINT(228 246)')),
+ ('d', 'q', 'f', GeomFromText('POINT(194 22)')),
+ ('d', 'z', 'l', GeomFromText('POINT(233 181)')),
+ ('c', 'a', 'q', GeomFromText('POINT(183 96)')),
+ ('m', 'i', 'd', GeomFromText('POINT(117 226)')),
+ ('z', 'y', 'y', GeomFromText('POINT(62 81)')),
+ ('g', 'v', 'm', GeomFromText('POINT(66 158)'));
+SET @@RAND_SEED1=481064922, @@RAND_SEED2=438133497;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=280535103, @@RAND_SEED2=444518646;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=1072017234, @@RAND_SEED2=484203885;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=358851897, @@RAND_SEED2=358495224;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+SET @@RAND_SEED1=509031459, @@RAND_SEED2=675962925;
+DELETE FROM t1 ORDER BY RAND() LIMIT 10;
+UPDATE t1 set spatial_point=GeomFromText('POINT(61 203)') where c1 like 'y%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(202 194)') where c1 like 'f%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(228 18)') where c1 like 'h%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(88 18)') where c1 like 'l%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(176 94)') where c1 like 'e%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(44 47)') where c1 like 'g%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(95 191)') where c1 like 'b%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(179 218)') where c1 like 'y%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(239 40)') where c1 like 'g%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(248 41)') where c1 like 'q%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(167 82)') where c1 like 't%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(13 104)') where c1 like 'u%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(139 84)') where c1 like 'a%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(145 108)') where c1 like 'p%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(147 57)') where c1 like 't%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(217 144)') where c1 like 'n%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(160 224)') where c1 like 'w%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(38 28)') where c1 like 'j%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(104 114)') where c1 like 'q%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(88 19)') where c1 like 'c%';
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+ ('f', 'x', 'p', GeomFromText('POINT(92 181)')),
+ ('s', 'i', 'c', GeomFromText('POINT(49 60)')),
+ ('c', 'c', 'i', GeomFromText('POINT(7 57)')),
+ ('n', 'g', 'k', GeomFromText('POINT(252 105)')),
+ ('g', 'b', 'm', GeomFromText('POINT(180 11)')),
+ ('u', 'l', 'r', GeomFromText('POINT(32 90)')),
+ ('c', 'x', 'e', GeomFromText('POINT(143 24)')),
+ ('x', 'u', 'a', GeomFromText('POINT(123 92)')),
+ ('s', 'b', 'h', GeomFromText('POINT(190 108)')),
+ ('c', 'x', 'b', GeomFromText('POINT(104 100)')),
+ ('i', 'd', 't', GeomFromText('POINT(214 104)')),
+ ('r', 'w', 'g', GeomFromText('POINT(29 67)')),
+ ('b', 'f', 'g', GeomFromText('POINT(149 46)')),
+ ('r', 'r', 'd', GeomFromText('POINT(242 196)')),
+ ('j', 'l', 'a', GeomFromText('POINT(90 196)')),
+ ('e', 't', 'b', GeomFromText('POINT(190 64)')),
+ ('l', 'x', 'w', GeomFromText('POINT(250 73)')),
+ ('q', 'y', 'r', GeomFromText('POINT(120 182)')),
+ ('s', 'j', 'a', GeomFromText('POINT(180 175)')),
+ ('n', 'i', 'y', GeomFromText('POINT(124 136)')),
+ ('s', 'x', 's', GeomFromText('POINT(176 209)')),
+ ('u', 'f', 's', GeomFromText('POINT(215 173)')),
+ ('m', 'j', 'x', GeomFromText('POINT(44 140)')),
+ ('v', 'g', 'x', GeomFromText('POINT(177 233)')),
+ ('u', 't', 'b', GeomFromText('POINT(136 197)')),
+ ('f', 'g', 'b', GeomFromText('POINT(10 8)')),
+ ('v', 'c', 'j', GeomFromText('POINT(13 81)')),
+ ('d', 's', 'q', GeomFromText('POINT(200 100)')),
+ ('a', 'p', 'j', GeomFromText('POINT(33 40)')),
+ ('i', 'c', 'g', GeomFromText('POINT(168 204)')),
+ ('k', 'h', 'i', GeomFromText('POINT(93 243)')),
+ ('s', 'b', 's', GeomFromText('POINT(157 13)')),
+ ('v', 'l', 'l', GeomFromText('POINT(103 6)')),
+ ('r', 'b', 'k', GeomFromText('POINT(244 137)')),
+ ('l', 'd', 'r', GeomFromText('POINT(162 254)')),
+ ('q', 'b', 'z', GeomFromText('POINT(136 246)')),
+ ('x', 'x', 'p', GeomFromText('POINT(120 37)')),
+ ('m', 'e', 'z', GeomFromText('POINT(203 167)')),
+ ('q', 'n', 'p', GeomFromText('POINT(94 119)')),
+ ('b', 'g', 'u', GeomFromText('POINT(93 248)')),
+ ('r', 'v', 'v', GeomFromText('POINT(53 88)')),
+ ('y', 'a', 'i', GeomFromText('POINT(98 219)')),
+ ('a', 's', 'g', GeomFromText('POINT(173 138)')),
+ ('c', 'a', 't', GeomFromText('POINT(235 135)')),
+ ('q', 'm', 'd', GeomFromText('POINT(224 208)')),
+ ('e', 'p', 'k', GeomFromText('POINT(161 238)')),
+ ('n', 'g', 'q', GeomFromText('POINT(35 204)')),
+ ('t', 't', 'x', GeomFromText('POINT(230 178)')),
+ ('w', 'f', 'a', GeomFromText('POINT(150 221)')),
+ ('z', 'm', 'z', GeomFromText('POINT(119 42)')),
+ ('l', 'j', 's', GeomFromText('POINT(97 96)')),
+ ('f', 'z', 'x', GeomFromText('POINT(208 65)')),
+ ('i', 'v', 'c', GeomFromText('POINT(145 79)')),
+ ('l', 'f', 'k', GeomFromText('POINT(83 234)')),
+ ('u', 'a', 's', GeomFromText('POINT(250 49)')),
+ ('o', 'k', 'p', GeomFromText('POINT(46 50)')),
+ ('d', 'e', 'z', GeomFromText('POINT(30 198)')),
+ ('r', 'r', 'l', GeomFromText('POINT(78 189)')),
+ ('y', 'l', 'f', GeomFromText('POINT(188 132)')),
+ ('d', 'q', 'm', GeomFromText('POINT(247 107)')),
+ ('p', 'j', 'n', GeomFromText('POINT(148 227)')),
+ ('b', 'o', 'i', GeomFromText('POINT(172 25)')),
+ ('e', 'v', 'd', GeomFromText('POINT(94 248)')),
+ ('q', 'd', 'f', GeomFromText('POINT(15 29)')),
+ ('w', 'b', 'b', GeomFromText('POINT(74 111)')),
+ ('g', 'q', 'f', GeomFromText('POINT(107 215)')),
+ ('o', 'h', 'r', GeomFromText('POINT(25 168)')),
+ ('u', 't', 'w', GeomFromText('POINT(251 188)')),
+ ('h', 's', 'w', GeomFromText('POINT(254 247)')),
+ ('f', 'f', 'b', GeomFromText('POINT(166 103)'));
+SET @@RAND_SEED1=866613816, @@RAND_SEED2=92289615;
+INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
+ ('l', 'c', 'l', GeomFromText('POINT(202 98)')),
+ ('k', 'c', 'b', GeomFromText('POINT(46 206)')),
+ ('r', 'y', 'm', GeomFromText('POINT(74 140)')),
+ ('y', 'z', 'd', GeomFromText('POINT(200 160)')),
+ ('s', 'y', 's', GeomFromText('POINT(156 205)')),
+ ('u', 'v', 'p', GeomFromText('POINT(86 82)')),
+ ('j', 's', 's', GeomFromText('POINT(91 233)')),
+ ('x', 'j', 'f', GeomFromText('POINT(3 14)')),
+ ('l', 'z', 'v', GeomFromText('POINT(123 156)')),
+ ('h', 'i', 'o', GeomFromText('POINT(145 229)')),
+ ('o', 'r', 'd', GeomFromText('POINT(15 22)')),
+ ('f', 'x', 't', GeomFromText('POINT(21 60)')),
+ ('t', 'g', 'h', GeomFromText('POINT(50 153)')),
+ ('g', 'u', 'b', GeomFromText('POINT(82 85)')),
+ ('v', 'a', 'p', GeomFromText('POINT(231 178)')),
+ ('n', 'v', 'o', GeomFromText('POINT(183 25)')),
+ ('j', 'n', 'm', GeomFromText('POINT(50 144)')),
+ ('e', 'f', 'i', GeomFromText('POINT(46 16)')),
+ ('d', 'w', 'a', GeomFromText('POINT(66 6)')),
+ ('f', 'x', 'a', GeomFromText('POINT(107 197)')),
+ ('m', 'o', 'a', GeomFromText('POINT(142 80)')),
+ ('q', 'l', 'g', GeomFromText('POINT(251 23)')),
+ ('c', 's', 's', GeomFromText('POINT(158 43)')),
+ ('y', 'd', 'o', GeomFromText('POINT(196 228)')),
+ ('d', 'p', 'l', GeomFromText('POINT(107 5)')),
+ ('h', 'a', 'b', GeomFromText('POINT(183 166)')),
+ ('m', 'w', 'p', GeomFromText('POINT(19 59)')),
+ ('b', 'y', 'o', GeomFromText('POINT(178 30)')),
+ ('x', 'w', 'i', GeomFromText('POINT(168 94)')),
+ ('t', 'k', 'z', GeomFromText('POINT(171 5)')),
+ ('r', 'm', 'a', GeomFromText('POINT(222 19)')),
+ ('u', 'v', 'e', GeomFromText('POINT(224 80)')),
+ ('q', 'r', 'k', GeomFromText('POINT(212 218)')),
+ ('d', 'p', 'j', GeomFromText('POINT(169 7)')),
+ ('d', 'r', 'v', GeomFromText('POINT(193 23)')),
+ ('n', 'y', 'y', GeomFromText('POINT(130 178)')),
+ ('m', 'z', 'r', GeomFromText('POINT(81 200)')),
+ ('j', 'e', 'w', GeomFromText('POINT(145 239)')),
+ ('v', 'h', 'x', GeomFromText('POINT(24 105)')),
+ ('z', 'm', 'a', GeomFromText('POINT(175 129)')),
+ ('b', 'c', 'v', GeomFromText('POINT(213 10)')),
+ ('t', 't', 'u', GeomFromText('POINT(2 129)')),
+ ('r', 's', 'v', GeomFromText('POINT(209 192)')),
+ ('x', 'p', 'g', GeomFromText('POINT(43 63)')),
+ ('t', 'e', 'u', GeomFromText('POINT(139 210)')),
+ ('l', 'e', 't', GeomFromText('POINT(245 148)')),
+ ('a', 'i', 'k', GeomFromText('POINT(167 195)')),
+ ('m', 'o', 'h', GeomFromText('POINT(206 120)')),
+ ('g', 'z', 's', GeomFromText('POINT(169 240)')),
+ ('z', 'u', 's', GeomFromText('POINT(202 120)')),
+ ('i', 'b', 'a', GeomFromText('POINT(216 18)')),
+ ('w', 'y', 'g', GeomFromText('POINT(119 236)')),
+ ('h', 'y', 'p', GeomFromText('POINT(161 24)'));
+UPDATE t1 set spatial_point=GeomFromText('POINT(33 100)') where c1 like 't%';
+UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%';
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 51dec7d2b81..7ae6e3adda7 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -360,14 +360,14 @@ t1 where object_id=85984;
drop table t1;
-create table t1 (fl geometry);
+create table t1 (fl geometry not null);
--error 1416
insert into t1 values (1);
--error 1416
insert into t1 values (1.11);
--error 1416
insert into t1 values ("qwerty");
---error 1416
+--error 1048
insert into t1 values (pointfromtext('point(1,1)'));
drop table t1;
@@ -389,7 +389,41 @@ load data infile '../std_data_ln/bad_gis_data.dat' into table t1;
alter table t1 enable keys;
drop table t1;
-# End of 4.1 tests
+#
+# Bug #26038: is null and bad data
+#
+
+create table t1 (a int, b blob);
+insert into t1 values (1, ''), (2, NULL), (3, '1');
+select * from t1;
+
+select
+ geometryfromtext(b) IS NULL, geometryfromwkb(b) IS NULL, astext(b) IS NULL,
+ aswkb(b) IS NULL, geometrytype(b) IS NULL, centroid(b) IS NULL,
+ envelope(b) IS NULL, startpoint(b) IS NULL, endpoint(b) IS NULL,
+ exteriorring(b) IS NULL, pointn(b, 1) IS NULL, geometryn(b, 1) IS NULL,
+ interiorringn(b, 1) IS NULL, multipoint(b) IS NULL, isempty(b) IS NULL,
+ issimple(b) IS NULL, isclosed(b) IS NULL, dimension(b) IS NULL,
+ numgeometries(b) IS NULL, numinteriorrings(b) IS NULL, numpoints(b) IS NULL,
+ area(b) IS NULL, glength(b) IS NULL, srid(b) IS NULL, x(b) IS NULL,
+ y(b) IS NULL
+from t1;
+
+select
+ within(b, b) IS NULL, contains(b, b) IS NULL, overlaps(b, b) IS NULL,
+ equals(b, b) IS NULL, disjoint(b, b) IS NULL, touches(b, b) IS NULL,
+ intersects(b, b) IS NULL, crosses(b, b) IS NULL
+from t1;
+
+select
+ point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS NULL,
+ multilinestring(b) IS NULL, multipolygon(b) IS NULL,
+ geometrycollection(b) IS NULL
+from t1;
+
+drop table t1;
+
+--echo End of 4.1 tests
#
# Bug #12281 (Geometry: crash in trigger)
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index a533af995dc..866c5a8a4b3 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -395,6 +395,8 @@ delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
drop database mysqltest_1;
+--source include/add_anonymous_users.inc
+
# But anonymous users can't change their password
connect (n5,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection n5;
@@ -403,6 +405,8 @@ set password = password("changed");
disconnect n5;
connection default;
+--source include/delete_anonymous_users.inc
+
# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
# multi-threaded environment". We should be able to execute FLUSH
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
index c28dd12cdee..10e571fc5f5 100644
--- a/mysql-test/t/grant_cache.test
+++ b/mysql-test/t/grant_cache.test
@@ -4,6 +4,8 @@
# See at the end of the test why we disable the ps protocol (*)
-- disable_ps_protocol
+--source include/add_anonymous_users.inc
+
#
# Test grants with query cache
#
@@ -73,6 +75,7 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_not_cached";
+
# Don't use '' as user because it will pick Unix login
connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
connection unkuser;
@@ -152,6 +155,9 @@ drop database mysqltest;
set GLOBAL query_cache_size=default;
+--source include/delete_anonymous_users.inc
+
+
# End of 4.1 tests
# (*) Why we disable the ps protocol: because in normal protocol,
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 76e4af8f610..a3318745764 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -757,10 +757,66 @@ SET SQL_MODE = '';
# Bug #21174: Index degrades sort performance and
# optimizer does not honor IGNORE INDEX
#
-CREATE TABLE t1 (a INT, b INT, KEY(a));
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
+CREATE TABLE t1 (a INT, b INT,
+ PRIMARY KEY (a),
+ KEY i2(a,b));
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
+INSERT INTO t1 SELECT a + 8,b FROM t1;
+INSERT INTO t1 SELECT a + 16,b FROM t1;
+INSERT INTO t1 SELECT a + 32,b FROM t1;
+INSERT INTO t1 SELECT a + 64,b FROM t1;
+INSERT INTO t1 SELECT a + 128,b FROM t1;
+ANALYZE TABLE t1;
+EXPLAIN SELECT a FROM t1 WHERE a < 2;
+EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a;
+EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a;
+EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2);
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2);
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
+EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY)
+ IGNORE INDEX FOR GROUP BY (i2) GROUP BY a;
+EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2);
+EXPLAIN SELECT a FROM t1 FORCE INDEX (i2);
+EXPLAIN SELECT a FROM t1 USE INDEX ();
+EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2);
+--error ER_WRONG_USAGE
+EXPLAIN SELECT a FROM t1
+ FORCE INDEX (PRIMARY)
+ IGNORE INDEX FOR GROUP BY (i2)
+ IGNORE INDEX FOR ORDER BY (i2)
+ USE INDEX (i2);
+EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX ();
+--error ER_PARSE_ERROR
+EXPLAIN SELECT a FROM t1 FORCE INDEX ();
+--error ER_PARSE_ERROR
+EXPLAIN SELECT a FROM t1 IGNORE INDEX ();
+EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2)
+ USE INDEX FOR GROUP BY (i2) GROUP BY a;
+EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2)
+ FORCE INDEX FOR GROUP BY (i2) GROUP BY a;
+EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2);
+EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX ();
+
+EXPLAIN SELECT a FROM t1
+ USE INDEX FOR GROUP BY (i2)
+ USE INDEX FOR ORDER BY (i2)
+ USE INDEX FOR JOIN (i2);
+
+EXPLAIN SELECT a FROM t1
+ USE INDEX FOR JOIN (i2)
+ USE INDEX FOR JOIN (i2)
+ USE INDEX FOR JOIN (i2,i2);
+
+EXPLAIN SELECT 1 FROM t1 WHERE a IN
+ (SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
+
+CREATE TABLE t2 (a INT, b INT, KEY(a));
+INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4);
+EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2;
+EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2;
+
+EXPLAIN SELECT 1 FROM t2 WHERE a IN
+ (SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
-EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
-EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
-
-DROP TABLE t1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index 624597cd8d7..b47a5fc2033 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -471,3 +471,12 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
DROP TABLE t1;
# End of 5.0 tests
+
+#
+# BUG#26080 - Memory Storage engine not working properly
+#
+CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('', 0);
+ALTER TABLE t1 MODIFY c1 VARCHAR(101);
+SELECT c2 FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test
index cf98f608982..c9a18a4003d 100644
--- a/mysql-test/t/init_connect.test
+++ b/mysql-test/t/init_connect.test
@@ -2,6 +2,8 @@
# Test of init_connect variable
#
+--source include/add_anonymous_users.inc
+
# should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc
connect (con0,localhost,root,,);
@@ -41,6 +43,8 @@ disconnect con3;
disconnect con4;
disconnect con5;
+--source include/delete_anonymous_users.inc
+
--echo End of 4.1 tests
#
# Test 5.* features
diff --git a/mysql-test/t/innodb-ucs2.test b/mysql-test/t/innodb-ucs2.test
new file mode 100644
index 00000000000..6647a9d0845
--- /dev/null
+++ b/mysql-test/t/innodb-ucs2.test
@@ -0,0 +1,226 @@
+-- source include/have_innodb.inc
+-- source include/have_ucs2.inc
+
+#
+# BUG 14056 Column prefix index on UTF-8 primary key column causes: Can't find record..
+#
+
+create table t1 (
+ a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+
+create table t1 (
+ a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+
+create table t1 (
+ a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+
+create table t1 (
+ a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+select a,hex(b),hex(c),filler from t2 order by filler;
+drop table t1;
+drop table t2;
+commit;
+
+#
+# Test cases for bug #15308 Problem of Order with Enum Column in Primary Key
+#
+CREATE TABLE t1 (
+ ind enum('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ ind enum('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+drop table t1,t2;
+
+CREATE TABLE t1 (
+ ind set('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ ind set('0','1','2') NOT NULL default '0',
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+drop table t1,t2;
+
+CREATE TABLE t1 (
+ ind bit not null,
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ ind bit not null,
+ string1 varchar(250) NOT NULL,
+ PRIMARY KEY (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+insert into t1 values(0,''),(1,'');
+insert into t2 values(0,''),(1,'');
+select hex(ind),hex(string1) from t1 order by string1;
+select hex(ind),hex(string1) from t2 order by string1;
+drop table t1,t2;
+
+# tests for bug #14056 Column prefix index on UTF-8 primary key column causes 'Can't find record..'
+
+create table t2 (
+ a int, b char(10), filler char(10), primary key(a, b(2))
+) character set utf8 engine = innodb;
+
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+create table t2 (
+ a int, b char(10), filler char(10), primary key(a, b(2))
+) character set ucs2 engine = innodb;
+
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+
+create table t1(a int not null, b char(110),primary key(a,b(100))) engine=innodb default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+update t1 set b = 'three' where a = 6;
+drop table t1;
+create table t1(a int not null, b text(110),primary key(a,b(100))) engine=innodb default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+update t1 set b = 'three' where a = 6;
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 27116b1345b..0937b4fd30d 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1630,139 +1630,6 @@ connection default;
disconnect a;
disconnect b;
-#
-# BUG 14056 Column prefix index on UTF-8 primary key column causes: Can't find record..
-#
-
-create table t1 (
- a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
- a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-
-create table t1 (
- a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
- a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-
-create table t1 (
- a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
- a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
-insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
-insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-
-create table t1 (
- a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set utf8 engine = innodb;
-create table t2 (
- a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
-) character set ucs2 engine = innodb;
-insert into t1 values (1,'abcdefg','abcdefg','one');
-insert into t1 values (2,'ijkilmn','ijkilmn','two');
-insert into t1 values (3,'qrstuvw','qrstuvw','three');
-insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
-insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
-insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
-insert into t2 values (1,'abcdefg','abcdefg','one');
-insert into t2 values (2,'ijkilmn','ijkilmn','two');
-insert into t2 values (3,'qrstuvw','qrstuvw','three');
-insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
-insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
-insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
-insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
-insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
-insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
-insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
-update t1 set filler = 'boo' where a = 1;
-update t2 set filler ='email' where a = 4;
-select a,hex(b),hex(c),filler from t1 order by filler;
-select a,hex(b),hex(c),filler from t2 order by filler;
-drop table t1;
-drop table t2;
-commit;
-
# tests for bugs #9802 and #13778
# test that FKs between invalid types are not accepted
@@ -1943,94 +1810,6 @@ select a,hex(s1) from t1;
select hex(s1) from t2;
drop table t2,t1;
-#
-# Test cases for bug #15308 Problem of Order with Enum Column in Primary Key
-#
-CREATE TABLE t1 (
- ind enum('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
- ind enum('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
-
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-drop table t1,t2;
-
-CREATE TABLE t1 (
- ind set('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
- ind set('0','1','2') NOT NULL default '0',
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
-
-INSERT INTO t1 VALUES ('1', ''),('2', '');
-INSERT INTO t2 VALUES ('1', ''),('2', '');
-SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
-SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
-drop table t1,t2;
-
-CREATE TABLE t1 (
- ind bit not null,
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE t2 (
- ind bit not null,
- string1 varchar(250) NOT NULL,
- PRIMARY KEY (ind)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
-insert into t1 values(0,''),(1,'');
-insert into t2 values(0,''),(1,'');
-select hex(ind),hex(string1) from t1 order by string1;
-select hex(ind),hex(string1) from t2 order by string1;
-drop table t1,t2;
-
-# tests for bug #14056 Column prefix index on UTF-8 primary key column causes 'Can't find record..'
-
-create table t2 (
- a int, b char(10), filler char(10), primary key(a, b(2))
-) character set utf8 engine = innodb;
-
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-create table t2 (
- a int, b char(10), filler char(10), primary key(a, b(2))
-) character set ucs2 engine = innodb;
-
-insert into t2 values (1,'abcdefg','one');
-insert into t2 values (2,'ijkilmn','two');
-insert into t2 values (3, 'qrstuvw','three');
-update t2 set a=5, filler='booo' where a=1;
-drop table t2;
-
-create table t1(a int not null, b char(110),primary key(a,b(100))) engine=innodb default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-update t1 set b = 'three' where a = 6;
-drop table t1;
-create table t1(a int not null, b text(110),primary key(a,b(100))) engine=innodb default charset=utf8;
-insert into t1 values(1,'abcdefg'),(2,'defghijk');
-insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
-insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
-select a,hex(b) from t1 order by b;
-update t1 set b = 'three' where a = 6;
-drop table t1;
# Ensure that <tablename>_ibfk_0 is not mistreated as a
# generated foreign key identifier. (Bug #16387)
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 0a6b081e7c3..6c076fa6dc0 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -248,3 +248,5 @@ insert ignore into t1 values(NULL,100),(NULL,110),(NULL,120);
insert ignore into t1 values(NULL,10),(NULL,20),(NULL,110),(NULL,120),(NULL,100),(NULL,90);
insert ignore into t1 values(NULL,130),(NULL,140),(500,110),(550,120),(450,100),(NULL,150);
select * from t1 order by id;
+
+drop table t1;
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 4c6d22a98cb..1ed1e8657ac 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -162,3 +162,36 @@ INSERT INTO t2 VALUES (1), (3);
--error ER_BAD_FIELD_ERROR
INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a;
DROP TABLE t1,t2;
+
+#
+# Bug #26261: Missing default value isn't noticed in
+# insert ... on duplicate key update
+#
+SET SQL_MODE = 'TRADITIONAL';
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL);
+
+--error 1364
+INSERT INTO t1 (a) VALUES (1);
+
+--error 1364
+INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b;
+
+--error 1364
+INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b;
+
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+#
+# Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
+# touched but not actually changed.
+#
+CREATE TABLE t1 (f1 INT AUTO_INCREMENT PRIMARY KEY,
+ f2 VARCHAR(5) NOT NULL UNIQUE);
+INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1);
+SELECT LAST_INSERT_ID();
+INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1);
+SELECT LAST_INSERT_ID();
+DROP TABLE t1;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 1a53344c8ef..99736e0f11f 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -453,3 +453,51 @@ ALTER TABLE t1 DISABLE KEYS;
EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a);
drop table t1;
+
+#
+# Bug #24778: Innodb: No result when using ORDER BY
+#
+CREATE TABLE t1 (
+ a INTEGER auto_increment PRIMARY KEY,
+ b INTEGER NOT NULL,
+ c INTEGER NOT NULL,
+ d CHAR(64)
+);
+
+CREATE TABLE t2 (
+ a INTEGER auto_increment PRIMARY KEY,
+ b INTEGER NOT NULL,
+ c SMALLINT NOT NULL,
+ d DATETIME NOT NULL,
+ e SMALLINT NOT NULL,
+ f INTEGER NOT NULL,
+ g INTEGER NOT NULL,
+ h SMALLINT NOT NULL,
+ i INTEGER NOT NULL,
+ j INTEGER NOT NULL,
+ UNIQUE INDEX (b),
+ INDEX (b, d, e, f, g, h, i, j, c),
+ INDEX (c)
+);
+
+INSERT INTO t2 VALUES
+ (NULL, 1, 254, '1000-01-01 00:00:00', 257, 0, 0, 0, 0, 0),
+ (NULL, 2, 1, '2004-11-30 12:00:00', 1, 0, 0, 0, 0, 0),
+ (NULL, 3, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -21600, 0),
+ (NULL, 4, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -10800, 0),
+ (NULL, 5, 1, '2004-11-30 12:00:00', 1, 0, 0, 5, -10800, 0),
+ (NULL, 6, 1, '2004-11-30 12:00:00', 102, 0, 0, 0, 0, 0),
+ (NULL, 7, 1, '2004-11-30 12:00:00', 105, 2, 0, 0, 0, 0),
+ (NULL, 8, 1, '2004-11-30 12:00:00', 105, 10, 0, 0, 0, 0);
+
+INSERT INTO t1 (b, c, d) VALUES
+ (3388000, -553000, NULL),
+ (3388000, -553000, NULL);
+
+SELECT *
+FROM t2 c JOIN t1 pa ON c.b = pa.a
+WHERE c.c = 1
+ORDER BY c.b, c.d
+;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index aff5efa51cb..b608ab601c1 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -114,6 +114,29 @@ truncate table t1;
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
select * from t1;
+#
+# Bug#18628 mysql-test-run: security problem
+#
+# It should not be possible to load from a file outside of vardir
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show variables like "secure_file_pri%";
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select @@secure_file_priv;
+--error 1238
+set @@secure_file_priv= 0;
+
+# Test "load data"
+truncate table t1;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1290
+eval load data infile '$MYSQL_TEST_DIR/Makefile' into table t1;
+select * from t1;
+
+# Test "load_file" returns NULL
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval select load_file("$MYSQL_TEST_DIR/Makefile");
+
# cleanup
drop table t1, t2;
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 2b92ddf76ec..4a6b4ff5e56 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -123,6 +123,10 @@ drop table t1;
#
# Bug#16986 - Deadlock condition with MyISAM tables
#
+
+# Need a matching user in mysql.user for multi-table select
+--source include/add_anonymous_users.inc
+
connection locker;
use mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
@@ -199,6 +203,8 @@ UNLOCK TABLES;
connection default;
DROP TABLE t1;
+--source include/delete_anonymous_users.inc
+
#
# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
#
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index e16256d48df..a5e00cb0387 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -70,12 +70,19 @@ show variables like 'general_log_file';
show variables like 'slow_query_log_file';
show variables like 'log_output';
+# Can't set general_log_file to a non existing file
--error 1231
set global general_log_file='/not exiting path/log.master';
+
+# Can't set general_log_file to a directory
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1231
-set global general_log_file='/tmp';
+eval set global general_log_file='$MYSQLTEST_VARDIR';
+
+# Can't set general_log_file to empty string
--error 1231
set global general_log_file='';
+
--replace_column 2 #
show variables like 'general_log_file';
set global general_log= OFF;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index d3639b07bdb..e132c33ab7f 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -434,6 +434,32 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1);
SELECT * FROM tm1;
DROP TABLE t1, tm1;
+#
+# Bug#26464 - insert delayed + update + merge = corruption
+#
+CREATE TABLE t1(c1 INT) ENGINE=MyISAM;
+CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1);
+--error 1031
+INSERT DELAYED INTO t2 VALUES(1);
+DROP TABLE t1, t2;
+
+#
+# BUG#26881 - Large MERGE tables report incorrect specification when no
+# differences in tables
+#
+CREATE TABLE t1(c1 VARCHAR(1));
+CREATE TABLE m1 LIKE t1;
+ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
+SELECT * FROM m1;
+DROP TABLE t1, m1;
+
+CREATE TABLE t1(c1 VARCHAR(4), c2 TINYINT, c3 TINYINT, c4 TINYINT,
+ c5 TINYINT, c6 TINYINT, c7 TINYINT, c8 TINYINT, c9 TINYINT);
+CREATE TABLE m1 LIKE t1;
+ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
+SELECT * FROM m1;
+DROP TABLE t1, m1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/mix2_myisam_ucs2.test b/mysql-test/t/mix2_myisam_ucs2.test
new file mode 100644
index 00000000000..fe22fa50238
--- /dev/null
+++ b/mysql-test/t/mix2_myisam_ucs2.test
@@ -0,0 +1,27 @@
+#
+# Tests which require ucs2 character set
+#
+
+-- source include/have_ucs2.inc
+
+let $engine_type= MyISAM;
+let $other_engine_type= MEMORY;
+# There are unfortunately only MyISAM and MEMORY all time available
+# Therefore use here MEMORY again.
+let $other_engine_type1= MEMORY;
+let $other_non_trans_engine_type= MEMORY;
+let $other_non_live_chks_engine_type= MEMORY;
+# Therefore use here MyISAM again.
+let $other_live_chks_engine_type= MyISAM;
+# MyISAM does not support transactions
+let $test_transactions= 0;
+# MyISAM does not support FOREIGN KEYFOREIGN KEYs
+let $test_foreign_keys= 0;
+# MyISAM supports fulltext queries
+let $fulltext_query_unsupported= 0;
+# MyISAM internal autoincrement values are updated during updates
+let $no_autoinc_update= 0;
+# MyISAM supports keys on spatial data types
+let $no_spatial_key= 0;
+
+-- source include/mix2_ucs2.inc
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 23cdb094e83..b999c5c0029 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -44,20 +44,6 @@ unlock tables;
drop table t1;
#
-# BUG#16217 - MySQL client misinterprets multi-byte char as escape `\'
-#
-
-# new command \C or charset
---exec $MYSQL --default-character-set=utf8 test -e "\C cp932 \g"
---exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
-
-# its usage to switch internally in mysql to requested charset
---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ƒ\'); select * from t1; drop table t1;"
---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'"
---exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select 'ƒ\'"
---exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select 'ƒ\'"
-
-#
# Bug#16859 -- NULLs in columns must not truncate data as if a C-language "string".
#
--exec $MYSQL -t test -e "create table t1 (col1 binary(4), col2 varchar(10), col3 int); insert into t1 values ('a', 'b', 123421),('a ', '0123456789', 4), ('abcd', '', 4); select concat('>',col1,'<'), col2, col3 from t1; drop table t1;" 2>&1
@@ -138,9 +124,9 @@ drop table t1;
#
# Bug #20328: mysql client interprets commands in comments
#
---exec $MYSQL -e 'help' > $MYSQLTEST_VARDIR/tmp/bug20328_1.result
---exec $MYSQL -e 'help ' > $MYSQLTEST_VARDIR/tmp/bug20328_2.result
---exec diff $MYSQLTEST_VARDIR/tmp/bug20328_1.result $MYSQLTEST_VARDIR/tmp/bug20328_2.result
+--exec $MYSQL -e "help" > $MYSQLTEST_VARDIR/tmp/bug20328_1.result
+--exec $MYSQL -e "help " > $MYSQLTEST_VARDIR/tmp/bug20328_2.result
+--diff_files $MYSQLTEST_VARDIR/tmp/bug20328_1.result $MYSQLTEST_VARDIR/tmp/bug20328_2.result
#
# Bug #19216: Client crashes on long SELECT
@@ -251,16 +237,22 @@ drop table t17583;
#
# This should work just fine...
---exec echo "DELIMITER /" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
---exec echo "SELECT 1/" >> $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
+DELIMITER /
+SELECT 1/
+EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
# This should give an error...
---exec echo "DELIMITER \\" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
+DELIMITER \
+EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
# As should this...
---exec echo "DELIMITER \\\\" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
+DELIMITER \\
+EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
#
diff --git a/mysql-test/t/mysql_cp932.test b/mysql-test/t/mysql_cp932.test
new file mode 100644
index 00000000000..60a129c3805
--- /dev/null
+++ b/mysql-test/t/mysql_cp932.test
@@ -0,0 +1,22 @@
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+
+#
+# Tests from mysql.test which require the cp932 character set
+#
+-- source include/have_cp932.inc
+
+#
+# BUG#16217 - MySQL client misinterprets multi-byte char as escape `\'
+#
+
+# new command \C or charset
+--exec $MYSQL --default-character-set=utf8 test -e "\C cp932 \g"
+--exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
+
+# its usage to switch internally in mysql to requested charset
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ƒ\'); select * from t1; drop table t1;"
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select 'ƒ\'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select 'ƒ\'"
+
diff --git a/mysql-test/t/mysqlbinlog-cp932-master.opt b/mysql-test/t/mysqlbinlog-cp932-master.opt
new file mode 100644
index 00000000000..bb0cda4519a
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog-cp932-master.opt
@@ -0,0 +1 @@
+--max-binlog-size=8192
diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test
new file mode 100644
index 00000000000..5d44ab63f12
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog-cp932.test
@@ -0,0 +1,20 @@
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/have_cp932.inc
+
+# Bug#16217 (mysql client did not know how not switch its internal charset)
+flush logs;
+create table t3 (f text character set utf8);
+create table t4 (f text character set cp932);
+--exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
+--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');"
+flush logs;
+rename table t3 to t03, t4 to t04;
+--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000002 | $MYSQL --default-character-set=utf8
+# original and recovered data must be equal
+select HEX(f) from t03;
+select HEX(f) from t3;
+select HEX(f) from t04;
+select HEX(f) from t4;
+
+drop table t3, t4, t03, t04;
+--echo End of 5.0 tests
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 852cc6d2e36..9a27c4cbdb2 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -111,34 +111,24 @@ select "--- reading stdin --" as "";
drop table t1,t2;
#
-# Bug#16217 (mysql client did not know how not switch its internal charset)
-#
-flush logs;
-create table t3 (f text character set utf8);
-create table t4 (f text character set cp932);
---exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
---exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');"
-flush logs;
-rename table t3 to t03, t4 to t04;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000004 | $MYSQL --default-character-set=utf8
-# original and recovered data must be equal
-select HEX(f) from t03;
-select HEX(f) from t3;
-select HEX(f) from t04;
-select HEX(f) from t4;
-drop table t3,t4,t03,t04;
-
-#
#BUG#14157: utf8 encoding in binlog without set character_set_client
#
flush logs;
---exec $MYSQL test -e 'create table if not exists t5 (a int); set names latin1; create temporary table `äöüÄÖÜ` (a int); insert into `äöüÄÖÜ` values (1); insert into t5 select * from `äöüÄÖÜ`'
+--write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
+create table if not exists t5 (a int);
+set names latin1;
+create temporary table `äöüÄÖÜ` (a int);
+insert into `äöüÄÖÜ` values (1);
+insert into t5 select * from `äöüÄÖÜ`
+EOF
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug14157.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
# resulted binlog, parly consisting of multi-byte utf8 chars,
# must be digestable for both client and server. In 4.1 the client
# should use default-character-set same as the server.
flush logs;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL
+--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000004 | $MYSQL
select * from t5 /* must be (1),(1) */;
drop table t5;
@@ -157,7 +147,7 @@ insert into t5 values (3, date_format('2001-01-01','%W'));
select * from t5 order by c1;
flush logs;
drop table t5;
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL
+--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL
select * from t5 order by c1;
drop table t5;
@@ -180,8 +170,8 @@ call p1();
drop procedure p1;
--error 1305
call p1();
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010 | $MYSQL
+--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008
+--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL
call p1();
drop procedure p1;
@@ -215,16 +205,16 @@ select hex(a) from t1;
drop table t1;
flush logs;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000012
+--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010
-# End of 5.0 tests
+--echo End of 5.0 tests
#
# Test --disable-force-if-open and --force-if-open
#
flush logs;
--error 1
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000014 >/dev/null 2>/dev/null
---exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000014 >/dev/null 2>/dev/null
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null
+--exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null
-# End of 5.1 tests
+--echo End of 5.1 tests
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index d841312392d..d9372ad35c1 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -126,13 +126,13 @@ drop table t1;
create table t1(a int);
insert into t1 values (1),(2),(3);
--exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
---exec cat $MYSQLTEST_VARDIR/tmp/t1.sql
---exec cat $MYSQLTEST_VARDIR/tmp/t1.txt
---exec rm $MYSQLTEST_VARDIR/tmp/t1.sql
---exec rm $MYSQLTEST_VARDIR/tmp/t1.txt
+--cat_file $MYSQLTEST_VARDIR/tmp/t1.sql
+--cat_file $MYSQLTEST_VARDIR/tmp/t1.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
---exec rm $MYSQLTEST_VARDIR/tmp/t1.sql
---exec rm $MYSQLTEST_VARDIR/tmp/t1.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
drop table t1;
--echo #
@@ -710,7 +710,7 @@ drop table t1, t2, t3;
create table t1 (a int);
--error 2
---exec $MYSQL_DUMP --skip-comments --force test t1 --where='xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 2>&1
+--exec $MYSQL_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
drop table t1;
--echo #
@@ -913,11 +913,13 @@ DROP TABLE t1, t2;
--echo # Bugs #9136, #12917: problems with --defaults-extra-file option
--echo #
---system echo '[mysqltest1]' > $MYSQLTEST_VARDIR/tmp/tmp.cnf
---system echo 'port=1234' >> $MYSQLTEST_VARDIR/tmp/tmp.cnf
+--write_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
+[mysqltest1]
+port=1234
+EOF
--exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1
--exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1
---system rm $MYSQLTEST_VARDIR/tmp/tmp.cnf
+--remov_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
--echo #
--echo # Test of fix to BUG 12597
@@ -1190,9 +1192,9 @@ create view v1 as select qty, price, qty*price as value from t;
create view v2 as select qty from v1;
--echo mysqldump {
--exec $MYSQL_DUMP --compact -F --tab $MYSQLTEST_VARDIR/tmp test
---exec cat $MYSQLTEST_VARDIR/tmp/v1.sql
+--cat_file $MYSQLTEST_VARDIR/tmp/v1.sql
--echo } mysqldump {
---exec cat $MYSQLTEST_VARDIR/tmp/v2.sql
+--cat_file $MYSQLTEST_VARDIR/tmp/v2.sql
--echo } mysqldump
drop view v1;
drop view v2;
@@ -1258,7 +1260,7 @@ create database mysqldump_views;
use mysqldump_views;
create view nasishnasifu as select mysqldump_tables.basetable.id from mysqldump_tables.basetable;
---exec $MYSQL_DUMP --skip-comments --compact --databases mysqldump_tables mysqldump_views;
+--exec $MYSQL_DUMP --skip-comments --compact --databases mysqldump_tables mysqldump_views
drop view nasishnasifu;
drop database mysqldump_views;
@@ -1281,7 +1283,7 @@ create table t1 (f1 int, f2 int);
insert into t1 values (2,2);
create view v1 as select f1, f2 from t1;
---exec $MYSQL_DUMP --skip-comments --add-drop-database --databases mysqldump_dba mysqldump_dbb > $MYSQLTEST_VARDIR/tmp/bug20221_backup;
+--exec $MYSQL_DUMP --skip-comments --add-drop-database --databases mysqldump_dba mysqldump_dbb > $MYSQLTEST_VARDIR/tmp/bug20221_backup
drop view v1;
drop table t1;
@@ -1291,7 +1293,7 @@ drop view v1;
drop table t1;
drop database mysqldump_dba;
---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20221_backup;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20221_backup
select * from mysqldump_dba.v1;
select * from mysqldump_dbb.v1;
@@ -1393,7 +1395,7 @@ flush privileges;
--echo # Restore. Flush Privileges test ends.
--echo #
---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21527.sql;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21527.sql
# Do as a user
connection user1;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index a8a55336144..1914f2794e2 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -555,8 +555,8 @@ echo ;
# Illegal use of echo
---error 1
---exec echo "echo \$;" | $MYSQL_TEST 2>&1
+#--error 1
+#--exec echo "echo \$;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
@@ -902,9 +902,9 @@ echo $d;
# ----------------------------------------------------------------------------
# Test system
# ----------------------------------------------------------------------------
-system ls > /dev/null;
+#system ls > /dev/null;
system echo "hej" > /dev/null;
---system ls > /dev/null
+#--system ls > /dev/null
--system echo "hej" > /dev/null;
--error 1
@@ -1134,18 +1134,24 @@ EOF
--error 1
--exec echo "{;" | $MYSQL_TEST 2>&1
---system echo "while (0)" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+while (0)
+echo hej;
+EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
---system echo "while (0)" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "{echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+while (0)
+{echo hej;
+EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
---system echo "while (0){" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+while (0){
+ echo hej;
+EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
@@ -1244,28 +1250,34 @@ EOF
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1
# Repeat connect/disconnect, exceed max number of connections
---system echo "let \$i=200;" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "while (\$i)" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "{" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo " dec \$i; " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "}" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+let $i=200;
+while ($i)
+{
+ connect (test_con1,localhost,root,,);
+ disconnect test_con1;
+ dec $i;
+}
+EOF
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
# Select disconnected connection
---system echo "connect (test_con1,localhost,root,,);" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "connection test_con1;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+connect (test_con1,localhost,root,,);
+disconnect test_con1;
+connection test_con1;
+EOF
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
# Connection name already used
---system echo "connect (test_con1,localhost,root,,);" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
---system echo "connect (test_con1,localhost,root,,);" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+connect (test_con1,localhost,root,,);
+connect (test_con1,localhost,root,,);
+EOF
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
@@ -1510,8 +1522,9 @@ remove_file non_existing_file;
--error 1
--exec echo "write_file filename ;" | $MYSQL_TEST 2>&1
---error 1
---exec echo "write_file filename \";" | $MYSQL_TEST 2>&1
+# Comment out this test as it confuses cmd.exe with unmatched "
+#--error 1
+#--exec echo "write_file filename \";" | $MYSQL_TEST 2>&1
write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
Content for test_file1
@@ -1526,6 +1539,74 @@ file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
# ----------------------------------------------------------------------------
+# test for append_file
+# ----------------------------------------------------------------------------
+
+write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+Content for test_file1
+EOF
+file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+
+append_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+Appended text
+EOF
+file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+
+remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+append_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+Appended text on nonexisting file
+EOF
+
+# ----------------------------------------------------------------------------
+# test for cat_file
+# ----------------------------------------------------------------------------
+
+--write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp
+Some data
+for cat_file command
+of mysqltest
+EOF
+cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+
+--error 1
+--exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# test for diff_files
+# ----------------------------------------------------------------------------
+
+--write_file $MYSQLTEST_VARDIR/tmp/diff1.tmp
+Some data
+for diff_file command
+of mysqltest
+EOF
+
+--write_file $MYSQLTEST_VARDIR/tmp/diff2.tmp
+Some data
+for diff_file command
+of mysqltest
+EOF
+
+--write_file $MYSQLTEST_VARDIR/tmp/diff3.tmp
+Some other data
+for diff_file command
+of mysqltest
+EOF
+
+# Compare equal files
+--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
+--diff_files $MYSQLTEST_VARDIR/tmp/diff2.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
+
+# Compare files that differ
+--error 1
+--diff_files $MYSQLTEST_VARDIR/tmp/diff3.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
+--error 1
+--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff3.tmp
+
+# Compare equal files, again...
+--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
+
+# ----------------------------------------------------------------------------
# test for file_exist
# ----------------------------------------------------------------------------
--error 1
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
index ad5f9c652c7..a20cfc500cf 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/t/ndb_basic.test
@@ -597,8 +597,8 @@ drop table t1;
# Test auto_increment
#
-connect (con1,localhost,,,test);
-connect (con2,localhost,,,test);
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
create table t1
(counter int(64) NOT NULL auto_increment,
@@ -631,7 +631,7 @@ drop table t1;
#
# Bug #17249 delete statement with join where clause fails
# when table do not have pk
-#
+ #
create table t1 (a int) engine=ndb;
create table t2 (a int) engine=ndb;
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test
index c2a96a590ca..782f17ca5b2 100644
--- a/mysql-test/t/ndb_index_ordered.test
+++ b/mysql-test/t/ndb_index_ordered.test
@@ -336,8 +336,8 @@ drop table t1;
# bug#7798
create table t1(a int primary key, b int not null, index(b));
insert into t1 values (1,1), (2,2);
-connect (con1,localhost,,,test);
-connect (con2,localhost,,,test);
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
connection con1;
set autocommit=0;
begin;
diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test
index a50b3ef28ea..3482db1d1b2 100644
--- a/mysql-test/t/ndb_multi.test
+++ b/mysql-test/t/ndb_multi.test
@@ -21,8 +21,8 @@ select * from t2;
show status like 'handler_discover%';
# Check dropping and recreating table on same server
-connect (con1,localhost,,,test);
-connect (con2,localhost,,,test);
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
connection con1;
select * from t1;
connection con2;
diff --git a/mysql-test/t/ndb_multi_row.test b/mysql-test/t/ndb_multi_row.test
index 05a0944e99a..632a9fda89a 100644
--- a/mysql-test/t/ndb_multi_row.test
+++ b/mysql-test/t/ndb_multi_row.test
@@ -23,8 +23,8 @@ select * from t2;
show status like 'handler_discover%';
# Check dropping and recreating table on same server
-connect (con1,localhost,,,test);
-connect (con2,localhost,,,test);
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
connection con1;
select * from t1;
connection con2;
diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/t/ndb_single_user.test
new file mode 100644
index 00000000000..c655124f79f
--- /dev/null
+++ b/mysql-test/t/ndb_single_user.test
@@ -0,0 +1,84 @@
+-- source include/have_ndb.inc
+-- source include/have_multi_ndb.inc
+-- source include/ndb_default_cluster.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+--enable_warnings
+
+# operations allowed while cluster is in single user mode
+
+--connection server1
+--let $node_id= `SHOW STATUS LIKE 'Ndb_cluster_node_id'`
+--disable_query_log
+--eval set @node_id= SUBSTRING('$node_id', 20)+0
+--enable_query_log
+--let $node_id= `SELECT @node_id`
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
+
+# verify that we are indeed in single user mode
+--connection server2
+--error 1005
+create table t1 (a int key, b int unique, c int) engine ndb;
+
+# test some sql on first mysqld
+--connection server1
+create table t1 (a int key, b int unique, c int) engine ndb;
+insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+create table t2 as select * from t1;
+# read with pk
+select * from t1 where a = 1;
+# read with unique index
+select * from t1 where b = 4;
+# read with ordered index
+select * from t1 where a > 4 order by a;
+# update with pk
+update t1 set b=102 where a = 2;
+# update with unique index
+update t1 set b=103 where b = 3;
+# update with full table scan
+update t1 set b=b+100;
+# update with ordered insex scan
+update t1 set b=b+100 where a > 7;
+# delete with full table scan
+delete from t1;
+insert into t1 select * from t2;
+
+# test some sql on other mysqld
+--connection server2
+--error 1051
+drop table t1;
+--error 1146
+#--error 1296
+create index new_index on t1 (c);
+--error 1146
+#--error 1296
+insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+--error 1146
+#--error 1296
+select * from t1 where a = 1;
+--error 1146
+#--error 1296
+select * from t1 where b = 4;
+--error 1146
+#--error 1296
+update t1 set b=102 where a = 2;
+--error 1146
+#--error 1296
+update t1 set b=103 where b = 3;
+--error 1146
+#--error 1296
+update t1 set b=b+100;
+--error 1146
+#--error 1296
+update t1 set b=b+100 where a > 7;
+
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
+
+# cleanup
+--connection server1
+drop table t1;
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index 4e5e7b72fc8..e6cbfe3166c 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -327,3 +327,18 @@ SELECT * FROM v1;
DROP VIEW v1;
DROP TABLE t1;
+
+#
+# Bug #26830: derived table with ROLLUP
+#
+
+CREATE TABLE t1 (a int, KEY (a));
+INSERT INTO t1 VALUES (3), (1), (4), (1), (3), (1), (1);
+
+SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t;
+
+DROP TABLE t1;
+
+
+
+
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 3d614514de3..8772b8157e3 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -1,6 +1,7 @@
-# We test openssl. Result set is optimized to be compiled with --with-openssl.
-# Use mysql-test-run with --with-openssl option.
--- source include/have_openssl.inc
+# Tests for SSL connections, only run if mysqld is compiled
+# with support for SSL.
+
+-- source include/have_ssl.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 15fb6771101..5093263b864 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -589,6 +589,36 @@ SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
DROP TABLE t1;
#
+# Bug#25126: Reference to non-existant column in UPDATE...ORDER BY...
+# crashes server
+#
+CREATE TABLE bug25126 (
+ val int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
+);
+--error 1054
+UPDATE bug25126 SET MissingCol = MissingCol;
+--error 1054
+UPDATE bug25126 SET val = val ORDER BY MissingCol;
+UPDATE bug25126 SET val = val ORDER BY val;
+UPDATE bug25126 SET val = 1 ORDER BY val;
+--error 1054
+UPDATE bug25126 SET val = 1 ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET val = 1 ORDER BY val, MissingCol;
+--error 1054
+UPDATE bug25126 SET val = MissingCol ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = 1 ORDER BY val, MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = 1 ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = val ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = MissingCol ORDER BY MissingCol;
+DROP TABLE bug25126;
+
+
+#
# Bug #25427: crash when order by expression contains a name
# that cannot be resolved unambiguously
#
@@ -603,7 +633,6 @@ SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1;
DROP TABLE t1;
-# End of 4.1 tests
create table t1 (a int not null, b int not null, c int not null);
insert t1 values (1,1,1),(1,1,2),(1,2,1);
select a, b from t1 group by a, b order by sum(c);
@@ -642,6 +671,29 @@ ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b;
DROP TABLE t1,t2,t3,t4;
#
+# Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
+#
+create table t1 (a int, b int, c int);
+insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9);
+select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc;
+drop table t1;
+
+#
+# Bug#26672: Incorrect SEC_TO_TIME() casting in ORDER BY
+#
+CREATE TABLE t1 (a INT UNSIGNED NOT NULL, b TIME);
+INSERT INTO t1 (a) VALUES (100000), (0), (100), (1000000),(10000), (1000), (10);
+UPDATE t1 SET b = SEC_TO_TIME(a);
+
+-- Correct ORDER
+SELECT a, b FROM t1 ORDER BY b DESC;
+
+-- must be ordered as the above
+SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC;
+
+DROP TABLE t1;
+
+#
# BUG#16590: Optimized does not do right "const" table pre-read
#
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE KEY b (b));
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index c48e6c9730d..7c90fd32909 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -84,3 +84,15 @@ FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5;
enable_query_log;
--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+use test;
+
+#
+# Bug#18628 mysql-test-run: security problem
+#
+# It should not be possible to write to a file outside of vardir
+create table t1(a int);
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1290
+eval select * into outfile "$MYSQL_TEST_DIR/outfile-test1" from t1;
+drop table t1;
+
diff --git a/mysql-test/t/overflow.test b/mysql-test/t/overflow.test
index c930707413b..a62ef9c4cd2 100644
--- a/mysql-test/t/overflow.test
+++ b/mysql-test/t/overflow.test
@@ -1,4 +1,4 @@
-connect (con1,localhost,boo,,);
+connect (con1,localhost,root,,);
connection con1;
-- error 1064,1102,1280
drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index d475fc65136..8920b424021 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -409,8 +409,8 @@ select * from t1 where id=2;
create table t1 (word char(20) not null);
select * from t1;
show status like "Qcache_queries_in_cache";
---replace_result $MYSQL_TEST_DIR TEST_DIR
-eval load data infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data_ln/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
select count(*) from t1;
drop table t1;
diff --git a/mysql-test/t/rpl_ndb_bank.test b/mysql-test/t/rpl_ndb_bank.test
index 9174d09484b..c1448573f5b 100644
--- a/mysql-test/t/rpl_ndb_bank.test
+++ b/mysql-test/t/rpl_ndb_bank.test
@@ -175,7 +175,7 @@ insert into t1 values (1);
--connection master
drop table t1;
---exec diff $MYSQLTEST_VARDIR/tmp/master_BANK.sql $MYSQLTEST_VARDIR/tmp/slave_BANK.sql
+diff_files $MYSQLTEST_VARDIR/tmp/master_BANK.sql $MYSQLTEST_VARDIR/tmp/slave_BANK.sql;
--dec $2
}
diff --git a/mysql-test/t/rpl_ndb_dd_advance.test b/mysql-test/t/rpl_ndb_dd_advance.test
index 82ec85c09a5..0a1ab37cdad 100644
--- a/mysql-test/t/rpl_ndb_dd_advance.test
+++ b/mysql-test/t/rpl_ndb_dd_advance.test
@@ -571,7 +571,7 @@ connection master;
--echo ****** Do dumps compare ************
---exec diff $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql
+diff_files $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql;
## Note: Ths files should only get removed, if the above diff succeeds.
diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_openssl.test
index 00ae5c935bf..edef603f617 100644
--- a/mysql-test/t/rpl_openssl.test
+++ b/mysql-test/t/rpl_openssl.test
@@ -1,4 +1,4 @@
-source include/have_openssl.inc;
+source include/have_ssl.inc;
source include/master-slave.inc;
# We don't test all types of ssl auth params here since it's a bit hard
diff --git a/mysql-test/t/rpl_rbr_to_sbr.test b/mysql-test/t/rpl_rbr_to_sbr.test
index 379b1edec02..4def515eb13 100644
--- a/mysql-test/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/t/rpl_rbr_to_sbr.test
@@ -39,7 +39,7 @@ DROP TABLE IF EXISTS t1;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
# If all is good, we can remove the files
diff --git a/mysql-test/t/rpl_read_only.test b/mysql-test/t/rpl_read_only.test
index 659c3d10044..62864b62a28 100644
--- a/mysql-test/t/rpl_read_only.test
+++ b/mysql-test/t/rpl_read_only.test
@@ -2,6 +2,11 @@
-- source include/master-slave.inc
-- source include/have_innodb.inc
+# Create a test and replicate it to slave
+connection master;
+create user test;
+sync_slave_with_master;
+
# Setting the master readonly :
# - the variable @@readonly is not replicated on the slave
@@ -99,7 +104,10 @@ insert into t2 values(2006);
## Cleanup
connection master;
+drop user test;
drop table t1;
drop table t2;
sync_slave_with_master;
+set global read_only=0;
+
diff --git a/mysql-test/t/rpl_row_NOW.test b/mysql-test/t/rpl_row_NOW.test
index 24a8774284a..d0272b35c1f 100644
--- a/mysql-test/t/rpl_row_NOW.test
+++ b/mysql-test/t/rpl_row_NOW.test
@@ -56,6 +56,7 @@ connection master;
# lets cleanup
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
+DROP DATABASE mysqltest1;
# Lets compare. Note: If they match test will pass, if they do not match
# the test will show that the diff statement failed and not reject file
@@ -63,7 +64,7 @@ DROP FUNCTION mysqltest1.f1;
# the files your self to see what is not matching :-) The failed dump
# files will be located in $MYSQLTEST_VARDIR/tmp
-exec diff $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave.sql;
# If all is good, when can cleanup our dump files.
system rm $MYSQLTEST_VARDIR/tmp/NOW_master.sql;
diff --git a/mysql-test/t/rpl_row_USER.test b/mysql-test/t/rpl_row_USER.test
index a099a35ec27..7b13ebc50ee 100644
--- a/mysql-test/t/rpl_row_USER.test
+++ b/mysql-test/t/rpl_row_USER.test
@@ -2,7 +2,7 @@
# Original Author: JBM #
# Original Date: Aug/18/2005 #
#############################################################################
-# TEST: To test the UUID() in rbr #
+# TEST: To test the USER() and CURRENT_USER() in rbr #
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
@@ -52,6 +52,8 @@ connection master;
DROP DATABASE mysqltest1;
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
+DROP USER tester@'%';
+DROP USER ''@'localhost%';
sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_basic_11bugs.test b/mysql-test/t/rpl_row_basic_11bugs.test
index 5b28af75d33..348b6d45f52 100644
--- a/mysql-test/t/rpl_row_basic_11bugs.test
+++ b/mysql-test/t/rpl_row_basic_11bugs.test
@@ -92,6 +92,8 @@ INSERT INTO t1 VALUES (7),(8),(9);
sync_slave_with_master;
SELECT * FROM t1;
+SET GLOBAL QUERY_CACHE_SIZE=0;
+
# Bug#22550: Replication of BIT columns failing
--echo ================ Test for BUG#22550 ================
--disable_query_log
@@ -113,3 +115,7 @@ UPDATE t1 SET a=0 WHERE b=2;
SELECT HEX(a),b FROM t1;
sync_slave_with_master;
SELECT HEX(a),b FROM t1;
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_func002.test b/mysql-test/t/rpl_row_func002.test
index 46767abd529..44a704bfbc5 100644
--- a/mysql-test/t/rpl_row_func002.test
+++ b/mysql-test/t/rpl_row_func002.test
@@ -90,6 +90,7 @@ connection master;
# Cleanup
DROP FUNCTION test.f1;
DROP TABLE test.t1;
+DROP TABLE test.t2;
sync_slave_with_master;
# the test will show that the diff statement failed and no reject file
@@ -97,7 +98,7 @@ sync_slave_with_master;
# the files your self to see what is not matching :-). The files are located
# in mysql-test/var/tmp
-exec diff $MYSQLTEST_VARDIR/tmp/func002_master.sql $MYSQLTEST_VARDIR/tmp/func002_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/func002_master.sql $MYSQLTEST_VARDIR/tmp/func002_slave.sql;
# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp001.test b/mysql-test/t/rpl_row_sp001.test
index 8e01cbc4f44..c6fc29e3750 100644
--- a/mysql-test/t/rpl_row_sp001.test
+++ b/mysql-test/t/rpl_row_sp001.test
@@ -137,7 +137,7 @@ sync_slave_with_master;
# the files your self to see what is not matching :-) Failed dump files
# will be located in $MYSQLTEST_VARDIR/tmp
---exec diff $MYSQLTEST_VARDIR/tmp/sp001_master.sql $MYSQLTEST_VARDIR/tmp/sp001_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/sp001_master.sql $MYSQLTEST_VARDIR/tmp/sp001_slave.sql;
# If all is good, when can cleanup our dump files.
system rm $MYSQLTEST_VARDIR/tmp/sp001_master.sql;
diff --git a/mysql-test/t/rpl_row_sp008.test b/mysql-test/t/rpl_row_sp008.test
index 8e8e709a2d9..b1295820c99 100644
--- a/mysql-test/t/rpl_row_sp008.test
+++ b/mysql-test/t/rpl_row_sp008.test
@@ -51,6 +51,7 @@ SELECT * FROM test.t2;
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
sync_slave_with_master;
# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp011.test b/mysql-test/t/rpl_row_sp011.test
index 54e708492d1..fb87249d93c 100644
--- a/mysql-test/t/rpl_row_sp011.test
+++ b/mysql-test/t/rpl_row_sp011.test
@@ -102,7 +102,7 @@ sync_slave_with_master;
# the files your self to see what is not matching :-) Failed test
# Will leave dump files in $MYSQLTEST_VARDIR/tmp
-exec diff $MYSQLTEST_VARDIR/tmp/sp011_master.sql $MYSQLTEST_VARDIR/tmp/sp011_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/sp011_master.sql $MYSQLTEST_VARDIR/tmp/sp011_slave.sql;
# If all is good, when can cleanup our dump files.
system rm $MYSQLTEST_VARDIR/tmp/sp011_master.sql;
diff --git a/mysql-test/t/rpl_row_sp012.test b/mysql-test/t/rpl_row_sp012.test
index 5b6fc139577..3a8d295121c 100644
--- a/mysql-test/t/rpl_row_sp012.test
+++ b/mysql-test/t/rpl_row_sp012.test
@@ -68,6 +68,7 @@ DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+DROP USER user1@localhost;
sync_slave_with_master;
# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_trig001.test b/mysql-test/t/rpl_row_trig001.test
index 931cab95948..7b1fca2d6a1 100644
--- a/mysql-test/t/rpl_row_trig001.test
+++ b/mysql-test/t/rpl_row_trig001.test
@@ -95,6 +95,6 @@ sync_slave_with_master;
# the files your self to see what is not matching :-) Failed tests
# will leave dump files in $MYSQLTEST_VARDIR/tmp
-exec diff $MYSQLTEST_VARDIR/tmp/trig001_master.sql $MYSQLTEST_VARDIR/tmp/trig001_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/trig001_master.sql $MYSQLTEST_VARDIR/tmp/trig001_slave.sql;
# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_trig003.test b/mysql-test/t/rpl_row_trig003.test
index d4570afd094..4a1bbc5ca89 100644
--- a/mysql-test/t/rpl_row_trig003.test
+++ b/mysql-test/t/rpl_row_trig003.test
@@ -147,6 +147,6 @@ DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
--enable_warnings
-exec diff $MYSQLTEST_VARDIR/tmp/trg003_master.sql $MYSQLTEST_VARDIR/tmp/trg003_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/trg003_master.sql $MYSQLTEST_VARDIR/tmp/trg003_slave.sql;
# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_view01.test b/mysql-test/t/rpl_row_view01.test
index 895a922fef8..634e3c30cc6 100644
--- a/mysql-test/t/rpl_row_view01.test
+++ b/mysql-test/t/rpl_row_view01.test
@@ -82,6 +82,7 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
+DROP DATABASE mysqltest1;
sync_slave_with_master;
# End of 5.1 test case
diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test
index f98cc7a7d14..32320a50656 100644
--- a/mysql-test/t/rpl_slave_status.test
+++ b/mysql-test/t/rpl_slave_status.test
@@ -49,6 +49,7 @@ show slave status;
# Cleanup (Note that slave IO thread is not running)
connection slave;
drop table t1;
+delete from mysql.user where user='rpl';
connection master;
drop table t1;
diff --git a/mysql-test/t/rpl_sp004.test b/mysql-test/t/rpl_sp004.test
index 055a13cc157..967e7007c15 100644
--- a/mysql-test/t/rpl_sp004.test
+++ b/mysql-test/t/rpl_sp004.test
@@ -91,7 +91,7 @@ sync_slave_with_master;
# If the test fails, you will need to diff the dumps to see why.
--- exec diff $MYSQLTEST_VARDIR/tmp/sp004_master.sql $MYSQLTEST_VARDIR/tmp/sp004_slave.sql
+diff_files $MYSQLTEST_VARDIR/tmp/sp004_master.sql $MYSQLTEST_VARDIR/tmp/sp004_slave.sql;
# End of 5.0 test case
diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test
new file mode 100644
index 00000000000..9f25f71525a
--- /dev/null
+++ b/mysql-test/t/rpl_ssl.test
@@ -0,0 +1,60 @@
+source include/have_ssl.inc;
+source include/master-slave.inc;
+
+# create a user for replication that requires ssl encryption
+connection master;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+
+sync_slave_with_master;
+
+# Set slave to use SSL for connection to master
+stop slave;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval change master to
+ master_user='replssl',
+ master_password='',
+ master_ssl=1,
+ master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
+ master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
+ master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
+start slave;
+
+# Switch to master and insert one record, then sync it to slave
+connection master;
+insert into t1 values(1);
+sync_slave_with_master;
+
+# The record should now be on slave
+select * from t1;
+
+# The slave is synced and waiting/reading from master
+# SHOW SLAVE STATUS will show "Waiting for master to send event"
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+query_vertical show slave status;
+
+# Stop the slave, as reported in bug#21871 it would hang
+STOP SLAVE;
+
+select * from t1;
+
+# Do the same thing a number of times
+disable_query_log;
+let $i= 100;
+while ($i)
+{
+ start slave;
+ connection master;
+ insert into t1 values (NULL);
+ connection slave;
+ stop slave;
+ dec $i;
+}
+start slave;
+enable_query_log;
+connection master;
+sync_slave_with_master;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+query_vertical show slave status;
diff --git a/mysql-test/t/rpl_switch_stm_row_mixed.test b/mysql-test/t/rpl_switch_stm_row_mixed.test
index bffa5905f1f..494e73fda49 100644
--- a/mysql-test/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/t/rpl_switch_stm_row_mixed.test
@@ -19,6 +19,8 @@ create database mysqltest1;
--enable_warnings
use mysqltest1;
+# Save binlog format
+set @my_binlog_format= @@global.binlog_format;
# play with switching
set session binlog_format=mixed;
@@ -531,7 +533,7 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
connection master;
--replace_column 2 # 5 #
@@ -559,8 +561,12 @@ drop database mysqltest1;
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
# the old mysqldump output on slave is the same as what it was on
# master before restoring on master.
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
}
drop database mysqltest1;
sync_slave_with_master;
+
+connection master;
+# Restore binlog format setting
+set global binlog_format =@my_binlog_format;
diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test
index fc336db1a3a..09b8b83f25f 100644
--- a/mysql-test/t/rpl_temporary.test
+++ b/mysql-test/t/rpl_temporary.test
@@ -1,3 +1,5 @@
+# Test need anonymous user when connection are made as "zedjzlcsjhd"
+source include/add_anonymous_users.inc;
-- source include/master-slave.inc
@@ -191,7 +193,14 @@ drop table t1;
#
#14157: utf8 encoding in binlog without set character_set_client
#
---exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=latin1 test -e 'create table t1 (a int); set names latin1; create temporary table `äöüÄÖÜ` (a int); insert into `äöüÄÖÜ` values (1); insert into t1 select * from `äöüÄÖÜ`'
+--write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
+create table t1 (a int);
+set names latin1;
+create temporary table `äöüÄÖÜ` (a int);
+insert into `äöüÄÖÜ` values (1);
+insert into t1 select * from `äöüÄÖÜ`
+EOF
+--exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=latin1 test < $MYSQLTEST_VARDIR/tmp/bug14157.sql
sync_slave_with_master;
#connection slave;
@@ -200,4 +209,7 @@ select * from t1;
connection master;
drop table t1;
+# Delete the anonymous users
+source include/delete_anonymous_users.inc;
+
# End of 5.1 tests
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index f7f458e277c..f613b836350 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3299,4 +3299,51 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
DROP TABLE t1,t2;
+
+#
+# Bug #26963: join with predicates that contain fields from equalities evaluated
+# to constants after constant table substitution
+#
+
+CREATE TABLE t1 (
+ access_id int NOT NULL default '0',
+ name varchar(20) default NULL,
+ rank int NOT NULL default '0',
+ KEY idx (access_id)
+);
+
+CREATE TABLE t2 (
+ faq_group_id int NOT NULL default '0',
+ faq_id int NOT NULL default '0',
+ access_id int default NULL,
+ UNIQUE KEY idx1 (faq_id),
+ KEY idx2 (faq_group_id,faq_id)
+);
+
+INSERT INTO t1 VALUES
+ (1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4);
+INSERT INTO t2 VALUES
+ (261,265,1),(490,494,1);
+
+
+SELECT t2.faq_id
+ FROM t1 INNER JOIN t2 IGNORE INDEX (idx1)
+ ON (t1.access_id = t2.access_id)
+ LEFT JOIN t2 t
+ ON (t.faq_group_id = t2.faq_group_id AND
+ find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4'))
+ WHERE
+ t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265);
+
+SELECT t2.faq_id
+ FROM t1 INNER JOIN t2
+ ON (t1.access_id = t2.access_id)
+ LEFT JOIN t2 t
+ ON (t.faq_group_id = t2.faq_group_id AND
+ find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4'))
+ WHERE
+ t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265);
+
+DROP TABLE t1,t2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index c8ee3490552..5e0fc65bc34 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -115,3 +115,10 @@ DROP FUNCTION f3;
--error ER_OPTION_PREVENTS_STATEMENT
set global event_scheduler=1;
+#
+# Bug#26285 Selecting information_schema crahes server
+#
+select count(*) from information_schema.COLUMN_PRIVILEGES;
+select count(*) from information_schema.SCHEMA_PRIVILEGES;
+select count(*) from information_schema.TABLE_PRIVILEGES;
+select count(*) from information_schema.USER_PRIVILEGES;
diff --git a/mysql-test/t/sp-ucs2.test b/mysql-test/t/sp-ucs2.test
new file mode 100644
index 00000000000..7dd88b04871
--- /dev/null
+++ b/mysql-test/t/sp-ucs2.test
@@ -0,0 +1,28 @@
+-- source include/have_ucs2.inc
+
+delimiter |;
+
+#
+# BUG#17615: problem with character set
+#
+--disable_warnings
+drop function if exists bug17615|
+--enable_warnings
+
+create table t3 (a varchar(256) unicode)|
+
+create function bug17615() returns varchar(256) unicode
+begin
+ declare tmp_res varchar(256) unicode;
+ set tmp_res= 'foo string';
+ return tmp_res;
+end|
+
+insert into t3 values(bug17615())|
+select * from t3|
+
+drop function bug17615|
+drop table t3|
+
+
+delimiter ;|
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index d65bec48cc4..d49f36fd6d7 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -12,6 +12,8 @@
# Tests that destroys system tables (e.g. mysql.proc) for error testing
# go to sp-destruct.
# Tests that require --with-geometry go into sp_gis.test
+# Tests that require multibyte character sets, which are not always available,
+# go into separate files (e.g. sp-ucs2.test)
use test;
@@ -5544,29 +5546,6 @@ drop table t3|
#
-# BUG#17615: problem with character set
-#
---disable_warnings
-drop function if exists bug17615|
---enable_warnings
-
-create table t3 (a varchar(256) unicode)|
-
-create function bug17615() returns varchar(256) unicode
-begin
- declare tmp_res varchar(256) unicode;
- set tmp_res= 'foo string';
- return tmp_res;
-end|
-
-insert into t3 values(bug17615())|
-select * from t3|
-
-drop function bug17615|
-drop table t3|
-
-
-#
# BUG#17476: Stored procedure not returning data when it is called first
# time per connection
#
@@ -6814,6 +6793,7 @@ SELECT bug23760_rc_test(ROW_COUNT())|
DROP TABLE bug23760, bug23760_log|
DROP PROCEDURE bug23760_update_log|
DROP PROCEDURE bug23760_test_row_count|
+DROP PROCEDURE bug23760_test_row_count2|
DROP FUNCTION bug23760_rc_test|
#
@@ -7023,6 +7003,21 @@ drop procedure proc_26503_ok_3|
drop procedure proc_26503_ok_4|
#
+# Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
+# result.
+#
+--disable_warnings
+DROP FUNCTION IF EXISTS bug25373|
+--disable_warnings
+CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER
+LANGUAGE SQL DETERMINISTIC
+RETURN p1;|
+CREATE TABLE t3 (f1 INT, f2 FLOAT)|
+INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
+SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
+DROP FUNCTION bug25373|
+DROP TABLE t3|
+#
# NOTE: The delimiter is `|`, and not `;`. It is changed to `;`
# at the end of the file!
#
diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test
index de88569d74a..a15f0212fbd 100644
--- a/mysql-test/t/ssl.test
+++ b/mysql-test/t/ssl.test
@@ -1,7 +1,7 @@
# Turn on ssl between the client and server
# and run a number of tests
--- source include/have_openssl.inc
+-- source include/have_ssl.inc
connect (ssl_con,localhost,root,,,,,SSL);
diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test
index f5fe86e9a81..23051c0e367 100644
--- a/mysql-test/t/ssl_compress.test
+++ b/mysql-test/t/ssl_compress.test
@@ -1,7 +1,7 @@
# Turn on compression between the client and server
# and run a number of tests
--- source include/have_openssl.inc
+-- source include/have_ssl.inc
-- source include/have_compress.inc
connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS);
diff --git a/mysql-test/t/ssl_connect.test b/mysql-test/t/ssl_connect.test
index 99c875186c1..31e581c9342 100644
--- a/mysql-test/t/ssl_connect.test
+++ b/mysql-test/t/ssl_connect.test
@@ -1,5 +1,5 @@
--- source include/have_openssl.inc
+-- source include/have_ssl.inc
# Repeat connect/disconnect
diff --git a/mysql-test/t/ssl_des.test b/mysql-test/t/ssl_des.test
deleted file mode 100644
index 7cf2c920ab5..00000000000
--- a/mysql-test/t/ssl_des.test
+++ /dev/null
@@ -1,19 +0,0 @@
-# Tell the server to use a DES-encrypted cert
-# then turn on ssl between the client and server
-# and run a number of standard tests
-
--- source include/have_openssl.inc
-
-# Connect by ip to avoid turning on "ssl-verify-server-cert"
-connect (ssl_con,127.0.0.1,root,,,,$MASTER_MYPORT,SSL);
-
-# Check ssl turned on
-SHOW STATUS LIKE 'Ssl_cipher';
-
-# Source select test case
--- source include/common-tests.inc
-
-# Check ssl turned on
-SHOW STATUS LIKE 'Ssl_cipher';
-
-
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 8ca99130921..9c2248cbcc2 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2736,3 +2736,15 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t1xt2;
+#
+# Bug #26728: derived table with concatanation of literals in select list
+#
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3), (1), (2);
+
+SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1;
+SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t;
+
+DROP table t1;
+
diff --git a/mysql-test/t/trigger-grant.test b/mysql-test/t/trigger-grant.test
index 2a0cf829bae..8145212ed5b 100644
--- a/mysql-test/t/trigger-grant.test
+++ b/mysql-test/t/trigger-grant.test
@@ -359,9 +359,21 @@ CREATE TRIGGER trg5 BEFORE DELETE ON t1
FOR EACH ROW
SET @a = 5;
---system grep -v '^definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
---system echo "definers='' '@' '@abc@def@@' '@hostname' '@abcdef@@@hostname'" >> $MYSQLTEST_VARDIR/tmp/t1.TRG
---system mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
+# Replace definers with the "weird" definers
+perl;
+use strict;
+use warnings;
+my $fname= "$ENV{'MYSQLTEST_VARDIR'}/master-data/mysqltest_db1/t1.TRG";
+open(FILE, "<", $fname) or die;
+my @content= grep($_ !~ /^definers=/, <FILE>);
+close FILE;
+open(FILE, ">", $fname) or die;
+# Use binary file mode to avoid CR/LF's being added on windows
+binmode FILE;
+print FILE @content;
+print FILE "definers='' '\@' '\@abc\@def\@\@' '\@hostname' '\@abcdef\@\@\@hostname'\n";
+close FILE;
+EOF
--echo
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 14608a3b193..22d3a68ba74 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -1699,4 +1699,42 @@ DROP TABLE bug22580_t1;
DROP PROCEDURE bug22580_proc_1;
DROP PROCEDURE bug22580_proc_2;
+#
+# Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY
+# UPDATE if the row wasn't actually changed.
+#
+--disable_warnings
+DROP TRIGGER IF EXISTS trg27006_a_update;
+DROP TRIGGER IF EXISTS trg27006_a_insert;
+--enable_warnings
+
+CREATE TABLE t1 (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `val` varchar(10) NOT NULL,
+ PRIMARY KEY (`id`)
+);
+CREATE TABLE t2 like t1;
+DELIMITER |;
+
+CREATE TRIGGER trg27006_a_insert AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ insert into t2 values (NULL,new.val);
+END |
+CREATE TRIGGER trg27006_a_update AFTER UPDATE ON t1 FOR EACH ROW
+BEGIN
+ insert into t2 values (NULL,new.val);
+END |
+DELIMITER ;|
+
+INSERT INTO t1(val) VALUES ('test1'),('test2');
+SELECT * FROM t1;
+SELECT * FROM t2;
+INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val);
+INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val);
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TRIGGER trg27006_a_insert;
+DROP TRIGGER trg27006_a_update;
+drop table t1,t2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index cd8f2d48eea..e08b2de0f85 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -307,22 +307,21 @@ drop table t1;
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default '');
insert into t1 (id) values (1);
# We have to clean up the path in the results for safe comparison
---replace_result $MYSQL_TEST_DIR ../..
-eval select
- charset(load_file('$MYSQL_TEST_DIR/std_data/words.dat')),
- collation(load_file('$MYSQL_TEST_DIR/std_data/words.dat')),
- coercibility(load_file('$MYSQL_TEST_DIR/std_data/words.dat'));
---replace_result $MYSQL_TEST_DIR ../..
-eval explain extended select
- charset(load_file('$MYSQL_TEST_DIR/std_data/words.dat')),
- collation(load_file('$MYSQL_TEST_DIR/std_data/words.dat')),
- coercibility(load_file('$MYSQL_TEST_DIR/std_data/words.dat'));
---replace_result $MYSQL_TEST_DIR ../..
-eval update t1 set imagem=load_file('$MYSQL_TEST_DIR/std_data/words.dat') where id=1;
+eval select
+ charset(load_file('../std_data_ln/words.dat')),
+ collation(load_file('../std_data_ln/words.dat')),
+ coercibility(load_file('../std_data_ln/words.dat'));
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval explain extended select
+ charset(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')),
+ collation(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')),
+ coercibility(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat'));
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval update t1 set imagem=load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
drop table t1;
---replace_result $MYSQL_TEST_DIR ../..
-eval create table t1 select load_file('$MYSQL_TEST_DIR/std_data/words.dat') l;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval create table t1 select load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') l;
# We mask out the Privileges column because it differs for embedded server
--replace_column 8 #
show full fields from t1;
diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test
index 3ba80514ff9..1b27a92e95c 100644
--- a/mysql-test/t/type_varchar.test
+++ b/mysql-test/t/type_varchar.test
@@ -3,7 +3,7 @@ drop table if exists t1, t2;
--enable_warnings
create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text);
-system cp $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLTEST_VARDIR/master-data/test/;
+copy_file $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLTEST_VARDIR/master-data/test/vchar.frm;
truncate table vchar;
show create table t1;
show create table vchar;
@@ -162,7 +162,8 @@ create table t3 (
en varchar(255) character set utf8,
cz varchar(255) character set utf8
);
-system cp $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLTEST_VARDIR/master-data/test/t3.frm;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm;
+copy_file $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLTEST_VARDIR/master-data/test/t3.frm;
truncate table t3;
insert into t3 (id, en, cz) values
(1,'en string 1','cz string 1'),
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 2bdf8420d6d..cc93fbd715a 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -900,4 +900,17 @@ drop table t1, t2;
#
select _utf8'12' union select _latin1'12345';
+#
+# Bug #26661: UNION with ORDER BY undefined column in FROM list
+#
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3),(1),(2),(4),(1);
+
+SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a) AS test;
+--error 1054
+SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test;
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 23ee75d61ea..6cec940d286 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -306,6 +306,14 @@ create table t1(f1 int, `*f2` int);
insert into t1 values (1,1);
update t1 set `*f2`=1;
drop table t1;
+
+#
+# Bug#25126: Wrongly resolved field leads to a crash
+#
+create table t1(f1 int);
+--error 1054
+update t1 set f2=1 order by f2;
+drop table t1;
# End of 4.1 tests
#
diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test
index 2f0c1c83e84..2d055920c22 100644
--- a/mysql-test/t/varbinary.test
+++ b/mysql-test/t/varbinary.test
@@ -83,4 +83,5 @@ insert into t1 values("aaa ");
select length(a) from t1;
alter table t1 modify a varchar(255);
select length(a) from t1;
+drop table t1;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 4f91b75ced1..d381ed62bc7 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -18,12 +18,11 @@ set @my_key_buffer_size =@@global.key_buffer_size;
set @my_max_binlog_cache_size =@@global.max_binlog_cache_size;
set @my_max_binlog_size =@@global.max_binlog_size;
set @my_max_connect_errors =@@global.max_connect_errors;
+set @my_max_connections =@@global.max_connections;
set @my_max_delayed_threads =@@global.max_delayed_threads;
set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size;
-set @my_max_user_connections =@@global.max_user_connections;
-set @my_max_write_lock_count =@@global.max_write_lock_count;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
@@ -689,6 +688,17 @@ select @@&;
--error ER_PARSE_ERROR
select @@@;
+#
+# Bug#20166 mysql-test-run.pl does not test system privilege tables creation
+#
+# Don't actually output, since it depends on the system
+--replace_column 1 #
+select @@hostname;
+--error 1238
+set @@hostname= "anothername";
+--replace_column 2 #
+show variables like 'hostname';
+
--echo End of 5.0 tests
# This is at the very after the versioned tests, since it involves doing
@@ -707,12 +717,13 @@ set global key_buffer_size =@my_key_buffer_size;
set global max_binlog_cache_size =default; #@my_max_binlog_cache_size;
set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors;
+set global max_connections =@my_max_connections;
set global max_delayed_threads =@my_max_delayed_threads;
set global max_heap_table_size =@my_max_heap_table_size;
set global max_insert_delayed_threads=@my_max_insert_delayed_threads;
set global max_join_size =@my_max_join_size;
-set global max_user_connections =@my_max_user_connections;
-set global max_write_lock_count =@my_max_write_lock_count;
+set global max_user_connections =default;
+set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 8d5ceb7fc8e..026a08bf365 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3155,6 +3155,45 @@ drop view view_24532_a;
drop view view_24532_b;
drop table table_24532;
+#
+# Bug#26560: view using subquery with a reference to an outer alias
+#
+
+CREATE TABLE t1 (
+ lid int NOT NULL PRIMARY KEY,
+ name char(10) NOT NULL
+);
+INSERT INTO t1 (lid, name) VALUES
+ (1, 'YES'), (2, 'NO');
+
+CREATE TABLE t2 (
+ id int NOT NULL PRIMARY KEY,
+ gid int NOT NULL,
+ lid int NOT NULL,
+ dt date
+);
+INSERT INTO t2 (id, gid, lid, dt) VALUES
+ (1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'),
+ (3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02');
+
+SELECT DISTINCT t2.gid AS lgid,
+ (SELECT t1.name FROM t1, t2
+ WHERE t1.lid = t2.lid AND t2.gid = lgid
+ ORDER BY t2.dt DESC LIMIT 1
+ ) as clid
+ FROM t2;
+
+CREATE VIEW v1 AS
+SELECT DISTINCT t2.gid AS lgid,
+ (SELECT t1.name FROM t1, t2
+ WHERE t1.lid = t2.lid AND t2.gid = lgid
+ ORDER BY t2.dt DESC LIMIT 1
+ ) as clid
+ FROM t2;
+SELECT * FROM v1;
+
+DROP VIEW v1;
+DROP table t1,t2;
--echo End of 5.0 tests.
diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test
index 92405bac137..0d564727fe3 100644
--- a/mysql-test/t/xa.test
+++ b/mysql-test/t/xa.test
@@ -37,7 +37,7 @@ begin;
--error 1399
create table t2 (a int);
-connect (con1,localhost,,,);
+connect (con1,localhost,root,,);
connection con1;
--error 1440